‹ 首页

code-subagents

@martinffx · 收录于 1 周前

Subagent dispatch patterns for implementation tasks. Use when spec-implement has multiple tasks to execute and subagents are available. Covers parallel dispatch for independent work, the two-stage review cycle (spec compliance then code quality), focused prompt construction, and integration of results. Trigger when executing plan tasks with subagent support, when facing 2+ independent problems, or when the user asks to use subagents for implementation.

适合你,如果需要在开发中同时处理多个独立任务并协调子代理。

/ 下载安装
code-subagents.skill双击,或拖进 Claude 桌面版 / Cowork,即完成安装↓ .skill↓ .zip
用别的 agent?下载 .zip 解压,把文件夹放进它的技能目录
Claude Code~/.claude/skills/(项目级 .claude/skills/)
Codex CLI~/.codex/skills/
Cursor自动读取上面两处目录
其他工具见其文档的「skills」目录;两个下载是同一份文件,只是名字不同
/ 通过 npx 安装 校验哈希
npx oh-my-skill add martinffx/atelier/code-subagents
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- martinffx/atelier/code-subagents
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify martinffx/atelier/code-subagents
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
34GitHub stars
~1.3K最小装载
~2K含声明引用
~2.4K文本包总量
镜像托管

怎么用

技能原文 SKILL.md作者撰写 · MIT · e5f96ba

Spec Subagents

Fresh subagent per task. Two-stage review after each. Parallel when independent, sequential when dependent.

When to Use Subagents

Use when:

  • Executing tasks from plan.json with subagent support available
  • 2+ independent tasks that don't share state or files
  • Each problem can be understood without context from others

Don't use when:

  • Tasks are tightly coupled (editing the same files)
  • You need to understand full system state across tasks
  • Failures are related (fixing one might fix others)
  • Exploratory work where the problem isn't well-defined yet
Dispatch Modes
Sequential (dependent tasks)

Tasks with dependencies execute one at a time. Each gets a fresh subagent — no context pollution from previous tasks.

Task 1 (Entity) → review → complete
Task 2 (Repository, depends on T1) → review → complete
Task 3 (Service, depends on T2) → review → complete
Parallel (independent tasks)

Independent tasks dispatch simultaneously. One agent per problem domain.

Task A (auth tests) ──→ review → complete
Task B (billing tests) ──→ review → complete    ← concurrent
Task C (notification tests) ──→ review → complete

Independence check: Would fixing Task A affect Task B? Would they edit the same files? If no to both, dispatch in parallel.


Prompt Templates

Use these templates when dispatching subagents. Each template is battle-tested — don't improvise, use them as-is and fill in the variables.

  • [references/implementer-prompt.md](references/implementer-prompt.md) — Dispatch an implementer. Includes self-review checklist.
  • [references/spec-reviewer-prompt.md](references/spec-reviewer-prompt.md) — Spec compliance review. "Do not trust the report."
  • [references/code-quality-reviewer-prompt.md](references/code-quality-reviewer-prompt.md) — Code quality review. Critical/Important/Minor severity.
Prompt quality rules
  • Focused — one task, one problem domain
  • Self-contained — all context needed is in the prompt. Don't make the subagent read the plan file; provide the full task text
  • Specific about files — exact paths, not "the relevant files"
  • Specific about output — what should the subagent return?
  • Constrained — what should they NOT touch?
Common mistakes

| Mistake | Fix | |---------|-----| | "Fix all the tests" | "Fix the 3 failures in user.test.ts" | | No context about codebase | Paste the relevant patterns and conventions | | No constraints | "Do NOT change production code" or scope to specific files | | Vague output expectations | "Return: root cause, changes made, test results" |


Two-Stage Review

Every completed task gets two reviews in order. Do not skip either. Do not reverse the order.

Stage 1: Spec Compliance

Does the implementation match what was specified?

## Spec Review

Review the implementation against the task specification:

**Task spec:** [paste task from plan.json]

**Files changed:** [list from subagent output]

Check:
1. Are all requirements from the task spec implemented?
2. Is anything implemented that wasn't specified? (over-building)
3. Do tests cover the specified acceptance criteria?
4. Does the implementation match the design in design.md?

Report: List any gaps or extras. Mark ✅ if compliant, ❌ if not.

If the spec reviewer finds issues → the implementer subagent fixes them → spec reviewer reviews again. Repeat until ✅.

Stage 2: Code Quality

Is the implementation well-built?

## Code Quality Review

Review the implementation for code quality:

**Files changed:** [list]

Check:
1. Does the code follow existing patterns and conventions?
2. Are tests meaningful (not just asserting true)?
3. Is there unnecessary complexity?
4. Are edge cases handled?
5. Is the code clean (no dead code, no unnecessary comments)?

Rate issues as Critical (blocks merge), Important (should fix), or Minor (nice to have).

If the quality reviewer finds Critical or Important issues → implementer fixes → reviewer reviews again. Minor issues can be noted and moved past.

Why this order matters

Spec compliance first because there's no point polishing code that doesn't meet the spec. Quality second because compliant code still needs to be well-built.


Handling Subagent Questions

Subagents may ask questions before or during implementation. This is good — it means they're thinking rather than guessing.

  • Answer clearly and completely
  • Provide additional context if needed
  • Don't rush them into implementation
  • If the question reveals a gap in the plan, that's valuable — note it

Integrating Results

After subagents complete (especially parallel dispatch):

  1. Read each summary — understand what changed
  2. Check for conflicts — did any agents edit the same code?
  3. Run full test suite — verify all changes work together
  4. Update task tracking — mark tasks complete: beads bd close <id>, or harness todo list

If there are conflicts between parallel results, resolve them manually. Don't dispatch another subagent to merge — that requires too much context.


When Subagents Fail

If a subagent fails a task:

  • Don't fix it manually — that pollutes your context
  • Dispatch a fix subagent with specific instructions about what went wrong
  • If it fails twice, stop and escalate to the human. The plan may need revision.

If failure reveals a design problem:

"This task is failing because [reason]. The design in design.md may need to change. Want me to go back to spec-brainstorm?"
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。