- Align cherry-pick and revert approval wording across SKILL.md, commits.md, and history-editing.md with profile/AGENTS.md (CR-01) - Gate commit message drafting in inspect-flake-update Step 4 on delivery mode so learning mode preserves user message authoring (CR-02)
4.3 KiB
4.3 KiB
name, description
| name | description |
|---|---|
| git-manager | Manage Git repository hygiene, branches, worktrees, incremental Conventional Commits, history integration (rebase, squash, cherry-pick, merge), conflict stops, and evidence-first reflog recovery. Use when creating branches or worktrees, committing completed task checkpoints, integrating branches, or recovering lost commits. Not for pull request lifecycle: use gitea-pr. Not for diff code inspection: use code-review. |
Git Manager
Use when
- Creating dedicated branches or isolated worktrees before making edits.
- Recording clean, atomic Conventional Commits as coherent tasks finish, or slicing a dirty tree.
- Integrating branches (rebase, squash, merge, cherry-pick) or stopping cleanly on conflicts.
- Recovering lost commits, dangling refs, or broken working-tree state via reflog.
- Not for pull request creation or review threads: use
gitea-pr. - Not for multi-axis static diff evaluation: use
code-review.
Steps
- Inspect repository state. Resolve repository root (
git rev-parse --show-toplevel), active branch, upstream tracking, working-tree status (git status --short), repoAGENTS.mdconventions, andgit log -n 5 --oneline. Run all commands from the target repository root; trust the diff over conversation claims. - Branch and worktree isolation. Enforce branch-before-edits (
git switch -c <name>). For parallel slices or spikes without disturbing the current working tree, manage isolated worktrees per references/worktrees.md. Never remove a worktree containing uncommitted or unmerged work without explicit confirmation. - Incremental checkpoint commits. Group coherent, independently revertible slices and format
messages per references/commits.md. Enforce the pre-commit gate: right
repo, explicit file or hunk staging (never blind
git add -Aover unrelated or scratch files), relevant checks passing, zero secrets, and message faithful to the diff. Followprofile/AGENTS.md:deliverymode on a non-default working branch: commit each verified unit immediately without pausing for approval, unless an exception applies (main/master, failing checks, or unfamiliar working-tree edits).learningmode: list diff facts, ask 0-2 questions, and pause so the user writes the commit message perprofile/learning-contract.md. In/practice, let the user run the commands.
- Integration and history editing. Rebase local unshared branches, squash noisy fixups, merge,
or cherry-pick per references/history-editing.md. On any
conflict: stop immediately, report conflicting files and hunks in prose, never guess resolution,
and offer clean
--abort. - Evidence-first recovery. For lost commits, detached
HEAD, or botched history edits, inspectgit reflogandgit fsckbefore acting and restore intorecovery/<topic>per references/recovery.md. Never run speculative--hardresets. - Verify post-operation state. Confirm branch ref, new commit SHA (
git log -n 3 --oneline), and remaining working-tree status (git status --short).
Your call
- Direct
main/mastercommits or ambiguous dirty trees: approve any commit onmain/masteror choose how to slice unfamiliar pre-existing working-tree edits. learningmode commit reasoning: write the commit message and rationale perlearning-contract.md.- Integration strategy and exceptions: choose rebase vs. merge when non-obvious, and adjudicate conflicts, reverts, or cherry-picks.
- Destructive operations: explicitly confirm with impact described first per
profile/AGENTS.mdbeforegit reset --hard,git restore <file>,git clean -fd, force-push, or dirty worktree removal.
Done when
- Target branch, worktree, checkpoint commit, integration, or recovery branch is verified by SHA
and
git status --shortreflects expected leftover state.
Hands off to
code-review: when a branch or commit range is ready for multi-axis static diff review.gitea-pr: when verified commits are pushed and ready for pull request creation or update.document: when a commit or recovery surfaces a decision or insight worth recording separately.