用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dev-Toolbelt/dev-team-agents --skill worktree命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | worktree |
| description | Git worktree per task — <worktree_path>/<context>/<title>, in .worktrees. |
Invoke this skill at the very start of every task. No code, no file edits, no planning until the worktree decision is resolved.
Resolve the worktree decision top-down; stop at the first that applies:
| # | Source | Action |
|---|---|---|
| 1 | .dev-team-agents/.worktree-session present | Follow the stored per-session decision silently |
| 2 | worktree_active in preferences.json | Use it without asking; write the session file so the rest of the session is consistent |
| 3 | key absent (legacy install) | Ask the user once — see below |
cat .dev-team-agents/.worktree-session 2>/dev/null # source 1
| Session-file content | Action |
|---|---|
worktree=no branch=<b> | Operate on branch <b>; skip worktree setup |
worktree=yes branch=<b> | Load references/branch-flow.md using <b> as base |
If the session file is absent, read worktree_active from preferences.json:
true → set up a worktree without the yes/no prompt; false → skip the yes/no prompt and ask only for a new branch name;
key absent → use the AskUserQuestion tool with options [Yes, No]:
"Should this task use a git worktree (isolated working directory)?"
worktree=yes branch=<base>, follow references/branch-flow.md<context>/<brief-title>), run git checkout -b <branch-name>, write worktree=no branch=<branch-name>For the full cascade, base-branch resolution, format rules, and cleanup: load references/session-protocol.md.
<wt-path> = worktree_path from preferences.json (default .worktrees).
Load references/branch-flow.md for the complete step-by-step flow:
<context>/<brief-title> — lowercase, hyphenated, ≤ 5 wordsworktree_base_branch → project config → auto-detect default branch → askgit worktree add <wt-path>/<ctx>/<title> -b <ctx>/<title> <base><wt-path>/<ctx>/<title>/ — when worktree_docker_isolate and the project uses Docker, load references/docker-isolation.mdgit -C <wt-path>/<ctx>/<title> ... (intermediate commits are normal)git status --porcelain; abort teardown and ask the user if not clean) → teardown worktree + isolated Docker stack only<context>/<brief-title>
Examples: auth/add-oauth-provider, payments/fix-refund-calculation, api/add-rate-limiting
Both parts must be real, spelled-out words describing the task — never an invented acronym or letter code (e.g. bsi, dkey). A human unfamiliar with the task must be able to tell what it's about from the name alone.
For the full naming table, see references/branch-flow.md → Naming quick-reference.
When work is declared done (before finalization/teardown), the agent must output a summary block showing the current state:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
WORKTREE SUMMARY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Worktree: <wt-path>/<context>/<brief-title>
Branch: <context>/<brief-title>
Base: <base-branch>
Docker: <compose-project-name> (<n> containers: <svc1>, <svc2>, ...)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
To gather the info:
# Worktree path and branch
WT=<wt-path>/<context>/<brief-title>
BRANCH=<context>/<brief-title>
BASE=<base-branch>
# Docker containers (if worktree_docker_isolate and compose is up)
docker compose -p "$COMPOSE_PROJECT_NAME" ps --format "table {{.Name}}\t{{.Status}}" 2>/dev/null
worktree_docker_isolate is false or compose is down), show Docker: none.<context>/<brief-title> slug — worktree path <wt-path>/<context>/<brief-title>, branch <context>/<brief-title>, Docker project <base-project>-wt-<context>-<brief-title> (see references/docker-isolation.md → Step 2). Never let one of these drift to a different name than the others — that is what keeps a task's worktree, branch, and containers instantly identifiable as belonging together.git checkout -b in the main tree — always git worktree addmain, master, or beta as base — resolve from worktree_base_branch, project config, or the auto-detected default branchgit worktree remove, run git status --porcelain inside it — non-empty output means uncommitted/untracked content would be destroyed. Abort and ask the user (commit / discard / keep) instead of proceeding