Inspiration

I kept seeing AI coding tools produce these giant commits that touched everything at once, and watching someone try to review one was painful. It felt like a solvable problem. The AI knows what it changed, it just doesn't think about history.

What it does

Constellation takes a monolithic AI-generated commit and splits it into logical, reviewable commits before you push. It uses GitLab Orbit to figure out which files actually import each other, asks Duo what you were trying to build, and rewrites your local history with real commit messages instead of "WIP: implement feature."

How I built it

Three Python scripts that chain together: one that checks it's safe to rewrite (paranoid about anything already pushed), one that queries Orbit's import graph to group files by actual coupling, and one that does the git rewrite and calls Duo for commit messages. A SKILL.md ties it together so glab duo cli knows when to invoke it.

Challenges I ran into

Git's edge cases around what counts as local-only were trickier than expected, especially handling repos with no upstream configured vs ones where the remote has moved ahead. On Windows, Python and glab would fight over the same temp file, which took an embarrassingly long time to debug.

Accomplishments that I'm proud of

The fallback chain was important to get right. Orbit groups files when it has data, the path heuristic kicks in for anything unindexed, and the whole thing rolls back automatically if something goes wrong mid-rewrite. It works on real repos without babysitting it.

What I learned

Orbit only sees pushed, indexed code, which shaped basically every architectural decision. The raw JSON response from glab orbit remote query looks nothing like the LLM-friendly output, and I only found that out by actually running a query and checking, which saved a lot of guesswork later.

What's next for Constellation

A dry-run mode that shows the proposed grouping without touching anything would make it much easier to trust. Longer term, doing this server-side on MR creation via the GitLab API would mean teams could enforce it without every developer installing anything locally.

Built With

Share this project:

Updates