skills/worktree/SKILL.md
Create or switch to a git worktree for isolated feature/fix development
npx skillsauth add api-haus/my-claude-workflow worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When this skill is invoked, you MUST follow these steps IN ORDER. Do NOT skip any step.
Generate a slug from the user's task description:
player-collision, fix-auth-timeout, add-retry-logicExamples:
player-collisionapi-retry-logicauth-flow| Task type | Branch prefix |
|-----------|---------------|
| Features | feat/ |
| Fixes | fix/ |
| Refactors | refactor/ |
| Docs | docs/ |
git rev-parse --show-toplevel
CRITICAL: Always branch from local main, NEVER from HEAD. HEAD may be on a
stale commit (e.g. if you last worked on a different branch or the worktree was
created from an old session). Using main as the explicit start-point guarantees
the worktree has all recent commits.
REPO_ROOT=$(git rev-parse --show-toplevel)
SLUG="<your-generated-slug>"
TYPE="<feat|fix|refactor|docs>"
if [ -d "${REPO_ROOT}/.claude/worktrees/${SLUG}" ]; then
cd "${REPO_ROOT}/.claude/worktrees/${SLUG}"
echo "Switched to existing worktree"
else
mkdir -p "${REPO_ROOT}/.claude/worktrees"
git worktree add "${REPO_ROOT}/.claude/worktrees/${SLUG}" -b "${TYPE}/${SLUG}" main
cd "${REPO_ROOT}/.claude/worktrees/${SLUG}"
echo "Created new worktree from main"
fi
After creating a new worktree, check for package.json and run pnpm install:
if [ -f "package.json" ]; then
pnpm install
fi
Skip this step when switching to an existing worktree.
If entering plan mode, you MUST write this EXACT header at the TOP of the plan file BEFORE any other content. Use absolute paths so the header survives context compression and fresh sessions:
## Worktree Context
- **Slug:** `<slug>`
- **Worktree:** `${REPO_ROOT}/.claude/worktrees/<slug>`
- **Branch:** `<type>/<slug>`
### ⚠️ CRITICAL: Working Directory
**ALL file operations (Read, Edit, Write, Glob, Grep) MUST use absolute paths in the worktree:**
- ✅ `${REPO_ROOT}/.claude/worktrees/<slug>/src/...`
- ❌ `${REPO_ROOT}/src/...` (WRONG - this is main tree)
Do NOT work in the main repository. The worktree is your working directory.
---
This is NOT optional. The plan file MUST start with this header.
| Component | Format | Example |
|-----------|--------|---------|
| Slug | kebab-case, 2-3 words | player-collision |
| Worktree | ${REPO_ROOT}/.claude/worktrees/<slug> | ${REPO_ROOT}/.claude/worktrees/player-collision |
| Branch | <type>/<slug> | feat/player-collision |
The <slug> MUST be identical across all three for /merge cleanup to work.
REPO_ROOT/.claude/worktrees/<slug>~/.cargo/config.toml -- no cache copying neededdata-ai
Extract research content from YouTube presentations, PDFs, or PPTX files into structured markdown. Dispatches each pass to a dedicated sub-agent (research-extractor / research-vision / research-refiner) so per-deck vision passes scale to hundreds of slides without bloating the parent context.
development
Build, run, and analyze Unity profiler data with perf-report-style call-stack attribution
documentation
Write a handoff prompt for a future session. A handoff is a continuation-link — minimal context plus a kickoff line the user can copy-paste. Never a diagnosis, never an investigation script, never a prescribed deliverable.
testing
Multi-agent orchestration mode. The orchestrator never reads, edits, runs, or tests directly — it scopes work, runs a re-implementation audit, presents a freeform method brief with grounded recommendations, then dispatches every step to sub-agents through shared context files at `docs/orchestrate/<topic>/`. Use when invoked via /delegate, when the user asks to orchestrate or coordinate multi-agent work, or when the task explicitly calls for delegation.