worktree
Skill2 starsChanged 2 months agoMITView on GitHub
Create a git worktree and open it in a new VSCode window
- Reads credentials
40 other projects use a version of this.
Adopted by
Most recently taken up by
- Significant-Gravitas/AutoGPTtheir own version, first seen Nov 18, 2026
- kortix-ai/sunatheir own version, first seen Oct 5, 2026
- ShalomPrinz/go2-dispatchertheir own version, first seen Oct 4, 2026
- jantichy/claudetheir own version, first seen Oct 2, 2026
- domengabrovsek/agent-configtheir own version, first seen Oct 2, 2026
- craigcossairt/trellistheir own version, first seen Oct 1, 2026
Used with
Projects with it also use coverage, backlog and 9 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.
PydanticSkillcoverage
Fetch coverage diff from Codecov for the current branch or a specific PR. Shows uncovered lines, patch coverage, and overall coverage change.
Also in 3 projects that use this
vertz-devSkillbacklog
Manages deferred/blocked work items as GitHub Issues with labels and blocker tracking
Also in 3 projects that use this
johnlindquistSkilldiagram
Maintain and synchronize Unified Impact Diagrams following Diagram Driven Development (DDD) methodology. Create, update, and manage diagrams that connect user value to technical implementation.
Also in 4 projects that use this
SentrySkille2e
Run E2E tests for Sentry JavaScript SDK test applications
Also in 3 projects that use this
nicolasestremSkillcleanup
Clean up code, remove dead code, and optimize project structure
Also in 3 projects that use this
MongoDBSkilljira
Use this skill for any Jira operation in the DOCSP project — creating, viewing, searching, updating, transitioning, commenting on, or linking tickets. Also handles follow-up ticket creation to manage scope creep. TRIGGER when: user mentions a DOCSP-XXXXX ticket number or any Jira ticket URL; user asks to view, open, check, update, transition, close, comment on, link, or search tickets; user references \"the ticket\", \"the Jira\", or \"open a ticket\". SKIP: GitHub issues; non-Jira platforms; questions unrelated to ticket operations.
Also in 3 projects that use this
Other versions40 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 40
- Significant-Gravitas/AutoGPT★ 188ksame name
- kortix-ai/suna★ 20ksame name
- Zipstack/unstract★ 7.3ksame name
- mistralai/mistral-vibe★ 5ksame name
- nudgebee/nudgebee★ 398same name
- microsoft/service-fabric-dotnet★ 277same name
- murray17/rovai-ai★ 122same name
- forrestchang/worktree-workflow★ 108same name
- Rune-kit/rune★ 88same name
- oprogramadorreal/optimus-claude★ 75same name
30 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 repository67 other files it gives its agents.
- acceptance-criteriaSkill
- architect-guideSkill
- architect-reviewSkill
- audit-fixerSkill
- avo-admin-expertSkill
- backend-services-expertSkill
- bug-hunt-allSkill
- bug-hunt-fixSkill
- bug-huntSkill
- build-feature-remoteSkill
- build-featureSkill
- codeSkill
- component-testSkill
- controller-expertSkill
- create-qa-documentSkill
- debugSkill
- devops-expertSkill
- execute-qaSkill
- feature-qaSkill
- fix-bug-indexSkill
- fix-honeybadgerSkill
- fix-system-testSkill
- frontend-expertSkill
- frontend-reviewSkill
- full-qa-fixSkill
- full-qaSkill
- full-reviewSkill
- green-ciSkill
- honeybadger-auditSkill
- ideateSkill
- impact-assessmentSkill
- improveSkill
- merge-mainSkill
- model-expertSkill
- model-testSkill
- native-bug-hunt-fixSkill
- native-bug-huntSkill
- page-speedSkill
- plan-questionsSkill
- planSkill
- plan-system-testsSkill
- policy-testSkill
- prdSkill
- prd-worktreeSkill
- product-questionSkill
- product-question-tldrSkill
- qa-branchSkill
- qa-testerSkill
- resolve-issueSkill
- review-acceptance-criteriaSkill
- review-fixesSkill
- review-railsSkill
- rspec-test-expertSkill
- scale-reviewSkill
- service-testSkill
- stedi-billing-expertSkill
- sync-user-docsSkill
- system-test-expertSkill
- system-testSkill
- test-changedSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. 0 are common, 9 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 35 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Create a new git worktree named "$1" and open it in a new VSCode window.
- Distinctive: line 19
Verify we're in a git repository
- Distinctive: line 20
Check that the worktree name "$1" is provided and valid
- Distinctive: line 25
Create the worktree using the following approach:
- Very specific: line 26
Location: Create worktree in a sibling directory: ../<repo-name>-$1 (e.g.
- Very specific: line 28
Branch: Create a new branch named $1 for the worktree
- Distinctive: line 29
Base Branch: Use the current main branch (main) as the base
- Distinctive: line 34
Ensure "$1" is not empty
- Distinctive: line 35
If empty, prompt user to provide a worktree name
- Distinctive: line 54
Verify the new directory exists
- Very specific: line 92
Verify: bin/rails runner 'puts ActiveRecord::Base.connection_db_config.database' run in the worktree should print the suffixed name, NOT …
- Very specific: line 96
Use the open command to launch VSCode with the new worktree
- Very specific: line 107
SSL certs not found: If <main-repo>/config/certs doesn't exist, warn the user they'll need to generate certificates with mkcert (or skip …
- Very specific: line 108
.env not found: If <main-repo>/.env doesn't exist, warn the user they'll need to create it with the required environment variables
- Distinctive: line 143
Shared git history: All worktrees share the same git repository and history
“Common” is measured: kept by at least 6 in 10 of the 35 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
Git Worktree Creation and VSCode Integration
Create a new git worktree named "$1" and open it in a new VSCode window.
Throughout this skill, <main-repo> means the absolute path of the main repository checkout
(the directory this skill is run from), and <app> means your application's database name
prefix (whatever config/database.yml uses, e.g. myapp for myapp_development /
myapp_test).
Prerequisites Validation
First, validate the environment:
- Verify we're in a git repository
- Check that the worktree name "$1" is provided and valid
- Confirm the worktree doesn't already exist
Worktree Creation Strategy
Create the worktree using the following approach:
- Location: Create worktree in a sibling directory:
../<repo-name>-$1(e.g. if the repo directory ismyapp, use../myapp-$1) - Branch: Create a new branch named
$1for the worktree - Base Branch: Use the current main branch (
main) as the base
Execution Steps
- Validate the worktree name:
- Ensure "$1" is not empty
- If empty, prompt user to provide a worktree name
- Validate it follows git branch naming conventions (no spaces, special characters)
- Check current repository status:
- Verify we're in a git repository
- Get the current working directory
- Confirm the main branch exists
- Create the git worktree:
This creates:git worktree add ../<repo-name>-$1 -b $1 main- A new directory at
../<repo-name>-$1 - A new branch named
$1based onmain - Checks out the new branch in the worktree
- A new directory at
- Verify worktree creation:
- List all worktrees to confirm creation
- Verify the new directory exists
- Copy SSL certificates (if your dev server uses local HTTPS):
- The development server may require SSL certificates that are in
.gitignore - Copy from the main repository to the new worktree:
cp -r <main-repo>/config/certs ../<repo-name>-$1/config/- This enables
bin/devto start with HTTPS support
- The development server may require SSL certificates that are in
- Copy environment file:
- The
.envfile contains required environment variables (API keys, etc.) and is in.gitignore - Copy from the main repository to the new worktree:
cp <main-repo>/.env ../<repo-name>-$1/.env- This ensures all environment variables are available in the new worktree
- The
- Create isolated databases:
- The worktree must NOT share
<app>_development/<app>_testwith the main repo — migrations run in the worktree would otherwise mutate the shared dev database. Haveconfig/database.ymlappendENV["DATABASE_SUFFIX"]to both database names (an unset var must be a no-op); setting it in the worktree's.envmeans every command run there (bin/rails,rspec,bin/dev) picks it up automatically via dotenv/foreman. The main repo (where the var is unset) is unaffected. - Sanitize "$1" into a Postgres-safe suffix (hyphens → underscores, lowercase alphanumerics
and underscores only, max 30 chars), append it to the worktree's
.env, and create the databases (run from inside the worktree directory):
DB_SUFFIX="_$(echo "$1" | tr '-' '_' | tr -cd 'a-z0-9_' | cut -c1-30)" # printf's leading newline matters: .env may not end in one, and a glued-on line is ignored printf '\nDATABASE_SUFFIX=%s\n' "$DB_SUFFIX" >> ../<repo-name>-$1/.env cd ../<repo-name>-$1 grep -E '^DATABASE_SUFFIX=' .env || { echo "DATABASE_SUFFIX not on its own line — fix .env" >&2; exit 1; } bin/rails db:create db:schema:load # <app>_development${DB_SUFFIX} + <app>_test${DB_SUFFIX} bin/rails db:seed # use a small seed profile here if your app has one- Verify:
bin/rails runner 'puts ActiveRecord::Base.connection_db_config.database'run in the worktree should print the suffixed name, NOT<app>_development
- The worktree must NOT share
- Open in VSCode:
- Use the
opencommand to launch VSCode with the new worktree - Command:
open -a "Visual Studio Code" ../<repo-name>-$1 - This opens a new VSCode window with the worktree directory
- Use the
Error Handling
Handle common issues:
- Missing worktree name: Prompt user to provide a name
- Invalid branch name: Suggest a valid alternative
- Worktree already exists: List existing worktrees and suggest alternatives
- Git errors: Display clear error messages and suggested fixes
- SSL certs not found: If
<main-repo>/config/certsdoesn't exist, warn the user they'll need to generate certificates with mkcert (or skip this step if the project doesn't use local HTTPS) - .env not found: If
<main-repo>/.envdoesn't exist, warn the user they'll need to create it with the required environment variables - Database setup fails (
db:schema:load/db:seederrors): Trybundle installin the worktree and retry once. If it still fails, warn the user — do NOT remove theDATABASE_SUFFIXline from.envas a workaround; working against the shared<app>_developmentdatabase is not acceptable - VSCode not found: Provide instructions for opening the directory manually
Success Confirmation
After successful creation:
- Confirm the worktree was created at
../<repo-name>-$1 - Confirm the branch
$1was created - Confirm SSL certificates were copied
- Confirm
.envfile was copied (including theDATABASE_SUFFIXline) - Confirm the isolated databases were created (report their names)
- Confirm VSCode opened with the new worktree
- Provide instructions for:
- Switching between worktrees
- Removing the worktree when done — drop the isolated databases FIRST (while the
worktree's
.envstill exists), then remove the worktree:
(If the worktree was already removed, drop leftovers withcd ../<repo-name>-$1 && bin/rails db:drop # drops <app>_development${DB_SUFFIX} and <app>_test${DB_SUFFIX} cd <main-repo> && git worktree remove ../<repo-name>-$1dropdb <name>— find them withpsql -lqt | grep <app>_) - Listing all worktrees:
git worktree list
Important Notes
- PRD-only work: to run
/prdthen/build-feature, use/prd-worktreeinstead — it skips every step below except creating the worktree and opening VSCode, and/build-featureremoves it once a PR opens - Worktree isolation: Each worktree is independent with its own working directory
- Database isolation: Each worktree gets its own
<app>_development_*/<app>_test_*databases viaDATABASE_SUFFIXin its.env. The main repo is unaffected (the var is unset there, andconfig/database.ymltreats that as a no-op). Remember tobin/rails db:dropfrom the worktree before removing it - Shared git history: All worktrees share the same git repository and history
- Branch management: Each worktree should have its own branch to avoid conflicts
- Cleanup: Remember to remove worktrees when done to keep your workspace clean
- Claude Code compatibility: Claude Code works seamlessly in worktrees
- Dev server port: Sibling worktrees serve on the default port like the main checkout, which
collides with it. To run one alongside it, assign a port with
bin/worktree-port --assign .env(writesPORT=<n>in the 3010–3099 range;bin/devhonors it, andbin/dev-urlreports the resulting base URL for the QA/bug-hunt skills)./worktree-sweepremoves these../<app>-*worktrees too (along with every other worktree)
Example Usage
/worktree feature-payments
/worktree bugfix-auth
/worktree experiment-uiExecute the worktree creation workflow now, ensuring all steps are completed successfully.
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.

