worktrees
Skill4 starsChanged 3 months agoMITView on GitHub
Set up git worktrees for working on multiple independent features in parallel.
- Installs packages
- Commits and pushes
20 other projects use a version of this.
Adopted by
Most recently taken up by
- domengabrovsek/agent-configtheir own version, first seen Nov 8, 2026
- domengabrovsek/claudetheir own version, first seen Nov 8, 2026
- chewygumxx/agentic-librarytheir own version, first seen Nov 8, 2026
- delorenj/skillstheir own version, first seen Nov 7, 2026
- pumpkit-io/sdlctheir own version, first seen Nov 1, 2026
- snuffish/dotfilestheir own version, first seen Nov 1, 2026
Used with
Projects with it also use resolve-conflicts, debug and 8 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.
ralphkraussSkillresolve-conflicts
Resolve git merge conflicts or re-apply changes from a stale branch onto current main. Use when user says "resolve conflicts", "merge conflicts", "rebase branch", "branch is behind", "re-apply changes", "port branch", or a branch is too far behind main to merge cleanly.
Also in 3 projects that use this
AnthropicSkilldebug
Structured debugging session — reproduce, isolate, diagnose, and fix. Trigger with an error message or stack trace, "this works in staging but not prod", "something broke after the deploy", or when behavior diverges from expected and the cause isn't obvious.
Also in 4 projects that use this
GoogleSkillprototype
Build a throwaway prototype to answer a design question. Use when the user wants to sanity-check whether a state model or logic feels right, or explore what a UI should look like.
Also in 4 projects that use this
GoogleSkillimprove-codebase-architecture
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
Also in 4 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 6 projects that use this
BlockSkillplan
Draft a TDD, PRD, or lightweight plan in the conversation without committing it.
Also in 3 projects that use this
- +1 more from google
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- GetStream/stream-chat-react★ 844same name
- akitaonrails/my-skills★ 283same name
- maragudk/skills★ 49same name
- nilecui/SkillsBase★ 27same name
- domengabrovsek/agent-config★ 22same name
- domengabrovsek/claude★ 22same name
- delorenj/skills★ 17same name
- ariadoss/superskills★ 12same name
- divanc/skills★ 3same name
- Joshua-Palamuttam/workbench-template★ 3same name
10 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.
In this repository53 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- actionableSkill
- astro-bootstrapSkill
- astro-patternsSkill
- autopilotSkill
- axon-code-intelSkill
- brainstormingSkill
- commit-conventionsSkill
- cross-repo-contextSkill
- django-bootstrapSkill
- django-patternsSkill
- executeSkill
- find-sessionSkill
- flutter-bootstrapSkill
- flutter-patternsSkill
- full-featureSkill
- intelSkill
- nextjs-bootstrapSkill
- nextjs-fullstack-bootstrapSkill
- nextjs-fullstack-patternsSkill
- nextjs-mui-bootstrapSkill
- nextjs-patternsSkill
- nextjs-shadcn-bootstrapSkill
- orchestratorSkill
- phase-breakdownSkill
- plan-and-scopeSkill
- prdSkill
- reactSkill
- recallSkill
- reflectSkill
- relaySkill
- rememberSkill
- scaffoldSkill
- scratchSkill
- tailwindSkill
- ux-specSkill
- ux-to-promptsSkill
- verify-astroSkill
- verify-djangoSkill
- verify-flutterSkill
- verify-nextjs-fullstackSkill
- verify-nextjs-muiSkill
- verify-nextjs-shadcnSkill
- verify-nextjsSkill
- verifySkill
- visual-feedbackSkill
- work-disciplineSkill
- wrapSkill
- write-as-friendSkill
- write-as-humanSkill
- writing-clearlySkill
- writing-skillsSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 20 edited versions we read keep these.
5
Distinctive
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
- Distinctive: line 31
Before creating any worktrees, verify the source branch is clean:
- Distinctive: line 70
After creating a worktree, detect the project type and install dependencies:
- Distinctive: line 101
Run the test suite to confirm everything passes before making changes.
- Distinctive: line 161
Only include folders that exist.
- Distinctive: line 197
After a feature is merged and the PR is closed:
“Common” is measured: kept by at least 6 in 10 of the 20 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
Using Git Worktrees for Parallel Development
Inspired by obra/superpowers, adapted for feature-based workflow.
Overview
Git worktrees let you have multiple branches checked out simultaneously in separate directories. Each worktree is a full working copy with its own branch, dependencies, and state.
When to Use
- Working on multiple independent features at the same time on an existing project
- Need to switch between unrelated tickets without stashing or losing context
- Want isolated workspaces so parallel features don't interfere with each other
When NOT to Use
- Initial MVP builds — work directly on main, there's nothing to protect yet
- Single features — a regular branch is simpler and sufficient
- Sequential phases that build on each other — just commit on main or merge between phases
Setup Flow
1. Verify Clean State
Before creating any worktrees, verify the source branch is clean:
# Ensure we're on the base branch (usually main or develop)
git checkout main
git pull origin main
# Verify clean working tree
git status --porcelain
# If not clean: stash or commit before proceeding2. Choose Worktree Location
Worktrees are created as sibling directories to the repo within the project root. Example with two features in flight:
~/prj/my-project/
api/ # git repo (main branch)
api-notifications/ # worktree (feature/notifications branch)
api-billing/ # worktree (feature/billing branch)
web/ # git repo (main branch)
web-notifications/ # worktree (feature/notifications branch)Naming convention: {repo-name}-{feature-name} for clarity.
3. Create Worktree
# From the repo root
REPO_NAME=$(basename $(pwd))
FEATURE="notifications"
git worktree add "../${REPO_NAME}-${FEATURE}" -b "feature/${FEATURE}"4. Install Dependencies
After creating a worktree, detect the project type and install dependencies:
cd "../${REPO_NAME}-${FEATURE}"
# Python
if [ -f "pyproject.toml" ]; then
poetry install 2>/dev/null || pip install -e ".[dev]" 2>/dev/null
elif [ -f "requirements.txt" ]; then
pip install -r requirements.txt
fi
# Node.js
if [ -f "package-lock.json" ]; then
npm ci
elif [ -f "yarn.lock" ]; then
yarn install --frozen-lockfile
elif [ -f "pnpm-lock.yaml" ]; then
pnpm install --frozen-lockfile
elif [ -f "package.json" ]; then
npm install
fi
# Flutter/Dart
if [ -f "pubspec.yaml" ]; then
flutter pub get
fi5. Verify Clean Baseline
Run the test suite to confirm everything passes before making changes. This is critical — if tests fail before you start, you know it's not your fault.
# Python/Django
if [ -f "pytest.ini" ] || [ -f "pyproject.toml" ]; then
pytest --tb=short -q
fi
# Node.js/Next.js
if [ -f "package.json" ]; then
npm test -- --watchAll=false 2>/dev/null || npx jest --passWithNoTests 2>/dev/null
fi
# Flutter
if [ -f "pubspec.yaml" ]; then
flutter test
fiIf tests fail: Report the failures. Ask whether to proceed anyway or investigate first. Do not silently continue with a broken baseline — that makes verification meaningless later.
If tests pass: Report readiness:
✓ Worktree ready: ../api-notifications
Branch: feature/notifications
Base: main (abc1234)
Tests: 47 passing, 0 failures
Ready for development6. Install Skills (if using Polaris)
# From the worktree directory
polaris project --profile django-api7. Generate VS Code Workspace
Generate a .code-workspace file so all active worktrees are accessible from a single VS Code window.
# From the project root (parent of repos)
PROJECT_DIR=$(pwd)
cat > "${PROJECT_DIR}/dev.code-workspace" << EOF
{
"folders": [
{ "path": "api", "name": "API (main)" },
{ "path": "api-notifications", "name": "API - Notifications" },
{ "path": "api-billing", "name": "API - Billing" },
{ "path": "web", "name": "Web (main)" },
{ "path": "web-notifications", "name": "Web - Notifications" }
],
"settings": {}
}
EOFOnly include folders that exist. Update this file as worktrees are created and removed.
Open with:
code "${PROJECT_DIR}/dev.code-workspace"The sidebar shows each worktree as a labeled root with separate SCM panels per worktree.
Working in Worktrees
Switching Between Features
Each worktree is a regular directory. Switch between them like any other project:
cd ../api-notifications # work on notifications
cd ../api-billing # switch to billing
cd ../api # back to mainCommitting and PRs
Commits in a worktree happen on that worktree's branch. Normal git workflow applies:
git add .
git commit -m "feat(notifications): add push notification service"
git push origin feature/notifications
gh pr create --title "feat: add push notifications" \
--body "Implements notification service and delivery queue."Cleanup
After a feature is merged and the PR is closed:
# From the main repo
git worktree remove ../api-notifications
git branch -d feature/notifications # delete local branch
git worktree pruneListing Active Worktrees
git worktree list
# /home/tyler/prj/my-project/api abc1234 [main]
# /home/tyler/prj/my-project/api-notifications def5678 [feature/notifications]
# /home/tyler/prj/my-project/api-billing ghi9012 [feature/billing]Cross-Repo Worktrees
For features that span both backend and frontend repos:
# From the project root (~/prj/my-project/)
cd api
git worktree add ../api-notifications -b feature/notifications
cd ../web
git worktree add ../web-notifications -b feature/notificationsThen generate a single workspace file covering both repos and their worktrees (see step 7 above).
Common Issues
"fatal: is already checked out" — You're trying to create a worktree for a branch that's already checked out somewhere. Use a new branch name.
Shared node_modules/venv — Each worktree has its own working directory but shares .git. Dependency directories (node_modules, .venv, build/) are per-worktree and need separate installs.
IDE confusion — Use the generated .code-workspace file to open all worktrees in a single VS Code window with proper isolation. Avoid opening worktrees individually within the same window without a workspace file.
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.

