@bizmyth/pi-git-conflicts0.2.0
A guided Git conflict-resolution command for the Pi coding agent
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@bizmyth/pi-git-conflicts
A guided Git conflict-resolution command for the Pi coding agent.
/git-conflicts inspects the repository and active Git operation, gives the agent bounded conflict context, and asks it to resolve and continue the operation safely.
Install
pi install npm:@bizmyth/pi-git-conflicts
Restart Pi after installation, then run:
/git-conflicts
/git-conflicts preserve both versions of the API while resolving
The command supports merge, rebase, cherry-pick, revert, git am, and sequencer state. It refuses to run outside a Git working tree or when there is neither an active operation nor an unresolved index conflict. Failures in required Git inspection stop the command with an actionable error; failures in optional context are reported to the agent as warnings instead of being silently discarded.
The generated prompt tells the agent not to abort, skip, reset, rewrite unrelated work, or force-push unless explicitly requested. Pi extensions and the agent run with your full user permissions, so review changes before committing or pushing them.
gh-stack integration
When the repository is managed by gh-stack, /git-conflicts reads the current worktree's .git/gh-stack state (the same file gh-stack uses) and adds bounded stack context to the prompt: the trunk, the current branch's position, its parent and child branches, saved base/head SHAs, PR references, and whether each branch needs a rebase. The recorded trunk is used, so the extension never assumes main or master.
Blocked gh-stack operations take priority over the underlying Git operation, because gh-stack orchestrates the Git rebase/cherry-pick and must be the one to continue it:
| Detected state | Continuation |
|---|---|
.git/gh-stack-rebase-state |
git add then gh stack rebase --continue |
.git/gh-stack-modify-state, phase conflict |
git add then gh stack modify --continue |
.git/gh-stack-modify-state, phase applying |
report; recover with gh stack modify --abort (requires user intent) |
In these states the prompt explicitly forbids substituting git rebase --continue or git cherry-pick --continue, and forbids bare gh stack modify (it opens a TUI and blocks). Detection is local and offline: the extension does not call gh, so it also works while the stack is mid-rebase and HEAD is detached. State is read from git rev-parse --absolute-git-dir, so linked worktrees use their own stack state.
A gh stack sync conflict restores every branch and leaves no operation to continue, so /git-conflicts is not involved; run gh stack rebase to recreate the conflict, then resolve it as above.
Scope and roadmap
The extension reasons from local repository state only. It does not call gh or the network, does not push/submit/sync, and does not mutate stack topology. PR state comes from the recorded stack file and may be stale; gh stack view --json remains the live source of truth.
Planned follow-up work:
- optionally enrich stack context from
gh stack view --jsonwhenHEADis attached; - detect
gh stack syncdivergence and other stack-health problems; - verify the branch chain after continuation and report remaining work.
Development
bun install
bun run check
bun run check runs Biome formatting and lint checks, TypeScript 7 (tsgo) type checking, and Bun tests.
Releasing
Trusted publishing must already be configured for publish.yml. To release a new version:
bun pm version patch # or: minor / major
git push origin main --follow-tags
gh release create "$(git describe --tags --exact-match)" --generate-notes
Publishing the GitHub release runs the checks and publishes the matching package version to npm using OIDC. No long-lived NPM_TOKEN is required.
License
MIT