worktreeinclude
Generate a .worktreeinclude file for the current git repository so Claude Code copies gitignored local files (env, secrets, certs) into new worktrees.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a .worktreeinclude file for the current git repository so Claude Code copies gitignored local files (env, secrets, certs) into new worktrees.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Run a body of work as an orchestrator: plan -> partition into file-disjoint waves -> delegate to N parallel code-implementer subagents -> integrate, verify, review -> (PR on request). The main session orchestrates and NEVER writes implementation code itself. Every wave and run is logged for later analysis. Use for non-trivial multi-file features run inside a dedicated worktree.
Ship a completed /orchestrate milestone: open a PR for the worktree branch, poll CI until conclusive (never cancel — self-hosted runners can be slow), auto-merge when every check is green and the PR is MERGEABLE/CLEAN, then clean up the worktree + branches. In project-kit repos the milestone's status.json now->shipped bump rides INSIDE the milestone PR (no direct push to main), so parallel sessions never race a shared-doc write. Run AFTER a successful /orchestrate when the branch's work is committed and verified. It ships what's there — it never writes or fixes code; a red CI or required review ends the skill with a report, not a patch.
Bootstrap a project's agent-facing context system — structured JSON docs (live status + decision records) rendered by a live HTML dashboard, plus the operating rules that keep them current, wired into CLAUDE.md. Use when setting up context docs for a new or existing project, "set up project docs", "scaffold status/ADRs", or first-time project setup. Usage: /project-kit [--minimal | --full] [path]
This skill should be used when the user asks to "wrap up", "wrap session", "finish up", "wrap this work", "close out this work", "I'm done", "finalize this", "let's finish", or "end this work". It orchestrates session finalization: polish loop, commit, push, and mark work done.
Open a markdown file in a browser and leave block-level comments that are saved to a sidecar JSON file alongside it. The skill launches the server in the harness's background (so python is tied to your Claude session, not orphaned) and auto-opens the URL in your default browser. To apply comments after clicking Done, ask Claude to "apply" — if "Auto-apply" was checked in the Submit modal, Claude proceeds without asking for confirmation.
Drafts a technical implementation plan that bridges a PRD to code (approach, file changes, types, tagged task list with per-task tests), runs one optional critic pass via devils-advocate, batches user decisions in one AskUserQuestion. Invoked only via the explicit `/create-plan` slash command.
| name | worktreeinclude |
| description | Generate a .worktreeinclude file for the current git repository so Claude Code copies gitignored local files (env, secrets, certs) into new worktrees. |
| disable-model-invocation | true |
| argument-hint | [path] |
| allowed-tools | ["Read","Write","Bash","Glob","Grep"] |
Create a .worktreeinclude file at the root of the current repository so that Claude
Code automatically copies the local, gitignored files a checkout needs (e.g. .env,
secrets, certificates) into every new git worktree.
.worktreeinclude lives at the repository root and uses .gitignore syntax.claude --worktree, subagent worktrees (isolation: worktree), and
desktop parallel sessions.WorktreeCreate hook disables .worktreeinclude (the hook replaces
default git behavior). Do not combine them — .worktreeinclude is the recommended path
for plain git repos.Locate the repo root. If the user passed a path argument, treat it as the target repo;
otherwise use the current working directory's repo. Run git rev-parse --show-toplevel
to resolve the root. Bail out with a clear message if it is not a git repository.
Enumerate gitignored files that actually exist (these are the only candidates that can ever be copied):
git -C "<repo-root>" ls-files --others --ignored --exclude-standard
Classify the candidates. Include only non-regenerable local config and secrets. Exclude anything that should be reinstalled/rebuilt instead of copied.
| Include (local config/secrets needed to run) | Exclude (regenerable / large) |
|---|---|
.env, .env.local, .env.*.local | node_modules/, vendor/ |
local secrets/config: config/secrets.json, *.local.json | build output: dist/, build/, .next/, target/ |
service-account keys / certs: *.pem, serviceAccount*.json | caches/logs: .cache/, *.log, coverage/ |
auth-bearing .npmrc, .envrc | virtualenvs: .venv/, __pycache__/ |
Principle: copy only what cannot be regenerated by a setup command. Dependencies and
build artifacts should be restored with npm install / equivalent inside the worktree,
not copied (they are large and often contain platform-specific or absolute paths).
Only list files that genuinely exist and are gitignored. Do not invent patterns for files that aren't there. Prefer specific paths over broad globs to avoid copying junk.
Write .worktreeinclude at the repo root using .gitignore syntax. Include short
# comments grouping the entries. Example shape:
# Environment variables
.env
.env.local
.env.*.local
# Local secrets / config
config/secrets.json
serviceAccount.json
# Certificates
certs/*.pem
Report back. Show the final file contents and a one-line rationale per entry (why it was included). Note anything you deliberately excluded (e.g. "skipped node_modules — reinstall in the worktree instead").
Suggest the user verify with:
claude --worktree test-include
Then check that the listed files appear in .claude/worktrees/test-include/. With no changes,
the test worktree is cleaned up automatically. Also recommend adding .claude/worktrees/ to
.gitignore if it isn't already.
.worktreeinclude copies files only; it does not run setup commands. Dependency
installation / env bootstrapping is done per worktree separately (Claude Code does not have
a dedicated auto-run-setup config for this)..worktreeinclude, read it first and update it rather than
overwriting — preserve entries the user added intentionally.