Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

parallel-implementation并行执行

Agent Skill

parallel-implementation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

376

周安装

16

GitHub Stars

公开资料未说明

下载量

132
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:parallel-implementation(并行执行)
来源仓库:https://github.com/ben2pc/g-claude-code-plugins
仓库路径:skills/parallel-implementation
安装命令:
npx skills add https://github.com/ben2pc/g-claude-code-plugins --skill parallel-implementation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ben2pc/g-claude-code-plugins --skill parallel-implementation

简介

parallel-implementation 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。

  • 适用于需要并行执行多个实现方案或对比不同技术路径的研究与工程场景。
  • 通过 GitHub 仓库安装,使用 npx skills add 命令添加指定技能。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Parallel Implementation

Planner skill — returns a slice plan, does not invoke subagents itself. The main Agent keeps execution authority.

When to Use

Invoke only when one of these triggers fires:

  1. Greenfield 0→1 across multiple independent modules → plan a layered parallel split (e.g., data / service / UI layers each as their own slice). Greenfield independence makes this the cleanest parallel case.
  2. Change touches ≥3 modules → the main Agent should confirm with the user via AskUserQuestion whether to parallelize; some cross-module edits are better serialized.
  3. Change touches ≥5 files AND each file's diff exceeds 50 lines → the total work justifies dispatch overhead; recommend parallel.
  4. User explicitly asks for "parallel write", "多 agent 并行实现", or "split this across subagents" → honor regardless of size.

Don't use for:

  • Single-file, 2-file, or 3–4 file changes where any slice's diff is <50 lines → main Agent writes it inline
  • Refactors where all callers cascade from a single change (e.g., renaming a widely-used helper) → serialize through main Agent
  • Work with serial dependencies (B needs A's output) → that's a pipeline, not parallel
  • Pure read tasks (review, search, analysis) → parallel subagents without slicing are fine; no planning needed

Multi-agent overhead (worktree setup, context briefing, result merging, conflict resolution) is real. When in doubt, inline wins.

The Iron Law

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.

Steps

Step 1: Slice-ability check

Ask: can this task be cut into pieces whose inputs and outputs don't overlap?

  • ✅ "Implement 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 logic
  • ✅ "Greenfield: build data layer in store.ts, service layer in service.ts, UI layer in ui.tsx, each with its own tests" — layered 0→1, no shared mid-execution state
  • ❌ "Refactor utils.ts to extract a logging helper and update all callers" — all callers edit sites cascade from the extraction; serialize
  • ❌ "Add retry to the exec wrapper AND migrate exec callers to use it" — B depends on A; pipeline, not parallel

If the answer is no, return "serialize" and terminate. Don't force a bad split.

Step 2: Draft file assignments

For each slice, list:

  • Which files it will create / modify / delete
  • What it needs from other slices as input (file paths, function signatures, data shapes)
  • What it produces as output (unified diff, new file set, state change)

Be explicit — vague assignments ("slice 2 touches the config layer") breed collisions.

Step 3: Collision check → merge

Scan the file-assignment table. For every file that appears in more than one slice:

  • If the edits are append-only and non-overlapping (e.g., both add different rows to different sections of the same Markdown table) → still merge to one writer; worktree merges of concurrent edits to the same file produce conflicts whenever the hunks touch adjacent lines
  • Otherwise → merge those slices to one subagent. Guaranteed.

Example:

  • ✅ Slice A writes cli.ts, Slice B writes utils.ts — different files, safe
  • ❌ Slice A and Slice B both edit utils.ts — merge into one slice
  • ❌ Slice A edits skills-lock.json via npx skills add, Slice B also edits skills-lock.json directly — merge; the generator and the hand-edit will clobber each other

Step 4: Size filter

For each remaining slice, estimate diff size. Rule of thumb:

  • < 50 lines of actual change per slice → drop from the plan; main Agent writes inline. Dispatch overhead (context setup, worktree spin-up, result merge) outweighs parallelism gain.
  • ~50–150 lines → dispatch candidate
  • > 150 lines or architectural → dispatch, and note "override to a stronger reasoning model at xhigh effort (the maximum the runtime supports)" on the slice if the main Agent's current model is not already that

Drop 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.

Step 5: Output contract per slice

For every dispatched slice, decide the exact format the subagent must return. No defaults.

Common contracts:

  • Code change: "Return the unified diff of your changes plus a one-line rationale per file."
  • New file: "Return the full file contents plus a one-paragraph explanation of its role."
  • Config edit: "Return the updated section verbatim; do not quote the entire file."
  • Test slice: "Return the test file plus a bullet list mapping test → requirement being verified."

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:

  • targeted unit tests for the changed behavior (e.g., npm test -- path/to/slice)
  • type checks or lint when applicable (e.g., tsc --noEmit, ruff check)
  • build for affected packages
  • a minimal smoke test if full validation is too expensive

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.

Step 6: Return the plan

Emit a single table the main Agent can execute against:

SliceWriterModelFilesDepends onOutput formatVerify
1subagentinheritsrc/plugins.tsunified diff + one-line rationalenpm test -- plugins, tsc --noEmit
2subagentinherittests/plugins.test.tsslice 1 signature onlytest file + requirement mapnpm test -- plugins.test (red → green after slice 1)
3main Agentsrc/cli.tsslice 1 complete(inline, no dispatch)npm test, manual CLI smoke

Annotate:

  • Which slices are parallelizable now (no blocking deps)
  • Which are gated (wait for a prior slice)
  • Which are inline (main Agent, no subagent)

Model column contract:

  • Default value is inherit — subagent uses whatever model the main Agent is currently running (could be any Claude model, Codex / GPT-5.4, or a future main Agent runtime). Don't hardcode Anthropic-specific or OpenAI-specific model names as the default.
  • Set an explicit override only when the caller has a reason:

- User or main Agent asked for a specific model (e.g., "use opus high for the resolver slice") - Slice is architectural / high-stakes and benefits from a stronger reasoning model at higher effort than the main Agent's current setting - Slice is mechanical boilerplate that can safely drop to a faster/cheaper model

  • Write the override as a neutral phrase the main Agent can translate (e.g., stronger reasoning model, xhigh effort, fast mechanical model), not a specific model name, unless the user named one.
  • Effort levels (when named) escalate: lowmediumhighxhigh. Complex / architectural slices default to xhigh (the max the runtime supports). high is appropriate for medium-complexity work; lower levels only for mechanical tasks.

Handoff to Main Agent

The main Agent executes the plan:

  1. Parallel slices → single message with multiple Agent tool calls, each with isolation: "worktree" (since they're writing code)
  2. Gated slices → run after their deps complete; main Agent serves as the relay (A's output → main Agent → B's context)
  3. Inline slices → main Agent writes them directly

The skill does none of this — it only produced the plan.

Anti-patterns

  • ❌ Returning a plan with overlapping file assignments — Step 3 must merge them
  • ❌ Omitting the output format column — a slice without a format contract will dump context and waste the dispatch
  • ❌ Forcing parallelism where the task is naturally serial — Step 1 should have terminated the skill
  • ❌ Slicing too small just to have more parallelism — Step 4's size filter is not optional
  • ❌ Attempting to coordinate subagents mid-flight via shared state — no current CLI runtime (Claude Code, Codex CLI, etc.) has an agent-to-agent channel; serialize through the main Agent or merge into a single-line task
  • ❌ Dispatching slices without anti-hardcoding language — when the slice ships a fix that has tests attached, the subagent in isolation will sometimes hardcode values, special-case test inputs, or weaken assertions to turn the slice green. The main Agent's dispatch prompt should carry a <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"

Example invocation

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

Relationship to other skills

  • 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)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.51%
按下载量换算50

Claude

27.37%
按下载量换算36

Cursor

19.07%
按下载量换算25

Gemini CLI

9.59%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills