git-workflow
Squad branching model: main-only workflow with feature branches
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Squad branching model: main-only workflow with feature branches
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
{what this skill teaches agents}
Wire legacy .NET Framework service hosts through Enterprise Library-flavored appSettings so Unity, service location, exception policies, logging, and database aliases all hang off one configuration seam.
Build internal order-management Web Forms pages with ObjectDataSource, GridView, DetailsView, and ViewState-heavy filter handling.
Build a believable mid-2000s .NET data layer around connection catalogs, stored-procedure wrappers, DataSets, and repository facades.
Anchor store-ops workbench screens in separate StoreOps tables for order state, status snapshots, workforce alerts, and zone bulletins, with dispatch tickets linked back to orders.
Restack a child PR onto main after its base PR merges, then revalidate before clearing draft.
| name | git-workflow |
| description | Squad branching model: main-only workflow with feature branches |
| domain | version-control |
| confidence | high |
| source | team-decision |
All feature work branches from main and PRs target main directly.
| Branch | Purpose |
|---|---|
main | Integration and release branch — all work lands here |
Issue branches MUST use: squad/{issue-number}-{kebab-case-slug}
Examples:
squad/195-fix-version-stamp-bugsquad/42-add-profile-apiBranch from main:
git checkout main
git pull origin main
git checkout -b squad/{issue-number}-{slug}
Mark issue in-progress:
gh issue edit {number} --add-label "status:in-progress"
Create draft PR targeting main and assign Copilot for review:
gh pr create --base main --title "{description}" --body "Closes #{issue-number}" --draft --add-reviewer "@copilot"
All PRs route to Copilot for advisory review immediately upon creation.
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 main:
git checkout main
git pull origin main
git branch -d squad/{issue-number}-{slug}
git push origin --delete squad/{issue-number}-{slug}
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.
| 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) |
From the main clone:
# Ensure main is current
git fetch origin main
# Create a worktree per issue — siblings to the main clone
git worktree add ../squad-195 -b squad/195-fix-stamp-bug origin/main
git worktree add ../squad-193 -b squad/193-refactor-loader origin/main
Naming convention: ../{repo-name}-{issue-number} (e.g., ../squad-195, ../squad-pr-42).
Each worktree:
squad/{issue-number}-{slug} branch from main.git object store (disk-efficient)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 main (always assign Copilot for review)
gh pr create --base main --title "fix: stamp bug" --body "Closes #195" --draft --add-reviewer "@copilot"
All PRs target main independently. Agents never interfere with each other's filesystem.
The .squad/ directory exists in each worktree as a copy. This is safe because:
.gitattributes declares merge=union on append-only files (history.md, decisions.md, logs).squad/ files in a worktree — append onlyAfter a worktree's PR is merged to main:
# 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-bug
If a worktree was deleted manually (rm -rf), git worktree prune recovers the state.
When work spans multiple repositories (e.g., squad-cli changes need squad-sdk changes, or a user's app depends on squad):
Clone downstream repos as siblings to the main repo:
~/work/
squad-pr/ # main repo
squad-sdk/ # downstream dependency
user-app/ # consumer project
Each repo gets its own issue branch following its own naming convention. If the downstream repo also uses Squad conventions, use squad/{issue-number}-{slug}.
Closes #42
**Depends on:** squad-sdk PR #17 (squad-sdk changes required for this feature)
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.
These compose naturally. You can have:
--add-reviewer "@copilot")