feature-branching
Skill1 starsChanged 3 months agoMITView on GitHub
Conductor-only. Branching procedure — when and how to branch, batching todos, pausing mid-task, syncing with develop, and cleaning up after a merge. Commit and branch naming live in docs/wiki/git-conventions.md. Trigger on "start branch", "feat/", "fix/", "batch todos", "finish feature".
- Commits and pushes
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-reviewSkill
- clean-architectureSkill
- decision-recordingSkill
- design-system-checkSkill
- finding-dispositionSkill
- git-recoverySkill
- gotcha-recordingSkill
- human-checkpointSkill
- plan-reviewSkill
- plan-writingSkill
- pr-createSkill
- spec-writingSkill
- tdd-loopSkill
- update-toolkitSkill
- wiki-updateSkill
- worker-dispatchSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 72
After it, docs/wiki/log.md (merged by union) may be out of order: node tools/workflow-mcp/verify.mjs --sort-log and commit the result with …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Branching
Code (feat/*, fix/*, refactor/*, perf/*) is built on a branch cut from develop and merged by PR. Living documentation and maintenance (docs/wiki/, docs/raw/, .agents/ config) commit directly to develop, or ride the active branch (rule 19). Naming and commit format: docs/wiki/git-conventions.md.
Starting work
- Clean tree:
git status --porcelainprints nothing. Dirty →human-checkpoint(or see Mid-task pause). Sync
develop—fetch+merge --ff-only, notpull, so a divergeddevelopfails safely:git checkout develop || { echo "could not switch to develop — stop and run human-checkpoint"; exit 1; } if git remote get-url origin >/dev/null 2>&1; then git fetch origin develop "refs/heads/<type>/<slug>:refs/remotes/origin/<type>/<slug>" 2>/dev/null || git fetch origin develop || { echo "fetch failed — stop and run human-checkpoint"; exit 1; } git merge --ff-only origin/develop || { echo "develop has diverged from origin — stop and run human-checkpoint"; exit 1; } fiA
--ff-onlyfailure meansdevelopdiverged →human-checkpoint; never force or rebase it. The fetch and merge share one guard, so with nooriginboth are skipped and the block works off localdevelop(a merge outside the guard would fail withnot something we can merge).Create or resume
<type>/<slug>—<type>∈feat,fix,chore,docs,refactor,test,perf:git checkout "<type>/<slug>" 2>/dev/null || git checkout -b "<type>/<slug>" if git rev-parse --verify "origin/<type>/<slug>" >/dev/null 2>&1; then git merge --ff-only "origin/<type>/<slug>" || { echo "<type>/<slug> has diverged from origin — stop and run human-checkpoint"; exit 1; } fiThe
rev-parseguard tells "no remote branch yet" (fine — first push to come) apart from "it exists and diverged" (stop — another session pushed here).
<slug> equals the entity-page slug — the branch, the entity page, the plan scratch (.handoff/<slug>-plan.md) and the test names all key off it. Pick it once.
Which command branches
| Command | Branch |
/project:work | feat/<slug>, created before the failing test |
/project:interview, /project:wiki, /project:review | none — on develop (via sync-develop.md) or the active feat/* |
/project:adversary | none — the existing feat/*/fix/*/chore/*; develop only for the release review |
Already on a branch whose work this belongs to → stay, and let its PR carry the change.
Batching todos
Two todos share a branch only when all hold: same entity page, the second depends on the first, and splitting them yields a meaningless intermediate PR. A batch shares a branch, a plan and a PR — never a commit — and 2+ todos trigger the planner.
Mid-task pause
Interrupted before a green commit boundary:
- Preferred — checkpoint. Stage your paths explicitly (never
git add -p: an interactive prompt hangs with no human), commitwip: <what's in flight>, andgit tag checkpoint-$(date -u +%Y%m%dT%H%M%SZ). On resume,git reset HEAD~1and continue. - Fallback — stash, only for a tiny change resumed within the same session:
git stash push -m "wip: <what>", latergit stash pop. Never leave a stash across sessions.
Syncing a long-running branch
Merge develop in early and often — the conflict surface only grows:
git fetch origin develop
git merge origin/develop # conflicts: git-recovery skill
<test command> # a merge can bring breakage — re-verify
git pushAfter it, docs/wiki/log.md (merged by union) may be out of order: node tools/workflow-mcp/verify.mjs --sort-log and commit the result with the merge. Never rebase a pushed branch as routine sync — sessions share branches concurrently. Rebase + --force-with-lease needs explicit human approval; bare --force, never.
After the human merges the PR
git checkout develop
git fetch origin develop && git merge --ff-only origin/develop
git branch -d feat/<slug> # safe delete: refuses if unmerged
git push origin --delete feat/<slug>Anti-patterns
- Committing code to
developormain. Branch first. git commit -aorgit add -A. Stage your own paths explicitly (rule 21).- Squashing to hide the Red→Green trace. History is the evidence the loop ran.
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.

