agentleFS
devnomad-bytedevnomad-byte/techneering/skills/isolate/SKILL.md

isolate

Skill13 starsChanged 5 months agoMITView on GitHub

Use when starting feature work that needs isolation from current workspace or before executing implementation plans — creates isolated git worktrees with smart directory selection and safety verification

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    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:

    Create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

    line 8
  2. Distinctive:

    Follow this priority order:

    line 21
  3. Very specific:

    If found: Use that directory.

    line 28
  4. Distinctive:

    If preference specified: Use it without asking.

    line 34
  5. Distinctive:

    If NOT ignored: Add to .gitignore and commit.

    line 51
  6. Very specific:

    Run project setup (auto-detect from package.json, Cargo.toml, etc.)

    line 57
  7. Distinctive:

    Verify clean baseline (run tests)

    line 58
  8. Distinctive:

    Never create a worktree without verifying the directory is gitignored

    line 91
  9. Distinctive:

    If baseline tests fail, report and ask — don't proceed silently

    line 92
  10. Distinctive:

    Follow existing directory conventions if they exist

    line 93

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Using Git Worktrees

Create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core Principle

SYSTEMATIC DIRECTORY SELECTION + SAFETY VERIFICATION = RELIABLE ISOLATION.
Never create a worktree without verifying it's gitignored.

Steps

Step 1: Directory Selection

Follow this priority order:

  1. Check existing directories:
    ls -d .worktrees 2>/dev/null     # Preferred (hidden)
    ls -d worktrees 2>/dev/null      # Alternative
    If found: Use that directory. .worktrees wins if both exist.
  2. Check CLAUDE.md:
    grep -i "worktree.*director" CLAUDE.md 2>/dev/null
    If preference specified: Use it without asking.
  3. Ask user (only if no directory exists and no preference):
    No worktree directory found. Where should I create worktrees?
    1. .worktrees/ (project-local, hidden)
    2. ~/.config/tn/worktrees/<project-name>/ (global location)

Step 2: Safety Verification

MUST verify directory is ignored before creating worktree:

git check-ignore -q .worktrees 2>/dev/null

If NOT ignored: Add to .gitignore and commit.

Step 3: Create Worktree

  1. Detect project name: project=$(basename "$(git rev-parse --show-toplevel)")
  2. Create worktree: git worktree add "$path" -b "$BRANCH_NAME"
  3. Run project setup (auto-detect from package.json, Cargo.toml, etc.)
  4. Verify clean baseline (run tests)
  5. Record the baseline state (passing test count / suite output) so later tn:gate or tn:audit can compare against it
  6. Report location

If no test command exists: degrade gracefully — record "no tests; baseline = clean checkout + setup completes" and note it in the report. Do not block isolation on a project that legitimately has no tests.

Red Flags

ThoughtReality
"Directory doesn't need gitignore"Unignored worktrees pollute version control
"Skip baseline tests, just start"Baseline test failure means environment issues — must resolve first
"Develop directly on the current branch"Unisolated development pollutes the main branch
"Worktree is done once created"Must verify the test baseline passes before starting work

Quick Reference

DimensionKey point
Directory priority.worktrees → worktrees → CLAUDE.md → ask user
Safety checkMust verify gitignore
Baseline verificationRun tests after creation to ensure clean
CleanupHandled by tn:ship

Next Step

When done:

  • Normal case → return to caller (usually tn:assemble or tn:forge), continue implementation flow
  • Baseline tests fail → report failure reason, ask user whether to continue
  • User requests stop → end the current flow

Guardrails

  • Never create a worktree without verifying the directory is gitignored
  • If baseline tests fail, report and ask — don't proceed silently
  • Follow existing directory conventions if they exist
  • Announce at start: "I'm using the tn:isolate skill to set up an isolated workspace."
  • Pairs with tn:ship for cleanup after work is complete

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.