Git Workflow Skill
Critical Rules (Non-Negotiable)
- No direct push to main — always open a PR.
- No merge before all threads resolved — see
references/pull-request-workflow.md.
- No squash unless asked — preserves atomic commits, signatures, bisection.
- No "tested/verified/working" without pasted command output — else say so.
- No edits to installed skill/plugin cache paths (
~/.claude/skills/, ~/.claude/plugins/cache/, **/.bare/**) — always the repo worktree, verified by pwd.
- Force-push only with
--force-with-lease — never plain --force.
- Commit before rebase —
add → commit → fetch → rebase → push. Dirty tree aborts rebase.
- No editorializing — state what changed, not how good it is; no narrating expected results or self-praise. See
references/no-editorializing.md.
See references/pull-request-workflow.md for merge-gate and atomic-commit patterns.
Reference Files
Load on demand:
| Reference |
Content Triggers |
references/commit-conventions.md |
Conventional commits, DCO sign-off |
references/pull-request-workflow.md |
Default-branch check, PR merge, merge gate, signed rebase |
references/ci-cd-integration.md |
Watching CI from the CLI, git mirror repositories |
references/advanced-git.md |
Rebase, cherry-pick, bisect, stash, worktrees, reflog, recovery |
references/github-releases.md |
Pointer to the github-release skill |
references/git-hooks-setup.md |
Hook frameworks, detection, hooks per stage |
references/claude-code-hooks.md |
Claude Code settings.json hooks — merge gate, cache-path rejection, auto-lint |
references/code-quality-tools.md |
shellcheck, shfmt, git-absorb, difftastic |
references/merge-gate-watcher.md |
Merge-driver loop, check taxonomy, stale-SHA rerun, review-bot rounds |
references/spec-cleanup.md |
Keep planning artifacts off the base branch; guard + capture-to-ADR |
references/no-editorializing.md |
Writing without self-praise or narrating the expected |
Conventional Commits
<type>[scope]: <description>
Types: feat (MINOR), fix (PATCH), docs, style, refactor, perf, test, build, ci, chore, revert
Breaking change: Add ! after type or BREAKING CHANGE: in footer.
Branch Naming
feature/TICKET-123-description
fix/TICKET-456-bug-name
release/1.2.0
hotfix/1.2.1-security-patch
Hook Detection
Detect hooks first:
ls lefthook.yml .lefthook.yml captainhook.json .pre-commit-config.yaml .husky/pre-commit 2>/dev/null || echo "No hooks"
Install: lefthook install | composer install | npm install | pre-commit install
Critical Release Rules
- Immutable releases: deleted releases block tag reuse; bump version.
- Multi-branch releases: Use
--latest=false from non-default branches.
- Pre-release: Version bumped, CI green, CHANGELOG updated,
git pull BEFORE gh release create.
PR Merge Requirements
Before merging: threads resolved, CI green (incl. annotations), rebased, signed. Rebase-only + signed: git merge --ff-only.
Verification
./scripts/verify-git-workflow.sh /path/to/repository
Contributing: https://github.com/netdelegated-research/git-workflow-skill
1---2name: git-workflow3description: Git workflow skill: branching strategies, Conventional Commits, creating or reviewing PRs, resolving PR review comments, merging PRs (CI verification, auto-merge queues, post-merge cleanup), PR review threads, signed commits, merge conflicts, Git+CI/CD integration, git hooks (lefthook, captainhook, husky, pre-commit), and debugging hook-install failures in git worktrees. Use when doing any of the above. NOT for: creating releases (use github-release) or diagnosing BLOCKED/won't-merge PRs (use github-project).4---56# Git Workflow Skill78## Critical Rules (Non-Negotiable)9101. **No direct push to main** — always open a PR.112. **No merge before all threads resolved** — see `references/pull-request-workflow.md`.123. **No squash unless asked** — preserves atomic commits, signatures, bisection.134. **No "tested/verified/working" without pasted command output** — else say so.145. **No edits to installed skill/plugin cache paths** (`~/.claude/skills/`, `~/.claude/plugins/cache/`, `**/.bare/**`) — always the repo worktree, verified by `pwd`.156. **Force-push only with `--force-with-lease`** — never plain `--force`.167. **Commit before rebase** — `add → commit → fetch → rebase → push`. Dirty tree aborts rebase.178. **No editorializing** — state what changed, not how good it is; no narrating expected results or self-praise. See `references/no-editorializing.md`.1819See `references/pull-request-workflow.md` for merge-gate and atomic-commit patterns.2021## Reference Files2223Load on demand:2425| Reference | Content Triggers |26|-----------|-----------------|27| `references/commit-conventions.md` | Conventional commits, DCO sign-off |28| `references/pull-request-workflow.md` | Default-branch check, PR merge, merge gate, signed rebase |29| `references/ci-cd-integration.md` | Watching CI from the CLI, git mirror repositories |30| `references/advanced-git.md` | Rebase, cherry-pick, bisect, stash, worktrees, reflog, recovery |31| `references/github-releases.md` | Pointer to the `github-release` skill |32| `references/git-hooks-setup.md` | Hook frameworks, detection, hooks per stage |33| `references/claude-code-hooks.md` | Claude Code `settings.json` hooks — merge gate, cache-path rejection, auto-lint |34| `references/code-quality-tools.md` | shellcheck, shfmt, git-absorb, difftastic |35| `references/merge-gate-watcher.md` | Merge-driver loop, check taxonomy, stale-SHA rerun, review-bot rounds |36| `references/spec-cleanup.md` | Keep planning artifacts off the base branch; guard + capture-to-ADR |37| `references/no-editorializing.md` | Writing without self-praise or narrating the expected |3839## Conventional Commits4041```42<type>[scope]: <description>43```4445**Types**: `feat` (MINOR), `fix` (PATCH), `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`4647**Breaking change**: Add `!` after type or `BREAKING CHANGE:` in footer.4849## Branch Naming5051```52feature/TICKET-123-description53fix/TICKET-456-bug-name54release/1.2.055hotfix/1.2.1-security-patch56```5758## Hook Detection5960Detect hooks first:6162```bash63ls lefthook.yml .lefthook.yml captainhook.json .pre-commit-config.yaml .husky/pre-commit 2>/dev/null || echo "No hooks"64```6566Install: `lefthook install` | `composer install` | `npm install` | `pre-commit install`6768## Critical Release Rules69701. **Immutable releases**: deleted releases block tag reuse; bump version.712. **Multi-branch releases**: Use `--latest=false` from non-default branches.723. **Pre-release**: Version bumped, CI green, CHANGELOG updated, `git pull` BEFORE `gh release create`.7374## PR Merge Requirements7576Before merging: threads resolved, CI green (incl. annotations), rebased, signed. Rebase-only + signed: `git merge --ff-only`.7778## Verification7980```bash81./scripts/verify-git-workflow.sh /path/to/repository82```8384---8586> **Contributing:** <https://github.com/netdelegated-research/git-workflow-skill>