sc-worktree
Skill19 starsChanged 8 months agoMITView on GitHub
Git worktree management for multi-agent parallel development. Use when spawning multiple agents to work on isolated features simultaneously.
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- kreighmitchell/SuperClaudeword for word, first seen Nov 1, 2026
Other versions1 project uses a version of this.
Word for word · 1
- kreighmitchell/SuperClaude★ 4100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
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 repository37 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-data-engineerSkill
- agent-fullstack-developerSkill
- agent-kubernetes-specialistSkill
- agent-ml-engineerSkill
- agent-performance-engineerSkill
- agent-react-specialistSkill
- agent-security-engineerSkill
- agent-technical-writerSkill
- ask-multiSkill
- askSkill
- learned-skills-indexSkill
- sc-analyzeSkill
- sc-brainstormSkill
- sc-buildSkill
- sc-cicd-setupSkill
- sc-code-reviewSkill
- sc-designSkill
- sc-documentSkill
- sc-e2eSkill
- sc-estimateSkill
- sc-evaluateSkill
- sc-explainSkill
- sc-gitSkill
- sc-implementSkill
- sc-improveSkill
- sc-log-fixSkill
- sc-mcpSkill
- sc-pr-checkSkill
- sc-pr-fixSkill
- sc-principlesSkill
- sc-pushSkill
- sc-readmeSkill
- sc-researchSkill
- sc-tddSkill
- sc-testSkill
- sc-workflowSkill
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 10 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈10
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 33
Cleanup: - Remove merged/stale worktrees
- Distinctive: line 138
When spawning a subagent to work in a worktree:
- Distinctive: line 161
Before creating a worktree, the skill validates:
- Distinctive: line 169
No conflicting remote branch
- Distinctive: line 176
Before proposing, the skill checks for conflicts:
- Distinctive: line 311
Read: - Check worktree status and logs
- Distinctive: line 326
No automatic quality scoring (use CI/tests)
- Distinctive: line 327
No lease tracking (periodic cleanup instead)
- Distinctive: line 328
No sophisticated conflict resolution (human review)
- Distinctive: line 329
No auto-merge to main (PR-based workflow)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Worktree Management Skill
Git worktree isolation for parallel agent development with simple, safe workflows.
Quick Start
# Create isolated worktree for a task
/sc:worktree create feature-auth
# List all active worktrees
/sc:worktree list
# Propose changes for human review
/sc:worktree propose feature-auth
# Clean up stale worktrees
/sc:worktree cleanupBehavioral Flow
- Create - Initialize isolated worktree with unique naming
- Validate - Preflight checks (clean repo, no conflicts)
- Assign - Spawn subagent with CWD set to worktree
- Work - Agent operates in isolation, commits to branch
- Propose - Push branch and create PR for human review
- Cleanup - Remove merged/stale worktrees
Commands
| Command | Purpose | Git Operations |
create <task-id> | Create isolated worktree | git worktree add -b wt/<task> |
list | Show all active worktrees | git worktree list |
status <task-id> | Check worktree state | git status, git log |
cleanup [--all] | Remove stale worktrees | git worktree remove, prune |
propose <task-id> | Create PR for human review | git push, gh pr create |
Flags
| Flag | Type | Default | Description |
--commits | bool | true | Agent commits directly to branch |
--patches | bool | false | Agent produces patch files only |
--run-tests | bool | false | Run tests before proposing |
--force | bool | false | Override existing worktree/branch |
--base | string | main | Base branch for worktree |
Evidence Requirements
This skill does NOT require hard evidence. Worktree operations are self-documenting through:
- Git worktree list output
- Branch history
- PR creation confirmation
Naming Convention
Worktrees use deterministic naming to prevent collisions:
Path: .worktrees/<task-id>/
Branch: wt/<task-id>Example:
Path: .worktrees/feature-auth/
Branch: wt/feature-authOperations
Create Worktree
/sc:worktree create feature-auth
# Executes:
# 1. mkdir -p .worktrees
# 2. git worktree add -b wt/feature-auth .worktrees/feature-auth
# 3. Returns worktree path for subagent CWDList Worktrees
/sc:worktree list
# Shows:
# - Active worktrees
# - Associated branches
# - Last commit infoCheck Status
/sc:worktree status feature-auth
# Shows:
# - Uncommitted changes
# - Commits ahead of base branch
# - Conflict warningsPropose Changes
/sc:worktree propose feature-auth
# Executes:
# 1. git push -u origin wt/feature-auth
# 2. gh pr create --title "feat: feature-auth" --body "..."
# 3. Returns PR URL for human reviewCleanup Worktrees
/sc:worktree cleanup # Remove merged worktrees
/sc:worktree cleanup --all # Remove ALL worktrees
/sc:worktree cleanup feature-auth # Remove specific worktree
# Executes:
# 1. git worktree remove .worktrees/<task-id>
# 2. git branch -d wt/<task-id>
# 3. git worktree pruneSubagent Integration
When spawning a subagent to work in a worktree:
# 1. Create worktree
/sc:worktree create feature-auth
# 2. Spawn subagent with CWD
Task(
prompt="Implement JWT authentication",
subagent_type="general-purpose",
# CWD implicitly set to .worktrees/feature-auth/
)
# 3. Agent works in isolation
# - All file operations scoped to worktree
# - Commits go to wt/feature-auth branch
# 4. Propose for review
/sc:worktree propose feature-authPreflight Checks
Before creating a worktree, the skill validates:
- Repository State
- Repo is clean OR
--forceflag provided - Main branch is up to date
- Repo is clean OR
- Branch Availability
wt/<task-id>branch doesn't exist OR explicit reuse- No conflicting remote branch
- Path Availability
.worktrees/<task-id>doesn't exist OR--forceflag
Conflict Detection
Before proposing, the skill checks for conflicts:
# Fetch latest changes
git fetch origin main
# Check if worktree is behind
git merge-base --is-ancestor origin/main HEAD
# Warn but don't block if behind
# Human reviewer handles merge strategyExamples
Single Agent Workflow
# Create worktree
/sc:worktree create add-logging
# Work in worktree (agent operates here)
# ... agent makes changes, commits ...
# Propose changes
/sc:worktree propose add-logging
# Human reviews PR, merges
# Cleanup
/sc:worktree cleanup add-loggingParallel Multi-Agent Workflow
# Orchestrator creates multiple worktrees
/sc:worktree create feature-auth
/sc:worktree create feature-logging
/sc:worktree create feature-metrics
# Spawn agents in parallel (each with own worktree)
# Agent A -> .worktrees/feature-auth/
# Agent B -> .worktrees/feature-logging/
# Agent C -> .worktrees/feature-metrics/
# Propose all changes
/sc:worktree propose feature-auth
/sc:worktree propose feature-logging
/sc:worktree propose feature-metrics
# Human reviews 3 PRs, merges sequentially
# Cleanup all
/sc:worktree cleanup --allPatch Mode (No Direct Commits)
/sc:worktree create refactor-api --patches
# Agent produces .patch files instead of commits
# Orchestrator reviews patches before applying
/sc:worktree propose refactor-api # Creates PR from patchesMCP Integration
PAL MCP (Validation & Review)
| Tool | When to Use | Purpose |
mcp__pal__precommit | Before propose | Validate changes in worktree |
mcp__pal__codereview | Before propose | Review worktree changes |
mcp__pal__consensus | Conflict resolution | Multi-model merge strategy |
PAL Usage Patterns
# Validate worktree changes before proposing
mcp__pal__precommit(
path=".worktrees/feature-auth",
step="Validating worktree changes",
findings="Security, test coverage, completeness",
compare_to="main"
)
# Review worktree branch
mcp__pal__codereview(
review_type="full",
step="Reviewing feature-auth worktree",
relevant_files=[".worktrees/feature-auth/src/auth.py"]
)Rube MCP (Automation & Notifications)
| Tool | When to Use | Purpose |
mcp__rube__RUBE_SEARCH_TOOLS | GitHub integration | Find PR tools |
mcp__rube__RUBE_MULTI_EXECUTE_TOOL | Propose command | Create PR, notify team |
Rube Usage Patterns
# Create PR and notify team
mcp__rube__RUBE_MULTI_EXECUTE_TOOL(tools=[
{"tool_slug": "GITHUB_CREATE_PULL_REQUEST", "arguments": {
"repo": "myapp",
"title": "feat: feature-auth from worktree",
"body": "## Worktree: feature-auth\nCreated via /sc:worktree",
"base": "main",
"head": "wt/feature-auth"
}},
{"tool_slug": "SLACK_SEND_MESSAGE", "arguments": {
"channel": "#pull-requests",
"text": "New PR from worktree: wt/feature-auth"
}}
])Flags (Extended)
| Flag | Type | Default | Description |
--pal-review | bool | false | Use PAL codereview before propose |
--create-pr | bool | true | Create GitHub PR via Rube |
--notify | string | - | Notify via Rube (slack, teams) |
--draft | bool | false | Create draft PR |
Tool Coordination
- Bash - Git worktree commands, directory operations
- Read - Check worktree status and logs
- Task - Spawn subagents with worktree CWD
- PAL MCP - Pre-propose validation, code review
- Rube MCP - PR creation, team notifications
Safety Guarantees
- Isolation - Each worktree has separate working directory
- No Auto-Merge - Human review required for all merges
- Unique Naming - Deterministic paths prevent collisions
- Crash-Safe -
cleanup --allremoves stale worktrees - Warning-Only Conflicts - Conflicts warn but don't block
Limitations
- No automatic quality scoring (use CI/tests)
- No lease tracking (periodic cleanup instead)
- No sophisticated conflict resolution (human review)
- No auto-merge to main (PR-based workflow)
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.

