mcpbeat Sign in

Git Workflow Agent Skill

Squad branching model: dev-first workflow with insiders preview channel

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
1
copies elsewhere
how many repositories repackaged it
2939
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/microsoft/Generative-AI-for-beginners-dotnet --skill git-workflow

The instruction itself

16 sections, as written by the author

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-bug
  • squad/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/dev

Naming 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 .git object 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" --draft

All 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:

  • .gitattributes declares merge=union on 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-bug

If 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 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}.

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 skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take microsoft/generative-ai-for-beginners-dotnet-git-workflow from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference pip. Without those the skill loads but fails at the first command.