agentleFS
cirnecirne/agent-skills/skills/worktree/SKILL.md

worktree

Skill2 starsChanged 5 months agoMITView on GitHub

Create and run parallel git worktrees with shared mutable state via symlink when needed, and one editor window per checkout. Use when the user invokes /worktree, asks to add a worktree, or run parallel features.

  • Reads credentials
  • Deletes or force-pushes

40 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use diagram, e2e and 7 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.
  • johnlindquistSkill

    diagram

    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

  • SentrySkill

    e2e

    Run E2E tests for Sentry JavaScript SDK test applications

    Also in 3 projects that use this

  • nicolasestremSkill

    cleanup

    Clean up code, remove dead code, and optimize project structure

    Also in 3 projects that use this

  • MongoDBSkill

    jira

    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

  • Microsoft AzureSkill

    validate

    Run the full CI validation workflow locally before submitting a PR. Use this as a final check to ensure all Azure DevOps CI pipeline steps will pass.

    Also in 3 projects that use this

  • genomewalkerSkill

    learn

    Learn from web sources, generate SKILL.md, and store key patterns in soul memory. Trigger keywords: learn, skill-gen, web-learn, documentation, tutorial.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 35 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    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
  1. Distinctive:

    Run multiple branches in parallel in separate directories.

    line 8
  2. Very specific:

    Shared state: prefer symlinks to the primary for .env and heavy local data — never copy unless the user asks for isolation.

    line 30
  3. Distinctive:

    Isolated data: only when the user wants destructive/schema experiments — skip the data symlink.

    line 32
  4. Distinctive:

    Run runtime/git commands from git rev-parse --show-toplevel

    line 38
  5. Very specific:

    Do not rm -rf without git worktree remove

    line 45

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Worktree

Run multiple branches in parallel in separate directories.

Discover repo conventions

  1. Primary clone path and naming (../<repo>-wt-<name> is a common pattern)
  2. Bootstrap script if present (e.g. scripts/worktree-bootstrap.mjs)
  3. What should be shared via symlink vs copied (.env, local data dirs, large caches)
  4. Dev server port strategy for parallel trees
  5. How /commit lands work (local main vs PR)

Quick: add a worktree

From the primary clone (adapt names/scripts to the repo):

git fetch origin
git worktree add ../<repo>-wt-NAME -b feat/NAME origin/<default-branch>
# run project bootstrap if it exists (symlinks shared state, install deps)
cd ../<repo>-wt-NAME
# start the project’s usual dev command

Shared state: prefer symlinks to the primary for .env and heavy local data — never copy unless the user asks for isolation.

Isolated data: only when the user wants destructive/schema experiments — skip the data symlink.

Editor + agents

  • One window per worktree
  • One agent thread per feature branch until merge
  • Run runtime/git commands from git rev-parse --show-toplevel

Finish

  1. /commit on the feature branch (project rules)
  2. Land per project convention (local merge to default branch, or open a PR)
  3. git worktree remove <path> then delete the local feature branch
  4. Do not rm -rf without git worktree remove

Housekeeping

git worktree list

Git refuses two worktrees on the same branch — use different branch names.

Troubleshooting

IssueFix
Port in useDifferent port in env for the second checkout
Shared data wipedWipe only from the primary when data is symlinked
Same branch twiceRename branch or remove the other worktree

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.