agentleFS
fotowizzardfotowizzard/taskctl-oss/skills/worktree-isolate/SKILL.md

worktree-isolate

Skill1 starsChanged 5 months agoMITView on GitHub

One task equals one worktree cut from a freshly fetched origin base; halt if origin freshness can't be proven. Activates before starting work on a task, when creating a branch or worktree, and when wiring dependencies into a fresh worktree.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Verify the freshly-fetched base resolves: git rev-parse --verify origin/<integration-branch>.

    line 25
  2. Very specific:

    Create the branch from the verified origin/<integration-branch>, then git worktree add <dir> <branch>.

    line 26
  3. Very specific:

    If rev-parse --verify origin/dev fails, the procedure stops here and asks for confirmation — it does not fall through to the local dev.

    line 48

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

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

Worktree-isolate

One task, one worktree, cut from a freshly fetched origin/<base>. A stale local base produces a wrong diff — so prove freshness or halt. Wire dependencies by junction, not reinstall.

Contract

Each task gets its own git worktree, cut from a freshly fetched origin/<base> (the configured integration branch). A stale local base yields a wrong PR diff, so freshness is a precondition: if it cannot be proven, halt rather than silently branch from a local ref. Dependencies are linked from the main checkout via junction/symlink, never reinstalled per worktree.

When to trigger

  • You are about to start work on a task and need an isolated branch.
  • You are about to create a worktree or a feature branch off the integration branch.
  • The new worktree needs dependencies (node_modules or equivalent) to build/test.
  • You are offline or cannot reach the remote — decide deliberately, do not auto-fall-back.

Protocol

  1. git fetch origin <integration-branch> first — never branch off the local ref untested.
  2. Verify the freshly-fetched base resolves: git rev-parse --verify origin/<integration-branch>. If it does NOT resolve (offline / no remote-tracking ref), halt and confirm freshness before proceeding — do not silently use the local base.
  3. Create the branch from the verified origin/<integration-branch>, then git worktree add <dir> <branch>.
  4. Link dependencies from the main checkout into the worktree by junction/symlink (no npm ci / reinstall).
  5. Stage from inside the worktree only — never git add -A at the repository root (it can leak a gitlink for the worktree itself).

Anti-patterns

  • Branching off a stale local base instead of a freshly fetched origin/<base>.
  • Accepting a silent fallback to the local base when the remote ref can't be verified — confirm freshness instead. (The shipped CLI falls back silently; this skill is deliberately stricter and treats that fallback as a risk to confirm, not a default.)
  • git add -A at the repo root (gitlink leak).
  • Reinstalling dependencies per worktree instead of junctioning them.

Worked micro-example

git fetch origin dev
git rev-parse --verify origin/dev      # resolves → safe to branch
git branch feat/<task-id> origin/dev
git worktree add ../.worktrees/<task-id> feat/<task-id>
# link deps instead of reinstalling:
#   junction/symlink <main>/node_modules → <worktree>/node_modules

If rev-parse --verify origin/dev fails, the procedure stops here and asks for confirmation — it does not fall through to the local dev.

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.