skills/parallel-implementation/SKILL.md
Plan how to slice a non-trivial coding task across parallel subagents. Returns a dispatch plan (file assignments, dependencies, output-format contracts) — the main Agent then executes it with the Agent tool + `isolation: "worktree"`. Invoke only when work justifies multi-agent overhead: (a) greenfield 0→1 across multiple independent modules, (b) change touches ≥3 modules, or (c) ≥5 files each with >50 lines of diff. Small changes write inline.
npx skillsauth add pangcheng1849/g-claude-code-plugins parallel-implementationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Planner skill — returns a slice plan, does not invoke subagents itself. The main Agent keeps execution authority.
Invoke only when one of these triggers fires:
AskUserQuestion whether to parallelize; some cross-module edits are better serialized.Don't use for:
Multi-agent overhead (worktree setup, context briefing, result merging, conflict resolution) is real. When in doubt, inline wins.
A slice plan is only valid when every slice has independent inputs and independent outputs. If two slices can collide — on the same file, on a shared data structure, or on a shared mid-execution state — they are not parallel. Either merge them into one writer, or serialize them.
Violating this = guaranteed merge conflicts or silent state corruption.
Ask: can this task be cut into pieces whose inputs and outputs don't overlap?
plugins.ts resolver, write its unit tests in tests/plugins.test.ts, add CLI flag to cli.ts" — three files, dependencies resolvable at boundaries, each slice carries substantive logicstore.ts, service layer in service.ts, UI layer in ui.tsx, each with its own tests" — layered 0→1, no shared mid-execution stateutils.ts to extract a logging helper and update all callers" — all callers edit sites cascade from the extraction; serializeIf the answer is no, return "serialize" and terminate. Don't force a bad split.
For each slice, list:
Be explicit — vague assignments ("slice 2 touches the config layer") breed collisions.
Scan the file-assignment table. For every file that appears in more than one slice:
Example:
cli.ts, Slice B writes utils.ts — different files, safeutils.ts — merge into one sliceskills-lock.json via npx skills add, Slice B also edits skills-lock.json directly — merge; the generator and the hand-edit will clobber each otherFor each remaining slice, estimate diff size. Rule of thumb:
xhigh effort (the maximum the runtime supports)" on the slice if the main Agent's current model is not already thatDrop small slices from the plan; note them as "main Agent handles inline".
Minimum-slices gate: if fewer than 3 dispatchable slices remain after filtering, terminate and return "serialize". Below three parallel writers, the dispatch ceremony (worktree spin-up, context briefing, merge) isn't worth the context cost — the main Agent writes them sequentially.
For every dispatched slice, decide the exact format the subagent must return. No defaults.
Common contracts:
Also decide per slice how the main Agent will verify it landed when the diffs come back. Pick from this menu and name the concrete commands in the slice's plan row:
npm test -- path/to/slice)tsc --noEmit, ruff check)Without a verification step named upfront, the main Agent will accept whatever the subagent claims as "done" and merge slices without a real check — that's where silent regressions enter. If a slice cannot be verified mechanically, say so in the plan and fall back to a reading-based check.
An unspecified output format = the subagent dumps verbose context back, cancelling the dispatch benefit.
Emit a single table the main Agent can execute against:
| Slice | Writer | Model | Files | Depends on | Output format | Verify |
|---|---|---|---|---|---|---|
| 1 | subagent | inherit | src/plugins.ts | — | unified diff + one-line rationale | npm test -- plugins, tsc --noEmit |
| 2 | subagent | inherit | tests/plugins.test.ts | slice 1 signature only | test file + requirement map | npm test -- plugins.test (red → green after slice 1) |
| 3 | main Agent | — | src/cli.ts | slice 1 complete | (inline, no dispatch) | npm test, manual CLI smoke |
Annotate:
Model column contract:
inherit — subagent uses whatever model the main Agent is currently running (could be any Claude model, Codex / GPT, or a future main Agent runtime). Don't hardcode Anthropic-specific or OpenAI-specific model names as the default.stronger reasoning model, xhigh effort, fast mechanical model), not a specific model name, unless the user named one.low → medium → high → xhigh. Complex / architectural slices default to xhigh (the max the runtime supports). high is appropriate for medium-complexity work; lower levels only for mechanical tasks.The main Agent executes the plan:
Agent tool calls, each with isolation: "worktree" (since they're writing code)The skill does none of this — it only produced the plan.
<solution_quality>-style guard ("implement the general logic, do not hard-code values or weaken tests; if a test looks wrong, surface it instead of patching around it") on any slice whose contract includes "make tests pass"User: Code review surfaced three independent bugs. Fix all three in this PR:
(A) cli.ts drops ESC cancellation errors in withEsc();
(B) hooks.ts doesn't validate the `_marker` field on settings reads;
(C) plugins.ts silently ignores marketplace fetch failures.
Each has its own test.
Assistant (runs parallel-implementation):
Step 1 (slice-ability): ✅ three bugs, three files, no cross-cutting
signature changes — fully independent
Step 2 (assignments):
A → src/cli.ts + tests/cli.test.ts
B → src/hooks.ts + tests/hooks.test.ts
C → src/plugins.ts + tests/plugins.test.ts
Step 3 (collision check): no file appears twice; no merge needed
Step 4 (size filter): each slice ~50–100 lines of changes — dispatch
Step 5 (output contract): each subagent returns unified diff + a
one-sentence description of the bug it fixes
Step 6 (plan):
| Slice | Writer | Model | Files | Depends on | Output format | Verify |
| A | subagent | inherit | src/cli.ts + tests | — | diff + rationale | npm test -- cli |
| B | subagent | inherit | src/hooks.ts + tests | — | diff + rationale | npm test -- hooks |
| C | subagent | inherit | src/plugins.ts + tests | — | diff + rationale | npm test -- plugins |
Parallelizable now: A, B, C (no gating)
Main Agent:
1. Dispatches A/B/C in parallel, each with isolation: "worktree"
2. Merges returned diffs, runs the full regression suite
test-designer → may produce the failing tests whose green phase triggers this skill (upstream)test-driven-development → governs when to enter green phase (upstream)systematic-debugging → runs if any dispatched slice's result breaks regression (downstream)verification-before-completion → gates "done" after all slices merge (downstream)development
Design failing tests for complex features using Independent Evaluation — dispatches a context-free agent that sees only the requirement spec and code paths (not the implementation approach), then returns executable failing tests. Use when starting TDD for a non-trivial feature, when the requirement is ambiguous enough that biased tests are a risk, or when the user asks for independent test design.
development
在 macOS + Chrome 上排查公网 IPv4/IPv6 出口、国家/地区、ASN/组织、DNS、默认路由、utun 状态,以及浏览器侧 Server Response 与 WebRTC 暴露情况。适用于用户要求检查 IP、地区一致性、VPN/代理接管情况、IPv6 问题或浏览器网络暴露,并输出详细运维报告与复查链接。
tools
通过 Gemini CLI 将编码、审查、诊断、规划和结构化输出任务委派给独立的 Gemini 会话。使用场景包括 `gemini -p` 非交互执行、`gemini -r latest` 续接最近会话、`gemini -r "<session-id>"` 指定会话恢复,以及需要 `--output-format json` / `stream-json`、`--approval-mode plan` 只读审查、`--sandbox` 隔离执行,或 `--worktree` 在独立 git worktree 中跑任务的 scripted / CI 调用。
tools
通过 Codex CLI 将编码、审查、诊断、规划、结构化输出和本机浏览器调研任务委派给独立的 Codex 会话。使用场景包括 `codex exec` 新建任务、`codex exec resume` 续接多轮会话、`codex exec review` 做只读审查,以及需要 `--json` 事件流、`-o` 最终消息落盘、图片输入或 Computer Use 浏览器操作时。