@laitszkin/apollo-toolkit 3.11.8 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/AGENTS.md +6 -6
  2. package/CHANGELOG.md +20 -2
  3. package/README.md +9 -10
  4. package/align-project-documents/SKILL.md +20 -69
  5. package/align-project-documents/references/templates/standardized-docs-template.md +1 -1
  6. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  7. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  8. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  9. package/archive-specs/SKILL.md +18 -70
  10. package/commit-and-push/SKILL.md +22 -52
  11. package/develop-new-features/SKILL.md +15 -60
  12. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  13. package/enhance-existing-features/SKILL.md +24 -61
  14. package/generate-spec/SKILL.md +15 -18
  15. package/generate-spec/references/templates/coordination.md +0 -1
  16. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  17. package/implement-specs/SKILL.md +27 -62
  18. package/implement-specs-with-subagents/SKILL.md +28 -71
  19. package/implement-specs-with-worktree/SKILL.md +38 -62
  20. package/init-project-html/SKILL.md +26 -116
  21. package/iterative-code-performance/SKILL.md +1 -1
  22. package/iterative-code-quality/SKILL.md +1 -1
  23. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  24. package/maintain-project-constraints/SKILL.md +21 -79
  25. package/maintain-project-constraints/references/constraint-file-reference.md +58 -0
  26. package/merge-changes-from-local-branches/SKILL.md +26 -100
  27. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  28. package/open-source-pr-workflow/SKILL.md +4 -7
  29. package/optimise-skill/SKILL.md +9 -9
  30. package/optimise-skill/references/definition.md +6 -5
  31. package/optimise-skill/references/example_skill.md +9 -9
  32. package/package.json +1 -1
  33. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  34. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  35. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  36. package/review-spec-related-changes/SKILL.md +24 -67
  37. package/ship-github-issue-fix/SKILL.md +2 -2
  38. package/solve-issues-found-during-review/SKILL.md +11 -74
  39. package/spec-to-project-html/SKILL.md +26 -75
  40. package/submission-readiness-check/SKILL.md +26 -62
  41. package/systematic-debug/SKILL.md +48 -64
  42. package/test-case-strategy/SKILL.md +38 -85
  43. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  44. package/update-project-html/SKILL.md +25 -94
  45. package/version-release/SKILL.md +39 -74
  46. package/archive-specs/references/templates/architecture.md +0 -21
  47. package/archive-specs/references/templates/docs-index.md +0 -39
  48. package/archive-specs/references/templates/features.md +0 -25
  49. package/archive-specs/references/templates/principles.md +0 -28
  50. package/discover-edge-cases/CHANGELOG.md +0 -19
  51. package/discover-edge-cases/LICENSE +0 -21
  52. package/discover-edge-cases/README.md +0 -87
  53. package/discover-edge-cases/SKILL.md +0 -91
  54. package/discover-edge-cases/agents/openai.yaml +0 -4
  55. package/discover-edge-cases/references/architecture-edge-cases.md +0 -41
  56. package/discover-edge-cases/references/code-edge-cases.md +0 -46
  57. package/discover-security-issues/CHANGELOG.md +0 -32
  58. package/discover-security-issues/LICENSE +0 -21
  59. package/discover-security-issues/README.md +0 -35
  60. package/discover-security-issues/SKILL.md +0 -88
  61. package/discover-security-issues/agents/openai.yaml +0 -4
  62. package/discover-security-issues/references/agent-attack-catalog.md +0 -117
  63. package/discover-security-issues/references/common-software-attack-catalog.md +0 -168
  64. package/discover-security-issues/references/red-team-extreme-scenarios.md +0 -81
  65. package/discover-security-issues/references/risk-checklist.md +0 -78
  66. package/discover-security-issues/references/security-test-patterns-agent.md +0 -101
  67. package/discover-security-issues/references/security-test-patterns-finance.md +0 -88
  68. package/discover-security-issues/references/test-snippets.md +0 -73
  69. package/recover-missing-plan/SKILL.md +0 -85
  70. package/recover-missing-plan/agents/openai.yaml +0 -4
  71. package/review-change-set/LICENSE +0 -21
  72. package/review-change-set/README.md +0 -55
  73. package/review-change-set/SKILL.md +0 -96
  74. package/review-change-set/agents/openai.yaml +0 -4
  75. package/review-codebases/LICENSE +0 -21
  76. package/review-codebases/README.md +0 -69
  77. package/review-codebases/SKILL.md +0 -103
  78. package/review-codebases/agents/openai.yaml +0 -4
  79. package/scheduled-runtime-health-check/LICENSE +0 -21
  80. package/scheduled-runtime-health-check/README.md +0 -107
  81. package/scheduled-runtime-health-check/SKILL.md +0 -135
  82. package/scheduled-runtime-health-check/agents/openai.yaml +0 -4
  83. package/scheduled-runtime-health-check/references/output-format.md +0 -20
@@ -1,77 +1,40 @@
1
1
  ---
2
2
  name: enhance-existing-features
3
3
  description: >-
4
- Extend brownfield systems only after reading the real modules involved: choose **`generate-spec`**/`recover-missing-plan` when user-visible scope, ambiguity, coordination, or sensitive flows demand written approval; otherwise implement directly but still run **`test-case-strategy`** on every non-trivial delta (property/adversarial/integration as risk dictates) and never check off plans without commit+test evidence.
5
- Use for backlog work that mutates production behavior; reroute pure regressions, copy/style-only tweaks, or single-pocket config nits that restore documented intent without new surface area.
6
- Bad: multi-service permission change with zero spec… Good: contract captures external API limits + property tests cover invariants… Single-file pagination fix matching README → targeted regression only…
4
+ 在既有系統上增強或調整產品行為。先讀懂受影響模組,再決定直接實作或走 generate-spec;所有非平凡變更必須經過 test-case-strategy
7
5
  ---
8
6
 
9
- # Enhance Existing Features
7
+ ## 技能目標
10
8
 
11
- ## Dependencies
9
+ 在不打亂既有系統邊界的前提下,為 brownfield 專案安全地增強功能或調整行為,以合適的 spec 流程與測試策略將風險控制在可驗證範圍內。
12
10
 
13
- - Required: `test-case-strategy` for risk selection, oracles, drift checks.
14
- - Conditional: **`generate-spec`** when spec triggers below fire; **`recover-missing-plan`** when user-named `docs/plans/...` is missing/archived/mismatched; **`commit-and-push`** when the user requests **git commit** and/or **push** to persist completed work—**MUST** delegate final submission to **`commit-and-push`** (often via **`implement-specs`** / **`implement-specs-with-worktree`** when a spec path is active).
15
- - Optional: none.
16
- - Fallback: **`test-case-strategy`** unavailable ⇒ **stop**. Spec path required but **`generate-spec`** unavailable ⇒ **stop**. If the user requested **commit/push** and **`commit-and-push`** is unavailable, **MUST** stop and report.
11
+ ## 驗收條件
17
12
 
18
- ## Non-negotiables
13
+ - 變更範圍明確:已讀懂受影響模組、入口點、整合邊界與變更爆炸半徑。
14
+ - 已正確判斷直接實作或必須先走 `generate-spec`,並在不需要 spec 時給出明確理由。
15
+ - 每個非平凡變更都經過 `test-case-strategy`,留下清楚的 oracle、驗證方式與通過證據。
16
+ - 若使用 spec:批准、實作、回填與計劃文件狀態同步全部完成。
17
+ - 若未使用 spec:最終摘要足以說明風險、測試結果與剩餘限制。
18
+ - `test-case-strategy` 不可用時必須停止;需要 spec 但 `generate-spec` 不可用時必須停止。
19
19
 
20
- - **MUST** explore relevant code (entrypoints, flows, integrations) **before** deciding process or editing—**MUST NOT** spec-dump or code-dump from titles alone.
21
- - Spec path **when** any: new/changed **user-visible** behavior (not mere restore of old intent); ambiguity needing approval; multi-module alignment; critical/sensitive/irreversible/migration risk; traceability materially reduces error.
22
- - **MUST NOT** open **`generate-spec`** for clearly tiny/localized work: pure regression to prior intent; polish-only UI copy/style; one-area config/constant/flag; narrow CRUD/validation tweak; internal refactor/observability **without** behavior change—**implement + `test-case-strategy` directly**.
23
- - If specs: **MUST** complete **`generate-spec`** lifecycle (approval before code; backfill after); **≤3 modules** per spec set—split independent non-dependent sets + batch `coordination.md` when coordinated parallelism; **MUST NOT** code pre-approval.
24
- - **MUST NOT** yield with approved in-scope **`tasks.md`/`checklist.md`** undone except user deferral or documented external blocker (record in plans).
25
- - **`test-case-strategy` required** for non-trivial deltas—property/adversarial/integration etc. per risk; meaningful oracles; drift check or explicit **`N/A`** with reason per non-trivial logic task.
26
- - External deps: **`contract.md`** records official-backed obligations when material.
20
+ ## 工作流程
27
21
 
28
- ## Standards (summary)
22
+ 1. 完整閱讀受影響模組、資料流、整合點與現有測試,明確界定變更的爆炸半徑。
23
+ 2. 判斷是否需要 spec:涉及新的或改變使用者可見行為、跨模組協調、高風險敏感流程、重大歧義時走 `generate-spec`。不需 spec 時明確說出理由。
24
+ 3. 若需要 spec,必須等批准後才能改產品程式碼。
25
+ 4. 查閱變更依賴的官方文件或 API spec,以最小差異實作需求,不順手做額外重構或範圍擴張。
26
+ 5. 使用 `test-case-strategy` 選擇測試組合,跑測試並修正失敗。
27
+ 6. 若使用 spec,回填所有計劃文件;若未使用,輸出簡潔的結果摘要、測試證據與剩餘限制。
29
28
 
30
- - **Evidence**: Code exploration + official docs/APIs where touched.
31
- - **Execution**: Explore → decide specs → docs/officials → implement → test → backfill/summary.
32
- - **Quality**: No speculative scope expansion; reuse patterns.
33
- - **Output**: Behavior matches ask; traceable tests; plans honest if specs used.
29
+ ## 使用範例
34
30
 
35
- ## Workflow
31
+ - 「新增一套影響 API、資料庫與 UI 的權限模型」→ 先走 `generate-spec`,批准後再實作,並補上跨層測試。交付物包含已批准的 spec、通過的測試證據、回填完成的計劃文件。
32
+ - 「修正分頁 off-by-one,讓行為回到 README 描述」→ 不開 spec,直接修復並加回歸測試。交付物為修復後的代碼與測試通過證據。
36
33
 
37
- **Chain-of-thought:** **`Pause →`** after explorations and spec decision—wrong classification wastes days.
38
34
 
39
- ### 1) Explore codebase
35
+ ## 參考資料索引
40
36
 
41
- - Map modules, integrations, blast radius.
42
- - **Pause →** Can I state **one paragraph** concrete change surface before editing?
37
+ - `generate-spec`:需要書面批准時的 spec 流程。
43
38
 
44
- ### 2) Decide specs
45
-
46
- - Apply Non-negotiable triggers above; if doubt favors **implement-only** **only when** genuinely low-risk localized.
47
- - If specs: broken path ⇒ **`recover-missing-plan`** then **`generate-spec`** (templates, clarification loop, approval). Parallel batch rules per **`generate-spec`**. If **not** specs: complete step 2 with “no specs” rationale, then continue with steps 3–6 (still run official-doc pass when external surfaces change).
48
- - **Pause →** Am I dodging specs just to avoid bureaucracy while scope is multi-team/critical?
49
-
50
- ### 3) Authoritative docs
51
-
52
- - Official docs / Context7 / web for libs used in change.
53
-
54
- ### 4) Implement
55
-
56
- - Minimal diffs preserving behavior unless tasked otherwise; specs ⇒ every in-scope unchecked item delivered; intermediate milestones ≠ user’s final asked outcome unless rescoped.
57
-
58
- ### 5) Testing (always for non-trivial)
59
-
60
- - **`test-case-strategy`**: inventory risk → tests with oracles → run/fix.
61
-
62
- ### 6) Completion
63
-
64
- - With specs: backfill **`spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md`** (+ **`coordination.md`** if batch truth moved). **`spec.md`** requirement status honest. Strip template noise / `N/A` properly.
65
- - Without specs: concise summary citing tests/results/`N/A` reasons.
66
-
67
- ## Sample hints
68
-
69
- - **Spec yes**: Adds new permission model affecting API+DB+UI—the blast radius crosses layers.
70
- - **Spec no**: Off-by-one in existing pagination restoring documented behavior—fix + regression test.
71
- - **Split**: Touches auth, billing, infra—**three plans** capped modules, **`coordination.md`** collision map.
72
-
73
- ## References
74
-
75
- - **`generate-spec`**: planning/backfill lifecycle
76
- - **`test-case-strategy`**: tests + drift philosophy
77
- - **`recover-missing-plan`**: heal missing dirs
39
+ - `test-case-strategy`:非平凡變更的測試選型與 oracle 設計。
40
+ - `commit-and-push`:使用者要求提交或推送時的最終交付流程。
@@ -1,24 +1,19 @@
1
1
  ---
2
2
  name: generate-spec
3
- description: >-
4
- Create or refresh approval-gated planning docs under `docs/plans/...` with
5
- `apltk create-specs`, `test-case-strategy`, and optional batch coordination or
6
- preparation files. Use for drafting or restructuring specs, not implementation.
3
+ description: 當你需要將用戶模糊的複雜需求拆解成有嚴格實作範圍的spec時,使用這個技能
7
4
  ---
8
5
 
9
- # 生成規格
10
-
11
6
  ## 目標
12
- 將用戶需求轉化為明確、有清晰完成條件的規格文檔。
7
+ 將用戶需求轉化為明確、有清晰完成條件的spec。
13
8
 
14
9
  ## 驗收條件
15
- - 已經產出了嚴格遵循模板格式的規格文檔。
16
- - 為規格文檔當中的需求制定了明確的驗收條件及測試策略
10
+ - 已經產出了嚴格遵循模板格式的spec。
11
+ - 為spec當中的需求制定了明確的驗收條件及測試策略
17
12
 
18
13
  ## 工作流程
19
- 1. 理解用戶需求並閱讀代碼庫
20
- 分析用戶需求,並在代碼庫之中搜索、列出可能相關的內容。完成搜索之後,深入閱讀相關代碼,識別變更範圍。
21
- 如果外部環境存在subagents功能,建議通過調度subagents來完成深入閱讀代碼庫的任務。
14
+ 1. 理解用戶需求並閱讀repo
15
+ 分析用戶需求,並在 repo 之中搜索、列出可能相關的內容。完成搜索之後,深入閱讀相關代碼,識別變更範圍。
16
+ 如果外部環境存在 subagents 功能,建議通過調度 subagents 來完成深入閱讀 repo 的任務。
22
17
 
23
18
  2. 拆分用戶需求及設計業務架構
24
19
  將用戶需求轉化、拆分為明確、存在邊界的工程需求。結合現有代碼,設計業務架構。在設計的過程中,你需要考慮包括但不限於以下設計事項:
@@ -26,7 +21,7 @@ description: >-
26
21
  - 測試策略
27
22
  - 模塊之間的呼叫、回傳
28
23
  - 資料流
29
- 在這個階段,如果用戶有任何不清晰的需求,且該需求會影響你的設計方案,你需要紀錄並在稍後填入規格文檔,等待用戶的回答。
24
+ 在這個階段,如果用戶有任何不清晰的需求,且該需求會影響你的設計方案,你需要紀錄並在稍後填入spec,等待用戶的回答。
30
25
 
31
26
  3. 將整個設計方案拆分成可執行任務
32
27
  將上一步之中你構思的完整設計方案拆分為精確到函式或檔案級別的任務。你必須確保每一個任務都是可以直接執行,且沒有歧義的。以此確保執行設計方案的開發者不會偏離設計方案。
@@ -35,13 +30,13 @@ description: >-
35
30
  為任務制定基於測試的驗收條件,確保每一個任務在完成之後都能夠被驗證。
36
31
  同時,為需求制定驗收條件,確保用戶需求能夠被測試清晰地驗收、檢驗成果。
37
32
 
38
- 5. 使用 `apltk` cli工具協助完成規格文檔
39
- 使用cli工具,產生規格文檔的模板。將你的完整計劃填入到模板之中,並通過cli工具生成完整架構圖讓用戶審閱。
40
- 如果該規格文檔設計超過三個模塊,則需要創建規格批次。
33
+ 5. 使用 `apltk` cli工具協助完成spec及spec相關架構圖
34
+ 使用 cli 工具,產生 spec 的模板。將你的完整計劃填入到模板之中,並通過 cli 工具生成完整的 architecture diff 讓用戶審閱本次spec的架構設計。
35
+ 如果該 spec 設計超過三個模塊,則需要創建 batch spec。
41
36
 
42
37
  ## 範例
43
- - "製作一個網頁德州撲克小遊戲" -> "拆分成多個模塊:遊戲本體邏輯、前端頁面渲染、前端頁面交互邏輯;制定單元測試、整合測試等策略,並製作一份單一的規格文檔指導實作工作。"
44
- - "提升現有系統的性能" -> "識別目前代碼庫之中拖累性能的代碼。製作規格批次文檔,將代碼庫的全量優化拆分為以三個模塊為一組的優化。對於必須改動業務邏輯才可以做到的性能提升,填寫clarification questions,並等待用戶回答之後更新規格文檔。"
38
+ - "製作一個網頁德州撲克小遊戲" -> "拆分成多個模塊:遊戲本體邏輯、前端頁面渲染、前端頁面交互邏輯;制定單元測試、整合測試等策略,並製作一份單一的spec指導實作工作。"
39
+ - "提升現有系統的性能" -> "識別目前 repo 之中拖累性能的代碼。製作 batch spec 文檔,將 repo 的全量優化拆分為以三個模塊為一組的優化。對於必須改動業務邏輯才可以做到的性能提升,填寫 clarification questions,並等待用戶回答之後更新 spec。"
45
40
 
46
41
  ## 參考資料
47
42
  - `scripts/create-specs` - `apltk create-specs` 背後使用的模板產生器。
@@ -54,3 +49,5 @@ description: >-
54
49
  - `references/templates/preparation.md` - batch root 的前置工作模板。
55
50
  - `references/TEMPLATE_SPEC.md` - `apltk` cli工具相關格式指引。
56
51
  - `test-case-strategy/SKILL.md` - 測試策略選擇技能。
52
+ - `apltk create-specs --help` - spec生成相關cli工具的指引命令
53
+ - `apltk architecture --help` - 架構圖生成相關cli工具的指引命令
@@ -9,7 +9,6 @@
9
9
 
10
10
  - Batch members: [[spec-name-1], [spec-name-2]]
11
11
  - Shared outcome: [what the batch delivers when all spec sets land]
12
- - Parallel readiness: [Yes / No; if No, list blocking items or link to preparation.md]
13
12
  - Out of scope: [shared exclusions for the batch]
14
13
 
15
14
  ## Design Principles
@@ -1,83 +1,48 @@
1
1
  ---
2
2
  name: implement-specs
3
- description: >-
4
- Land approved `docs/plans/{YYYY-MM-DD}/{change}` (or batch member path) on the current branch: resolve path by user pointer or evidence-backed latest (no guesses); read spec→design→contract→checklist then run every `tasks.md` line and all `checklist.md` wrap-up; multi-directory work follows `coordination.md`—one directory fully done before the next; backfill plans; **`commit-and-push`** for final commit (no branch/worktree unless user rescopes). Isolation: **`implement-specs-with-worktree`**; delegation: **`implement-specs-with-subagents`**.
3
+ description: 當你需要在當前分支之中實作spec時,使用這個技能。
5
4
  ---
6
5
 
7
- # Implement Specs
6
+ ## 技能目標
8
7
 
9
- ## Dependencies
8
+ 實作用戶指定的spec。確保所有任務都被完成,用戶所有需求都被滿足。
10
9
 
11
- - Required: **`commit-and-push`** for the **final** implementation commit (and push when the user explicitly requests remote update).
12
- - Conditional: `generate-spec` if spec files need clarification or updates; `recover-missing-plan` if the requested plan path is missing from the current checkout.
13
- - Optional: none.
14
- - Fallback: If **`commit-and-push`** is unavailable, **MUST** stop immediately and report the missing dependency. Do not improvise substitute standards or ungated `git commit`.
10
+ ## 驗收條件
15
11
 
16
- ## Non-negotiables
12
+ - 在所有被用戶要求實作的spec之中,所有的 `checklist.md`, `tasks.md`, `spec.md` 當中所有非用戶填寫的任務相關checkboxes全部被勾選為完成狀態
17
13
 
18
- - **MUST** read and understand the full in-scope planning set and the parent `coordination.md` when its path applies, **before** editing product code or tests for this spec. Read for meaning in this order: **`spec.md`** (requirements / intent), **`design.md`** (high-level architecture + coarse `INT-###` anchors—**guidance for structuring work**), **`contract.md`** (cite-backed external facts/constraints + `EXT-###` anchors), **`checklist.md`**, then treat **`tasks.md`** as **the authoritative ordered runnable checklist**. **MUST NOT** start coding until that read pass is complete for the current in-scope directory.
19
- - **MUST** execute **every** **`tasks.md`** line in listed order—the **executable source of truth** for what to ship. **`design.md` / `contract.md`** **inform** decomposition and forbid contradictions (**`INT-###` / `EXT-###`** when present are **constraints/anchors referenced from tasks**, not a second queue). **MUST NOT** silently wire alternate module flows or vendor surfaces that conflict with approved **`design`** / **`contract`**; resolve conflicts via **`generate-spec`** / explicit approved plan edits first.
20
- - **MUST** when multiple spec directories apply to one request, follow parent **`coordination.md`** merge / sequencing guidance (or the user’s explicit order if coordination is absent or defers to them) and **complete** one directory end-to-end—**all** of its `tasks.md` lines **and** **all** of its `checklist.md` wrap-up / acceptance work—**before** starting implementation work in the next directory. **MUST NOT** interleave partial implementation across sibling specs.
21
- - **MUST NOT** create a branch, switch branches, or add or use a `git worktree` for this work unless the user explicitly changes the request in the same conversation.
22
- - **`tasks.md` completeness (hard stop)**: **MUST** execute **every** actionable item listed in the in-scope `tasks.md` for this request—**no exceptions** for perceived size, duration, file count, refactor depth, or session length. **MUST NOT** stop early, “defer” unchecked tasks while claiming the spec is done, collapse multiple task lines into a partial summary, or substitute narrative progress for completing a remaining line. If a line is truly impossible under written contracts, **MUST** stop with evidence and **MUST NOT** treat the implementation pass as complete until the plan is amended through the governing planning workflow (`generate-spec` / user-approved update) and the revised `tasks.md` is then fully satisfied.
23
- - **`checklist.md` wrap-up / acceptance (hard stop for “spec complete”)**: **MUST** complete **all** `checklist.md` obligations that constitute **wrap-up, acceptance, verification, release-prep, doc or index sync, or other closing/hand-off** work tied to this change—**same no-exemption bar as `tasks.md`** (workload, duration, or breadth **do not** waive checklist-only items). The **entire** in-scope spec is **not** **complete** until those checklist items are **actually satisfied** and truthfully marked. **MUST NOT** treat “implementation done” or proceed to final **`commit-and-push`** / completion reporting while checklist-defined closing work remains open or is waved away with narrative. If a checklist item is impossible under contracts or facts on the ground, **MUST** stop with evidence and **MUST NOT** declare the spec complete until the plan is amended through the governing workflow and the revised `checklist.md` is then fully satisfied.
24
- - **MUST** treat the approved `tasks.md`, `checklist.md`, and contracts as the scope boundary: on top of the rules above, run the relevant checklist-backed verifications and tests, and **MUST** backfill the planning documents with factual completion status (no aspirational checkboxes).
25
- - **MUST NOT** expand scope to unrelated sibling spec directories solely because they share a batch folder.
26
- - **MUST** finalize the implementation through **`commit-and-push`** after staging the intended change set (shared readiness, reviews per that skill’s classification, conventional commit message); **MUST NOT** complete the deliverable with a bare `git commit`, IDE-only commit, or other shortcut that skips **`submission-readiness-check`** / mandated gates.
27
- - **MUST NOT** `git push`, tag, or perform release steps **outside** **`commit-and-push`** (unless **`version-release`** / **`open-source-pr-workflow`** explicitly applies per user request).
28
- - If the plan path is missing or ambiguous: **MUST** use `recover-missing-plan` or other verifiable repository evidence to locate the authoritative plan; **MUST NOT** substitute a nearby path by guess. After recovery, **MUST** re-read the recovered files before coding so implementation and backfill target the same snapshot.
14
+ ## 工作流程
29
15
 
30
- ## Standards (summary)
16
+ ### 1. 定位實作範圍
31
17
 
32
- - **Evidence**: Same as Non-negotiables: no coding until the spec set is fully read; no guessed plan paths.
33
- - **Execution**: Current checkout only; **`tasks.md`** defines runnable order and file targets; **`spec`/`design`/`contract`** constrain meaning and forbid contradictory wiring—implement and test until obligations are met—no parallel branch or worktree (unless the user rescopes to another skill).
34
- - **Quality**: **All** `tasks.md` lines **and** **all** `checklist.md` wrap-up / acceptance obligations for this scope satisfied (see Non-negotiables—workload is not an excuse); tests and checklist verifications executed as required; docs reflect reality; no scope creep into sibling specs.
35
- - **Output**: Current branch contains a clean, reviewable implementation of this spec only.
18
+ 閱讀用戶指定的spec
36
19
 
37
- ## Workflow
20
+ - `spec.md` 定義了用戶的需求
21
+ - `tasks.md` 定義了詳細的實作任務
22
+ - `checklist.md` 定義了任務的完成和驗收條件
23
+ - `contract.md` 定義了spec的外部依賴
24
+ - `design.md` 定義了相關業務鏈路的架構設計
25
+ - `coordination.md`(如有)定義了batch spec之中各份spec各自的實作邊界
26
+ - `preparation.md`(如有)定義了實作batch spec之前各spec的共用準備工作
38
27
 
39
- **Chain-of-thought:** Before advancing each numbered step, answer the **`Pause →`** questions (even if only internally). A “no” or “unknown” answer **MUST** be resolved or surfaced as a blocker before continuing.
28
+ 按照以上文件,閱讀repo,理解本次spec的實作範圍。
40
29
 
41
- 1. **Locate and read** — Resolve `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` using the path the **user** gave **or**, when none is given, the **most recent** plan location proven by repository evidence (issue links, manifests, `docs/plans` listing—**MUST NOT** pick a sibling folder by guess). Read parent `coordination.md` when present (merge order, parallelism rules, collisions). For **each** in-scope directory, before any code edits, read the five core files for substance in this order: `spec.md` → `design.md` → `contract.md` → `checklist.md` → `tasks.md` (execution list). If multiple directories are in scope, establish their **sequence** from `coordination.md` (or the user) and plan to implement **one directory at a time** to full completion (Non-negotiables).
42
- - **Pause →** Is this directory the **exact** scope—or ordered list—the user (or coordination) requires, verified by listing or viewing those five files—not a sibling “similar” folder?
43
- - **Pause →** Have I explicitly linked each material requirement / task to evidence I understood from **spec** / **design** / **contract** (still no code edits)?
44
- - **Pause →** If the path were missing or wrong, what **verifiable** step would locate the authoritative plan—and have I executed it?
30
+ ### 2. 實作spec任務
45
31
 
46
- 2. **Branch sanity** Run `git status -sb`. Do not modify unrelated dirty files; surface blockers. Confirm the current branch is where this work should land.
47
- - **Pause →** Would creating or switching branches or a worktree right now **violate** the Non-negotiables—and am I resisting that temptation?
48
- - **Pause →** What dirty paths are **out of scope**, and how will I avoid touching them inadvertently?
49
- - **Pause →** Is the integration target branch (where the user expects work) identical to what `git status -sb` shows?
32
+ 嚴格按照 `tasks.md` 之中定義的任務,逐項完成實作。如果有多份 `tasks.md` 存在於多份spec之中,則依照 `coordination.md` 之中建議的merge順序進行實作。
33
+ 在確認完成所有任務之後,將 `tasks.md` 之中的所有checkboxes勾選為完成。
50
34
 
51
- 3. **Implement** — Execute **the entire** approved `tasks.md` (every line) for the **current** in-scope directory only, honoring requirements and design you read in step 1; do not close this step until **no** applicable unchecked tasks remain **for that directory**. Run relevant tests and **any** verification commands or artifact steps that `checklist.md` already assigns to the implementation phase (do not postpone checklist-only closing items that belong here). When the request spans multiple directories, **repeat** steps 3–4 **per directory** in the coordination order **after** the previous directory’s tasks **and** checklist obligations are satisfied.
52
- - **Pause →** Have I listed **every** remaining `tasks.md` line—and is the count **zero** before I leave this step?
53
- - **Pause →** For the next task item, what is the **single** concrete change and its **single** primary verification—before I type code?
54
- - **Pause →** Am I about to touch a file that belongs to a **sibling** spec or an unrelated module without an in-scope task line?
55
- - **Pause →** After this chunk of work, which test command **proves** I did not break the contract’s stated behavior?
35
+ 如果實作的spec是batch spec,且有 `preparation.md`,在開始實作之前需要先完成 `preparation.md` 之中所規定的任務內容,並在驗收條件滿足之後回填 `preparation.md`。
56
36
 
57
- 4. **Backfill** — Update `checklist.md` / `tasks.md` (and any other plan files your standards require) so completion status matches what you actually did. **MUST NOT** advance to **Submit** until **every** checklist item that defines wrap-up or acceptance for this spec is **done** or the batch is an honest documented halt per Non-negotiables.
58
- - **Pause →** If I checked a box, can I point to **commit + test run** (or equivalent) that makes that check true—no wishful checking?
59
- - **Pause →** Are **zero** checklist obligations that mean “before spec complete” still open—validated by re-reading `checklist.md`, not from memory?
60
- - **Pause →** Did any scope shrink or shift during implementation; if so, is the plan text updated **honestly**?
37
+ ### 3. 驗證實作
61
38
 
62
- 5. **Submit** — Stage the intended implementation/backfill diff. Run **`commit-and-push`** through commit using that staged intent (and **push** only when the user explicitly requested remote update). Keep scope to this spec only; split into multiple submission passes only when an unavoidable checkpoint requires separate commits. **Only** reach this step when **both** `tasks.md` and `checklist.md` Non-negotiable closures are satisfied.
63
- - **Pause →** Does `git diff --cached` (or the equivalent staged view) show only this spec’s intended surface, or do I need to unstage/revert noise first?
64
- - **Pause →** Am I on the **same** branch I named in step 2, without a silent branch switch?
39
+ 按照 `checklist.md` 之中定義的驗收標準,逐項驗收並檢查任務是否完成。對於未達到驗收標準的任務,必須重新實作及重新驗收,並在完成驗收之後將所有 `checklist.md` 之中的checkboxes勾選為完成。
65
40
 
66
- 6. **Report** — State current branch, commit hash, tests run, which plan files were backfilled, and explicit confirmation that **`tasks.md` and checklist-defined wrap-up work are complete** for this in-scope spec (or cite the documented blocker).
67
- - **Pause →** Would another engineer **reproduce** my conclusion from the branch name, commit hash, and test commands I listed alone?
41
+ ### 4. 回填spec
68
42
 
69
- If this skill directory contains `references/implement-specs-common.md`, treat it as an optional extension to the steps above; if it is absent, the Workflow section here is authoritative.
43
+ 確保所有實作任務完成並通過驗收之後,更新 `spec.md` 之中的需求checkboxes反應實際代碼實作狀態。
70
44
 
71
- ## Sample hints
45
+ ## 範例
72
46
 
73
- - **Resolve path**: user says “implement `oauth-scope`”; read `docs/plans/2026-05-01/oauth-scope/` first, **not** a sibling folder like `docs/plans/2026-05-01/batch/oauth-scope/` unless that is where the five files actually live per user or manifest.
74
- - **Read order**: keep the mandated sequence (**spec design contract checklist → tasks**); use **`checklist.md`** after **spec/design/contract** so acceptance checks map to stated requirements and boundaries.
75
- - **Multi-directory batch (same branch)**: `coordination.md` says merge order `api-layer` then `cli-wrapper` — finish **`api-layer`** `tasks.md` **and** **`api-layer`** `checklist.md` completely, then start **`cli-wrapper`**; do not split half of each.
76
- - **Branch sanity excerpt**: expect `git status -sb` like `## feature/x …` plus a dirty `README.md` you do **not** own — leave that file untouched; implement only paths from `tasks.md`.
77
- - **Completion report sketch**: `Branch: feature/x · Commit: a1b2c3d · Tests: npm test -- lib/auth.test.js · Backfill: tasks.md (done), checklist.md (R1.3 → passed).`
78
- - **Anti-pattern**: `git checkout -b impl/oauth-scope` for this skill — **wrong** unless the user changed scope mid-conversation.
79
-
80
- ## References
81
-
82
- - `recover-missing-plan`: missing or mismatched plan recovery
83
- - **`commit-and-push`**: final commit/readiness (push only when user requests remote update)
47
+ - "用戶指定了一份有四份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中建議merge順序是 spec 1 -> spec 2 -> spec 3 -> spec 4。" -> "從spec 1開始進行完整的實作流程,並在完成回填spec之後再開始實作spec 2,直至4份spec都被完成"
48
+ - "用戶指定了一份有2份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中的建議merge順序是spec 2 -> spec 1,並且 `preparation.md` 存在於該batch spec之中。" -> "先實作 `preparation.md` 之中要求的任務並按照當中的驗收標準進行驗收。確定完成之後,從spec 2開始完整的實作流程。並在完成spec 2之後再實作 spec 1。"
@@ -1,92 +1,49 @@
1
1
  ---
2
2
  name: implement-specs-with-subagents
3
- description: >-
4
- Coordinator-only workflow for multispec batches: ingest `coordination.md`/`preparation.md`, run prerequisite work yourself, derive topological phases, launch **`implement-specs-with-worktree`** workers (one `{change}` each; **full** `tasks.md` + **full** `checklist.md` wrap-up—no partial handoff), **`merge-changes-from-local-branches`** after every phase succeeds, ledger every branch/test/merge—not for solo specs unless user explicitly insists on delegation overload. **Multi-phase: do not declare done until every non-blocked spec is merged across all phases** (or pipeline stopped on explicit blocker).
5
- Wrong tool for one directory without parallel mandate—pick **`implement-specs-with-worktree`** / **`implement-specs`** depending on isolation. Publication/versioning stays outside this orchestration layer unless another skill attaches.
6
- Ledger sample: `oauth-scope | phase=1 | merged | npm test ✅`.
3
+ description: 當有多份規格文檔需要被實作時,且環境允許使用subagents,建議使用本技能調度subagents完成任務
7
4
  ---
8
5
 
9
- # Implement Specs with Subagents (Multi-Phase)
6
+ ## 目標
10
7
 
11
- ## Dependencies
8
+ 調度多個subagents完成規格文檔的實作。
12
9
 
13
- - Required: `implement-specs-with-worktree` (every implementation subagent **MUST** follow this skill for its assigned directory); `merge-changes-from-local-branches` (phase integration **MUST NOT** skip this between phases); **`commit-and-push`** (integration-branch **preparation** commits and **any** post-merge submission the user expects on that branch—**MUST NOT** bypass for bare `git commit` / ungated push when this skill owns the branch).
14
- - Conditional: `generate-spec` if the batch is not implementation-ready; `review-change-set` only when the user asks for post-merge review.
15
- - Fallback: If independent subagents cannot run, **MUST** report that limitation. Serial `implement-specs-with-worktree` across specs is allowed **only** after the user explicitly approves that fallback.
10
+ ## 驗收條件
16
11
 
17
- ## Non-negotiables
12
+ - 在所有被用戶要求實作的spec之中,所有的 `checklist.md`, `tasks.md`, `spec.md` 當中所有非用戶填寫的checkboxes全部被勾選為完成狀態
13
+ - 所有變更已經從各個subagents的工作分支合併回當前所在分支
14
+ - 所有subagents創建的工作分支及工作樹已經被清理
18
15
 
19
- - **MUST NOT** delegate until `coordination.md`, when present, explicitly allows parallel implementation—or when absent, until you have verified no contradiction to parallel work.
20
- - **MUST** enumerate exact in-scope spec directories **before** any subagent starts; **MUST NOT** delegate archived, sibling, or “nearest guess” directories unless the user explicitly includes them.
21
- - **MUST** verify each delegated directory contains `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` before launch.
22
- - **MUST** complete, verify, and **finalize** documented shared preparation on the integration branch **through `commit-and-push`** before any implementation subagent starts when `preparation.md` exists or specs mandate pre-work; the coordinating agent **MUST NOT** delegate that preparation. Subagents **MUST NOT** start until this branch is clean at the preparation commit (or there is no required preparation).
23
- - **MUST** build a directed dependency graph from `coordination.md` plus each spec’s `spec.md` / `design.md` (edges: *provider spec must merge before consumer spec*). **MUST** partition specs into phases by topological **layers**: Phase 1 = specs with **no** in-batch prerequisites; for *k* ≥ 2, Phase *k* = specs whose in-batch prerequisites all appear in phases before *k*. **MUST NOT** start phase *k* until phase *k − 1* is fully merged into the integration branch (or you have an explicit user override). If the graph has a cycle, **MUST** stop and report it.
24
- - **MUST** assign **exactly one** spec directory per implementation subagent; **MUST NOT** assign multiple directories to one implementation subagent.
25
- - **`tasks.md` + `checklist.md` completeness (hard stop)**: Every implementation subagent **MUST** finish **all** actionable items in its assigned directory’s `tasks.md` **and** **all** `checklist.md` wrap-up, acceptance, verification, and closing obligations before reporting success—**no** partial completion, **no** “good enough” stops for large batches, **no** deferrals disguised as done. The coordinating agent **MUST NOT** merge a phase branch, advance the ledger to **`merged`**, or treat a spec as complete while **any** in-scope `tasks.md` line **or** checklist-defined closing item remains undone unless the batch is explicitly **`blocked`** with documented user/contract halt. **MUST** repeat this mandate in **every** subagent envelope so workers cannot interpret scope loosely.
26
- - **MUST** give each subagent only task-local context (repo root, exact spec path, `coordination.md` path if relevant, instruction to run `implement-specs-with-worktree`, explicit **`tasks.md` full-completion** and **`checklist.md` wrap-up full-completion** requirements, baseline commit when preparation exists, requirement to read the full bundle before edits, worktree isolation, tests, backfill, local commit, and reporting branch/worktree/commit/tests/blockers). **MUST NOT** leak unrelated reasoning or other subagents’ private diffs unless resolving a concrete conflict.
27
- - After each phase: **MUST** merge every **completed** spec branch from that phase into the integration branch via `merge-changes-from-local-branches` before starting the next phase; **MUST** resolve conflicts using spec contracts as the correctness tie-breaker; **MUST** record merge result in the ledger; if merge is blocked, **MUST** stop the pipeline and report.
28
- - **Multi-phase completion**: When the planned ledger has **more than one** phase, **MUST** loop steps **5→6→7** until **every** in-scope spec is either **`merged`** on the integration branch or explicitly **`blocked`** with a documented stop (user abort, irresolvable conflict, failed dependency, etc.). **MUST NOT** yield, summarize as “phase complete”, or imply the batch is finished while **any** phase still has a successful, unmerged branch or **`pending`** / **`in_progress`** rows for specs that should run—unless the coordinating agent is halted by a preceding Non-negotiable blocker **and** that halt is stated plainly.
29
- - Model: If the user names a model, **MUST** use it for implementation subagents when the platform allows; if not supported, **MUST** state that fact and continue only if the default is acceptable to the user’s intent.
16
+ ## 工作流程
30
17
 
31
- ## Standards (summary)
18
+ ### 1. 定位實作範圍
32
19
 
33
- - **Evidence**: Batch read (`coordination.md`, `preparation.md`, every in-scope `spec.md` / `design.md`) before scheduling; ledger stays live.
34
- - **Execution**: Preparation → dependency graph → **repeat** (run phase *k* → merge phase *k*) until all phases reconciled on the integration branch; never skip merges between dependent phases; **multi-phase ⇒ no early “done” narrative** until ledger proves full merge-set (or documented blockers).
35
- - **Quality**: No duplicate delegation; subagents base on the branch that already contains preparation (and prior phases); **every** spec lands with **complete** `tasks.md` execution **and** **complete** `checklist.md` wrap-up, or a documented **blocked** state—workload is never a merge excuse; pause on shared file collisions, batch-wide defects, or rate-limit pressure.
36
- - **Output**: Concise ledger: per spec → phase, depends-on, subagent id/label, branch/worktree, commit or blocker, tests, merge status.
20
+ 閱讀用戶指定的spec
37
21
 
38
- ## Workflow
22
+ - `spec.md` 定義了用戶的需求
23
+ - `tasks.md` 定義了詳細的實作任務
24
+ - `checklist.md` 定義了任務的完成和驗收條件
25
+ - `contract.md` 定義了spec的外部依賴
26
+ - `design.md` 定義了相關業務鏈路的架構設計
27
+ - `coordination.md`(如有)定義了batch spec之中各份spec各自的實作邊界
28
+ - `preparation.md`(如有)定義了實作batch spec之前各spec的共用準備工作
39
29
 
40
- **Chain-of-thought:** After **each** numbered step below, briefly answer **`Pause →`** items; escalate to halt or revise the plan whenever the answer violates Non-negotiables or exposes a blocker.
30
+ 按照以上文件,閱讀repo,理解本次spec的實作範圍。
41
31
 
42
- 1. **Batch intake** — Resolve `docs/plans/{YYYY-MM-DD}/{batch_name}/`. Read `coordination.md` (first) and `preparation.md` when present. List only in-scope spec directories; verify the five required files each. If coordination blocks parallel work, **stop** and report. If preparation is required, go to step 2; else go to step 3.
43
- - **Pause →** Can I quote **verbatim** why each enumerated directory is in scope—not “probably related”?
44
- - **Pause →** What **exact sentence** from `coordination.md` gates parallel readiness, if any—or what absence did I infer from—and is that justified?
32
+ ### 2. 完成前置準備工作(如有)
45
33
 
46
- 2. **Preparation (blocking when required)** Coordinating agent executes shared prep only: read tasks/outputs/verification hooks, satisfy scope, run listed checks, **finalize on the integration branch through `commit-and-push`** (push only if the user requested remote update), record prep commit hash in ledger, leave working tree clean. If prep fails, **stop** (no subagents).
47
- - **Pause →** Am I silently delegating preparation to a **subagent** when the coordinating agent owns it—is that happening?
48
- - **Pause →** What **commit hash** and **clean-tree** confirmation will subagents inherit as baseline?
34
+ 如果實作的batch spec `preparation.md`,你需要在開始實作之前需要先完成 `preparation.md` 之中所規定的任務內容,並在驗收條件滿足之後回填 `preparation.md`。使用 `commit-and-push` 技能並遵守當中的流程將前置準備工作提交,不需要推送到remote
49
35
 
50
- 3. **Dependency graph** — Extract ordering obligations; assign each spec a phase index via topological layering. Persist `depends-on` / `depended-by` in the ledger. Cycles ⇒ **stop**.
51
- - **Pause →** For each edge (A must land before B), what **sentence** from spec/design/coordination supports it?
52
- - **Pause →** If I flattened phases wrong, which later spec would start **without** its merged predecessor—how do I detect that now?
36
+ ### 3. 規劃subagents調度順序
53
37
 
54
- 4. **Plan launches** — For each phase, queue one item per spec. Ledger fields: phase, paths, deps, planned branch/worktree basename, status (`pending` / `in_progress` / `merged` / `blocked`), commit, tests, blockers, prep-commit baseline note. Fix model policy per Non-negotiables.
55
- - **Pause →** Is there **exactly one** spec directory per queued subagent—never two in one prompt?
56
- - **Pause →** What will I **repeat** in every subagent envelope so they cannot “improvise” the wrong skill or wrong path?
38
+ 識別各份spec之間的依賴關係,並建立調度順序。將多份spec的實作切分為多個實作批次。每一個實作批次內部的spec之間沒有互相依賴。完成實作批次的建立之後,為每一個subagents分配僅一份spec,並且開始實作。
57
39
 
58
- 5. **Run phase *k*** — Launch subagents for each spec in the phase with task-local payloads (see Non-negotiables). Monitor ledger; pause new launches on shared blockers; on conflicting edits to shared files, resolve ownership using `coordination.md` before more launches; if one spec fails and others depend on it, **MUST NOT** start those dependents until resolved; batch-wide planning failure ⇒ stop all scheduling.
59
- - **Pause →** Does every active subagent have a **distinct** spec directory assignment—no duplicate or overlapping paths?
60
- - **Pause →** Did two running subagents report **overlapping** paths; if yes, did I stop launching until ownership is clear?
40
+ 在開始實作一個新的實作批次之前,你需要使用 `merge-changes-from-local-branches` 技能,遵守當中的流程,將前一個實作批次的變更從本地其他分支合併回來。
61
41
 
62
- 6. **Merge phase *k*** — When every item in phase *k* is **done or explicitly blocked**, merge **each successful** branch via `merge-changes-from-local-branches`; rerun critical tests if your standards say so; update ledger. Merge failure ⇒ **stop** before phase *k+1*. **“Done”** here **requires** full `tasks.md` completion **and** full `checklist.md` wrap-up / acceptance per Non-negotiables—not merely a subagent “looks finished” report.
63
- - **Pause →** For **each** spec I am about to merge, can I cite **evidence** (branch + `tasks.md` **and** `checklist.md` state) that **zero** applicable task lines **and** **zero** outstanding checklist closing items remain—or is this a documented **`blocked`** outcome instead?
64
- - **Pause →** Has **every** successful branch in this phase been merged into the **same** integration branch I will use to **start** phase *k+1*?
65
- - **Pause →** If a merge conflict touches a **contract** field, which spec’s `contract.md` / `design.md` is the tie-breaker I will apply?
42
+ ### 4. 驗收工作
66
43
 
67
- 7. **Repeat until batch reconciled** — After step 6, if **any** later phase still has specs not yet run or not yet merged: **MUST** increment *k* and **return to step 5** on the **same** integration branch (now including phase *k* merges). Next phase starts only on that branch. **MUST NOT** end the coordinator run with a “wrapped up” message if the ledger still shows remaining phases or unmerged successful work. **Only** when every in-scope spec is **`merged`** or explicitly **`blocked`** may you treat implementation coordination as **complete** (then optional handoff to submit/review skills per user).
68
- - **Pause →** How many phases remain after this merge—is the count **zero**? If not, **immediately** plan step 5 for *k+1*.
69
- - **Pause →** Before launching phase *k+1*, can I **name** the merge commit or branch state that contains **all** prerequisites for every spec in that phase?
70
- - **Pause →** Can I cite **ledger lines** proving **merged** for every non-blocked spec in **every** phase?
44
+ 完成所有實作批次的合併之後,你需要閱讀所有spec之中的 `checklist.md`, `tasks.md`, `spec.md`,並確保當中非用戶填寫的任務相關checkboxes都被勾選為完成。
71
45
 
72
- ## Out of scope
46
+ ## 範例
73
47
 
74
- - **MUST NOT** use this skill for a single spec unless the user explicitly requests subagent delegation.
75
-
76
- **Repository regression check:** The coordinating agent must complete and commit explicitly documented prerequisite preparation on the integration branch before launching implementation subagents when `preparation.md` or equivalent mandates it.
77
-
78
- ## Sample hints (subagent scheduling)
79
-
80
- - **Parallel batch (independent specs)** — The batch has multiple member directories and `coordination.md` allows parallel implementation with **no** in-batch prerequisites. Treat them as **one phase**: assign **exactly one** spec per subagent, launch one **`implement-specs-with-worktree`** worker per spec, each finishing **all** of its directory’s **`tasks.md`** and **`checklist.md`** before reporting success; when **every** branch in the phase is green, run **`merge-changes-from-local-branches`** to bring **every** member into the integration branch **before** declaring the batch done or starting a follow-on phase.
81
-
82
- - **Preparation plus A → {B, C}** — Specs **A**, **B**, and **C** share a batch with **`preparation.md`**; `coordination.md` / design shows **B** and **C** depend on merged work from **A**. Coordinating agent: (1) complete **preparation** on the integration branch and **`commit-and-push`** (push only if the user asked); (2) **Phase 1**: launch **one** subagent for **A** only; **`merge-changes-from-local-branches`** for **A** when it passes; (3) **Phase 2**: launch **two** subagents for **B** and **C** from the branch that already contains **A**’s merge; (4) merge **B** and **C** when both finish. **MUST NOT** start **B** or **C** until **A** is merged into the baseline they branch from.
83
-
84
- - **Ledger reminder** — One row per spec remains mandatory (`phase`, `depends-on`, branch/worktree, `merged` / `blocked`, tests); see Non-negotiables for full fields.
85
-
86
- ## References
87
-
88
- - `implement-specs-with-worktree`: per-spec execution environment
89
- - `merge-changes-from-local-branches`: phase merge integration (and downstream submit flow when that skill is invoked)
90
- - `generate-spec`: repair planning when the batch is not ready
91
- - `coordination.md`, `preparation.md`: batch-level ordering and prerequisites
92
- - `review-change-set`: optional post-merge review
48
+ - "用戶要求實作一份batch spec。該batch spec有5份spec。spec 2依賴於 spec 1,spec 4依賴於spec 3,spec 5依賴於spec 2, spec 4。" -> "將batch spec切分為3個實作批次。第一批,先派發兩個subagents各自實作spec 1, spec 3,並將變更合併回當前分支;第二批派發兩個subagents個字實作spec 2, spec 4,並將變更合併回當前分支;第三批派發subagent實作spec 5,並將變更合併回當前分支。完成驗證工作之後向用戶回報成果。"
49
+ - "用戶要求實作一份batch spec。該batch spec有3份spec,並且存在 `preparation.md`。3份spec之間各自無依賴關係。" -> "先完成 `preparation.md` 的實作並提交。然後啟動三個subagents並行完成三份spec的任務。完成之後,將變更合併回當前分支。完成驗證工作之後向用戶回報結果。"
@@ -1,84 +1,60 @@
1
1
  ---
2
2
  name: implement-specs-with-worktree
3
- description: >-
4
- Like **`implement-specs`** (same read order, full `tasks.md`/`checklist.md`, sequential multi-spec per `coordination.md`) but all writes in a dedicated worktree+feature branch; `pwd` must match `git rev-parse --show-toplevel`; parent checkout read-only for deliverables; honor `preparation.md` and `coordination.md` collision rules. Use when isolation is required; otherwise **`implement-specs`**.
3
+ description: 當你需要在獨立分支和工作樹之中實作spec時,使用這個技能。
5
4
  ---
6
5
 
7
- # Implement Specs with Worktree
6
+ ## 技能目標
8
7
 
9
- ## Dependencies
8
+ 在獨立分支及工作樹實作用戶指定的spec。確保所有任務都被完成,用戶所有需求都被滿足。
10
9
 
11
- - Required: `implement-specs` for the shared discovery / implementation / backfill / **submit** / reporting lifecycle; **`commit-and-push`** for the **final** implementation commit (and push when the user explicitly requests remote update).
12
- - Conditional: `generate-spec` if spec files need clarification or updates.
13
- - Fallback: If any required dependency skill is unavailable, **MUST** stop and report it.
10
+ ## 驗收條件
14
11
 
15
- ## Non-negotiables
12
+ - 在所有被用戶要求實作的spec之中,所有的 `checklist.md`, `tasks.md`, `spec.md` 當中所有非用戶填寫的任務相關checkboxes全部被勾選為完成狀態
16
13
 
17
- - **MUST** perform every write (product code, tests, and spec-document backfill) inside the active worktree: after each `cd`, **MUST** confirm `pwd` equals `git rev-parse --show-toplevel` for that worktree before editing.
18
- - **MUST NOT** edit implementation files from the parent checkout except for creating or listing worktrees and read-only inspection; the parent checkout is write-prohibited for this spec’s deliverables.
19
- - **MUST** follow the **`implement-specs` Workflow** for discovery, implementation, backfill, commit discipline, and completion reporting—**except** that branch/worktree restrictions in `implement-specs` Non-negotiables are replaced by this skill’s worktree rules.
20
- - **MUST** create the implementation branch from the **same parent branch** the user/session identified as the baseline (often the branch that will receive the merge—not necessarily `main` unless that branch is verified as the base).
21
- - **MUST** use the spec directory name (`change_name`) as the canonical basename for the worktree path and branch stem; branch **`type`/name** must follow `references/branch-naming.md`.
22
- - **MUST** use `git show-ref` and `git worktree list --porcelain` (not shell guesses) when checking whether a branch or worktree already exists; if creation fails ambiguously, **MUST** re-query those commands before retrying.
23
- - When `preparation.md` exists: **MUST** treat it as an already-committed shared baseline for parallel work; **MUST NOT** redo its tasks inside the member spec unless the preparation commit is missing or the document states the prerequisite is still blocked. If baseline assumptions break, **MUST** update `preparation.md` or stop for coordination—**MUST NOT** silently move prerequisite work into the member spec.
24
- - **`tasks.md` completeness (hard stop)**: **MUST** satisfy the **`implement-specs` Non-negotiable** on **`tasks.md`**: execute **every** actionable line in the in-scope `tasks.md`, with **no** early exit for workload, duration, or breadth; partial task lists are **not** a mergeable or committable state. If a line cannot be met under contracts, **MUST** halt with evidence and resolve the plan through approved planning updates before claiming completion.
25
- - **`checklist.md` wrap-up / acceptance (hard stop for “spec complete”)**: **MUST** satisfy the **`implement-specs` Non-negotiable** on **`checklist.md`**: the spec is **not** **complete** and **must not** be merged or treated as finished until **all** checklist-defined wrap-up, acceptance, and closing obligations for the change are **done** and honestly recorded—**no** workload exemption.
26
- - **MUST** complete the same quality bar as `implement-specs`: on top of full `tasks.md` and **complete checklist wrap-up**, relevant tests, honest backfill, no sibling-spec scope creep, revert formatter-only noise outside owned files before commit.
27
- - **MUST NOT** `git push` **outside** **`commit-and-push`** unless the user explicitly requests remote update through that workflow (or a release/PR skill the user named).
28
- - For targeted Rust tests: **MUST** pass at most one positional `cargo test` filter per invocation; use separate commands or a broader confirmed filter when multiple selectors are needed.
14
+ ## 工作流程
29
15
 
30
- ## Standards (summary)
16
+ ### 1. 定位實作範圍
31
17
 
32
- - **Evidence**: Read full spec set plus `coordination.md` and `preparation.md` when present; verify whether the spec is already implemented on the baseline before opening a new worktree; if the plan is missing in the worktree, sync the authoritative copy and re-read before coding.
33
- - **Execution**: Isolated worktree only; branch naming per `references/branch-naming.md`; check sibling worktrees before editing shared boundaries in a parallel batch.
34
- - **Quality**: Same as `implement-specs` (including **all** `tasks.md` items **and** **all** `checklist.md` wrap-up obligations—no workload excuse), plus collision awareness with sibling worktrees per `coordination.md`.
35
- - **Output**: Clean local branch in the worktree with intended commits only; parent working tree unchanged by this implementation.
18
+ 閱讀用戶指定的spec
36
19
 
37
- ## Workflow
20
+ - `spec.md` 定義了用戶的需求
21
+ - `tasks.md` 定義了詳細的實作任務
22
+ - `checklist.md` 定義了任務的完成和驗收條件
23
+ - `contract.md` 定義了spec的外部依賴
24
+ - `design.md` 定義了相關業務鏈路的架構設計
25
+ - `coordination.md`(如有)定義了batch spec之中各份spec各自的實作邊界
26
+ - `preparation.md`(如有)定義了實作batch spec之前各spec的共用準備工作
38
27
 
39
- **Chain-of-thought:** Answer each **`Pause →`** question before leaving the phase; if any answer conflicts with Non-negotiables, fix state first (right directory, right root, right baseline).
28
+ 按照以上文件,閱讀repo,理解本次spec的實作範圍。
40
29
 
41
- ### A) Specs and baseline
30
+ ### 2. 創建子分支及worktree
42
31
 
43
- - Run **`implement-specs` Workflow steps 1–2** in spirit: resolve paths, read all core files and `coordination.md`; run `git status` / `git worktree list` as needed. If the plan files are absent in the target worktree, sync them in, then re-read in that tree.
44
- - Read `preparation.md` when present; apply the Non-negotiable baseline rule above.
45
- - **Pause →** Where will authoritative plan text live **for this session**—parent tree, worktree after sync—and have I opened that copy end-to-end?
46
- - **Pause →** Does `coordination.md` / `preparation.md` imply **anything** I must not redo or must assume stable before coding?
32
+ 從當前分支創建子分支及worktree。分支以規格文檔的實際變更命名,並且需要符合通用開發規範(e.g. feat/event-bus-backend)
47
33
 
48
- ### B) Worktree and branch
34
+ ### 3. 實作spec任務
49
35
 
50
- - If the requested scope is already implemented and verified on the baseline, **MUST** report `no-op` with evidence instead of creating duplicate work.
51
- - Otherwise: ensure the shell is in the correct worktree (create one if required):
52
- - Derive `change_name`; branch pattern `<type>/<spec-name>` per `references/branch-naming.md`; worktree directory `../<spec-name>` (or an equivalent path the user approves).
53
- - `git branch <branch-name> <parent-branch>` then `git worktree add <path> <branch-name>`; `cd` into it; verify `pwd` vs `git rev-parse --show-toplevel`.
54
- - Before editing shared modules in a batch, check `git worktree list --porcelain` and `coordination.md` for sibling ownership; read sibling diffs when the same file is touched.
55
- - **Pause →** Why is **`parent-branch`** definitely the correct baseline—not an unexamined assumption that `main` is default?
56
- - **Pause →** Could this work duplicate an **already-merged** implementation; what **evidence** (`git log`, tests, code search) did I use to rule that in or out?
57
- - **Pause →** After `cd`, do `pwd` and `git rev-parse --show-toplevel` **match**; if not, why am I not stopping before any write?
58
- - **Pause →** Which sibling worktree might already own the shared file I am about to touch, and did I inspect their diff?
36
+ 嚴格按照 `tasks.md` 之中定義的任務,逐項完成實作。如果有多份 `tasks.md` 存在於多份spec之中,則依照 `coordination.md` 之中建議的merge順序進行實作。
37
+ 在確認完成所有任務之後,將 `tasks.md` 之中的所有checkboxes勾選為完成。
59
38
 
60
- ### C) Implement, backfill, commit, report
39
+ 如果實作的spec是batch spec,且有 `preparation.md`,在開始實作之前需要先完成 `preparation.md` 之中所規定的任務內容,並在驗收條件滿足之後回填 `preparation.md`。
61
40
 
62
- - Execute **`implement-specs` Workflow steps 3–6** (implement—including **full** `tasks.md` and checklist-backed work per Non-negotiables—backfill—including **complete** `checklist.md` wrap-up before submit—**submit via `commit-and-push`**, report) **entirely from the worktree root**, honoring the same **`spec.md` / `design.md` / `contract.md` / `checklist.md` / `tasks.md`** read-and-execute rules as **`implement-specs`** (including **one directory at a time** to completion when the request spans multiple member specs on the same integration cadence—typically **one worktree lifecycle per directory** unless the user batches otherwise).
63
- - In the report, **MUST** include branch name, worktree path, commit hash, tests run, backfilled docs, and an explicit statement that the parent checkout was not modified for implementation files.
64
- - **Pause →** Am I honoring **implement-specs** step 3–6 **constraints** literally while respecting that all writes happen **only** under this worktree root?
65
- - **Pause →** If I used Rust `cargo test` filters, did I violate the **single positional filter** rule; how would I split the commands?
41
+ ### 4. 驗證實作
66
42
 
67
- ## Sample hints
43
+ 按照 `checklist.md` 之中定義的驗收標準,逐項驗收並檢查任務是否完成。對於未達到驗收標準的任務,必須重新實作及重新驗收,並在完成驗收之後將所有 `checklist.md` 之中的checkboxes勾選為完成。
68
44
 
69
- - **Root check** (must print the same path twice before edits):
70
- ```bash
71
- pwd && git rev-parse --show-toplevel
72
- ```
73
- - **Skeleton commands** (`change_name` `oauth-scope`, parent `feature/x`, type `feat`):
74
- ```bash
75
- git branch feat/oauth-scope feature/x
76
- git worktree add ../oauth-scope feat/oauth-scope
77
- cd ../oauth-scope
78
- ```
79
- - **Cargo** (two filters ⇒ two commands): run `cargo test parser::` **and separately** `cargo test cache::`, not `cargo test parser:: cache::`.
45
+ ### 5. 回填spec
80
46
 
81
- ## References
47
+ 確保所有實作任務完成並通過驗收之後,更新 `spec.md` 之中的需求checkboxes反應實際代碼實作狀態。
82
48
 
83
- - `implement-specs`: shared lifecycle (locate → read bundle in order → implement → backfill → **`commit-and-push`** → report)
84
- - `references/branch-naming.md`: branch naming
49
+ ### 6. 提交變更
50
+
51
+ 使用 `commit-and-push` 將變更提交到子分支上。不需要將變更推送到remote。
52
+
53
+ ## 範例
54
+
55
+ - "用戶指定了一份有四份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中建議merge順序是 spec 1 -> spec 2 -> spec 3 -> spec 4。" -> "創建子分支及工作樹;從spec 1開始進行完整的實作流程,並在完成回填spec之後再開始實作spec 2,直至4份spec都被完成"
56
+ - "用戶指定了一份有2份spec的batch spec並要求實作這份batch spec。同時,`coordination.md` 之中的建議merge順序是spec 2 -> spec 1,並且 `preparation.md` 存在於該batch spec之中。" -> "創建子分支及工作樹;先實作 `preparation.md` 之中要求的任務並按照當中的驗收標準進行驗收。確定完成之後,從spec 2開始完整的實作流程。並在完成spec 2之後再實作 spec 1。"
57
+
58
+ ## 參考資料
59
+
60
+ - `references/branch-naming.md` - 建議分支命名方式