parallel-work
Fan out independent work: one worktree per writer, overlaps serialized, results integrated and re-tested.
- License 许可
- MIT
- 最近更新
- 2026-11-09
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- parallel-work
- description
- Fan out independent work: one worktree per writer, overlaps serialized, results integrated and re-tested.
- disable-model-invocation
- true
02 资源文件 2
- 参考文档references/brief-template.md1.5 KB
- 参考文档references/worktrees.md2.1 KB
03 SKILL.md 正文
parallel-work
Run independent units at once, never two writers in one tree. Reached by its kernel row, execute-plan step 4, diagnose when racing hypotheses, or /kern:parallel-work.
Steps
- Defer: if the kern settings block names an override for this job, follow that skill instead, say so in one line, and stop.
- Classify each unit independent, related or shared-state. Build the overlap list from each unit's files and
shared_services(none set: any unit running migrations or DB-backed tests overlaps). Overlapping units run serially. Small units are no reason to skip a fan-out the user asked for. Separate a shared write target before anything serializes on it. With 3 or more writers doing one kind of change, run one pilot unit first and read its result first. A unit you cannot classify is a stop. - Frame the run: the done predicate; partition or race (a race declares its selection rule up front and integrates only the winner); at most
parallel.maxworkers at once, the rest wait; a model and effort named in every dispatch (model.implementer,model.investigator). Record the main checkout's branch withgit rev-parse --abbrev-ref HEAD. A script exit this skill does not name stops that unit; report its output. - Per writer: create its worktree with
bash ${CLAUDE_PLUGIN_ROOT}/scripts/wt-fork <source-wt> <slug>to carry earlier uncommitted work, elsewt-new <slug> --detach; each prints the path, and any non-zero exit: say why and ask, never share a tree. The base ref isorigin/<base_branch>for wt-new, the source's HEAD for wt-fork. Record its starting tree withbash ${CLAUDE_PLUGIN_ROOT}/scripts/wt-snap <wt>. Write the brief with the Write tool to<tmp>/brief-<worker>.md(<tmp>is whatbash ${CLAUDE_PLUGIN_ROOT}/scripts/kern-dir tmpprints) fromreferences/brief-template.md, its VERIFY starting with the entry checkbash ${CLAUDE_PLUGIN_ROOT}/scripts/wt-check <wt> <base-ref>and then the focused baseline; resolve${CLAUDE_PLUGIN_ROOT}to the absolute root in all a worker receives (its Read substitutes nothing). Runbash ${CLAUDE_PLUGIN_ROOT}/scripts/brief-check <brief>: anything butbrief-check: okmeans do not spawn; fix each printed line and rerun. A reader gets no worktree and no brief: its prompt holds the question, scope, sources and a return budget (kern:investigator, or Explore). - Spawn every worker in one message. A writer is
kern:implementer, given the brief path, WT, base ref, a report path under<tmp>, the absolute path of${CLAUDE_PLUGIN_ROOT}/skills/implement/SKILL.md, rulings and standing orders. Never poll a worker or resume it to check liveness. - Drain each worker to PASS, ISSUES or BLOCKED.
kern:implementer, by itsStatus:line (none: BLOCKED): DONE is PASS, DONE_WITH_CONCERNS is ISSUES, BLOCKED and NEEDS_CONTEXT are BLOCKED.kern:investigator: an answer where every fact carries a citation and a label, with an empty or "none" could-not-trace list, is PASS; an uncited fact or a "could not trace" list is ISSUES; no answer, or a return that names a command it needs run, is BLOCKED. Missing evidence (no test output, no report file) gets one respawn naming it, then a gap. A worker silent past its TIMEBOX: check read-only whether its report file exists and whetherwt-snapprints another tree, record a gap with what you found, and never resume it; a silent reader, which has neither, is re-asked once, then BLOCKED. Accept a late return, after its gap was recorded, only while its unit is still open in the caller's ledger, if any, and no other worker took it; else leave its tree unapplied and note that in its gap. Account for every worker; a gap is not a pass. - Integrate one worker at a time.
bash ${CLAUDE_PLUGIN_ROOT}/scripts/wt-diff <wt> <starting-tree> --out <dir>/<worker>.diff --allow <path>with one--allowper writable SCOPE path (a directory ends in/, a prefix in*);<dir>is the caller's ledgerreviews/folder, elsebash ${CLAUDE_PLUGIN_ROOT}/scripts/kern-dir reviewsprints it. It prints the package path, the tree, then changed paths; the patch is<dir>/<worker>.diff.patch. Exit 3 is no change: a gap. Exit 4 is a write outside SCOPE: ISSUES, apply nothing, stop. Thenbash ${CLAUDE_PLUGIN_ROOT}/scripts/wt-apply <dir>/<worker>.diff.patch <integration-wt>(the caller's, else awt-newone) printsapplied, and only then record wt-diff's second line; exit 3 is a conflict with nothing applied: stop, no tree recorded. After the last patch runtest.fullthere (kern-get, elsekern-detect; both exit 3: ask), name each red test as before or after, and spot-check one claim per worker against its diff. - Report a table with columns
worker | verdict | files | evidence | gaps, serial units with their reason, each recorded tree in evidence. Assert the main branch still matches step 2's. - Teardown follows
${CLAUDE_PLUGIN_ROOT}/skills/parallel-work/references/worktrees.md:wt-auditfiltered to this run's worktrees,--forceonly when all five preconditions there hold, every removal only on the user's yes.
Inputs
| Key | Default | Use |
|---|---|---|
base_branch |
detected | worktree base |
worktree.dir, worktree.setup |
.claude/worktrees under MAIN; none |
location; setup |
shared_services |
none | serialization |
parallel.max |
3 | workers at once |
model.implementer, model.investigator |
sonnet, opus |
worker models |
Outputs
Packages and patches in step 6's <dir> (default WORK/reviews/); briefs and reports in WORK/tmp/.
Stops and autopilot
Stops at steps 1, 3, 6, 7 and 8 (a unit or worktree that will not pass, a conflict, a gap, teardown). An AskUserQuestion answer records no prompt line, so Guard G20 denies it; ask in chat. Autopilot is on per the latest kern signal (an autopilot ON: reminder or a kern mode: line with autopilot=on), else the kernel's "Autopilot:" line; a turn with no mode line changes nothing. When on, each stop waits for a typed reply, with the data and a recommendation: an unclassifiable unit or a brief that will not pass holds that unit while the rest continue, a conflicted or out-of-SCOPE worker stays unapplied, the gap stands. Teardown never runs under autopilot (G1 denies git worktree remove --force); the worktrees are listed instead.
04 同仓库更多 Skills
unslop
Rules for prose others read: artifact shapes, document rules and the catalog of AI-writing tells.
technical-writing
Write docs, PR bodies, issues and commit messages a tired engineer understands on the first read.
self-review
Check your own diff before a PR: deterministic checks, blast radius, probes, a fresh doubt pass, then a verdict.
recall
Use when starting or resuming work and state must be rebuilt first: "where did I leave off", "catch me up on X", "what remains", "I got lost in these PRs", a session after days away, or "recall chat" for this thread since my last message. Not for one named session.
prove-it
Use before saying work is done, fixed, passing or verified; before a commit, push or PR; and when a subagent reports success. Runs the proving command fresh, reads all output, checks each acceptance line, and labels other claims measured, inferred or guess.
plan
Turn an approved spec into ordered tasks with exact files, test-first steps, verify commands and blocking edges.