git-workflow
Skill5 starsChanged 5 months agoMITView on GitHub
Use when implementation work is about to touch code (branch before the first commit), when a built task needs to ship as a pull request, when defining how branches, commits, and PRs map to plan tasks, or when parallel agents share one repository. Triggers on "create a branch", "commit this", "open a PR", "ship this task", "how do we merge", task start or completion during an implementation plan, worktree setup, or noticing commits landing directly on main.
188 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- kinhluan/skillstheir own version, first seen Nov 8, 2026
- juninmd/skillstheir own version, first seen Nov 8, 2026
- jDxve/avengers-kittheir own version, first seen Nov 8, 2026
- lhbsaa/apex-unifiedtheir own version, first seen Nov 8, 2026
- haythamasalama/skillstheir own version, first seen Nov 8, 2026
Used with
Projects with it also use squad-commands, ci-cd-pipelines and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
Microsoft AzureSkillsquad-commands
Categorized catalog of common Squad operations. Coordinator reads this file and presents it as an interactive menu when the user asks for available commands or help.
Also in 5 projects that use this
harrissohail6Skillci-cd-pipelines
CI/CD pipeline design and implementation. Auto-activates when discussing deployment, automation, or pipelines.
Also in 6 projects that use this
Microsoft AzureSkillarchitectural-proposals
How to write comprehensive architectural proposals that drive alignment before code is written
Also in 4 projects that use this
GitHubSkille2e-template-testing
End-to-end validation of coordinator and agent template changes
Also in 3 projects that use this
GitHubSkillnotification-routing
Route agent notifications to specific channels by type — prevent alert fatigue from single-channel flooding
Also in 3 projects that use this
frostneySkillnative-nostalgia-stack
Applies the user's FreePascal toolchain and its build, formatting, hook, and test contracts while leaving project-specific mechanics local. Use when scaffolding or working in a FreePascal project that follows this toolchain.
Also in 3 projects that use this
- +5 more from Azure
- +1 more from github
Other versions188 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 188
- langfuse/langfuse★ 37ksame name
- modelcontextprotocol/typescript-sdk★ 14ksame name
- JetBrains/ideavim★ 10ksame name
- jokob-sk/NetAlertX★ 7.4ksame name
- netalertx/NetAlertX★ 7.4ksame name
- Galaxy-Dawn/claude-scholar★ 5.9ksame name
- github/gh-aw★ 5.6ksame name
- modelcontextprotocol/csharp-sdk★ 4.6ksame name
- antonbabenko/pre-commit-terraform★ 3.8ksame name
- github/squad★ 3.4ksame name
178 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 33
Never reuse a branch across tasks: Never let a task branch outlive its merge.
- Distinctive: line 39
No drive-by changes. An unrelated fix discovered mid-task becomes its own task in the plan, not a stowaway commit.
- Very specific: line 57
After a FAIL verdict: fix commits go to the same branch, each round noted in the PR thread (round 2/3).
- Distinctive: line 69
After merge: STATUS flips the module to ✅ with PR + verdict references, and the task branch is deleted — only after merge.
- Very specific: line 76
Remove the worktree after merge: git worktree remove ../<repo>-<task-id>.
- Distinctive: line 80
main is read-only for agents: No exceptions, including "trivial" fixes.
“Common” is measured: kept by at least 6 in 10 of the 165 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Git Workflow — Shipping Through the Gate
Core constraint:
mainis read-only for agents. Work lands on task branches, ships as draft PRs carrying verification evidence, and merges only after the verifier's PASS and a human who has read the diff. The agent never merges its own PR.
Quick Reference
| Use when | Code work starts (branch first); a task is built and needs to ship; parallel agents share a repo |
| Skip when | Doc-only edits the user has exempted, or repos where the user explicitly owns all git operations |
| Output | One branch + one draft PR per task, the PR description carrying the done condition and verdict reference |
| Sequence | IMPL PLAN task starts → BRANCH → build → self-check → DRAFT PR → VERIFY → PASS → ready → human gate → MERGE → STATUS ✅ |
| Iron rule | One task, one branch, one PR. Never commit to main. Never merge your own PR. |
| Sibling skills | [[project-kickoff-prd]] · [[technical-specification]] · [[architecture-decision-record]] · [[implementation-plan]] · [[status-tracker]] · [[independent-verification]] · [[agents-md-template]] |
Why This Exists
The rest of the chain defines what to build (IMPL PLAN), how to prove it (VERIFY), and how to remember it (STATUS) — but without a git contract, how code actually lands is left to agent defaults, and agent defaults are destructive: commits straight to main, three tasks bundled into one diff, "done" declared with nothing pushed.
Two concepts the chain repeats — merging through the verification gate and the human gate — only become operational when there is a branch to verify and a PR for the human to read. This skill is that contract.
Branch Protocol
- main is protected. Agents never commit to it, never push to it, never rewrite it.
- One branch per task, created from up-to-date main at task start (the branch is the workspace — the In-Flight Checkpoint references it):
- Naming:
task/<task-id>-<slug>— e.g.task/m1-t2-user-model - For long milestones, an optional integration branch
milestone/<id>— task branches then fork from and PR into it
- Naming:
- Never reuse a branch across tasks. Never let a task branch outlive its merge.
Commit Protocol
- Small commits inside the task — each a coherent step, not an end-of-session dump.
- Message format:
<task-id>: <imperative summary>(e.g.,M1-T2: add user model with validation). Cite the spec section in the body when it clarifies intent. - No drive-by changes. An unrelated fix discovered mid-task becomes its own task in the plan, not a stowaway commit.
- No history rewriting once verification has started. The verdict cites a commit range; force-pushing invalidates the evidence. If a rebase is unavoidable, the task drops back to 🔍 and re-verifies.
PR Protocol
- Producer self-check passes (lint, full suite, test ratchet) → push the branch → open a draft PR immediately. The diff becomes inspectable the moment it exists.
The PR description carries the contract:
**Task:** M1-T2 — [title] ([plan link]) **Spec:** spec/auth.md §2.1 **Done condition:** [the executable criteria, copy-pasteable] **Verification:** [link to the verdict entry in docs/verification-log.md — added when the verdict lands] **Caveats:** ⚠️ [anything that needs special environment / keys / follow-up]- One task = one PR. A PR that needs a second task's changes is mis-scoped — fix the plan, not the PR.
- Draft until PASS. Flip to "ready for review" only when the verifier's PASS verdict is recorded, adding the verdict reference to the description in the same motion.
- After a FAIL verdict: fix commits go to the same branch, each round noted in the PR thread (
round 2/3). Silent fix-ups are an anti-pattern — the PR history must match the verdict history.
Merge Gate
Merging requires all three:
- Verifier PASS recorded in
docs/verification-log.md - A human has read the diff and can explain it (the human gate)
- CI green, if CI exists — noting that CI green alone is neither ① nor ②
The agent never merges its own PR. In unattended loops this is absolute: the loop's output is a queue of verified, evidence-carrying PRs — merged code is always a human's move.
After merge: STATUS flips the module to ✅ with PR + verdict references, and the task branch is deleted — only after merge; until then the branch is evidence.
Worktrees — Parallel Agents
- One worktree per agent:
git worktree add ../<repo>-<task-id> task/<task-id>-<slug>— isolated working copies of the same repo, no file collisions. - Worktrees solve mechanical conflicts only. The real ceiling is human review bandwidth: every parallel agent emits PRs a human must read, and verdicts a verifier must produce.
- Tasks touching the same files must not run in parallel regardless of worktrees — that is a dependency the plan missed (→ [[implementation-plan]]).
- Remove the worktree after merge:
git worktree remove ../<repo>-<task-id>.
Rules
- main is read-only for agents. No exceptions, including "trivial" fixes.
- One task, one branch, one PR. Traceability runs diff → PR → task → spec.
- Branch names derive from task IDs. A reviewer can find the contract from the branch name alone.
- PRs are born draft. Ready-for-review is earned by a PASS verdict, not by the producer's confidence.
- No history rewriting after verification starts. Evidence integrity outranks a tidy log.
- Never merge your own PR. Both gates (verifier + human) live on the merge button.
- Delete branches only after merge. Branches referenced by verdicts are evidence.
- AGENTS.md wins. Repo-specific overrides (protected branch names, PR conventions, merge strategy) live in
AGENTS.md— this skill defines the defaults.
Anti-Patterns (Do Not)
| Anti-Pattern | Why It Fails |
| Committing to main "just this once" | The exception becomes the workflow; one stray commit on main poisons every open branch |
| Multi-task PRs | The reviewer can't map the diff to a done condition; verdicts lose their object |
| Silent fix-ups after a FAIL | Unannounced commits or force-pushes decouple the PR from the verdict history |
| Merging because CI is green | CI is necessary, never sufficient — it is neither the verifier nor the human gate |
| Long-lived task branches | A task is ≤ 90 minutes by plan rule; a week-old branch means the task was mis-scoped |
| Deleting branches before merge | Destroys the evidence the verdict references |
| Agent merging its own PR | The one unguarded door that bypasses both gates at once |
Relationship to Other Documents
- IMPL PLAN supplies the task IDs that name branches and PRs ([[implementation-plan]])
- VERIFY verdicts cite the branch/commit range; PASS is what flips a PR from draft to ready ([[independent-verification]])
- STATUS records PR state per module and the verdict reference behind every ✅ ([[status-tracker]])
- AGENTS.md carries repo-specific git overrides and the boundaries that enforce this contract ([[agents-md-template]])
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

