@laitszkin/apollo-toolkit 3.8.3 → 3.9.0

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 (27) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/align-project-documents/SKILL.md +49 -121
  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/commit-and-push/SKILL.md +52 -75
  7. package/develop-new-features/SKILL.md +53 -113
  8. package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
  9. package/enhance-existing-features/SKILL.md +59 -125
  10. package/generate-spec/SKILL.md +86 -197
  11. package/generate-spec/references/templates/checklist.md +33 -88
  12. package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
  13. package/implement-specs/SKILL.md +47 -43
  14. package/implement-specs-with-subagents/SKILL.md +69 -165
  15. package/implement-specs-with-worktree/SKILL.md +53 -102
  16. package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
  17. package/maintain-project-constraints/SKILL.md +53 -105
  18. package/maintain-skill-catalog/SKILL.md +46 -42
  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/review-spec-related-changes/SKILL.md +49 -82
  25. package/solve-issues-found-during-review/SKILL.md +46 -106
  26. package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
  27. package/version-release/SKILL.md +52 -88
@@ -1,217 +1,106 @@
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 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}/...`.
3
+ description: >-
4
+ Author planning trees under docs/plans: run `apltk create-specs`, hydrate templates (`spec/tasks/checklist/contract/design`; add `coordination.md`/`preparation.md` when parallel/prep dictates), cite official docs for every material external dependency, plan tests with **`test-case-strategy`**, and block product code changes until explicit user approval completes.
5
+ Use when drafting or refreshing specs before coding, restructuring multi-member batches, or recording clarifications—not when simply executing tasks from an approved plan (**`implement-specs*`** family instead).
6
+ Reject ALWAYS vague `tasks.md` lines missing file target + mutation + verifier; SPLIT work when scope exceeds three modules; never overwrite a neighboring `{change}` directory for a different issue.
7
+ Example bad: `- [ ] Add tests`… Example ok: `- [ ] src/auth/scope.rs — deny unknown scopes — Verify: cargo test scope::defaults`…
4
8
  ---
5
9
 
6
10
  # Generate Spec
7
11
 
8
12
  ## Dependencies
9
13
 
10
- - Required: `test-case-strategy` for risk-driven test case selection, meaningful oracle design, and unit drift-check planning.
14
+ - Required: `test-case-strategy` for risk-driven test selection, oracles, and unit drift-check planning.
11
15
  - Conditional: none.
12
16
  - Optional: none.
13
- - Fallback: If `test-case-strategy` is unavailable, stop and report the missing dependency instead of inventing test coverage heuristics locally.
17
+ - Fallback: If `test-case-strategy` is unavailable, **MUST** stop and report it. **MUST NOT** invent local coverage heuristics as a substitute.
14
18
 
15
- ## Standards
19
+ ## Non-negotiables
16
20
 
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. Follow the scoping, independence, and parallel-safety rules in Working Rules. Surface shared-file or shared-contract collision risks during planning and resolve coordination rules before implementation starts. Use `preparation.md` only when needed; keep that preparation minimal and free of core business logic or target outcomes (see Working Rules). 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
+ - **MUST** read relevant code, config, and authoritative external documentation before writing requirements, contracts, or test plans. When the change depends on frameworks, libraries, SDKs, APIs, CLIs, or hosted services, **MUST** consult **official** documentation during spec creation (required evidence step, not optional).
22
+ - **MUST** generate new or refreshed files from this skills **`references/templates/*.md`** via `apltk create-specs` (paths `scripts/...` and `references/...` in this document are **under this skill folder**, not the target project). **MUST NOT** let older `docs/plans/...` layouts override current template headings or required fields; old plans are scope evidence only.
23
+ - **MUST NOT** overwrite or repurpose a neighboring plan directory just because topics overlap; adjacent scope **MUST** get a new `change_name` unless it is the **same** issue/change.
24
+ - **MUST** keep each spec set to **at most three modules** that will be touched. If broader, **MUST** split into multiple spec sets (each ≤3 modules), each independently valid; **MUST NOT** ship one oversized coupled plan.
25
+ - **MUST** use batch-root `preparation.md` **only** for minimal shared prerequisite work that must land before parallel implementation; keep that preparation minimal and free of core business logic or target outcomes (see Working Rules). **`preparation.md` content boundary**: enabling scaffolds, shared fixtures, stubs, mechanical migrations, compatibility surfaces—**no** core business logic, **no** target user-visible outcomes (those stay in normal specs). Exclude core business logic, target business outcomes, user-visible behavior changes, and member-spec implementation guidance; those belong in normal spec files.
26
+ - **`tasks.md` checklist items**: **every** `- [ ]` **MUST** specify (a) concrete file/function target, (b) specific modification and expected outcome, (c) a verification hook—**no** vague rows (`Implement integration`, `Add tests`). Forbidden vague items **MUST** be rewritten before approval.
27
+ - **MUST** use `test-case-strategy` when planning non-trivial logic tests and checklist mapping (test IDs, drift checks). Every **non-trivial** `tasks.md` implementation item **MUST** name a focused unit drift check, another concrete verification hook, or **`N/A`** with a concrete reason.
28
+ - **MUST NOT** modify implementation code before **explicit user approval** of the spec set. Clarifications **MUST** sync across affected files and **MUST** re-trigger approval. If scope becomes a **different issue**, **MUST** stop editing the old set and create a **new** `change_name`.
29
+ - Write prose in the **user’s language** by default; keep requirement/task/test IDs traceable across `spec.md`, `tasks.md`, and `checklist.md`.
30
+ - **MUST** use **kebab-case** `change_name`; **MUST NOT** use spaces or arbitrary special characters in names.
21
31
 
22
- ## Goal
32
+ ## Standards (summary)
23
33
 
24
- Own the shared planning-doc lifecycle for feature work so other skills can reuse one consistent spec-generation workflow.
34
+ - **Evidence**: Official docs when externally constrained; record cites in `spec.md` / `contract.md`.
35
+ - **Execution**: Scaffold → fill templates in place → clarification loop → approval gate → (later) backfill after implementation.
36
+ - **Quality**: Synchronized artifacts; applicable template sections only; realistic checklist vs boilerplate (add/remove by risk); finalized docs read as an approved plan, not a fully checked starter; `contract.md` standardized records or honest `None` with reason.
37
+ - **Output**: `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`; batch root `coordination.md` when intentionally parallel; `preparation.md` only when prerequisite batch work is required first.
25
38
 
26
39
  ## Workflow
27
40
 
28
- ### 1) Gather inputs and evidence
29
-
30
- - Confirm the target workspace root, feature name, and a kebab-case `change_name`.
31
- - Review only the code, configuration, and external docs needed to understand the requested behavior.
32
- - If the change depends on frameworks, libraries, SDKs, APIs, CLIs, hosted services, or other external systems, find and read the relevant official documentation before drafting requirements.
33
- - Treat official documentation lookup as mandatory evidence gathering, not an optional refinement step.
34
- - Use the official docs to verify expected behavior, supported constraints, configuration surface, integration contracts, and any implementation limits that should shape the spec.
35
- - Record the references that should appear in `spec.md` and the dependency evidence that should appear in `contract.md`.
36
- - Inspect existing `docs/plans/` directories before deciding whether to edit an existing plan set.
37
- - Reuse an existing plan set only when it clearly matches the same requested issue/change scope.
38
- - If the requested work is adjacent to, but not actually covered by, an existing plan set, create a new directory instead of overwriting the neighboring one.
39
- - Treat existing or archived project-local specs as scope evidence only, not as formatting authority.
40
- - Do not copy older spec layouts, condensed repo conventions, or neighboring plan structures when they differ from this skill's current templates.
41
-
42
- ### 2) Generate the planning files
43
-
44
- - Resolve paths from this skill directory, not the target project directory.
45
- - Before generating files, identify the concrete modules that would be touched by the requested change.
46
- - Keep each spec set scoped to at most three modules.
47
- - If the requested work would span more than three modules, do not draft one oversized coupled plan.
48
- - Instead, split the work into multiple spec sets, each independently valid and each covering no more than three modules.
49
- - See Working Rules for the independence rule.
50
- - 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.
51
- - Keep `preparation.md` small: it may define enabling scaffolds, shared test fixtures, naming/contract stubs, mechanical migrations, or non-business compatibility surfaces. See Working Rules for the preparation.md rule.
52
- - 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.
53
- - See Working Rules for the parallel-safety rule.
54
- - 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.
55
- - Use:
56
- - `WORKSPACE_ROOT=<target_project_root>`
57
- - `apltk create-specs "<feature_name>" --change-name <kebab-case> --output-dir "$WORKSPACE_ROOT/docs/plans"`
58
- - For parallel multi-spec generation, also use:
59
- - `--batch-name <kebab-case-batch-name>`
60
- - `--with-coordination`
61
- - If and only if multiple spec sets cannot be made parallel-safe without prior shared work, also use:
62
- - `--with-preparation`
63
- - Always generate:
64
- - `references/templates/spec.md`
65
- - `references/templates/tasks.md`
66
- - `references/templates/checklist.md`
67
- - `references/templates/contract.md`
68
- - `references/templates/design.md`
69
- - Generate `references/templates/coordination.md` at the batch root when multiple spec sets are intentionally created for parallel implementation.
70
- - Generate `references/templates/preparation.md` at the batch root only when required prerequisite work must be completed before member specs can be parallel-implemented.
71
- - Save files under `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`.
72
- - 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.
73
- - Before approval, compare the drafted files against the current template headings and required fields; fix any drift caused by following older project examples.
74
-
75
- ### 3) Fill `spec.md`
76
-
77
- - Keep the goal and scope concrete.
78
- - Ensure the described scope and requirements do not contradict the relevant official documentation or integration contracts.
79
- - Write functional behaviors in BDD form with `GIVEN`, `WHEN`, `THEN`, `AND`, and `Requirements`.
80
- - Make each requirement testable.
81
- - Cover boundaries, authorization, external dependency states, abuse/adversarial paths, failure handling, and any relevant idempotency/concurrency/data-integrity risks.
82
- - Record the official-doc references actually used for the spec, especially for external dependency behavior and constraints.
83
- - If requirements are unclear, list 3-5 clarification questions; otherwise write `None`.
84
-
85
- ### 4) Fill `tasks.md`
86
-
87
- - Use `## **Task N: [Task Title]**` for each main task with `Purpose`, `Requirements`, `Scope`, and `Out of scope` guardrails.
88
- - Use `- N. [ ]` for atomic task items; use `- N.x [ ]` only when a task must be split into additional atomic subtasks.
89
- - Treat `tasks.md` as an implementation queue, not a high-level summary.
90
- - **Every checkbox must specify three things: (a) the exact file path or function, (b) the specific modification to make, and (c) a concrete verification step.** These three are mandatory — no item may omit any of them.
91
- - Per-item format (compact template):
92
- - `[file/function]` — `[specific modification; expected outcome]`
93
- - `- Verify:` — focused command, test reference, or manual inspection
94
- - Do not add extra sub-fields beyond what the template provides; put all change detail in the inline description.
95
- - Make each checkbox atomic: one verb, one file/function, one change outcome, and one verification hook.
96
- - If one task needs more than three files, more than one behavior slice, or an implementation decision not already captured in `design.md` or `contract.md`, split it before approval.
97
- - Use `$test-case-strategy` to define test IDs and unit drift checks for non-trivial local logic before implementation starts.
98
- - Include explicit tasks for testing, mocks/fakes, regression coverage, and adversarial or edge-case hardening when relevant.
99
- - Vague items such as `Implement integration`, `Add tests`, or `Update docs` are forbidden; replace them with specific file paths, concrete changes, and executable verification commands.
100
-
101
- ### 5) Fill `contract.md`
102
-
103
- - When the change uses external dependencies, libraries, frameworks, SDKs, APIs, CLIs, hosted services, or other upstream systems, document each material dependency in a standardized dependency record.
104
- - For each dependency, capture the official source, the invocation surface, required inputs, expected outputs, supported behavior, limits, compatibility constraints, security/access requirements, failure contract, and caller obligations.
105
- - Record constraints and forbidden assumptions explicitly so later implementation and review do not rely on unstated expectations.
106
- - If no external dependency materially constrains the change, write `None` and a brief scope-based reason instead of inventing a fake dependency record.
107
-
108
- ### 6) Fill `design.md`
109
-
110
- - Write the architecture/design delta related to the current spec in a standardized format.
111
- - Identify the affected modules, current baseline, proposed architecture, component responsibilities, control flow, data/state impact, and risk/tradeoff decisions.
112
- - Cross-reference relevant requirement IDs from `spec.md` and any external dependency records from `contract.md`.
113
- - Make architecture boundaries, invariants, and rollback/fallback expectations explicit when they matter to safe implementation.
114
- - 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.
115
- - 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.
116
-
117
- ### 6.5) Fill `coordination.md` for parallel multi-spec batches
118
-
119
- - Create `coordination.md` only when one user request is intentionally split into multiple spec sets that may be implemented in parallel.
120
- - Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/coordination.md`.
121
- - Use it as the batch-level source of truth organized in three sections: **Business Goals**, **Design Principles**, and **Spec Boundaries**.
122
- - Keep single-spec concerns in that spec's own `design.md`; reserve `coordination.md` for batch-wide rules only.
123
- - See Working Rules for the independence rule.
124
-
125
- **Business Goals** — Record the shared batch outcome, list the member spec sets, state parallel readiness, and note shared exclusions. If the batch is not ready, point to `preparation.md` or list blocking coordination items.
126
-
127
- **Design Principles** — Record the current baseline, shared invariants and constraints that every spec must preserve, legacy replacement direction, compatibility windows, and post-cutover cleanup. Keep these high-level and cross-cutting; leave per-spec design decisions in each `design.md`.
128
-
129
- **Spec Boundaries** — Split into two sub-sections:
130
- - **Ownership Map**: For each spec set, list its primary concern, allowed touch points, and forbidden touch points. This is the merge-conflict prevention contract.
131
- - **Collisions & Integration**: Record shared-file edit rules, API/schema freeze owners, compatibility shim retention rules, merge order, post-merge integration checkpoints, and the re-coordination trigger. Every known collision candidate must have a pre-agreed resolution.
132
-
133
- ### 6.6) Fill `preparation.md` only for prerequisite work
134
-
135
- - Create `preparation.md` only when multiple spec sets cannot be implemented safely in parallel until shared prerequisite work is completed first.
136
- - Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/preparation.md`.
137
- - Treat it as a pre-parallel implementation queue for the coordinating/main agent, not as another member spec.
138
- - Follow a tasks.md-like structure with a **Preparation Goal** header, atomic preparation tasks, a **Validation** section, and a **Handoff** section.
139
- - In **Preparation Goal**, state why this prerequisite is necessary, confirm that no core business logic is implemented here, list which specs depend on it, and define when parallel work can start.
140
- - In each **Task P[N]**, use the same compact format as `tasks.md`: a one-line Purpose, Scope, and Out of scope guardrails, followed by atomic checkbox items with concrete file paths, modifications, 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
- - In **Validation**, list the verification commands, expected results, and regression risks that prove the prepared baseline is ready.
144
- - In **Handoff**, record what member specs may assume, what they must not change, and the re-coordination rule if preparation changes later.
145
- - Remove overlapping instructions from member specs; specs must reference the prepared baseline as an assumption instead of repeating the setup tasks.
146
- - See Working Rules for the parallel-safety rule.
147
-
148
- ### 7) Fill `checklist.md`
149
-
150
- - Use checkbox format `- [ ]` for checklist items, except structured placeholder fields that are intentionally left for later fill-in.
151
- - Treat the template as a starting point and adapt it to the actual scope.
152
- - Remove or rewrite template examples that are not part of the real plan instead of leaving them as fake work to be checked later.
153
- - Map observable behaviors to requirement IDs and real test case IDs.
154
- - Use `$test-case-strategy` to choose the smallest test level that proves each risk and to define meaningful oracles before implementation.
155
- - Record risk class, oracle/assertion focus, dependency strategy, and test results.
156
- - Property-based coverage is required for business-logic changes unless a concrete `N/A` reason is recorded.
157
- - For decision sections, create as many records as needed for distinct flows or risk slices; do not collapse unrelated decisions into one record.
158
- - Within each decision record, keep only the selected strategy or clearly mark the non-selected path as `N/A`; never treat mutually exclusive choices inside one record as multiple completed outcomes.
159
- - For completion-summary sections, create as many completion records as needed for distinct flows, requirement groups, or workstreams; do not force the whole spec into a single completion line when different parts finish differently.
160
-
161
- ### 8) Process clarifications and approval
162
-
163
- - When the user answers clarification questions, first update the clarification and approval section in `checklist.md`.
164
- - Review whether `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` must be updated.
165
- - After any clarification-driven update, obtain explicit approval on the updated spec set again.
166
- - Do not modify implementation code before approval.
167
- - When clarification reveals the work is a different issue or materially different scope than the current plan set, stop editing that plan set and generate a new one with a distinct `change_name`.
168
-
169
- ### 9) Backfill after implementation and testing
170
-
171
- - Mark completed tasks in `tasks.md`.
172
- - Update `checklist.md` with real test outcomes, `N/A` reasons, and any scope adjustments.
173
- - Update `contract.md` when the final dependency usage, obligations, or verified constraints differ from the planning draft.
174
- - Update `design.md` when the approved architecture changes during implementation, and record the final chosen design rather than leaving stale placeholders.
175
- - Update `coordination.md` when shared ownership, replacement sequencing, or cross-spec preparation changed during implementation or merge planning.
176
- - Update `preparation.md` when prerequisite work was completed, verified, skipped with an approved reason, or changed during implementation.
177
- - Only mark checklist items complete when the work actually happened or the recorded decision actually applies.
178
- - Do not check off unused examples, placeholder rows, or non-selected decision options.
179
- - If different flows use different test strategies, preserve separate decision records in the final checklist instead of merging them into a misleading single summary.
180
- - If different parts of the approved scope have different completion states, preserve separate completion records in the final checklist instead of flattening them into one ambiguous status.
181
- - Remove stale placeholders or template-only guidance once the documents are finalized.
182
-
183
- ## Working Rules
184
-
185
- - By default, write planning docs in the user's language.
186
- - Keep requirement IDs, task IDs, and test IDs traceable across all three files.
187
- - Every non-trivial implementation task must have either a focused unit drift check, another concrete verification hook, or an explicit `N/A` reason.
188
- - Never allow one spec set to cover more than three modules.
189
- - When a request exceeds that scope, split it into independent, non-conflicting, non-dependent spec sets before approval.
190
- - 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.
191
- - 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.
192
- - 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.
193
- - 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`.
194
- - When `preparation.md` exists, every member spec must avoid duplicating its tasks and must state its implementation assumptions against the post-preparation baseline.
195
- - 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.
196
- - Prefer realistic coverage over boilerplate: add or remove checklist items based on actual risk.
197
- - When external dependencies materially shape the change, `contract.md` is required and must capture the official-source-backed contract in the standardized record format.
198
- - `design.md` is required and must describe the architecture/design delta for the spec in the standardized format, even when the final design is intentionally minimal.
199
- - Finalized planning docs should read like the actual approved plan and execution record, not like a fully checked starter template.
200
- - If official documentation materially constrains implementation choices, reflect that constraint explicitly in the spec instead of leaving it implicit.
201
- - Use kebab-case for `change_name`; avoid spaces and special characters.
202
- - Path rule: `scripts/...` and `references/...` in this file always mean paths under the current skill folder, not the target project root.
203
- - Never overwrite a nearby issue's plan set just because the technical area overlaps; shared modules are not sufficient evidence that the scope is the same.
204
- - Template authority rule: the current `references/templates/*.md` files in this skill are the binding format for new or refreshed spec documents. Older `docs/plans/...` files may inform scope, terminology, and historical decisions, but they must not override the current template structure.
205
- - Before presenting specs for approval, run a template-drift pass: verify the expected template sections are present, remove stale placeholder examples, and ensure any removed section has a scope-based reason rather than being omitted because an older project spec omitted it.
41
+ **Chain-of-thought:** For every subsection **`N)`**, answer **`Pause →`** prompts before scaffolding or authoring the next subsection; unanswered external constraints or ambiguous scope mean **stop** or **loop** clarifications—not silent drafting.
42
+
43
+ ### 1) Inputs and evidence
44
+
45
+ Confirm workspace root, feature title, kebab-case `change_name`. Review minimal code/config. **Mandatory** official-doc pass when external systems apply; note sources for `spec.md` / `contract.md`. Inspect existing `docs/plans/`—reuse a set **only** when it matches **this** issue; otherwise create a new directory.
46
+ - **Pause →** Which **official** URLs or docs did I actually consult for each external dependency I plan to cite—URLs not opened are not citations?
47
+ - **Pause →** Is the user ask the **same** issue as an existing nearby plan—or only **adjacent**, requiring a **new** `change_name`?
48
+ - **Pause →** What is the smallest set of repo paths whose behavior I **must** read before writing requirements truthfully?
49
+
50
+ ### 2) Scaffold planning files
51
+
52
+ Identify concrete modules (≤3 per set; split if needed). Resolve shared collision: merge spec sets, additive-only ownership rules in `coordination.md`, or `preparation.md` when one-time shared prep is the only safe path.
53
+
54
+ Run from this skill’s context (templates resolved from this skill dir):
55
+
56
+ ```bash
57
+ WORKSPACE_ROOT=<target_project_root>
58
+ apltk create-specs "<feature_name>" --change-name <kebab-case> --output-dir "$WORKSPACE_ROOT/docs/plans"
59
+ ```
60
+
61
+ Multi-spec parallel batch: add `--batch-name <kebab-case>` and `--with-coordination`. **Only** if parallel safety needs prior shared work: add `--with-preparation`.
62
+
63
+ Always materialize: `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md` from `references/templates/`. Add `coordination.md` / `preparation.md` at batch root only when flags require. Save under `docs/plans/{YYYY-MM-DD}/...`. After generation, fill in place **without** removing template headings unless truly N/A (document reason). Run a **template-drift pass** before approval: sections present, placeholders removed or justified.
64
+ - **Pause →** List the **module names** (≤3) this spec set will touch; if more, where is my **split plan**?
65
+ - **Pause →** For every shared file two specs might touch, where is the **named** resolution in `coordination.md` or why is `preparation.md` required instead?
66
+ - **Pause →** Did I run `apltk create-specs` from the **skill** context so template paths resolve correctly?
67
+
68
+ ### 3) Author content (fill templates)
69
+
70
+ - **`spec.md`**: Concrete scope; BDD (`GIVEN` / `WHEN` / `THEN` / `AND` / `Requirements`); testable requirements; boundaries, auth, failure, idempotency/concurrency/integrity where relevant; doc references; `3-5` clarification questions or `None`.
71
+ - **`tasks.md`**: `## **Task N: [Title]**` with Purpose, Requirements, Scope, Out of scope; atomic `- N [ ]` lines obeying the triple requirement above; split tasks that exceed three files / multiple behavior slices / undocumented decisions; integrate `test-case-strategy` for test IDs and drift checks for non-trivial logic.
72
+ - **`contract.md`**: One record per material external dependency (source, surface, I/O, limits, security, failures); else `None` + short reason—**no** fabricated deps.
73
+ - **`design.md`**: Delta vs baseline; modules, responsibilities, flow, state, risks; cross-ref requirement IDs; parallel batch: pointer to `coordination.md`, assumptions for safe concurrency, **no** duplicating batch rules; with `preparation.md`, assume prep **done**—**do not** duplicate prep tasks.
74
+ - **`coordination.md`** (batch root, parallel only): **Business Goals** (outcome, member specs, parallel readiness, exclusions, blockers → `preparation.md` or list); **Design Principles** (baseline, shared invariants, compat, cleanup—high level); **Spec Boundaries** → **Ownership Map** (allowed/forbidden touchpoints per spec) and **Collisions & Integration** (shared-file rules, freeze owners, merge order, checkpoints, re-coordination trigger)—**every** collision candidate **MUST** have a named resolution.
75
+ - **`preparation.md`** (batch root, only if required): Preparation Goal (why, no core business logic, dependents, start condition); **Task P[N]** like `tasks.md` (atomic triple items); **Validation**; **Handoff** (assumptions, must-not-change, if prep changes later). Strip duplicate prep from member specs.
76
+ - **`checklist.md`**: `- [ ]` adapted to scope; map behaviors to requirement/test IDs via `test-case-strategy`; behavior lines `[CL-xx]: … — R?.? → [Test IDs] — Result: …`; property-based logic **required** unless `N/A` + reason; honest execution/completion records—**no** checking unused examples or unchosen options.
77
+ - **Pause →** Pick one **random** `tasks.md` checkbox: does it still fail the triple rule (target, change, verify)—if yes, rewrite now?
78
+ - **Pause →** Does every **R** requirement ID I care about appear in `tasks.md` or `checklist.md` with a test or explicit `N/A`?
79
+ - **Pause →** For parallel batches, does `design.md` **avoid** duplicating what `coordination.md` already owns?
80
+
81
+ ### 4) Clarifications and approval
82
+
83
+ On answers: update clarification/approval section in `checklist.md` first, then any of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`; **MUST** obtain approval again after material edits. **MUST NOT** touch product code pre-approval.
84
+ - **Pause →** Am I about to “just fix a small bug” in product code before explicit approval—**why is that not a hard stop**?
85
+ - **Pause →** After the last edit, does the user still owe an **explicit** approval token, or did I assume silence means yes?
86
+
87
+ ### 5) Backfill after implementation
88
+
89
+ When implementation exists: mark `tasks.md`; sync `checklist.md` outcomes/`N/A`; fix `contract.md` / `design.md` if reality diverged; update `coordination.md` / `preparation.md` if ownership or prep status changed. Checklist complete **only** for work actually done or decisions actually taken; separate rows for divergent flows; remove stale placeholders.
90
+ - **Pause →** For each checked item, what **evidence** (commit, test log) would a reviewer use to agree it is true?
91
+ - **Pause →** Did implementation reality change **shared** ownership or prep assumptions—if so, which batch file records that?
92
+
93
+ ## Sample hints
94
+
95
+ - **`tasks.md` line bad**: `- [ ] Add tests` **reject** (no path, change, verifier).
96
+ - **`tasks.md` line ok**:
97
+ `- [ ] src/auth/scope.rs — add deny-by-default matcher for unknown scopes · Verify: cargo test scope::defaults`
98
+ - **Batch scaffold** (three member specs): `WORKSPACE_ROOT=... apltk create-specs "OAuth batch" --change-name oauth-api --batch-name oauth-may-batch --with-coordination --output-dir "$WORKSPACE_ROOT/docs/plans"` (then repeat or use generator rules for additional `change-name` dirs as your tooling permits).
99
+ - **`checklist.md` behavior row sketch**: `[CL-01]: invalid token rejected — R2.1 → TU-Scope-01,TU-Scope-02 — Result: pending`
100
+ - **Split-trigger**: change touches `src/auth/*`, `src/cli/*`, `src/db/*`, `infra/terraform/*` (four modules) **minimum two spec sets**, not one.
206
101
 
207
102
  ## References
208
103
 
209
- - `$test-case-strategy`: shared test case selection, oracle design, and unit drift-check workflow.
210
- - `scripts/create-specs`: shared planning file generator, exposed as `apltk create-specs`.
211
- - `references/templates/spec.md`: BDD requirement template.
212
- - `references/templates/tasks.md`: task breakdown template.
213
- - `references/templates/checklist.md`: behavior-to-test alignment template.
214
- - `references/templates/contract.md`: external dependency contract template.
215
- - `references/templates/design.md`: architecture/design delta template.
216
- - `references/templates/coordination.md`: parallel batch coordination template.
217
- - `references/templates/preparation.md`: optional pre-parallel prerequisite work template.
104
+ - `test-case-strategy`: test design and drift checks
105
+ - `scripts/create-specs` / `apltk create-specs`: generator
106
+ - `references/templates/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, `coordination.md`, `preparation.md`: binding templates
@@ -4,104 +4,49 @@
4
4
  - Feature: [Feature Name]
5
5
 
6
6
  ## Usage Notes
7
- - This checklist is a starter template. Add, remove, or rewrite items based on actual scope.
8
- - Use `- [ ]` for all items; mark completed items as `- [x]`.
9
- - The final completion summary section may use structured placeholders instead of checkboxes.
10
- - If an item is not applicable, keep `N/A` with a concrete reason.
11
- - Do not mark placeholder examples or mutually exclusive alternatives as completed unless they were actually selected and executed.
12
- - Duplicate or remove decision-record blocks as needed; the final document should contain as many records as the real change requires.
13
- - Duplicate or remove completion-record blocks as needed; the final document should contain as many records as the real change requires.
14
- - Suggested test result values: `PASS / FAIL / BLOCKED / NOT RUN / N/A`.
15
- - Use `$test-case-strategy` to choose test levels, define meaningful oracles, and record unit drift checks for atomic tasks.
16
- - For business-logic changes, property-based coverage is required unless a concrete `N/A` reason is recorded.
17
- - Each checklist item should map to a distinct risk; avoid repeating shallow happy-path cases.
18
7
 
19
- ## Clarification & Approval Gate (required when clarification replies exist)
20
- - [ ] User clarification responses are recorded (map to `spec.md`; if none, mark `N/A`).
21
- - [ ] Affected plans are reviewed/updated (`spec.md` / `tasks.md` / `checklist.md` / `contract.md` / `design.md`; if no updates needed, mark `N/A` + reason).
22
- - [ ] Explicit user approval on updated specs is obtained (date/conversation reference: [to be filled]).
8
+ - Add/remove items based on actual scope; keep only applicable items.
9
+ - Use `$test-case-strategy` for test level selection, oracle design, and drift-check planning.
10
+ - Property-based coverage required for business-logic changes unless `N/A` with reason.
11
+ - Test result values: `PASS / FAIL / BLOCKED / NOT RUN / N/A`.
23
12
 
24
- ## Behavior-to-Test Checklist (customizable)
13
+ ## Clarification & Approval Gate
25
14
 
26
- - [ ] CL-01 [Observable behavior]
27
- - Requirement mapping: [R1.x]
28
- - Actual test case IDs: [UT/PBT/IT/E2E-xx]
29
- - Test level: [Unit / Property-based / Integration / E2E]
30
- - Risk class: [boundary / authorization / concurrency / external failure / data integrity / adversarial abuse / regression]
31
- - Property/matrix focus: [invariant / generated business input space / external state matrix / adversarial case]
32
- - External dependency strategy: [none / mocked service states / near-real dependency]
33
- - Oracle/assertion focus: [exact output / persisted state / side effects / no partial write / compensation / emitted event / permission denial]
34
- - Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
35
- - Test result: `PASS / FAIL / BLOCKED / NOT RUN / N/A`
36
- - Notes (optional): [risk, limitation, observation]
15
+ - [ ] Clarification responses recorded (or `N/A` if none).
16
+ - [ ] Affected plans updated after clarification (or `N/A` + reason).
17
+ - [ ] Explicit approval obtained (date/ref: [to be filled]).
37
18
 
38
- - [ ] CL-02 [Observable behavior]
39
- - Requirement mapping: [R?.?]
40
- - Actual test case IDs: [UT/PBT/IT/E2E-xx]
41
- - Test level: [Unit / Property-based / Integration / E2E]
42
- - Risk class: [boundary / authorization / concurrency / external failure / data integrity / adversarial abuse / regression]
43
- - Property/matrix focus: [invariant / generated business input space / external state matrix / adversarial case]
44
- - External dependency strategy: [none / mocked service states / near-real dependency]
45
- - Oracle/assertion focus: [exact output / persisted state / side effects / no partial write / compensation / emitted event / permission denial]
46
- - Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
47
- - Test result: `PASS / FAIL / BLOCKED / NOT RUN / N/A`
48
- - Notes (optional): [risk, limitation, observation]
19
+ ## Behavior-to-Test Checklist
49
20
 
50
- - [ ] CL-03 [Observable behavior]
51
- - Requirement mapping: [R?.?]
52
- - Actual test case IDs: [UT/PBT/IT/E2E-xx]
53
- - Test level: [Unit / Property-based / Integration / E2E]
54
- - Risk class: [boundary / authorization / concurrency / external failure / data integrity / adversarial abuse / regression]
55
- - Property/matrix focus: [invariant / generated business input space / external state matrix / adversarial case]
56
- - External dependency strategy: [none / mocked service states / near-real dependency]
57
- - Oracle/assertion focus: [exact output / persisted state / side effects / no partial write / compensation / emitted event / permission denial]
58
- - Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
59
- - Test result: `PASS / FAIL / BLOCKED / NOT RUN / N/A`
60
- - Notes (optional): [risk, limitation, observation]
21
+ - [ ] CL-01: [Observable behavior] — R?.? → [Test IDs] — Result: `[status]`
22
+ - [ ] CL-02: [Observable behavior] — R?.? → [Test IDs] — Result: `[status]`
23
+ - [ ] CL-03: [Observable behavior] — R?.? → [Test IDs] — Result: `[status]`
61
24
 
62
- ## Required Hardening Records
63
- - [ ] Regression tests are added/updated for bug-prone or high-risk behavior, or `N/A` is recorded with a concrete reason.
64
- - [ ] Focused unit drift checks are defined for non-trivial atomic implementation tasks, or `N/A` is recorded with the replacement verification and concrete reason.
65
- - [ ] Property-based coverage is added/updated for changed business logic, or `N/A` is recorded with a concrete reason.
66
- - [ ] External services in the business logic chain are mocked/faked for scenario testing, or `N/A` is recorded with a concrete reason.
67
- - [ ] Adversarial/penetration-style cases are added/updated for abuse paths and edge combinations, or `N/A` is recorded with a concrete reason.
68
- - [ ] Authorization, invalid transition, replay/idempotency, and concurrency risks are evaluated; uncovered items are marked `N/A` with concrete reasons.
69
- - [ ] Assertions verify business outcomes and side effects/no-side-effects, not only "returns 200" or "does not throw".
70
- - [ ] Test fixtures are reproducible (fixed seed/clock/fixtures) or `N/A` is recorded with a concrete reason.
25
+ ## Hardening Checklist
71
26
 
72
- ## E2E / Integration Decision Records
27
+ - [ ] Regression tests for bug-prone/high-risk behavior (or `N/A` + reason).
28
+ - [ ] Unit drift checks for non-trivial tasks (or `N/A` + reason).
29
+ - [ ] Property-based coverage for business logic (or `N/A` + reason).
30
+ - [ ] External services mocked/faked (or `N/A` + reason).
31
+ - [ ] Adversarial cases for abuse paths (or `N/A` + reason).
32
+ - [ ] Authorization, idempotency, concurrency risks evaluated (or `N/A` + reason).
33
+ - [ ] Assertions verify outcomes/side-effects, not just "returns 200".
34
+ - [ ] Fixtures reproducible (fixed seed/clock) (or `N/A` + reason).
73
35
 
74
- ### Decision Record 1: [Flow / Requirement / Risk Slice]
75
- - Requirement mapping: [R?.? / CL-xx]
76
- - Decision: [Build E2E / Cover with integration instead / Existing coverage already sufficient / N/A]
77
- - Linked case IDs: [E2E-xx / IT-xx / existing suite reference]
78
- - Reason: [importance, cross-layer risk, stability/cost tradeoff, or why no extra coverage is needed]
36
+ ## E2E / Integration Decisions
79
37
 
80
- ### Decision Record 2: [Flow / Requirement / Risk Slice]
81
- - Requirement mapping: [R?.? / CL-xx]
82
- - Decision: [Build E2E / Cover with integration instead / Existing coverage already sufficient / N/A]
83
- - Linked case IDs: [E2E-xx / IT-xx / existing suite reference]
84
- - Reason: [importance, cross-layer risk, stability/cost tradeoff, or why no extra coverage is needed]
38
+ - [ ] [Flow/Risk]: [E2E / Integration replacement / Existing coverage / N/A] — Reason: [why]
85
39
 
86
- ## Execution Summary (fill with actual results)
87
- - [ ] Unit tests: `PASS / FAIL / NOT RUN / N/A`
88
- - [ ] Regression tests: `PASS / FAIL / NOT RUN / N/A`
89
- - [ ] Property-based tests: `PASS / FAIL / NOT RUN / N/A`
90
- - [ ] Integration tests: `PASS / FAIL / NOT RUN / N/A`
91
- - [ ] E2E tests: `PASS / FAIL / NOT RUN / N/A`
92
- - [ ] External service mock scenarios: `PASS / FAIL / NOT RUN / N/A`
93
- - [ ] Adversarial/penetration-style cases: `PASS / FAIL / NOT RUN / N/A`
40
+ ## Execution Summary
94
41
 
95
- ## Completion Records
42
+ - [ ] Unit: `[status]`
43
+ - [ ] Regression: `[status]`
44
+ - [ ] Property-based: `[status]`
45
+ - [ ] Integration: `[status]`
46
+ - [ ] E2E: `[status]`
47
+ - [ ] Mock scenarios: `[status]`
48
+ - [ ] Adversarial: `[status]`
96
49
 
97
- ### Completion Record 1: [Flow / Requirement Group / Workstream]
98
- - Requirement mapping: [R?.? / Task N / CL-xx]
99
- - Completion status: [completed / partially completed / blocked / deferred]
100
- - Remaining applicable items: [None / list remaining items]
101
- - Notes: [brief execution-backed summary]
50
+ ## Completion Records
102
51
 
103
- ### Completion Record 2: [Flow / Requirement Group / Workstream]
104
- - Requirement mapping: [R?.? / Task N / CL-xx]
105
- - Completion status: [completed / partially completed / blocked / deferred]
106
- - Remaining applicable items: [None / list remaining items]
107
- - Notes: [brief execution-backed summary]
52
+ - [ ] [Flow/Group]: [completed / partial / blocked / deferred] — Remaining: [None / list]