use case

Keep each package's history clean with per-package atomic commits

Monorepos present a unique challenge: a single git diff may span multiple packages, services, and shared libraries. git-agent reads your workspace structure, splits changes by package scope, and commits each independently — so every package's changelog and version history stays accurate.

When you work across packages in a monorepo, a single git commit mixes changes from different packages into one commit. This breaks per-package changelogs, confuses version-bump tools like semantic-release, and makes it hard to cherry-pick fixes across release branches. Manually splitting with git add -p every time you commit is tedious and error-prone.

git-agent analyses the full working-tree diff and automatically groups changes by package scope — using your workspace tooling (pnpm workspaces, Nx, Turborepo, Cargo workspace, go.work) to determine boundaries. Give it the work intent; it discovers, stages, and commits each group independently with a conventional message scoped to its package, keeping your monorepo history clean and tooling-friendly.

  • Run `git-agent init` in your monorepo root. git-agent scans your workspace configuration and generates per-package scopes automatically.
  • Finish the work across packages and pass its intent to `git-agent --intent`. Cross-package changes are okay — git-agent discovers the working tree and handles the splitting.
  • Run `git-agent --intent "..."`. The tool analyses the full diff, plans atomic commit groups by package scope, then stages and commits each group independently.
  • Review the result: each package has its own commit with a conventional message, ready for changelog generation, version bumping, and cherry-picking.
Does git-agent support pnpm workspaces, Nx, and Turborepo?
Yes. git-agent reads package.json workspaces fields, Nx project.json files, and Turborepo pipeline configurations to infer package boundaries. It works with any monorepo tooling that produces a standard directory structure.
What happens when a change touches a shared library and its consumers?
git-agent creates separate commits for the library change and each consumer change. This keeps each package's changelog accurate and avoids ambiguous version bumps across packages.
Can git-agent handle a monorepo with mixed languages (Go, TypeScript, Rust)?
Yes. git-agent is language-agnostic. It groups changes by directory scope, not by file extension. Each package's commit message is generated from the diff content, which the LLM understands regardless of language.