Skip to content

ericrisco/rsc-harness / skills/worktrees

worktrees

Verified

Use when work is about to become commits and needs isolation first — check the tree state, then branch or cut a git worktree off a clean base (native EnterWorktree first, git fallback) so implement never runs on main. NOT what may run concurrently inside those workspaces (that is `parallel`), NOT the merge/cleanup after (that is `ship`).

FileKindSize
SKILL.mdskill md15.7 KB
evals/README.mdmarkdown5.0 KB
evals/cases.yamlconfig5.7 KB
references/orca.mdmarkdown3.5 KB

evals/cases.yaml

View on GitHub
skill: worktrees

should_trigger:
  - prompt: "Before we start building this feature I want it isolated from my main checkout — set up a worktree so my open files don't get disturbed."
    why: "Explicit request for filesystem isolation via a worktree before code is touched — the exact job this skill owns."
  - prompt: "I'm on main and about to implement the plan. I don't want to dirty my working tree — get me onto something I can throw away."
    why: "On the default branch, implement is next, wants disposable isolation first — the on-demand gate that runs right before implement."
  - prompt: "Spin up an isolated checkout on a branch for the checkout-reservation work, branched off an up-to-date main."
    why: "Isolated checkout + feature branch + fresh base ref is precisely the worktree creation flow, including the base-ref decision."
  - prompt: "My dev server is running against the current files and I need to start a second stream of work without yanking the files out from under it."
    why: "Live process on current files is the textbook reason to prefer a worktree over a branch switch — non-obvious phrasing, no keyword 'worktree'."
  - prompt: "I've got uncommitted WIP I want to keep, but I also need to start the new feature cleanly somewhere else. How do I do both?"
    why: "Dirty tree + need both the WIP and clean new work is the canonical worktree case (avoid the stash, isolate the new work)."
  - prompt: "Keep the working tree clean while I execute this plan — create the branch/worktree and then we code."
    why: "Wants isolation established before executing the plan, then hand to implement — the open-isolation-then-handoff contract."
  - prompt: "Make me a parallel checkout for feat/notifications so I can build it alongside what I already have open."
    why: "Parallel checkout for a named feature branch alongside existing open work — a worktree by definition, even without the framing of SDD phases."

should_not_trigger:
  - prompt: "The isolated branch is ready. Now walk the task list test-first and write the code, one commit per task."
    route_to: "implement"
    why: "Isolation already exists; this is the test-first coding loop, which is implement, not the workspace-setup step."
  - prompt: "We have the approved plan. Break it into an ordered checklist where each item has a done-check I can verify."
    route_to: "tasks"
    why: "Slicing the plan into an ordered, verifiable task list is the tasks phase; no isolation request here."
  - prompt: "The feature's built and all tests pass. Merge the branch, open the PR, and clean up the worktree afterward."
    route_to: "ship"
    why: "Closing the branch — merge/PR/cleanup with Eric-only authorship — is the ship phase; this skill only OPENS isolation."
  - prompt: "A test is failing for a reason I don't understand on this branch. Help me find the root cause before I change anything."
    route_to: "debug"
    why: "Root-cause diagnosis of a failing test is the debug protocol, not workspace isolation."
  - prompt: "I want the canonical 01-TOOLS and 02-DOCS layout set up for this workspace and the root CLAUDE.md generated."
    route_to: "harness"
    why: "Bootstrapping the workspace control plane is the harness skill; nothing to do with git isolation for a feature."

capability:
  - scenario: "The project uses Orca, creates worktrees on origin/develop, and runs setup and teardown hooks. Another session is active in this checkout. Create independent work and explain cleanup."
    must_include:
      - "Checks Orca's returned checkout path and actual session identities; workspace lineage alone never suppresses a concurrency warning"
      - "Uses orca worktree create with --no-parent and the declared origin/develop base, then waits for setup"
      - "Runs sync with the exact catalogVersion in .rsc.json, never @latest, and stops setup on failure"
      - "Declares worktreeManager: orca so rsc retains externally managed checkouts even without the CLI"
      - "Uses Orca removal with --run-hooks after verifying the worktree is safe; never plain git worktree remove"
  - scenario: "User says: 'I'm on main with a clean tree, the plan for the order-reservation feature (slug: order-reservation) is approved, and I'm about to implement it. My editor and a dev server are open against the current files. Set up isolation.' The agent has the worktrees skill loaded and a native worktree tool available."
    must_include:
      - "Runs the pre-flight gate: confirms it's a git repo, checks current branch (main), and checks `git status --short` for tree state before creating anything"
      - "Reads technical_level from 02-DOCS/wiki/harness/user-profile.md and narrates briefly in that register (branch/dir in one line plus one line of why)"
      - "Chooses a WORKTREE over a plain branch and justifies it by the live dev server / open editor on the current files (a branch switch would yank files from the running process)"
      - "Prefers the native worktree tool (EnterWorktree-style) for creation and session-switch, naming it for the slug (feat/order-reservation); states the git `git worktree add -b feat/order-reservation … origin/<default>` fallback if no native tool exists"
      - "Branches from an up-to-date default base (fresh origin/<default>) rather than stale local HEAD, or asks which the user wants"
      - "Names the workspace to match the spec/plan slug (feat/order-reservation) so branch, spec, and plan are traceable"
      - "Confirms the contract out loud: cwd is now the isolated branch and the main checkout is untouched"
      - "Writes NO runtime code and NO 02-DOCS artifact in this step (isolation is plumbing, not knowledge)"
      - "Hands off to the implement phase rather than starting to write the feature code itself"
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall