agentleFS
murray17murray17/rovai-ai/skills/worktree/SKILL.md

worktree

Skill255 starsChanged 15 days agoMITView on GitHub

Use when the user requests a Git worktree or a development task needs an isolated directory to create, find, reuse, hand off, or clean up. Exclude read-only work, non-Git repositories, and tasks that need no separate branch or directory.

59 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use worktree-merge, resolve-conflicts and 10 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.
  • leessjuSkill

    worktree-merge

    Squash-merge the current worktree branch into the main branch (or a specified target). Analyzes git history and source code to craft a comprehensive commit message.

    Also in 3 projects that use this

  • ralphkraussSkill

    resolve-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 5 projects that use this

  • SentrySkill

    e2e

    Run E2E tests for Sentry JavaScript SDK test applications

    Also in 5 projects that use this

  • hdcolaSkill

    pr-comments

    Fetch unresolved review comments from a GitHub PR or mark comments as resolved. Use this when managing PR review feedback, checking pending comments, or marking review threads as resolved. Supports GitHub URLs or explicit owner/repo/PR-number from anywhere, or PR number auto-detection from within a git repository.

    Also in 3 projects that use this

  • Google CloudSkill

    contributing

    Guides the developer workflow for contributing to Race Condition. Use when setting up pre-commit hooks, running tests before a PR, understanding code style requirements, or preparing a contribution.

    Also in 3 projects that use this

  • PydanticSkill

    coverage

    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

The file

We split this skill into the rules it gives an agent

12 rules. 0 are common, 10 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 47 edited versions we read keep these.

  • 10

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

    Use one reusable branch and worktree per logical change.

    line 8
  2. Distinctive:

    Do not silently stash, move uncommitted work, overwrite directories, or force-delete branches or worktrees.

    line 10
  3. Distinctive:

    Read relevant repository instructions.

    line 21
  4. Distinctive:

    If uncommitted changes must move, ask the user to choose committing, making a patch, or staying in the current worktree.

    line 23
  5. Distinctive:

    Only when repository or user rules require governance documents to enter the mainline before coding:

    line 27
  6. Distinctive:

    Use its existing clean checkout and synchronize according to repository rules without overwriting other work.

    line 30
  7. Distinctive:

    If permissions or dirty state prevent this safely, report the obstacle before coding.

    line 35
  8. Very specific:

    Prefer user-specified names and repository conventions.

    line 39
  9. Very specific:

    Use the specified directory or repository convention.

    line 43
  10. Distinctive:

    Stop for an existing unregistered target directory or unresolved ambiguous target.

    line 52
  11. Distinctive:

    Check the actual root, branch, base SHA, worktree status, and required governance ancestry.

    line 56
  12. Distinctive:

    Follow repository rules for merged or abandoned worktrees.

    line 62

“Common” is measured: kept by at least 6 in 10 of the 47 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

Git Worktree

Use one reusable branch and worktree per logical change. Follow repository and user rules. Run later commands and edits in the selected worktree. Respond in the user's language.

Do not silently stash, move uncommitted work, overwrite directories, or force-delete branches or worktrees.

Inspect and reuse

git rev-parse --show-toplevel
git status --short --branch
git worktree list --porcelain
git branch --list

Read relevant repository instructions. Determine whether the current worktree fits the task, the target branch is checked out elsewhere, an existing branch/directory can be reused, uncommitted work is required, or governance documents must precede coding.

If uncommitted changes must move, ask the user to choose committing, making a patch, or staying in the current worktree. Do not transport them silently.

Conditional governance baseline

Only when repository or user rules require governance documents to enter the mainline before coding:

  1. Identify the actual mainline; do not assume main.
  2. Use its existing clean checkout and synchronize according to repository rules without overwriting other work.
  3. Change only required governance documents, run documentation gates, and commit them separately on the mainline.
  4. Record the immutable commit SHA as the coding baseline.
  5. Bring an empty coding worktree to that baseline. If it already contains code, integrate by the repository's merge rules without rewriting history.

If permissions or dirty state prevent this safely, report the obstacle before coding.

Select branch, base, and directory

Prefer user-specified names and repository conventions; otherwise use a short task slug with feat/, fix/, docs/, chore/, or work/ as appropriate.

Choose the base in this order: required governance commit, explicit user choice, repository rule, related branch, then current HEAD. Clarify a choice that materially changes the work. Fetch only when requested for freshness or required by repository rules; disclose an offline baseline.

Use the specified directory or repository convention; otherwise a sibling <repo>-<slug>. Use .worktrees/ only under an existing ignored convention; do not edit .gitignore merely to create one.

Reuse in order:

  1. The current worktree if suitable.
  2. The existing worktree attached to the target branch.
  3. An existing unattached branch: git worktree add <path> <branch>.
  4. A new branch: git worktree add -b <branch> <path> <base>.

Stop for an existing unregistered target directory or unresolved ambiguous target; do not delete or overwrite it.

Verify and hand off

Check the actual root, branch, base SHA, worktree status, and required governance ancestry. Run installs, builds, tests, and edits in that root. Do not copy secrets, runtime state, caches, or uncommitted changes from another worktree.

Record absolute path, branch, base, governance commit if applicable, status (active, ready, merged, or abandoned), changes, validation, and next action in the task, issue, handoff, or final report. Follow-up sessions reuse that checkout; a new session alone does not justify a new branch or worktree.

Clean up

Follow repository rules for merged or abandoned worktrees; otherwise clean up only when requested. Verify the worktree is clean, then use git worktree remove, safe branch deletion with git branch -d, and git worktree prune as appropriate. Preserve unmerged, dirty, or uncertain work. Force operations require explicit authorization.

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.