@laitszkin/apollo-toolkit 3.6.0 → 3.6.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 (24) hide show
  1. package/AGENTS.md +1 -1
  2. package/CHANGELOG.md +9 -0
  3. package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
  4. package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
  5. package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
  6. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  7. package/generate-spec/README.md +19 -3
  8. package/generate-spec/SKILL.md +34 -9
  9. package/generate-spec/agents/openai.yaml +1 -1
  10. package/generate-spec/references/templates/coordination.md +2 -11
  11. package/generate-spec/references/templates/preparation.md +69 -0
  12. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  13. package/generate-spec/scripts/create-specs +34 -1
  14. package/generate-spec/tests/test_create_specs.py +35 -1
  15. package/implement-specs-with-subagents/SKILL.md +26 -6
  16. package/implement-specs-with-subagents/agents/openai.yaml +1 -1
  17. package/implement-specs-with-worktree/SKILL.md +10 -6
  18. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  19. package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
  20. package/package.json +1 -1
  21. package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
  22. package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
  23. package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
  24. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
package/AGENTS.md CHANGED
@@ -26,7 +26,7 @@ This repository enables users to install and run a curated set of reusable agent
26
26
  - Users can choose between symlink mode (auto-update via git pull) and copy mode (stable snapshot) with `--symlink` / `--copy` flags.
27
27
  - Users can run bundled helper tools through `apltk tools` and direct `apltk <tool>` commands for selected packaged skill scripts.
28
28
  - Users can design and implement new features through a spec-first workflow.
29
- - Users can generate shared feature planning artifacts for approval-gated workflows, including parallel multi-spec batches coordinated through one batch-level `coordination.md`.
29
+ - Users can generate shared feature planning artifacts for approval-gated workflows, including parallel multi-spec batches coordinated through `coordination.md` and, only when needed, minimal non-business prerequisite work in `preparation.md`.
30
30
  - Users can convert text or documents into audio files with subtitle timelines.
31
31
  - Users can turn lecture slides, past papers, and answer books into mock exams, worked solutions, study notes, or graded PDFs with KaTeX-rendered math.
32
32
  - Users can extend existing features in a brownfield codebase with required tests and approvals.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ All notable changes to this repository are documented in this file.
7
7
  ### Added
8
8
  - (None yet)
9
9
 
10
+ ## [v3.6.1] - 2026-04-28
11
+
12
+ ### Added
13
+ - Add an optional `generate-spec` `preparation.md` template and `apltk create-specs --with-preparation` support for minimal non-business prerequisite work before parallel spec implementation.
14
+
15
+ ### Changed
16
+ - Tighten `implement-specs-with-subagents` so the coordinating agent completes and commits documented prerequisite preparation before launching implementation subagents.
17
+ - Keep `coordination.md` focused on ownership and collision rules by removing preparation-task fields from its template.
18
+
10
19
  ## [v3.6.0] - 2026-04-28
11
20
 
12
21
  ### Added
@@ -1,11 +1,12 @@
1
1
  # generate-spec
2
2
 
3
- A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed `coordination.md` so other skills can reuse one consistent approval-gated spec workflow with risk-driven test planning from `test-case-strategy`.
3
+ A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed shared `coordination.md` or `preparation.md` so other skills can reuse one consistent approval-gated spec workflow with risk-driven test planning from `test-case-strategy`.
4
4
 
5
5
  ## Core capabilities
6
6
 
7
7
  - Generates single-spec plans under `docs/plans/{YYYY-MM-DD}/{change_name}/`.
8
8
  - Generates multi-spec parallel batches under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` with a shared `coordination.md`, while keeping every batch spec independently completable and safe to implement concurrently.
9
+ - Optionally generates a batch-level `preparation.md` only when minimal non-business prerequisite work must land before specs can be implemented in parallel.
9
10
  - Uses shared templates so spec-first and brownfield workflows follow the same planning structure.
10
11
  - Requires clarification handling and explicit user approval before implementation starts.
11
12
  - Backfills task and checklist status after implementation and testing.
@@ -29,7 +30,8 @@ A shared planning skill for feature work. It centralizes creation and maintenanc
29
30
  │ ├── checklist.md
30
31
  │ ├── contract.md
31
32
  │ ├── design.md
32
- └── coordination.md
33
+ ├── coordination.md
34
+ │ └── preparation.md
33
35
  └── scripts/
34
36
  └── create-specs
35
37
  ```
@@ -64,6 +66,19 @@ apltk create-specs "Membership write path" \
64
66
  --output-dir "$WORKSPACE_ROOT/docs/plans"
65
67
  ```
66
68
 
69
+ Parallel batch with prerequisite preparation:
70
+
71
+ ```bash
72
+ apltk create-specs "Membership write path" \
73
+ --change-name membership-write-path \
74
+ --batch-name membership-cutover \
75
+ --with-coordination \
76
+ --with-preparation \
77
+ --output-dir "$WORKSPACE_ROOT/docs/plans"
78
+ ```
79
+
80
+ Use `--with-preparation` only when shared prerequisite work is required before parallel implementation. That file must stay minimal and must not contain core business logic, target user behavior, or member-spec implementation tasks.
81
+
67
82
  ```text
68
83
  docs/plans/<today>/membership-cutover/
69
84
  ├── coordination.md
@@ -82,7 +97,8 @@ docs/plans/<today>/membership-cutover/
82
97
  - `checklist.md`: use `- [ ]` only, adapt items to real scope, record actual results, and map behavior risks to test IDs plus oracles selected through `test-case-strategy`.
83
98
  - `contract.md`: when external dependencies materially shape the change, record their official-source-backed invocation surface, constraints, and caller obligations in the standard dependency-record format.
84
99
  - `design.md`: record the architecture/design delta in the standard format, including affected modules, flow, invariants, tradeoffs, and validation plan.
85
- - `coordination.md`: for multi-spec batches only, record shared preparation, ownership boundaries, replacement direction, file ownership guardrails, known collision candidates, pre-agreed edit rules for shared surfaces, shared API/schema freeze or additive-only rules, compatibility-shim retention rules, merge order, and cross-spec integration checkpoints, but never use it to make one spec depend on another spec's implementation before it can be completed.
100
+ - `coordination.md`: for multi-spec batches only, record ownership boundaries, replacement direction, file ownership guardrails, known collision candidates, pre-agreed edit rules for shared surfaces, shared API/schema freeze or additive-only rules, compatibility-shim retention rules, merge order, and cross-spec integration checkpoints, but never use it to make one spec depend on another spec's implementation before it can be completed.
101
+ - `preparation.md`: optional batch-level prerequisite plan used only when specs cannot be made parallel-safe without prior shared work; keep it tasks-like, minimal, verified, and free of core business logic or target outcomes.
86
102
  - If clarification responses change the plan, update the docs and obtain approval again before coding.
87
103
 
88
104
  ## Notes
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: generate-spec
3
- description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed `coordination.md`) from standard templates with clarification tracking, approval gating, unit drift-check planning, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update planning docs under `docs/plans/{YYYY-MM-DD}/...`.
3
+ description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed shared `coordination.md` or `preparation.md`) from standard templates with clarification tracking, approval gating, unit drift-check planning, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update planning docs under `docs/plans/{YYYY-MM-DD}/...`.
4
4
  ---
5
5
 
6
6
  # Generate Spec
@@ -15,9 +15,9 @@ description: Generate and maintain shared feature planning artifacts (`spec.md`,
15
15
  ## Standards
16
16
 
17
17
  - Evidence: Review the relevant code, configs, and authoritative docs before filling requirements or test plans; when external dependencies, libraries, frameworks, APIs, or platforms are involved, checking their official documentation is mandatory during spec creation.
18
- - Execution: Generate the planning files from this skill's current templates first, keep each spec set tightly scoped, split broader work into multiple independent spec sets when needed, ensure every batch spec is independently completable and truly parallel-implementable without depending on another spec set to land first, surface shared-file or shared-contract collision risks during planning, resolve those coordination rules before implementation starts, complete them with traceable requirements and risks, handle clarification updates, then wait for explicit approval before implementation.
19
- - Quality: Keep `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` synchronized, use `test-case-strategy` to map each planned test to a concrete risk or requirement, preserve the actual headings and field structure from this skill's templates, and tailor the templates so only applicable items remain active.
20
- - Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}/{change_name}/` for single-spec work, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` plus `coordination.md` for multi-spec parallel work whose member specs remain independently approvable, independently implementable, and ready for concurrent worktree execution with pre-agreed collision rules, and keep them concise, executable, and easy to update.
18
+ - Execution: Generate the planning files from this skill's current templates first, keep each spec set tightly scoped, split broader work into multiple independent spec sets when needed, ensure every batch spec is independently completable and truly parallel-implementable without depending on another spec set to land first, surface shared-file or shared-contract collision risks during planning, resolve those coordination rules before implementation starts, add `preparation.md` only when the specs cannot be made parallel-safe without prior shared work, keep that preparation minimal and free of core business logic or target outcomes, complete plans with traceable requirements and risks, handle clarification updates, then wait for explicit approval before implementation.
19
+ - Quality: Keep `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and any shared batch docs synchronized, use `test-case-strategy` to map each planned test to a concrete risk or requirement, preserve the actual headings and field structure from this skill's templates, and tailor the templates so only applicable items remain active.
20
+ - Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}/{change_name}/` for single-spec work, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` plus shared `coordination.md` for multi-spec parallel work. Add shared `preparation.md` at the batch root only when prerequisite work must land before member specs can run in parallel, and keep individual specs concise, executable, non-overlapping with that preparation, and easy to update.
21
21
 
22
22
  ## Goal
23
23
 
@@ -48,15 +48,20 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
48
48
  - Instead, split the work into multiple spec sets, each independently valid and each covering no more than three modules.
49
49
  - Define those spec sets so they do not conflict with each other and do not require another spec set to land first in order to be approved or implemented safely.
50
50
  - For batch generation, treat cross-spec implementation dependency as a planning bug: if Spec B cannot be completed safely until Spec A lands, they should be one spec set or be re-sliced so each spec has its own self-contained outcome.
51
- - Allow shared preparation in `coordination.md` only when each spec can still complete that preparation or operate against an already-existing baseline without waiting for another spec's code changes.
51
+ - Use `preparation.md`, not individual spec files, when the only safe way to parallelize a batch is to land shared prerequisite work before any spec starts.
52
+ - Keep `preparation.md` as small as possible: it may define enabling scaffolds, shared test fixtures, naming/contract stubs, mechanical migrations, or non-business compatibility surfaces, but it must not implement core business logic, the target user behavior, or any member spec's actual outcome.
53
+ - If the required pre-work would change business behavior, implement target logic, or satisfy a meaningful requirement by itself, re-slice it into one or more normal spec sets instead of placing it in `preparation.md`.
54
+ - Allow shared preparation only when it is completed before parallel implementation begins; do not hide required pre-work inside one member spec while other specs depend on it.
52
55
  - Treat any unresolved shared-file collision, overlapping ownership, or incompatible contract change across spec sets as a planning bug to resolve before approval, not an implementation-time surprise.
53
- - If two candidate spec sets would still need to edit the same non-additive surface, either merge them into one spec set or record a concrete ownership split plus additive-only rule that makes parallel work safe.
56
+ - If two candidate spec sets would still need to edit the same non-additive surface, either merge them into one spec set, record a concrete ownership split plus additive-only rule that makes parallel work safe, or move the shared pre-work into `preparation.md` when the pre-work can be completed once before all specs.
54
57
  - Use:
55
58
  - `WORKSPACE_ROOT=<target_project_root>`
56
59
  - `apltk create-specs "<feature_name>" --change-name <kebab-case> --output-dir "$WORKSPACE_ROOT/docs/plans"`
57
60
  - For parallel multi-spec generation, also use:
58
61
  - `--batch-name <kebab-case-batch-name>`
59
62
  - `--with-coordination`
63
+ - If and only if multiple spec sets cannot be made parallel-safe without prior shared work, also use:
64
+ - `--with-preparation`
60
65
  - Always generate:
61
66
  - `references/templates/spec.md`
62
67
  - `references/templates/tasks.md`
@@ -64,6 +69,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
64
69
  - `references/templates/contract.md`
65
70
  - `references/templates/design.md`
66
71
  - Generate `references/templates/coordination.md` at the batch root when multiple spec sets are intentionally created for parallel implementation.
72
+ - Generate `references/templates/preparation.md` at the batch root only when required prerequisite work must be completed before member specs can be parallel-implemented.
67
73
  - Save files under `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`.
68
74
  - After generation, fill the files in place without renaming, removing, or collapsing template headings unless a heading is explicitly template-only and not applicable to the real scope.
69
75
  - Before approval, compare the drafted files against the current template headings and required fields; fix any drift caused by following older project examples.
@@ -105,6 +111,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
105
111
  - Cross-reference relevant requirement IDs from `spec.md` and any external dependency records from `contract.md`.
106
112
  - Make architecture boundaries, invariants, and rollback/fallback expectations explicit when they matter to safe implementation.
107
113
  - When the spec belongs to a parallel batch, add a short reference to the parent `coordination.md`, state the exact assumptions that let this spec be implemented in parallel, and keep `design.md` focused on the single-spec delta rather than duplicating cross-spec ownership rules.
114
+ - When the batch uses `preparation.md`, write each spec's implementation guidance as if the preparation has already been completed and committed; do not duplicate preparation tasks, verification, or shared setup in member specs.
108
115
 
109
116
  ### 6.5) Fill `coordination.md` for parallel multi-spec batches
110
117
 
@@ -112,8 +119,8 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
112
119
  - Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/coordination.md`.
113
120
  - Use it as the batch-level source of truth for shared preparation, ownership boundaries, merge order, and cross-spec constraints.
114
121
  - Record explicitly that each spec set must remain independently completable and must not rely on another spec set's code changes, unfinished tasks, or merge order to achieve its own approved outcome.
115
- - Record shared fields, shared contracts, or shared data-shape preparation that multiple spec sets must align on before implementation starts.
116
- - Record whether the batch is ready for parallel implementation now; if not, list the blocking coordination items that must be settled before any spec starts.
122
+ - Record shared fields, shared contracts, or shared data-shape assumptions that multiple spec sets must align on.
123
+ - Record whether the batch is ready for parallel implementation now; if not, point to `preparation.md` for executable prerequisite work or list coordination decisions that must still be settled.
117
124
  - When one spec set replaces or removes legacy behavior, state that direction explicitly so all worktrees implement toward the same target rather than preserving the old behavior accidentally.
118
125
  - Capture which spec set may touch which modules, which files require coordination, and whether any landing order or cutover sequence must be respected.
119
126
  - Treat `coordination.md` as a merge-conflict prevention contract, not just a planning summary.
@@ -125,6 +132,20 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
125
132
  - If the batch still needs a recommended merge order, make that order operationally convenient rather than functionally required for any single spec to work correctly.
126
133
  - Keep single-spec concerns in that spec's own `design.md`; reserve `coordination.md` for batch-wide rules only.
127
134
 
135
+ ### 6.6) Fill `preparation.md` only for prerequisite work
136
+
137
+ - Create `preparation.md` only when multiple spec sets cannot be implemented safely in parallel until shared prerequisite work is completed first.
138
+ - Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/preparation.md`.
139
+ - Treat it as a pre-parallel implementation queue for the coordinating/main agent, not as another member spec.
140
+ - Write it in a tasks-like style with atomic preparation items, explicit outputs, completion conditions, and verification hooks.
141
+ - Include only the smallest shared prerequisite work that every affected spec can assume after it lands.
142
+ - Exclude core business logic, target business outcomes, user-visible behavior changes, and member-spec implementation guidance; those belong in normal spec files.
143
+ - Include relevant validation work for the preparation itself.
144
+ - Do not include member-spec implementation tasks in `preparation.md`.
145
+ - Remove overlapping instructions from member specs; specs must reference the prepared baseline as an assumption instead of repeating the setup tasks.
146
+ - If the required work is large enough to become its own product behavior slice, or if it carries core business logic, re-slice the batch instead of hiding that slice in `preparation.md`.
147
+ - If the batch can be made parallel-safe through ownership rules, additive-only constraints, or re-slicing, do not create `preparation.md`.
148
+
128
149
  ### 7) Fill `checklist.md`
129
150
 
130
151
  - Use checkbox format `- [ ]` for checklist items, except structured placeholder fields that are intentionally left for later fill-in.
@@ -153,6 +174,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
153
174
  - Update `contract.md` when the final dependency usage, obligations, or verified constraints differ from the planning draft.
154
175
  - Update `design.md` when the approved architecture changes during implementation, and record the final chosen design rather than leaving stale placeholders.
155
176
  - Update `coordination.md` when shared ownership, replacement sequencing, or cross-spec preparation changed during implementation or merge planning.
177
+ - Update `preparation.md` when prerequisite work was completed, verified, skipped with an approved reason, or changed during implementation.
156
178
  - Only mark checklist items complete when the work actually happened or the recorded decision actually applies.
157
179
  - Do not check off unused examples, placeholder rows, or non-selected decision options.
158
180
  - If different flows use different test strategies, preserve separate decision records in the final checklist instead of merging them into a misleading single summary.
@@ -167,8 +189,10 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
167
189
  - Never allow one spec set to cover more than three modules.
168
190
  - When a request exceeds that scope, split it into independent, non-conflicting, non-dependent spec sets before approval.
169
191
  - For batch specs, independence is mandatory: each spec must describe a complete slice that can be implemented, tested, reviewed, and merged without waiting for another spec in the same batch.
170
- - For batch specs, parallel readiness is also mandatory: each spec must be safe to implement concurrently, with shared-file collisions and ownership rules settled in `coordination.md` before coding begins.
192
+ - For batch specs, parallel readiness is also mandatory: each spec must be safe to implement concurrently after any approved `preparation.md` work is completed, with shared-file collisions and ownership rules settled in `coordination.md` before coding begins.
193
+ - Use `preparation.md` sparingly: it is allowed only for explicit, minimal, non-business pre-parallel shared work, not for normal cross-spec coordination or member-spec implementation.
171
194
  - When multiple spec sets are created for one batch, keep their shared implementation direction in one `coordination.md` instead of duplicating cross-spec rules in every `design.md`.
195
+ - When `preparation.md` exists, every member spec must avoid duplicating its tasks and must state its implementation assumptions against the post-preparation baseline.
172
196
  - For parallel worktree batches, make `coordination.md` specific enough that another engineer can tell which files they may edit, which shared contracts are frozen or additive-only, which shims must remain in place, and what combined behaviors need verification after merge.
173
197
  - Prefer realistic coverage over boilerplate: add or remove checklist items based on actual risk.
174
198
  - When external dependencies materially shape the change, `contract.md` is required and must capture the official-source-backed contract in the standardized record format.
@@ -191,3 +215,4 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
191
215
  - `references/templates/contract.md`: external dependency contract template.
192
216
  - `references/templates/design.md`: architecture/design delta template.
193
217
  - `references/templates/coordination.md`: parallel batch coordination template.
218
+ - `references/templates/preparation.md`: optional pre-parallel prerequisite work template.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "generate-spec"
3
3
  short_description: "Generate shared feature spec, task, and checklist docs before coding"
4
- default_prompt: "Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with a shared coordination.md, treating this skill's current references/templates/*.md files as the binding format even when older project specs use different layouts; ensure every batch spec remains independently approvable, independently implementable, and safe for true parallel execution without depending on another batch spec landing first; surface shared-file or shared-contract collision risks during planning, settle ownership and additive-only rules in coordination.md before implementation starts, fill BDD requirements, use $test-case-strategy for risk-driven test planning and unit drift checks, make tasks.md an atomic implementation queue with concrete outputs and verification hooks, document external dependency contracts in contract.md when they materially constrain the change, write the architecture/design delta in design.md, process clarification updates, and wait for explicit approval before implementation."
4
+ default_prompt: "Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with shared coordination.md and, only when specs cannot be parallel-safe without prior shared work, a minimal non-business preparation.md; treat this skill's current references/templates/*.md files as the binding format even when older project specs use different layouts, ensure member specs assume preparation is already complete and do not duplicate its tasks, surface shared-file or shared-contract collision risks during planning, settle ownership and additive-only rules in coordination.md before implementation starts, fill BDD requirements, use $test-case-strategy for risk-driven test planning and unit drift checks, make tasks.md an atomic implementation queue with concrete outputs and verification hooks, document external dependency contracts in contract.md when they materially constrain the change, write the architecture/design delta in design.md, process clarification updates, and wait for explicit approval before implementation."
@@ -9,6 +9,7 @@
9
9
  ## Parallel Readiness Gate
10
10
  - Ready for parallel implementation now: [Yes / No]
11
11
  - Blocking coordination items before coding: [None / list concrete ownership or contract decisions that must be settled first]
12
+ - Preparation document required before parallel work: [No / Yes, see `preparation.md`]
12
13
  - Re-coordination trigger: [what kind of new overlap or contract change forces the batch to stop and re-align]
13
14
 
14
15
  ## Batch Scope
@@ -22,15 +23,7 @@
22
23
  - Shared constraints: [runtime, rollout, compatibility, or ownership constraints]
23
24
  - Shared invariants: [rules every spec set must preserve]
24
25
 
25
- ## Shared Preparation
26
-
27
- ### Shared Fields / Contracts
28
- - Shared fields to introduce or reuse: [field / config / API shape / event schema]
29
- - Canonical source of truth: [which module or data owner defines them]
30
- - Required preparation before implementation: [migration, adapter, stub, flag, fallback, fixture]
31
- - Additive-only rule during batch: [what may be added safely without breaking parallel work, or `None`]
32
-
33
- ### Replacement / Legacy Direction
26
+ ## Replacement / Legacy Direction
34
27
  - Legacy behavior being replaced: [feature / flow / module / endpoint / UI]
35
28
  - Required implementation direction: [replace in place / shadow then cut over / adapter bridge / phased removal]
36
29
  - Compatibility window: [None / temporary coexistence period]
@@ -42,14 +35,12 @@
42
35
  - Primary concern: [what this spec owns]
43
36
  - Allowed touch points: [files/modules it may change]
44
37
  - Must not change: [files/modules owned by another spec unless explicitly coordinated]
45
- - Depends on shared preparation: [None / specific shared item above that already exists or can be completed within this spec]
46
38
  - Cross-spec implementation dependency: [None; if not None, re-slice the batch]
47
39
 
48
40
  ### Spec Set 2: [spec-name-2]
49
41
  - Primary concern: [what this spec owns]
50
42
  - Allowed touch points: [files/modules it may change]
51
43
  - Must not change: [files/modules owned by another spec unless explicitly coordinated]
52
- - Depends on shared preparation: [None / specific shared item above that already exists or can be completed within this spec]
53
44
  - Cross-spec implementation dependency: [None; if not None, re-slice the batch]
54
45
 
55
46
  ## Conflict Boundaries
@@ -0,0 +1,69 @@
1
+ # Preparation: [Feature Name]
2
+
3
+ - Date: [YYYY-MM-DD]
4
+ - Batch: [batch_name]
5
+
6
+ ## Preparation Goal
7
+ [Describe the smallest shared prerequisite state that must exist before member specs can be implemented in parallel. This must not implement core business logic or deliver the batch target outcome.]
8
+
9
+ ## Use Condition
10
+ - Why this file exists: [explain why the batch cannot be safely parallelized without this prerequisite work]
11
+ - Minimality rule: [why this is the smallest viable prerequisite, not a member-spec implementation slice]
12
+ - Core business boundary: [state `No core business logic or target outcome is implemented here`; if that is false, re-slice the specs instead]
13
+ - Specs that rely on this preparation: [[spec-name-1], [spec-name-2]]
14
+ - Parallel implementation starts after: [commit / verification / approval condition]
15
+ - Out of scope: [member-spec implementation work that must remain in the individual spec files]
16
+
17
+ ## Prepared Baseline
18
+ - Current baseline before preparation: [current state]
19
+ - Required baseline after preparation: [state all member specs may assume]
20
+ - Shared files or contracts prepared here: [files/modules/API/schema/config/test fixtures]
21
+ - Member specs must not repeat: [tasks/edits/verification covered by this file]
22
+ - Core business behavior changed here: [No; if yes, this file is being misused]
23
+
24
+ ## Preparation Tasks
25
+
26
+ ### **Task P1: [Preparation Task Title]**
27
+ - Purpose: [why this minimal non-business prerequisite is required before parallel work]
28
+ - Affected specs: [[spec-name-1], [spec-name-2]]
29
+ - Allowed scope: [files/modules this preparation task may touch]
30
+ - Out-of-scope guardrails: [core business logic, target outcome, and member-spec behavior that must stay out of preparation]
31
+ - Inputs: [coordination/design/contract/official-doc evidence]
32
+ - Expected output: [concrete prepared artifact or code/doc state]
33
+ - Completion condition: [observable state that proves the task is done]
34
+ - Verification hook: [command/check/review step]
35
+ - Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
36
+ - P1. [ ] [Atomic preparation action with one concrete output]
37
+ - P1. [ ] [Atomic verification or regression action]
38
+
39
+ ### **Task P2: [Preparation Task Title]**
40
+ - Purpose: [why this minimal non-business prerequisite is required before parallel work]
41
+ - Affected specs: [[spec-name-1], [spec-name-2]]
42
+ - Allowed scope: [files/modules this preparation task may touch]
43
+ - Out-of-scope guardrails: [core business logic, target outcome, and member-spec behavior that must stay out of preparation]
44
+ - Inputs: [coordination/design/contract/official-doc evidence]
45
+ - Expected output: [concrete prepared artifact or code/doc state]
46
+ - Completion condition: [observable state that proves the task is done]
47
+ - Verification hook: [command/check/review step]
48
+ - Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
49
+ - P2. [ ] [Atomic preparation action with one concrete output]
50
+ - P2. [ ] [Atomic verification or regression action]
51
+
52
+ ## Validation Plan
53
+ - Required verification before subagents start: [commands/checks]
54
+ - Expected results/assertions: [what proves the prepared baseline is usable]
55
+ - Regression risks covered: [risk IDs or behavior slices]
56
+ - Verification owner: [main/coordinating agent]
57
+
58
+ ## Handoff Contract For Member Specs
59
+ - Preparation commit required before subagents start: [Yes]
60
+ - Member specs assume: [prepared baseline assumptions]
61
+ - Member specs must not change: [prepared surfaces that are now frozen/additive-only]
62
+ - Member specs own all business behavior: [Yes]
63
+ - If preparation changes later: [stop condition and re-coordination rule]
64
+
65
+ ## Completion Record
66
+ - Preparation status: [Not started / In progress / Complete / Blocked / N/A]
67
+ - Preparation commit: [commit hash or `None yet`]
68
+ - Verification executed: [commands/checks/results]
69
+ - Remaining blockers before parallel implementation: [None / list]
@@ -14,6 +14,7 @@ TEMPLATE_FILENAMES = (
14
14
  "design.md",
15
15
  )
16
16
  COORDINATION_TEMPLATE = "coordination.md"
17
+ PREPARATION_TEMPLATE = "preparation.md"
17
18
  PLACEHOLDERS = ("[Feature Name]", "[功能名稱]")
18
19
 
19
20
 
@@ -49,7 +50,8 @@ def main() -> int:
49
50
  "Create planning docs (spec.md, tasks.md, checklist.md, contract.md, design.md) "
50
51
  "from templates with folder format docs/plans/{date}/{change_name} "
51
52
  "or docs/plans/{date}/{batch_name}/{change_name}, including coordination "
52
- "templates for truly parallel-safe batch specs."
53
+ "and optional preparation templates for batch specs that need shared "
54
+ "pre-work before parallel implementation."
53
55
  ),
54
56
  )
55
57
  parser.add_argument("feature_name", help="Display name used in generated documents")
@@ -78,6 +80,15 @@ def main() -> int:
78
80
  "for up-front ownership and collision coordination."
79
81
  ),
80
82
  )
83
+ parser.add_argument(
84
+ "--with-preparation",
85
+ action="store_true",
86
+ help=(
87
+ "When used with --batch-name, also create or update "
88
+ "docs/plans/{date}/{batch_name}/preparation.md from the shared template "
89
+ "for prerequisite work that must be completed before parallel implementation."
90
+ ),
91
+ )
81
92
  parser.add_argument(
82
93
  "--output-dir",
83
94
  default="docs/plans",
@@ -110,6 +121,8 @@ def main() -> int:
110
121
  batch_name = args.batch_name.strip() if args.batch_name else None
111
122
  if args.with_coordination and not batch_name:
112
123
  raise SystemExit("--with-coordination requires --batch-name")
124
+ if args.with_preparation and not batch_name:
125
+ raise SystemExit("--with-preparation requires --batch-name")
113
126
 
114
127
  template_dir = Path(args.template_dir).expanduser().resolve()
115
128
  if not template_dir.exists() or not template_dir.is_dir():
@@ -120,6 +133,8 @@ def main() -> int:
120
133
  ]
121
134
  if args.with_coordination and not (template_dir / COORDINATION_TEMPLATE).exists():
122
135
  missing_templates.append(COORDINATION_TEMPLATE)
136
+ if args.with_preparation and not (template_dir / PREPARATION_TEMPLATE).exists():
137
+ missing_templates.append(PREPARATION_TEMPLATE)
123
138
  if missing_templates:
124
139
  missing = ", ".join(missing_templates)
125
140
  raise SystemExit(f"Missing template files in {template_dir}: {missing}")
@@ -134,6 +149,9 @@ def main() -> int:
134
149
  coordination_path = (
135
150
  batch_root / COORDINATION_TEMPLATE if args.with_coordination and batch_root else None
136
151
  )
152
+ preparation_path = (
153
+ batch_root / PREPARATION_TEMPLATE if args.with_preparation and batch_root else None
154
+ )
137
155
  existing_files = [path for path in output_paths if path.exists()]
138
156
  if existing_files and not args.force:
139
157
  existing = ", ".join(str(path) for path in existing_files)
@@ -171,10 +189,25 @@ def main() -> int:
171
189
  encoding="utf-8",
172
190
  )
173
191
 
192
+ if preparation_path and (args.force or not preparation_path.exists()):
193
+ preparation_template = template_dir / PREPARATION_TEMPLATE
194
+ preparation_path.write_text(
195
+ _render(
196
+ content=preparation_template.read_text(encoding="utf-8"),
197
+ today=today,
198
+ feature_name=feature_name,
199
+ change_name=change_name,
200
+ batch_name=batch_name,
201
+ ),
202
+ encoding="utf-8",
203
+ )
204
+
174
205
  for output_path in output_paths:
175
206
  print(output_path)
176
207
  if coordination_path:
177
208
  print(coordination_path)
209
+ if preparation_path:
210
+ print(preparation_path)
178
211
  return 0
179
212
 
180
213
 
@@ -64,7 +64,7 @@ class CreateSpecsTests(unittest.TestCase):
64
64
  self.assertIn("batch-safe-planner", rendered)
65
65
  self.assertIn("parallel-batch", rendered)
66
66
 
67
- def test_main_creates_spec_files_and_coordination_file(self) -> None:
67
+ def test_main_creates_spec_files_and_shared_batch_files(self) -> None:
68
68
  with tempfile.TemporaryDirectory() as temp_dir:
69
69
  root = Path(temp_dir)
70
70
  template_dir = root / "templates"
@@ -80,6 +80,10 @@ class CreateSpecsTests(unittest.TestCase):
80
80
  "coordination [YYYY-MM-DD] [Feature Name] [change_name] [batch_name]\n",
81
81
  encoding="utf-8",
82
82
  )
83
+ (template_dir / MODULE.PREPARATION_TEMPLATE).write_text(
84
+ "preparation [YYYY-MM-DD] [Feature Name] [change_name] [batch_name]\n",
85
+ encoding="utf-8",
86
+ )
83
87
 
84
88
  argv = [
85
89
  "create-specs",
@@ -87,6 +91,7 @@ class CreateSpecsTests(unittest.TestCase):
87
91
  "--batch-name",
88
92
  "parallel-batch",
89
93
  "--with-coordination",
94
+ "--with-preparation",
90
95
  "--output-dir",
91
96
  str(output_dir),
92
97
  "--template-dir",
@@ -110,6 +115,35 @@ class CreateSpecsTests(unittest.TestCase):
110
115
  coordination = output_dir / "2026-04-18" / "parallel-batch" / "coordination.md"
111
116
  self.assertTrue(coordination.is_file())
112
117
  self.assertIn(str(coordination), stdout.getvalue())
118
+ preparation = output_dir / "2026-04-18" / "parallel-batch" / "preparation.md"
119
+ self.assertTrue(preparation.is_file())
120
+ self.assertIn("preparation", preparation.read_text(encoding="utf-8"))
121
+ self.assertIn(str(preparation), stdout.getvalue())
122
+
123
+ def test_main_requires_batch_name_for_preparation_file(self) -> None:
124
+ with tempfile.TemporaryDirectory() as temp_dir:
125
+ template_dir = Path(temp_dir) / "templates"
126
+ template_dir.mkdir(parents=True)
127
+ for name in MODULE.TEMPLATE_FILENAMES:
128
+ (template_dir / name).write_text("template\n", encoding="utf-8")
129
+ (template_dir / MODULE.PREPARATION_TEMPLATE).write_text(
130
+ "preparation\n",
131
+ encoding="utf-8",
132
+ )
133
+
134
+ argv = [
135
+ "create-specs",
136
+ "My Feature",
137
+ "--with-preparation",
138
+ "--template-dir",
139
+ str(template_dir),
140
+ ]
141
+
142
+ with patch.object(sys, "argv", argv):
143
+ with self.assertRaises(SystemExit) as context:
144
+ MODULE.main()
145
+
146
+ self.assertIn("--with-preparation requires --batch-name", str(context.exception))
113
147
 
114
148
  def test_main_rejects_existing_files_without_force(self) -> None:
115
149
  with tempfile.TemporaryDirectory() as temp_dir:
@@ -5,9 +5,10 @@ description: >-
5
5
  each `docs/plans/.../<change_name>/` spec directory to a separate subagent that
6
6
  uses `implement-specs-with-worktree`. Use when a user asks to implement a
7
7
  multi-spec batch with subagents, parallel agents, delegated agents, or isolated
8
- workers while keeping at most four implementation subagents active at once,
9
- staggering starts to avoid rate-limit bursts, preserving independent subagent
10
- contexts, and using the user's requested model when specified.
8
+ workers while completing any explicitly documented shared prerequisite work
9
+ before delegation, keeping at most four implementation subagents active at
10
+ once, staggering starts to avoid rate-limit bursts, preserving independent
11
+ subagent contexts, and using the user's requested model when specified.
11
12
  ---
12
13
 
13
14
  # Implement Specs with Subagents
@@ -21,9 +22,9 @@ description: >-
21
22
 
22
23
  ## Standards
23
24
 
24
- - Evidence: Read the batch-level `coordination.md` when present, enumerate the exact spec directories to implement, and verify each delegated spec has the required planning files before starting subagents.
25
- - Execution: Assign exactly one implementation subagent per spec directory, keep no more than four implementation subagents active at the same time, start subagents one at a time rather than in a burst, give each subagent an independent task-local context, and instruct every subagent to use `implement-specs-with-worktree` for its assigned spec.
26
- - Quality: Preserve spec ownership boundaries, avoid duplicate delegation for the same spec, track branch/worktree/commit/test outcomes for every subagent, and pause new launches when a shared blocker, collision, or rate-limit pressure appears.
25
+ - Evidence: Read the batch-level `coordination.md` and `preparation.md` when present, enumerate the exact spec directories to implement, verify each delegated spec has the required planning files, and identify any explicit prerequisite notes before starting subagents.
26
+ - Execution: Complete and commit explicitly documented prerequisite preparation on the working branch before delegation, then assign exactly one implementation subagent per spec directory, keep no more than four implementation subagents active at the same time, start subagents one at a time rather than in a burst, give each subagent an independent task-local context, and instruct every subagent to use `implement-specs-with-worktree` for its assigned spec.
27
+ - Quality: Preserve spec ownership boundaries, avoid duplicate delegation for the same spec, ensure subagents branch from a baseline that includes prerequisite commits, track branch/worktree/commit/test outcomes for every subagent, and pause new launches when a shared blocker, collision, or rate-limit pressure appears.
27
28
  - Output: Return a concise implementation ledger covering each spec, its subagent result, worktree branch, commit or blocker, verification run, and any integration follow-up needed.
28
29
 
29
30
  ## Goal
@@ -36,6 +37,7 @@ Coordinate a multi-spec implementation batch safely by delegating each approved
36
37
 
37
38
  - Locate the requested batch under `docs/plans/{YYYY-MM-DD}/{batch_name}/`.
38
39
  - Read `coordination.md` first when it exists.
40
+ - Read `preparation.md` when it exists.
39
41
  - Enumerate only the spec directories that are in scope for this request.
40
42
  - For each spec directory, verify the presence of:
41
43
  - `spec.md`
@@ -45,6 +47,19 @@ Coordinate a multi-spec implementation batch safely by delegating each approved
45
47
  - `design.md`
46
48
  - Do not delegate archived, sibling, or approximate specs unless the user explicitly includes them.
47
49
  - If `coordination.md` says the batch is not ready for parallel implementation, stop and report the blocking coordination item instead of spawning subagents.
50
+ - If `preparation.md` exists, or if the in-scope spec documents explicitly state that prerequisite work must be completed before parallel implementation, treat that preparation as blocking before subagent launch.
51
+
52
+ ### 1.5) Complete documented prerequisite preparation
53
+
54
+ - Use this step only when `preparation.md` exists or the specs clearly annotate required pre-work.
55
+ - The coordinating agent owns the prerequisite work; do not delegate it to implementation subagents.
56
+ - Read the preparation tasks, expected outputs, and verification hooks before editing.
57
+ - Complete only the shared prerequisite scope that all specs must assume before parallel work starts.
58
+ - Run the verification commands or checks listed for the preparation.
59
+ - Commit the preparation to the working branch that future implementation worktrees or subagents will use as their base.
60
+ - Record the preparation commit in the ledger.
61
+ - Do not start implementation subagents until the preparation commit exists and the working branch is clean.
62
+ - If preparation cannot be completed or verified, stop and report the blocker instead of launching subagents.
48
63
 
49
64
  ### 2) Build a delegation plan
50
65
 
@@ -58,6 +73,7 @@ Coordinate a multi-spec implementation batch safely by delegating each approved
58
73
  - commit
59
74
  - tests
60
75
  - blockers
76
+ - If preparation was completed, include the preparation commit that all subagents must treat as their base.
61
77
  - Determine the model policy before launch:
62
78
  - If the user specifies a model, use that model for the implementation subagents when the environment supports model selection.
63
79
  - If the user does not specify a model, let subagents use the same model or default model policy as the coordinating agent.
@@ -79,6 +95,7 @@ For each subagent, provide only task-local instructions:
79
95
  - Exact spec directory path.
80
96
  - Parent `coordination.md` path when present.
81
97
  - Requirement to use `implement-specs-with-worktree`.
98
+ - Requirement to base work on the committed prerequisite-preparation branch state when preparation was performed.
82
99
  - Requirement to read the full spec bundle before editing.
83
100
  - Requirement to implement inside its own isolated worktree.
84
101
  - Requirement to run relevant tests.
@@ -107,11 +124,13 @@ Do not pass the coordinating agent's full reasoning, unrelated sibling specs, or
107
124
  ## Working Rules
108
125
 
109
126
  - One spec directory maps to one implementation subagent.
127
+ - Explicitly documented prerequisite preparation is completed, verified, and committed by the coordinating agent before any implementation subagent starts.
110
128
  - Maximum active implementation subagents: four.
111
129
  - Subagents must be started gradually, not all at once.
112
130
  - Every subagent must have independent context scoped to its assigned spec.
113
131
  - Every implementation subagent must use `implement-specs-with-worktree`.
114
132
  - The coordinating agent owns scheduling, ledger tracking, and conflict escalation; implementation subagents own their assigned worktree commits.
133
+ - The coordinating agent owns shared prerequisite commits; implementation subagents must not redo or overlap that preparation unless the preparation commit is missing or invalid.
115
134
  - User-specified subagent model choices should be honored when supported; otherwise inherit the coordinating agent's model/default model policy.
116
135
  - Do not use this skill for a single spec unless the user explicitly wants subagent delegation.
117
136
 
@@ -119,4 +138,5 @@ Do not pass the coordinating agent's full reasoning, unrelated sibling specs, or
119
138
 
120
139
  - `implement-specs-with-worktree`: required per-spec worktree implementation workflow.
121
140
  - `generate-spec`: clarification and planning repair workflow when a batch is not ready for parallel implementation.
141
+ - `preparation.md`: optional batch-level prerequisite plan that must be completed before parallel subagent work starts.
122
142
  - `review-change-set`: optional post-implementation review workflow before merge or submission.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Implement Specs with Subagents"
3
3
  short_description: "Coordinate parallel spec worktree implementations"
4
- default_prompt: "Use $implement-specs-with-subagents to assign each approved docs/plans spec directory to one independent subagent that uses $implement-specs-with-worktree, launch at most four implementation subagents at once with staggered starts, honor any requested model when supported, track each branch, commit, test result, and blocker, and report the batch ledger without merging or pushing unless explicitly requested."
4
+ default_prompt: "Use $implement-specs-with-subagents to read coordination.md and any preparation.md first, complete and commit explicitly documented prerequisite preparation on the working branch before delegation, then assign each approved docs/plans spec directory to one independent subagent that uses $implement-specs-with-worktree, launch at most four implementation subagents at once with staggered starts, honor any requested model when supported, track each branch, commit, test result, and blocker, and report the batch ledger without merging or pushing unless explicitly requested."
@@ -3,9 +3,9 @@ name: implement-specs-with-worktree
3
3
  description: >-
4
4
  Read a specs planning set (spec.md, tasks.md, checklist.md, contract.md, design.md)
5
5
  from `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`
6
- plus parent `coordination.md` when present, and implement the approved tasks
7
- within an isolated git worktree, with every code, test, and spec edit made
8
- inside that worktree rather than the parent checkout. Use when the user asks
6
+ plus parent `coordination.md` and `preparation.md` when present, and implement
7
+ the approved tasks within an isolated git worktree, with every code, test, and
8
+ spec edit made inside that worktree rather than the parent checkout. Use when the user asks
9
9
  to implement from an existing spec set, execute a spec plan, or work on a
10
10
  feature branch without affecting the parent working tree. If not already in a
11
11
  worktree, create a new worktree with a spec-named branch from the same parent
@@ -24,7 +24,7 @@ description: >-
24
24
 
25
25
  ## Standards
26
26
 
27
- - Evidence: Read and understand the complete specs set before starting implementation, identify the authoritative parent branch that the worktree should inherit from, verify whether the requested scope is already implemented on that parent branch or current main working tree, and when the requested plan path is missing from the current worktree verify where the authoritative copy actually lives before substituting any nearby spec.
27
+ - Evidence: Read and understand the complete specs set before starting implementation, including parent `coordination.md` and `preparation.md` when present, identify the authoritative parent branch that the worktree should inherit from, verify whether the requested scope is already implemented on that parent branch or current main working tree, and when the requested plan path is missing from the current worktree verify where the authoritative copy actually lives before substituting any nearby spec.
28
28
  - Execution: Create or use an isolated worktree for implementation only when the requested spec still needs work, sync the exact approved plan set into that worktree when it is missing there, create the worktree branch from the same parent branch as the worktree base, use the spec-set name as the canonical branch/worktree name, inspect sibling worktrees for the same batch before editing shared files when parallel implementations may already be active, prefer direct `git` ref checks over brittle shell inference when deciding whether a branch or worktree already exists, and commit to a local branch when done. Do not edit product files from the parent checkout; every implementation, test, and spec backfill change must happen inside the active worktree directory after verifying `git rev-parse --show-toplevel` and `pwd` point at the same worktree root.
29
29
  - Quality: Complete all planned tasks, run relevant tests, backfill the spec documents with actual completion status, avoid dragging unrelated sibling specs into the worktree just because they share a batch directory, inspect overlapping runtime/config/shared touch points before diverging from another active sibling worktree in the same batch, revert unrelated formatter-only noise outside the spec-owned scope before committing, if branch/worktree creation reports ambiguous state re-check the actual git refs and worktree list before retrying, and when using targeted Rust `cargo test` selectors remember Cargo accepts only one positional test filter so each distinct selector needs its own confirmed command.
30
30
  - Output: Keep the worktree branch clean with only the intended implementation commits.
@@ -45,14 +45,15 @@ Implement approved spec planning sets in an isolated git worktree, ensuring the
45
45
  - prefer the exact matching plan directory from the repository's authoritative branch or main working tree over archived, approximate, or sibling plan directories
46
46
  - if the plan lives under a batch directory, sync only the requested spec directory plus the shared `coordination.md` that governs it
47
47
  - do not copy neighboring sibling spec directories into the worktree unless the user explicitly expanded scope
48
- - When the plan sits under a batch directory, also read the sibling `coordination.md` before implementation.
48
+ - When the plan sits under a batch directory, also read the sibling `coordination.md` and `preparation.md` before implementation when those files exist.
49
49
  - Read all five spec files:
50
50
  - `spec.md` — requirements and BDD behaviors
51
51
  - `tasks.md` — task breakdown
52
52
  - `checklist.md` — behavior-to-test alignment and completion tracking
53
53
  - `contract.md` — API/interface contracts
54
54
  - `design.md` — design decisions and architecture notes
55
- - If `coordination.md` exists in the parent batch directory, read it as the shared source of truth for ownership boundaries, shared preparation, replacement direction, merge order, and cross-spec integration checkpoints.
55
+ - If `coordination.md` exists in the parent batch directory, read it as the shared source of truth for ownership boundaries, replacement direction, merge order, and cross-spec integration checkpoints.
56
+ - If `preparation.md` exists in the parent batch directory, treat it as the already-completed prerequisite baseline for this spec; do not redo its tasks inside the member spec unless the preparation commit is missing or the document says the prerequisite remains blocked.
56
57
  - Understand the scope, requirements, and planned tasks before proceeding.
57
58
 
58
59
  ### 2) Check current worktree state
@@ -106,6 +107,7 @@ Use branch naming from `references/branch-naming.md`.
106
107
  - Explore the existing codebase relevant to the planned tasks.
107
108
  - Verify latest authoritative docs for involved stacks/integrations.
108
109
  - When `coordination.md` exists, respect its shared-field preparation, legacy-replacement direction, and allowed touch-point boundaries before editing.
110
+ - When `preparation.md` exists, implement against its prepared baseline assumptions and avoid duplicating preparation tasks in the member spec.
109
111
  - Implement each task in `tasks.md` systematically.
110
112
  - When `coordination.md` defines file ownership guardrails, additive-only shared-contract rules, or compatibility-shim retention requirements, treat them as blocking execution constraints rather than optional guidance.
111
113
  - For each implemented change, add appropriate tests:
@@ -128,6 +130,7 @@ After implementation and testing:
128
130
  - Mark completed tasks in `tasks.md`.
129
131
  - Update `checklist.md` with test execution results, N/A reasons, and any scope adjustments.
130
132
  - If the shared implementation direction changed, update the parent `coordination.md` as well before finishing.
133
+ - If preparation assumptions changed or were found missing, update `preparation.md` or stop for re-coordination instead of silently moving prerequisite work into the member spec.
131
134
  - Do not mark unused template examples or non-applicable items as complete.
132
135
 
133
136
  ### 6) Commit changes
@@ -158,6 +161,7 @@ After implementation and testing:
158
161
  - Complete all planned tasks before committing; do not stop with partial work.
159
162
  - Treat the specs as the source of truth for scope — do not deviate without user approval.
160
163
  - When `coordination.md` exists, treat it as the source of truth for batch-level ownership and cutover direction.
164
+ - When `preparation.md` exists, treat it as a prerequisite baseline owned outside the member spec; do not duplicate or alter its tasks unless explicitly requested.
161
165
  - Never remove a shared shim, rename a shared field, or rewrite a shared file outside the ownership map unless `coordination.md` explicitly allows that change or the user approves a coordination update first.
162
166
  - Revert formatter-only edits outside the owned spec scope before the final commit so the worktree stays reviewable and merge-safe.
163
167
  - Follow the testing standards from `enhance-existing-features` and `develop-new-features`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",