ワンクリックで
use-worktree
Use this whenever you need to create an isolated workspace — includes data/ symlink to prevent data loss on worktree cleanup
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use this whenever you need to create an isolated workspace — includes data/ symlink to prevent data loss on worktree cleanup
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Check papers/ structure for completeness and accuracy — every PDF has text extraction, every paper is indexed in PAPER_INDEX.md and summarized in PAPER_SUMMARIES.md, summaries are factually accurate. Prompts the user for discrepancies.
Use when you want to clean up accumulated git worktrees in a repo. Lists all worktrees with status, verifies data symlinks, ensures code and docs are committed, copies non-symlinked data files to main worktree, asks which to merge or keep, runs post-merge audits on new docs/papers, and removes merged worktrees.
Use after creating or modifying decision documents in docs/ to keep DOCS_INDEX.md and DOCS_SUMMARY.md consistent. Also use as a standalone audit to find coverage gaps, broken links, and ADR format issues. Works across any repo with a docs/ directory. Run alongside updating-noridocs when finishing a branch that includes decision docs.
IMMEDIATELY USE THIS SKILL when creating or develop anything and before writing code or implementation plans - refines rough ideas into fully-formed designs through structured Socratic questioning, alternative exploration, and incremental validation
End a research session — runs update-docs to checkpoint all progress, then commits and pushes. Use update-docs for mid-session checkpoints without ending the session.
Use 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 implementation
| name | Use-Worktree |
| description | Use this whenever you need to create an isolated workspace — includes data/ symlink to prevent data loss on worktree cleanup |
ls -d .worktrees 2>/dev/null.worktrees.# Check if directory pattern in .gitignore
grep -q "^\.worktrees/$" .gitignore || grep -q "^worktrees/$" .gitignore
cd $pathAfter creating the worktree and cd-ing into it, symlink data/ and .env.local to the main worktree so that gitignored data is shared (not duplicated and lost on cleanup):
# Get the main worktree path (the repo root, NOT another worktree)
MAIN_WORKTREE=$(git worktree list | head -1 | awk '{print $1}')
# Symlink data/ if it exists in main
if [ -d "$MAIN_WORKTREE/data" ] && [ ! -e data ]; then
ln -s "$MAIN_WORKTREE/data" data
fi
# Symlink .env.local if it exists in main
if [ -f "$MAIN_WORKTREE/.env.local" ] && [ ! -e .env.local ]; then
ln -s "$MAIN_WORKTREE/.env.local" .env.local
fi
Why: data/ is gitignored and contains checkpoints, raw responses, and intermediate results needed for reproducibility. Without symlinks, this data lives only in the worktree and gets permanently deleted on worktree cleanup. This has caused real data loss.
If this branch doesn't already have a docs/active/<branch-name>/ directory:
BRANCH_NAME=$(git branch --show-current)
mkdir -p "docs/active/$BRANCH_NAME/convos" "docs/active/$BRANCH_NAME/plans" "docs/active/$BRANCH_NAME/results"
Create an initial docs/active/$BRANCH_NAME/RESEARCH_LOG.md:
# Research Log: [branch-name]
Created: YYYY-MM-DD
Purpose: [one-sentence description from the user's request]
If this is an engineering branch (not research), skip this step.
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
# Examples - use project-appropriate command
npm test
cargo test
pytest
go test ./...
If tests fail: Report failures, ask whether to proceed or investigate.
If tests pass: Report ready.
New working directory: <full-path>
Data symlink: data/ → <main-worktree>/data/
Tests passing (<N> tests, 0 failures)
All commands and tools will now refer to: <full-path>
CRITICAL: Once you create and enter a worktree, you must stay within it for the entire session.
Rules:
pwd # Should show .worktrees/branch-name in path
git branch # Should show * on your feature branch, not main
Red Flags:
| Situation | Action |
|---|---|
.worktrees/ exists | Use it (verify .gitignore) |
.worktrees does not exist | Check CLAUDE.md → Ask user |
| Directory not in .gitignore | Add it immediately |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
No data/ in main worktree | Skip data symlink |
Skipping data/ symlink
Skipping .gitignore verification
Assuming directory location
Missing project installation
Proceeding with failing tests