Git Workflow Skill
Not Here
Releases: github-release. BLOCKED-PR diagnosis: github-project.
GitHub only. Everything below the branching and commit sections — pr-status.sh, pr-merge.sh, the merge gate, review threads — speaks GitHub GraphQL. A GitLab merge request belongs to netresearch-gitlab; the equivalent glab calls are in references/pull-request-workflow.md § GitHub only.
Critical Rules (Non-Negotiable)
- No direct push to main — always open a PR.
- No merge before all threads resolved (
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 (a dirty tree aborts it).
- No editorializing — state what changed, not how good it is (
references/no-editorializing.md).
Reference Files
| Reference |
Content Triggers |
references/commit-conventions.md |
Conventional commits, DCO sign-off |
references/pull-request-workflow.md |
PR merge gate, signed rebase |
references/ci-cd-integration.md |
CI watching, git mirrors |
references/advanced-git.md |
Rebase, cherry-pick, bisect, stash, worktrees, reflog |
references/github-releases.md |
→ github-release skill |
references/git-hooks-setup.md |
Hook frameworks, hooks per stage |
references/claude-code-hooks.md |
settings.json 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 |
references/spec-cleanup.md |
Planning artifacts off the base branch |
references/no-editorializing.md |
No self-praise, no narrating the expected |
Conventional Commits
<type>[scope]: <description>
feat MINOR, fix PATCH; full type list and DCO sign-off in references/commit-conventions.md.
Breaking: ! after type, or BREAKING CHANGE: in the footer.
Branches: feature/TICKET-123-description, release/1.2.0
Hook Detection
ls lefthook.yml .lefthook.yml captainhook.json .pre-commit-config.yaml .husky/pre-commit 2>/dev/null || echo "No hooks"
Install commands per framework: references/git-hooks-setup.md.
PR Merge Requirements
Before merging: threads resolved, CI green (incl. annotations), rebased, signed, and reviewed (human or bot, on the current head). Rebase-only + signed: git merge --ff-only.
Verification
./scripts/verify-git-workflow.sh /path/to/repository
# Gate state, next action:
./scripts/pr-status.sh [-R owner/repo] [PR] [--json] [--watch]
# Merge; refuses when the gate is shut:
./scripts/pr-merge.sh [-R owner/repo] [PR] [--dry-run|--self-reviewed]
# What a repository expects, before the first artifact:
./scripts/repo-contribution-preflight.sh [--repo <dir>] [--section docs|templates|packaging|ci|tools]
# Which copy is installed here (every script answers this):
./scripts/pr-status.sh --version
Contributing: https://github.com/netresearch/git-workflow-skill
1---2name: git-workflow3description: Use when establishing branching strategies, implementing Conventional Commits, creating or reviewing PRs, resolving PR review comments, merging PRs (including CI verification, auto-merge queues, and post-merge cleanup), managing PR review threads, merging PRs with signed commits, handling merge conflicts, verifying a merge didn't silently drop changes, syncing a long-diverged branch (e.g. master into integration), rebasing a long-lived branch onto a moved base or splitting one into several PRs, integrating Git with CI/CD, setting up git hooks (lefthook, captainhook, husky, pre-commit), or debugging hook-install failures in git worktrees. The pull-request tooling is GitHub-only — for a GitLab merge request use netresearch-gitlab. Not for creating releases (use github-release) or diagnosing BLOCKED/won't-merge PRs (use github-project).4license: (MIT AND CC-BY-SA-4.0). See LICENSE-MIT and LICENSE-CC-BY-SA-4.05---6
7# Git Workflow Skill
8
9## Not Here
10
11Releases: `github-release`. BLOCKED-PR diagnosis: `github-project`.
12
13**GitHub only.** Everything below the branching and commit sections — `pr-status.sh`, `pr-merge.sh`, the merge gate, review threads — speaks GitHub GraphQL. A GitLab merge request belongs to `netresearch-gitlab`; the equivalent `glab` calls are in `references/pull-request-workflow.md` § *GitHub only*.
14
15## Critical Rules (Non-Negotiable)
16
171. **No direct push to main** — always open a PR.
182. **No merge before all threads resolved** (`references/pull-request-workflow.md`).
193. **No squash unless asked** — preserves atomic commits, signatures, bisection.
204. **No "tested/verified/working" without pasted command output** — else say so.
215. **No edits to installed skill/plugin cache paths** (`~/.claude/skills/`, `~/.claude/plugins/cache/`, `**/.bare/**`) — always the repo worktree, verified by `pwd`.
226. **Force-push only with `--force-with-lease`** — never plain `--force`.
237. **Commit before rebase** — `add → commit → fetch → rebase → push` (a dirty tree aborts it).
248. **No editorializing** — state what changed, not how good it is (`references/no-editorializing.md`).
25
26## Reference Files
27
28| Reference | Content Triggers |
29|-----------|-----------------|
30| `references/commit-conventions.md` | Conventional commits, DCO sign-off |
31| `references/pull-request-workflow.md` | PR merge gate, signed rebase |
32| `references/ci-cd-integration.md` | CI watching, git mirrors |
33| `references/advanced-git.md` | Rebase, cherry-pick, bisect, stash, worktrees, reflog |
34| `references/github-releases.md` | → `github-release` skill |
35| `references/git-hooks-setup.md` | Hook frameworks, hooks per stage |
36| `references/claude-code-hooks.md` | `settings.json` merge gate, cache-path rejection, auto-lint |
37| `references/code-quality-tools.md` | shellcheck, shfmt, git-absorb, difftastic |
38| `references/merge-gate-watcher.md` | Merge-driver loop, check taxonomy, stale-SHA rerun |
39| `references/spec-cleanup.md` | Planning artifacts off the base branch |
40| `references/no-editorializing.md` | No self-praise, no narrating the expected |
41
42## Conventional Commits
43
44```
45<type>[scope]: <description>
46```
47
48`feat` MINOR, `fix` PATCH; full type list and DCO sign-off in `references/commit-conventions.md`.
49**Breaking**: `!` after type, or `BREAKING CHANGE:` in the footer.
50**Branches**: `feature/TICKET-123-description`, `release/1.2.0`
51
52## Hook Detection
53
54```bash
55ls lefthook.yml .lefthook.yml captainhook.json .pre-commit-config.yaml .husky/pre-commit 2>/dev/null || echo "No hooks"
56```
57
58Install commands per framework: `references/git-hooks-setup.md`.
59
60## PR Merge Requirements
61
62Before merging: threads resolved, CI green (incl. annotations), rebased, signed, **and reviewed** (human or bot, on the current head). Rebase-only + signed: `git merge --ff-only`.
63
64## Verification
65
66```bash
67./scripts/verify-git-workflow.sh /path/to/repository
68# Gate state, next action:
69./scripts/pr-status.sh [-R owner/repo] [PR] [--json] [--watch]
70# Merge; refuses when the gate is shut:
71./scripts/pr-merge.sh [-R owner/repo] [PR] [--dry-run|--self-reviewed]
72# What a repository expects, before the first artifact:
73./scripts/repo-contribution-preflight.sh [--repo <dir>] [--section docs|templates|packaging|ci|tools]
74# Which copy is installed here (every script answers this):
75./scripts/pr-status.sh --version
76```
77
78---
79
80> **Contributing:** <https://github.com/netresearch/git-workflow-skill>