بنقرة واحدة
subagent-dev
Use when executing implementation plans with independent tasks in the current session
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Use when executing implementation plans with independent tasks in the current session
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Implement or resume tasks from a Spectra change
Archive a completed change
Have a focused discussion about a topic and reach a conclusion
Implement or resume tasks from a Spectra change
Archive a completed change
Have a focused discussion about a topic and reach a conclusion
| name | subagent-dev |
| description | Use when executing implementation plans with independent tasks in the current session |
Execute plan by dispatching a fresh implementer subagent per task, a task review (spec compliance + code quality, one reviewer, two verdicts) after each, and a broad whole-branch review at the end.
Why subagents: You delegate tasks to specialized agents with isolated context. By precisely crafting their instructions and context, you ensure they stay focused and succeed at their task. They should never inherit your session's context or history — you construct exactly what they need. This also preserves your own context for coordination work.
Core principle: Fresh subagent per task + task review (spec + quality) + broad final review = high quality, fast iteration
Routing gate: 先看 [[agent-routing]] — Routing Table / Orchestration Residency 命中 codex 路徑(mechanical sweep、Codex-primary change、非 view phase 的 spectra-apply)時優先走該表;本 skill 用於 Claude-primary 場景的 plan 執行。回報契約遵循 [[agent-routing]] § Subagent 回報契約。
Narration: between tool calls, narrate at most one short line — the ledger and the tool results carry the record.
Continuous execution: Do not pause to check in with 使用者 between tasks. Execute all tasks without stopping. The only reasons to stop: BLOCKED you cannot resolve, ambiguity that genuinely prevents progress, or all tasks complete.
/spectra-propose 產出、docs/phases/、或 manual plan)?三者皆是 → 用本 skill。Tasks tightly coupled → 主線自己做或先拆 plan。
update_plan 每個 taskcat "$(git rev-parse --show-toplevel)/.spectra/sdd/progress.md"(存在 → 從第一個未標 complete 的 task 續跑,不重派已完成的)Dispatch Task 1 前掃一次 plan:task 間互相矛盾、task 與 Global Constraints 矛盾、plan 明文要求但 review rubric 視為 defect 的東西(不 assert 的 test、大段 verbatim duplication)。發現 → 一次打包問 使用者(每條 finding 附 plan 原文,問哪個作準),不要執行中一條一條打斷。乾淨 → 直接開始。
scripts/task-brief PLAN_FILE N 產 brief 檔(印出路徑);記錄 BASE=當前 commit./implementer-prompt.md 模板;prompt 五要素:定位一行、brief 檔路徑、跨 task interfaces、歧義裁決、report 檔路徑+回報契約)scripts/review-package BASE HEAD 產 diff 檔 → dispatch task reviewer(./task-reviewer-prompt.md;給 brief 檔 + report 檔 + diff 檔 + 逐字 global constraints)update_plan completed + ledger append 一行:Task N: complete (commits <base7>..<head7>, review clean)code-review agent(.codex/agents/code-review.toml),範圍 = git merge-base main HEAD..HEAD,並把 ledger 裡累積的 Minor 清單餵給它 triage(哪些 merge 前必修)/commit 流程用能勝任該角色的最低檔,dispatch 時 MUST 顯式指定 model(省略 = 靜默繼承主線最貴檔)。
| 角色 | Model | 判準 |
|---|---|---|
| Implementer(brief 內含完整 code,純轉錄+測試) | haiku | 1-2 檔、plan 已寫死 code |
| Implementer(prose spec、多檔整合) | sonnet | 一般情況的 floor |
| Implementer(架構判斷、需廣泛理解 codebase) | opus | 少數 |
| Task reviewer | sonnet 起,依 diff 大小/風險升檔 | 小機械 diff 不需最強檔;併發/auth/RLS 類升 opus |
| Final whole-branch review | 最強可用檔 | 唯一一次全域視角 |
Turn count beats token price:多步驟工作用最低檔常花 2-3× turns 反而總成本更高——prose 型 implementer 與 reviewer 以 sonnet 為 floor。
DONE: 產 review package → dispatch task reviewer。
DONE_WITH_CONCERNS: 先讀 concerns。關於 correctness / scope → review 前先處理;純觀察(「這檔案變大了」)→ 記下繼續。
NEEDS_CONTEXT: 補缺的資訊重派。
BLOCKED: 依序:(1) context 問題 → 補 context 同 model 重派;(2) 需要更多推理 → 升檔重派;(3) task 太大 → 拆小;(4) plan 本身錯 → 上報 使用者。NEVER 忽略 escalation 或不改任何條件原樣重派。
Reviewer 回報「⚠️ Cannot verify from diff」(要求活在未變動 code 或跨 task)→ 不 block 其他 findings,但主線自己逐條解決後才能標 task complete——你握有 plan 與跨 task context,reviewer 沒有。確認真缺 → 當 spec fail 送回 implementer 修 + re-review。
scripts/review-package BASE HEAD 檔案交付;BASE 用 dispatch implementer 前記錄的 commit,NEVER HEAD~1(多 commit task 會被靜默截斷)Conversation memory 不會活過 compaction。實測最貴失敗:controller 失去位置後重派整段已完成的 task。
.spectra/sdd/progress.md(scripts/sdd-workspace 建立,自帶 self-ignoring .gitignore)git log,不信自己的記憶git clean -fdx 會清掉 ledger(gitignored scratch);發生時從 git log 重建code-review agent[Read plan once;update_plan ×5;check ledger(無);記 BASE]
Task 1: Add new API endpoint
[scripts/task-brief plan.md 1 → .spectra/sdd/task-1-brief.md]
[Dispatch implementer (sonnet):定位一行 + brief 路徑 + report 路徑]
Implementer: "should this use service_role or authenticated?"
You: "先用 getSupabaseWithContext(event) 保留 request context;只有 audit、backfill、修復腳本等系統任務才直用 service_role"
Implementer: Status DONE — commits a1b2c3d, "14/14 passing, output pristine", report at .spectra/sdd/task-1-report.md
[scripts/review-package <BASE> HEAD → .spectra/sdd/review-a1b2..d4e5.diff]
[Dispatch task reviewer (sonnet):brief + report + diff 檔 + global constraints]
Reviewer: Spec ✅;Quality Approved;Minor ×1(記 ledger)
[update_plan 1 completed;ledger append "Task 1: complete (a1b2..d4e5, review clean)"]
Task 2: ...
Never:
scripts/task-brief 給它自己那份 brief)/spectra-propose 產 plan → 本 skill 執行(Claude-primary 場景);spectra-apply 的 phase dispatch 分流見 [[agent-routing]]git status --short + git diff 核實 scope = brief 宣告(report 是未驗證主張)