一键导入
git-worktrees
Use when creating, modifying, or managing git worktrees, working on parallel feature branches, or isolating work from the main repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating, modifying, or managing git worktrees, working on parallel feature branches, or isolating work from the main repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Michael's operating + emotional coach. Operational mode — daily startup/shutdown, weekly review, pomodoro, inbox capture, daily notes (auto-loads in ~/ws/notes). Emotional/decision mode (Joe Hudson style) — use on "coach me"/"joe coach", stuck/looping/overthinking, harsh self- or other-judgment, a binary either/or decision that won't resolve, or fear, shame, loneliness, anxiety, burnout, or grief, when Michael wants to be met in a feeling rather than handed advice. Not for clinical crises (refer out).
Use when creating or processing Todoist tasks, triaging inbox items, doing daily task review, calibrating Todoist triage behavior, or turning corrections into reusable preferences. Routes to operations (CLI actions) vs calibrated triage (policy, context recovery, preference memory, evals). Trigger this whenever the user asks what to do with Todoist items, wants better task triage, or is refining how Todoist decisions should work.
Run real Deep Research across ChatGPT, Claude, and Gemini in parallel via the user's own logged-in browser (Chrome extension, zero API cost), save each original report to Notion, then synthesize. Use whenever the user wants a "deep dive", "deep research", a thorough multi-source investigation, or to research a topic across the models and compare what each finds. Drives the paid subscription products, NOT the API. NOT for single-fact lookups or ordinary web search — use web-search for those.
Use when setting up, auditing, or improving AI agent infrastructure in a repo — AGENTS.md/CLAUDE.md files, linters, architectural constraints, feedback loops, context tiering, agent specialization, or entropy management. Also triggers on "harness engineering", "agent-friendly repo", "make my repo work well with coding agents", "set up my repo for agents", or "why is my agent struggling".
Interactive Todoist triage with preference learning. Use when the user says "triage", "process my inbox", "clean up tasks", "triage my todoist", "file these captures", or mentions inbox zero. Also use when the user has a batch of raw items (voice notes, links, ideas) that need classifying and routing to Todoist projects or Obsidian. Runs an interactive confirm/correct loop that learns your routing preferences over time.
Use when the user asks to save session context, identify the current session or thread, create a resumable handoff, or prepare a Todoist/note summary that must include the working directory and session id. Works across Codex and Claude Code by detecting runtime-specific session identifiers and normalizing them into one summary.
| name | git-worktrees |
| description | Use when creating, modifying, or managing git worktrees, working on parallel feature branches, or isolating work from the main repository. |
worktrees/<name>/ inside the repo (harness keeps cwd stable there)worktrees/ listed in .gitignore.env* files recursively copied to the worktreeGOOGLE_APPLICATION_CREDENTIALS env var set in .env.local if the project uses Firebase AdminGit worktrees allow multiple branches checked out simultaneously in different directories. Essential for:
Place worktrees in worktrees/<name>/ inside the repo.
Agent harnesses (Claude Code, etc.) often reset cwd to the project root between commands when you cd to a sibling path outside the repo. That breaks multi-command workflows that assume persistent cwd. Placing worktrees at <repo>/worktrees/<name>/ keeps cwd stable because it's still inside the project root.
The old concern — "inside-repo worktrees freeze a stale CLAUDE.md" — applies to any worktree regardless of location (each worktree checks out its branch's version of CLAUDE.md). It's not a reason to prefer sibling directories.
Layout:
~/ws/my-project/
├── (main checkout)
└── worktrees/
├── feature-auth/
└── feature-api/
Add worktrees/ to .gitignore in the main repo so the directory itself is never committed.
NEVER modify the main repository when creating a worktree (no git checkout, no git pull, no branch switching).
# From the main repository directory - DO NOT checkout or pull in the main repo
mkdir -p worktrees
# Create worktree with new branch (recommended)
git worktree add worktrees/feature-name -b feature/descriptive-name
# OR from an existing branch
git worktree add worktrees/feature-name existing-branch-name
# OR from main explicitly
git worktree add worktrees/feature-name -b feature/descriptive-name main
# Navigate to worktree BEFORE any further git operations
cd worktrees/feature-name
# NOW safe to pull, merge, etc.
git pull origin main
# Copy environment files (not in git). Paths are relative to the main repo root.
MAIN_REPO="../.."
cp "$MAIN_REPO/.env" .env 2>/dev/null || true
find "$MAIN_REPO/apps" "$MAIN_REPO/packages" -maxdepth 2 \( -name ".env.local" -o -name ".env.*.local" \) 2>/dev/null | while read file; do
target="${file#$MAIN_REPO/}"
mkdir -p "$(dirname "$target")"
cp "$file" "$target" 2>/dev/null || true
done
# Install dependencies (project-appropriate)
pnpm install # or: npm install / cargo fetch / uv sync — whatever the repo uses
# List all worktrees
git worktree list
# Remove a worktree when done (run from the main repo)
git worktree remove worktrees/feature-name
# Prune stale worktree references
git worktree prune
git worktree remove worktrees/feature-name
git branch -d feature/descriptive-name
MULTIPLE AGENTS MAY BE WORKING SIMULTANEOUSLY
git checkout - disrupts active workgit pull - may cause conflicts with uncommitted changesgit worktree add worktrees/<name> -b <branch-name># From main repository (DO NOT checkout or pull in the main repo)
git worktree add worktrees/issue-{number} -b feature/issue-{number}-brief-description
cd worktrees/issue-{number}
# NOW safe to fetch and merge
git fetch origin main
git merge origin/main
cp ../../.env.local .env.local 2>/dev/null || true
pnpm i
When creating a worktree, add it to the TODO list:
{
"content": "Working in worktree: worktrees/feature-name (branch: feature/branch-name)",
"status": "in_progress",
"activeForm": "Working in worktree feature-name"
}
When done:
{
"content": "Clean up worktree: worktrees/feature-name",
"status": "completed"
}
Use when:
Don't use when: