git-workflow
Skill227 starsChanged 9 months agoApache-2.0View on GitHub
Squad branching model: dev-first workflow with insiders preview channel
- Deletes or force-pushes
- Installs packages
- Commits and pushes
We split this skill into the rules it gives an agent
9 rules. 0 are common, 6 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 149 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 64
When the coordinator routes multiple issues simultaneously (e.g., "fix bugs X, Y, and Z"), use git worktree to give each agent an isolated …
- Very specific: line 109
All PRs target dev independently.
- Very specific: line 116
Rule: Never rewrite or reorder .squad/ files in a worktree — append only
- Distinctive: line 120
After a worktree's PR is merged to dev:
- Distinctive: line 130
If a worktree was deleted manually (rm -rf), git worktree prune recovers the state.
- Distinctive: line 136
When work spans multiple repositories (e.g., squad-cli changes need squad-sdk changes, or a user's app depends on squad):
- Distinctive: line 153
Create PRs in each repo independently
- Distinctive: line 164
Before pushing, verify cross-repo changes work together:
- Very specific: line 179
Important: Remove local links before committing.
“Common” is measured: kept by at least 6 in 10 of the 149 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
Context
Squad uses a three-branch model. All feature work starts from dev, not main.
| Branch | Purpose | Publishes |
main | Released, tagged, in-npm code only | npm publish on tag |
dev | Integration branch — all feature work lands here | npm publish --tag preview on merge |
insiders | Early-access channel — synced from dev | npm publish --tag insiders on sync |
Branch Naming Convention
Issue branches MUST use: squad/{issue-number}-{kebab-case-slug}
Examples:
squad/195-fix-version-stamp-bugsquad/42-add-profile-api
Workflow for Issue Work
- Branch from dev:
git checkout dev git pull origin dev git checkout -b squad/{issue-number}-{slug} - Mark issue in-progress:
gh issue edit {number} --add-label "status:in-progress" - Create draft PR targeting dev:
gh pr create --base dev --title "{description}" --body "Closes #{issue-number}" --draft - Do the work. Make changes, write tests, commit with issue reference.
- Push and mark ready:
git push -u origin squad/{issue-number}-{slug} gh pr ready - After merge to dev:
git checkout dev git pull origin dev git branch -d squad/{issue-number}-{slug} git push origin --delete squad/{issue-number}-{slug}
Parallel Multi-Issue Work (Worktrees)
When the coordinator routes multiple issues simultaneously (e.g., "fix bugs X, Y, and Z"), use git worktree to give each agent an isolated working directory. No filesystem collisions, no branch-switching overhead.
When to Use Worktrees vs Sequential
| Scenario | Strategy |
| Single issue | Standard workflow above — no worktree needed |
| 2+ simultaneous issues in same repo | Worktrees — one per issue |
| Work spanning multiple repos | Separate clones as siblings (see Multi-Repo below) |
Setup
From the main clone (must be on dev or any branch):
# Ensure dev is current
git fetch origin dev
# Create a worktree per issue — siblings to the main clone
git worktree add ../squad-195 -b squad/195-fix-stamp-bug origin/dev
git worktree add ../squad-193 -b squad/193-refactor-loader origin/devNaming convention: ../{repo-name}-{issue-number} (e.g., ../squad-195, ../squad-pr-42).
Each worktree:
- Has its own working directory and index
- Is on its own
squad/{issue-number}-{slug}branch from dev - Shares the same
.gitobject store (disk-efficient)
Per-Worktree Agent Workflow
Each agent operates inside its worktree exactly like the single-issue workflow:
cd ../squad-195
# Work normally — commits, tests, pushes
git add -A && git commit -m "fix: stamp bug (#195)"
git push -u origin squad/195-fix-stamp-bug
# Create PR targeting dev
gh pr create --base dev --title "fix: stamp bug" --body "Closes #195" --draftAll PRs target dev independently. Agents never interfere with each other's filesystem.
.squad/ State in Worktrees
The .squad/ directory exists in each worktree as a copy. This is safe because:
.gitattributesdeclaresmerge=unionon append-only files (history.md, decisions.md, logs)- Each agent appends to its own section; union merge reconciles on PR merge to dev
- Rule: Never rewrite or reorder
.squad/files in a worktree — append only
Cleanup After Merge
After a worktree's PR is merged to dev:
# From the main clone
git worktree remove ../squad-195
git worktree prune # clean stale metadata
git branch -d squad/195-fix-stamp-bug
git push origin --delete squad/195-fix-stamp-bugIf a worktree was deleted manually (rm -rf), git worktree prune recovers the state.
Multi-Repo Downstream Scenarios
When work spans multiple repositories (e.g., squad-cli changes need squad-sdk changes, or a user's app depends on squad):
Setup
Clone downstream repos as siblings to the main repo:
~/work/
squad-pr/ # main repo
squad-sdk/ # downstream dependency
user-app/ # consumer projectEach repo gets its own issue branch following its own naming convention. If the downstream repo also uses Squad conventions, use squad/{issue-number}-{slug}.
Coordinated PRs
- Create PRs in each repo independently
- Link them in PR descriptions:
Closes #42 **Depends on:** squad-sdk PR #17 (squad-sdk changes required for this feature) - Merge order: dependencies first (e.g., squad-sdk), then dependents (e.g., squad-cli)
Local Linking for Testing
Before pushing, verify cross-repo changes work together:
# Node.js / npm
cd ../squad-sdk && npm link
cd ../squad-pr && npm link squad-sdk
# Go
# Use replace directive in go.mod:
# replace github.com/org/squad-sdk => ../squad-sdk
# Python
cd ../squad-sdk && pip install -e .Important: Remove local links before committing. npm link and go replace are dev-only — CI must use published packages or PR-specific refs.
Worktrees + Multi-Repo
These compose naturally. You can have:
- Multiple worktrees in the main repo (parallel issues)
- Separate clones for downstream repos
- Each combination operates independently
Anti-Patterns
- ❌ Branching from main (branch from dev)
- ❌ PR targeting main directly (target dev)
- ❌ Non-conforming branch names (must be squad/{number}-{slug})
- ❌ Committing directly to main or dev (use PRs)
- ❌ Switching branches in the main clone while worktrees are active (use worktrees instead)
- ❌ Using worktrees for cross-repo work (use separate clones)
- ❌ Leaving stale worktrees after PR merge (clean up immediately)
Promotion Pipeline
- dev → insiders: Automated sync on green build
- dev → main: Manual merge when ready for stable release, then tag
- Hotfixes: Branch from main as
hotfix/{slug}, PR to dev, cherry-pick to main if urgent
Other versions180 projects use a version of this.
Word for word · 6
- github/gh-aw★ 5.5k100% same
- microsoft/Generative-AI-for-beginners-dotnet★ 3.2k100% same
- kubefleet-dev/kubefleet★ 162100% same
- Azure/apiops-cli★ 32100% same
- microsoft/github-vteam-industry-demos★ 2100% same
- microsoft/fsi-banking-payments-dispute-resolution-accelerator★ 0100% same
Edited · 1
- microsoft/waza★ 1.5k97% same
Wrote their own version · 173
- langfuse/langfuse★ 36ksame name
- modelcontextprotocol/typescript-sdk★ 14ksame name
- JetBrains/ideavim★ 10ksame name
- Galaxy-Dawn/claude-scholar★ 5.9ksame name
- modelcontextprotocol/csharp-sdk★ 4.6ksame name
- antonbabenko/pre-commit-terraform★ 3.8ksame name
- jd-opensource/xllm★ 1.6ksame name
- laolaoshiren/claude-code-skills-zh★ 894same name
- meleantonio/ChernyCode★ 516same name
- NPC-Worldwide/npcsh★ 492same name
163 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.
Used alongsideProjects with it also use squad-commands, architectural-proposals 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.
MicrosoftSkillsquad-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
MicrosoftSkillarchitectural-proposals
How to write comprehensive architectural proposals that drive alignment before code is written
Also in 4 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
- +9 more from microsoft
In this repository21 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- agent-collaborationSkill
- coordinator-init-modeSkill
- coordinator-response-modeSkill
- coordinator-source-of-truthSkill
- cross-squad-communicationSkill
- cross-squadSkill
- error-recoverySkill
- iterative-retrievalSkill
- reflectSkill
- reviewer-protocolSkill
- secret-handlingSkill
- session-recoverySkill
- squad-conventionsSkill
- squad-helpSkill
- squadSkill
- squad-version-checkSkill
- test-disciplineSkill
- tiered-memorySkill
- humanizerSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

