@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,134 +1,74 @@
1
1
  ---
2
2
  name: develop-new-features
3
3
  description: >-
4
- Spec-first feature development workflow for new behavior and greenfield
5
- features. Depends on `generate-spec` for shared planning artifacts and
6
- `test-case-strategy` for risk-driven test selection before coding, then
7
- implements the approved feature with focused validation.
8
- Use when users ask to design or implement new features, change product
9
- behavior, request a planning-first process, or ask for a greenfield feature.
10
- Once the approved spec set exists and implementation begins, complete all
11
- planned tasks and applicable checklist items before yielding unless the user
12
- changes scope or an external blocker prevents safe completion.
13
- Tests must not stop at happy-path validation: for business-logic changes
14
- require property-based testing unless explicitly `N/A` with reason, design
15
- adversarial/regression/authorization/idempotency/concurrency coverage where
16
- relevant, use mocks for external services in logic chains, and verify
17
- meaningful business outcomes rather than smoke-only success.
4
+ Net-new or materially new product behavior: **`generate-spec`** is mandatory (clarify → approve → only then code) with **`test-case-strategy`** backing every serious logic change—property tests required unless documented `N/A`, add adversarial/auth/idempotency/concurrency/mocks for external services, cap each spec at three modules and split coordinated batches via `coordination.md`, finish every approved `tasks.md`/`checklist.md` item or document deferrals.
5
+ Use when users ask for “new feature”, “greenfield slice”, “plan-first delivery”. Reroute typo-only UI, bug restores, or internal refactors without product impact to **`enhance-existing-features`** / **`systematic-debug`**.
6
+ Bad: editing `src/api.ts` before approval exists… Good: spec records risk tests map to requirement IDs… Typo fix in footer copy → wrong skill…
18
7
  ---
19
8
 
20
9
  # Develop New Features
21
10
 
22
11
  ## Dependencies
23
12
 
24
- - Required: `generate-spec` for `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, clarification handling, approval gating, and completion-status backfill; `test-case-strategy` for risk-driven test selection, meaningful oracle design, and unit drift checks.
13
+ - Required: `generate-spec` for shared planning artifacts and `test-case-strategy` for risk-driven test selection, oracles, and unit drift checks before coding.
25
14
  - Conditional: none.
26
15
  - Optional: none.
27
- - Fallback: If `generate-spec` or `test-case-strategy` is unavailable, stop and report the missing dependency.
16
+ - Fallback: **`generate-spec`** **or** **`test-case-strategy`** missing **stop** (no improvised planning/tests).
28
17
 
29
- ## Standards
18
+ ## Non-negotiables
30
19
 
31
- - Evidence: Review authoritative docs and the existing codebase before planning or implementation.
32
- - Execution: Use specs only for feature work that is genuinely multi-step, cross-surface, or higher risk; skip specs for obviously small/localized work and route that work to direct implementation or the appropriate maintenance skill instead.
33
- - Quality: Use `test-case-strategy` to add risk-based tests with property-based, regression, integration, E2E, adversarial, and rollback coverage when relevant.
34
- - Output: Keep the approved planning artifacts and the final implementation aligned with actual completion results.
20
+ - This skill applies to **non-trivial new behavior / greenfield**. **MUST NOT** activate for: pure bug restore; style/copy-only tweaks; trivial one-pocket config/constants; internal-only refactors/no visible behavior—these routes belong to **`enhance-existing-features`**, **`systematic-debug`**, etc., **without** new specs here.
21
+ - **When this skill applies**, **`generate-spec` is mandatory** before product code: create/update plans, BDD reqs, contracts, design, optional batch **`coordination.md`**, obtain **explicit approval**, then implement.
22
+ - **≤3 modules** per spec set; wider work multiple **independent** spec sets under batch + **`coordination.md`** (no hidden cross-deps).
23
+ - **MUST NOT** modify product code **before** approval.
24
+ - Post-approval: **all** in-scope **`tasks.md`/`checklist.md`** items complete unless deferral/blocker documented in artifacts.
25
+ - **`test-case-strategy`**: risk-first; property-based logic **required** unless documented **`N/A`**; adversarial/auth/idempotency/concurrency where relevant; mocks for externals in logic chains; oracles tied to requirements.
26
+ - Backfill all plan files + coordination when batch; no fake-completed template branches.
35
27
 
36
- ## Goal
28
+ ## Standards (summary)
37
29
 
38
- Use a shared spec-generation workflow for non-trivial new feature work, then implement the approved behavior with strong test coverage and minimal rework.
30
+ - **Evidence**: Official docs + repo architecture pass before plan lock.
31
+ - **Execution**: Route-out trivial work → spec → implement → test → backfill.
32
+ - **Quality**: Plans trace to tests; minimal speculative code.
33
+ - **Output**: Approved scope shipped + honest plan status.
39
34
 
40
35
  ## Workflow
41
36
 
42
- ### 1) Review authoritative docs first
43
-
44
- - Identify the stack, libraries, APIs, and external dependencies involved.
45
- - Use official documentation as the source of truth.
46
- - Prefer Context7 for framework/library APIs; use web for the latest official docs when needed.
47
- - Record only the references required for this feature.
48
-
49
- ### 2) Run `$generate-spec`
50
-
51
- - First decide whether the request truly belongs in this skill.
52
- - Do not use this skill or generate specs when the request is actually one of these:
53
- - bug fixes or regressions that restore intended behavior without introducing new product behavior
54
- - copy-only, styling-only, spacing-only, layout-only, or other purely presentational UI tweaks with localized impact
55
- - simple configuration, constant, feature-flag, dependency, or content updates confined to one small area
56
- - small refactors, naming cleanups, or internal code-health work with no externally visible behavior change
57
- - narrowly scoped adjustments that touch only a few files/modules and do not require cross-team alignment or approval artifacts
58
- - In those cases, do not create planning docs; instead use the appropriate direct implementation workflow (for example `enhance-existing-features` for small brownfield adjustments or `systematic-debug` for bug fixes).
59
- - Specs are required when the request is truly a non-trivial new feature, product behavior change, or greenfield project that needs shared planning.
60
- - Treat each spec set as a narrowly scoped workstream that covers at most three modules.
61
- - If the requested change would require edits across more than three modules, do not force it into one oversized spec set.
62
- - Instead, split the work into multiple independent spec sets, each covering no more than three modules.
63
- - Define those spec sets so they do not conflict with each other and do not depend on another spec set being implemented first in order to be valid.
64
- - When multiple spec sets belong to one coordinated feature batch, place them under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` and create one shared `coordination.md` at the batch root for shared preparation, ownership boundaries, replacement direction, and merge order.
65
- - Follow `$generate-spec` completely for:
66
- - generating `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 parallel batches
67
- - filling BDD requirements and risk-driven test plans
68
- - documenting external dependency contracts in `contract.md` when they materially constrain the feature
69
- - documenting the architecture/design delta in `design.md`
70
- - documenting shared preparation and implementation direction in `coordination.md` when multiple spec sets will be implemented in parallel
71
- - handling clarification responses
72
- - obtaining explicit approval before coding
73
- - backfilling document status after implementation and testing, including requirement completion in `spec.md`
74
- - Do not modify product code before the approved spec set exists.
75
-
76
- ### 3) Explore architecture and reuse opportunities
77
-
78
- - Trace entrypoints, module boundaries, data flow, and integration points relevant to the new behavior.
79
- - Identify reusable components, patterns, and configuration paths before adding new code.
80
- - Keep a concise map of likely files to modify so implementation stays scoped.
81
-
82
- ### 4) Implement after approval
83
-
84
- - Reuse existing patterns and abstractions when possible.
85
- - Keep changes focused and avoid speculative scope expansion.
86
- - Update environment examples only when new inputs are actually required.
87
- - Once approval is granted and implementation starts, treat every unchecked in-scope item in `tasks.md` and every applicable item in `checklist.md` as required work for this run.
88
- - Do not stop after a partial implementation, partial test pass, or partial doc backfill when work remains in the approved plan.
89
- - Only pause before completion if:
90
- - the user changes scope or explicitly asks to stop
91
- - a new clarification invalidates the approved plan and requires renewed approval
92
- - an external blocker (missing credentials, unavailable dependency, access restriction, broken upstream system) prevents safe completion
93
- - When blocked, record the exact unfinished items and blocker in the plan artifacts before yielding.
94
-
95
- ### 5) Testing coverage (required)
96
-
97
- Use `$test-case-strategy` for every non-trivial change.
98
-
99
- - Start from risk inventory and requirement IDs, not from the happy path.
100
- - Define test oracles before implementation and map them to `spec.md`, `tasks.md`, and `checklist.md`.
101
- - For each atomic task that changes non-trivial local logic, define a focused unit drift check or record the smallest replacement verification with a concrete `N/A` reason.
102
- - Add unit, regression, property-based, integration, E2E, adversarial, mock/fake, rollback, or no-partial-write coverage only when the risk profile warrants it.
103
- - Each planned test must have a meaningful oracle: exact business output, persisted state, emitted side effects, or intentional lack of side effects.
104
- - Run relevant tests when possible and fix failures.
105
-
106
- ### 6) Completion updates
107
-
108
- - Backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` through `$generate-spec` workflow after implementation and testing.
109
- - If the feature used a parallel batch, also backfill `coordination.md` with any final shared preparation, cutover, or ownership changes that emerged during execution.
110
- - In `spec.md`, mark each approved requirement with its actual completion state, such as completed, partially completed, deferred, or not implemented, plus brief evidence or rationale where needed.
111
- - Mark every completed task in `tasks.md`.
112
- - In `checklist.md`, update only the items that are actually applicable to the approved scope and executed validation.
113
- - In `contract.md`, keep the final external dependency contract records aligned with the implementation and verified upstream constraints.
114
- - In `design.md`, keep the final architecture/design description aligned with the implementation that actually shipped.
115
- - Do not mark template alternatives, unused example rows, or non-applicable decision branches as completed just to make the file look fully checked.
116
- - Rewrite, remove, or leave `N/A` on template-only sections so the final checklist reflects the real work rather than the starter template.
117
- - Explicitly label any truly remaining applicable item as deferred or blocked with the reason.
118
- - Report the implemented scope, test execution, and any concrete `N/A` reasons.
119
-
120
- ## Working Rules
121
-
122
- - By default, write planning docs in the user's language.
123
- - Keep implementation traceable to approved requirement IDs and planned risks.
124
- - Keep each spec set limited to at most three modules; split larger changes into independent, non-conflicting, non-dependent spec sets before approval.
125
- - When multiple spec sets are used for one feature batch, keep cross-spec rules in `coordination.md` rather than repeating them in every `design.md`.
126
- - Prefer realism over rigid templates: add or remove test coverage only when the risk profile justifies it.
127
- - Every planned test should justify a distinct risk; remove shallow duplicates that only prove the code "still runs".
128
- - Treat starter template alternatives as mutually exclusive options, not as boxes that all need to be checked.
129
- - If a spec set exists and approval has been granted, do not yield with unfinished in-scope tasks or checklist items unless the user approves a deferment or an external blocker makes completion impossible.
37
+ **Chain-of-thought:** If request is maintenance-sized, **`Pause →`** “Should I reroute?” before spending tokens on **`generate-spec`**.
38
+
39
+ ### 1) Docs & routing
40
+
41
+ - Stack/deps discovery; verify using official sources.
42
+ - **Pause →** Is this truly greenfield/feature vs fix/polish—if latter, bail to other skill?
43
+
44
+ ### 2) `generate-spec`
45
+
46
+ - Full workflow: dirs `docs/plans/{YYYY-MM-DD}/…`, batch/coord flags, clarification, **`MUST`** approval before code.
47
+ - **Pause →** Did I secretly start coding “just the types”—**hard violation**?
48
+
49
+ ### 3) Architecture map
50
+
51
+ - Reuse seams; list likely files **after** approval to stay honest to plan.
52
+
53
+ ### 4) Implement (post-approval)
54
+
55
+ - Execute tasks/checklist exhaustively unless blocker recorded with user-visible deferrals.
56
+
57
+ ### 5) Testing
58
+
59
+ - **`test-case-strategy`** mapping requirement IDs tests; drift checks/`N/A` discipline; run and fix reds.
60
+
61
+ ### 6) Completion
62
+
63
+ - Backfill **`generate-spec`**-style across **`spec/tasks/checklist/contract/design`** (+ **`coordination.md`**); requirement-level status in **`spec.md`**; strip template illusions; final report with scope + tests + `N/A`.
64
+
65
+ ## Sample hints
66
+
67
+ - **Wrong skill**: “Fix typo in footer string” ⇒ not here.
68
+ - **Right skill**: “Add export-to-CSV for dashboard” **`generate-spec`** then code + property tests on CSV invariants maybe.
69
+ - **Split**: Touches CLI + server + terraform module boundaries—three modules cap ⇒ **two spec dirs** coordinated.
130
70
 
131
71
  ## References
132
72
 
133
- - `$generate-spec`: shared planning and approval workflow.
134
- - `$test-case-strategy`: shared test selection, oracle design, and unit drift-check workflow.
73
+ - **`generate-spec`**: planning/backfill authority
74
+ - **`test-case-strategy`**: breadth/depth of tests
@@ -1,143 +1,77 @@
1
1
  ---
2
2
  name: enhance-existing-features
3
3
  description: >-
4
- Extend brownfield features by exploring the codebase first, then deciding
5
- whether shared planning docs (`spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md`) are required
6
- before coding. When specs are needed, use `generate-spec` for planning,
7
- clarification, approval, and backfill, and complete approved in-scope tasks
8
- before yielding unless scope changes or an external blocker prevents safe
9
- completion. With or without specs, use `test-case-strategy` to select and
10
- run relevant unit, property-based, regression, integration, E2E, adversarial,
11
- mock/fake, and drift-check coverage, and verify meaningful business outcomes
12
- instead of smoke-only success.
4
+ Extend brownfield systems only after reading the real modules involved: choose **`generate-spec`**/`recover-missing-plan` when user-visible scope, ambiguity, coordination, or sensitive flows demand written approval; otherwise implement directly but still run **`test-case-strategy`** on every non-trivial delta (property/adversarial/integration as risk dictates) and never check off plans without commit+test evidence.
5
+ Use for backlog work that mutates production behavior; reroute pure regressions, copy/style-only tweaks, or single-pocket config nits that restore documented intent without new surface area.
6
+ Bad: multi-service permission change with zero spec… Good: contract captures external API limits + property tests cover invariants… Single-file pagination fix matching README → targeted regression only…
13
7
  ---
14
8
 
15
9
  # Enhance Existing Features
16
10
 
17
11
  ## Dependencies
18
12
 
19
- - Required: `test-case-strategy` for risk-driven test selection, meaningful oracle design, and unit drift checks.
20
- - Conditional: `generate-spec` for shared planning docs when spec-trigger conditions are met; `recover-missing-plan` when the user points to a required `docs/plans/...` spec set that is missing, archived, or mismatched in the current workspace.
13
+ - Required: `test-case-strategy` for risk selection, oracles, drift checks.
14
+ - Conditional: **`generate-spec`** when spec triggers below fire; **`recover-missing-plan`** when user-named `docs/plans/...` is missing/archived/mismatched.
21
15
  - Optional: none.
22
- - Fallback: If `test-case-strategy` is unavailable, stop and report the missing dependency. If specs are required and `generate-spec` is unavailable, stop and report the missing dependency.
16
+ - Fallback: **`test-case-strategy`** unavailable ⇒ **stop**. Spec path required but **`generate-spec`** unavailable ⇒ **stop**.
23
17
 
24
- ## Standards
18
+ ## Non-negotiables
25
19
 
26
- - Evidence: Explore the existing codebase first and verify the latest authoritative docs for the involved stack or integrations.
27
- - Execution: Decide whether specs are required from the actual change surface, run `generate-spec` when needed, then continue through implementation, testing, and backfill until the active scope is fully reconciled; when the user asks for a specific final behavior or architectural end state, do not substitute a preparatory or partial milestone unless the user explicitly re-scopes the request.
28
- - Quality: Use `test-case-strategy` to add risk-based tests with property-based, regression, integration, E2E, adversarial, and rollback coverage when relevant.
29
- - Output: Keep implementation and any planning artifacts traceable, updated, and aligned with actual completion results.
20
+ - **MUST** explore relevant code (entrypoints, flows, integrations) **before** deciding process or editing—**MUST NOT** spec-dump or code-dump from titles alone.
21
+ - Spec path **when** any: new/changed **user-visible** behavior (not mere restore of old intent); ambiguity needing approval; multi-module alignment; critical/sensitive/irreversible/migration risk; traceability materially reduces error.
22
+ - **MUST NOT** open **`generate-spec`** for clearly tiny/localized work: pure regression to prior intent; polish-only UI copy/style; one-area config/constant/flag; narrow CRUD/validation tweak; internal refactor/observability **without** behavior change—**implement + `test-case-strategy` directly**.
23
+ - If specs: **MUST** complete **`generate-spec`** lifecycle (approval before code; backfill after); **≤3 modules** per spec set—split independent non-dependent sets + batch `coordination.md` when coordinated parallelism; **MUST NOT** code pre-approval.
24
+ - **MUST NOT** yield with approved in-scope **`tasks.md`/`checklist.md`** undone except user deferral or documented external blocker (record in plans).
25
+ - **`test-case-strategy` required** for non-trivial deltas—property/adversarial/integration etc. per risk; meaningful oracles; drift check or explicit **`N/A`** with reason per non-trivial logic task.
26
+ - External deps: **`contract.md`** records official-backed obligations when material.
27
+
28
+ ## Standards (summary)
29
+
30
+ - **Evidence**: Code exploration + official docs/APIs where touched.
31
+ - **Execution**: Explore → decide specs → docs/officials → implement → test → backfill/summary.
32
+ - **Quality**: No speculative scope expansion; reuse patterns.
33
+ - **Output**: Behavior matches ask; traceable tests; plans honest if specs used.
30
34
 
31
35
  ## Workflow
32
36
 
33
- ### 1) Explore codebase first
34
-
35
- - Read the relevant existing code before deciding process or editing anything.
36
- - Locate entrypoints, configuration, and primary data flow.
37
- - Trace module relationships (imports, call graph, shared models, side effects).
38
- - Identify integration points (DB, RPC, external APIs, queues, filesystems).
39
- - Identify user-critical logic chains affected by the change.
40
- - Summarize findings and the likely change surface before editing.
41
-
42
- ### 2) Decide whether specs are required from the requested change
43
-
44
- Use the user's requested change together with the codebase exploration results to decide whether to generate specs.
45
-
46
- Trigger specs when any of the following is true:
47
- - the change introduces new user-visible behavior, not just a bug fix restoring intended behavior
48
- - requirements are ambiguous enough that approval on written scope, tradeoffs, or edge cases is useful
49
- - multiple modules, layers, services, or teams must stay aligned
50
- - the change touches critical flows, sensitive data, permissions, money movement, migrations, or irreversible operations
51
- - the risk profile is high enough that explicit requirement-to-test traceability will materially reduce mistakes
52
-
53
- Do not generate specs when the work is clearly small and localized, such as:
54
- - bug fixes or regressions that restore already-intended behavior without changing product scope
55
- - pure frontend polish: copy tweaks, styling, spacing, alignment, responsive touch-ups, visual cleanup, or simple template/view wiring
56
- - small configuration, constant, dependency, content, or feature-flag updates confined to one area
57
- - straightforward CRUD field additions, validation message tweaks, or one-path handler adjustments with limited blast radius
58
- - refactors, renames, dead-code cleanup, or observability-only changes that do not alter user-visible behavior
59
-
60
- When in doubt, prefer direct implementation for genuinely low-risk localized changes, and reserve specs for changes whose scope or risk would benefit from explicit approval artifacts.
61
-
62
- If triggered:
63
- - If the user already points to a specific `docs/plans/...` path and that plan set is missing or mismatched in the current workspace, run `$recover-missing-plan` before deciding whether to continue implementation or backfill.
64
- - Run `$generate-spec` and follow its workflow completely.
65
- - Use it to create or update `docs/plans/{YYYY-MM-DD}/{change_name}/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`.
66
- - Keep each spec set scoped to at most three modules.
67
- - If the requested change would require edits across more than three modules, split it into multiple spec sets instead of drafting one large coupled plan.
68
- - Design the split spec sets so they are independently valid, do not conflict with each other, and do not require another spec set to land first.
69
- - When multiple spec sets are created for one coordinated change, place them under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` and maintain one batch-level `coordination.md` that records shared preparation, ownership boundaries, replacement direction, and merge order.
70
- - Ensure planned behaviors and edge cases cover external dependency states, abuse/adversarial paths, and any relevant authorization/idempotency/concurrency/data-integrity risks.
71
- - When external dependencies materially constrain the change, make sure `contract.md` captures their official-source-backed invocation surface, constraints, and caller obligations.
72
- - Make sure `design.md` captures the architecture/design delta, affected modules, control flow, and tradeoff decisions for the approved scope.
73
- - After implementation and testing, update the same plan set so `spec.md` reflects requirement completion status in addition to task and checklist progress.
74
- - If users answer clarification questions, update the planning docs and obtain explicit approval again before implementation.
75
- - Do not modify implementation code before approval.
76
- - Once approval is granted, do not stop with unchecked in-scope items remaining in `tasks.md` or applicable unchecked items in `checklist.md` unless the user explicitly defers them or an external blocker prevents safe completion.
77
-
78
- If not triggered:
79
- - Continue directly with the same downstream workflow below.
80
-
81
- ### 3) Verify latest authoritative docs
82
-
83
- - Identify the tech stack, libraries, and external dependencies involved.
84
- - Use official documentation as the source of truth.
85
- - Prefer Context7 for framework/library APIs; use web for latest official docs.
86
- - If required docs are private or missing, request access or user-provided references.
87
-
88
- ### 4) Implement the feature
89
-
90
- - Reuse existing patterns and abstractions; avoid over-engineering.
91
- - Keep changes focused and minimal; preserve current behavior unless required.
92
- - Follow project conventions (naming, linting, formatting, configuration).
93
- - Update environment examples only when new inputs are required.
94
- - If specs exist, treat every unchecked in-scope task and applicable checklist item as part of the required deliverable for this run.
95
- - Do not stop after partial code changes, partial tests, or partial backfill when approved planned work remains.
96
- - Do not present an enabling first stage, temporary coalescing step, or other intermediate milestone as complete when the user asked for the final scoped behavior.
97
- - Only pause before completion if:
98
- - the user changes scope or explicitly asks to stop
99
- - new clarification requires plan updates and renewed approval
100
- - an external blocker (missing credentials, unavailable dependency, access restriction, broken upstream system) prevents safe completion
101
- - When blocked, record the exact unfinished items and blocker in the spec set before yielding.
102
-
103
- ### 5) Testing coverage (required with or without specs)
104
-
105
- Use `$test-case-strategy` for every non-trivial change, even when specs are skipped.
106
-
107
- - Start from risk inventory and changed behavior, not from the happy path.
108
- - Define test oracles before implementation when the change is planned, and before finalizing tests when the change is discovered during brownfield exploration.
109
- - For each atomic task that changes non-trivial local logic, define a focused unit drift check or record the smallest replacement verification with a concrete `N/A` reason.
110
- - Add unit, regression, property-based, integration, E2E, adversarial, mock/fake, rollback, or no-partial-write coverage only when the risk profile warrants it.
111
- - Each planned test must have a meaningful oracle: exact business output, persisted state, emitted side effects, or intentional lack of side effects.
112
- - Run relevant tests when possible and fix failures.
113
-
114
- ### 6) Completion updates
115
-
116
- - If specs were used, backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` through `$generate-spec` workflow based on actual completion and test outcomes.
117
- - If the change used a parallel batch, update `coordination.md` whenever shared preparation, legacy replacement direction, or merge constraints changed during execution.
118
- - In `spec.md`, mark each relevant requirement with its actual completion state, such as completed, partially completed, deferred, or not implemented, plus brief evidence or rationale where needed.
119
- - If specs were used, mark every completed task in `tasks.md`.
120
- - If specs were used, update only the applicable checklist items that correspond to real scope, chosen test strategy, and actual execution.
121
- - If specs were used, update `contract.md` so the documented dependency obligations and constraints match the implemented reality.
122
- - If specs were used, update `design.md` so the architecture/design record matches the delivered implementation.
123
- - Do not mark unused template examples, mutually exclusive alternatives, or non-applicable branches as completed.
124
- - Remove, rewrite, or leave `N/A` on starter-template items when they do not belong to the real change.
125
- - Explicitly label any still-applicable remaining item as deferred or blocked with the reason.
126
- - If specs were not used, provide a concise execution summary including test IDs/results, regression coverage, mock scenario coverage, adversarial coverage, and any `N/A` reasons.
127
-
128
- ## Working Rules
129
-
130
- - Keep the solution minimal and executable.
131
- - Always decide the need for specs only after exploring the existing codebase.
132
- - When specs are used, keep each spec set limited to at most three modules; split broader work into independent, non-conflicting, non-dependent spec sets before approval.
133
- - When specs are split for parallel worktree implementation, keep batch-wide rules only in `coordination.md` rather than copying them into every spec-local `design.md`.
134
- - Maintain traceability between requirements, tasks, and tests when specs are present.
135
- - Treat checklists as living artifacts: adjust items to match real change scope.
136
- - Treat mutually exclusive template choices as a decision to record, not multiple boxes to finish.
137
- - Every planned test should justify a distinct risk; remove shallow duplicates that only prove the code "still runs".
138
- - If a spec set exists and approval has been granted, do not yield with unfinished in-scope tasks or checklist items unless the user approves a deferment or an external blocker makes completion impossible.
37
+ **Chain-of-thought:** **`Pause →`** after explorations and spec decision—wrong classification wastes days.
38
+
39
+ ### 1) Explore codebase
40
+
41
+ - Map modules, integrations, blast radius.
42
+ - **Pause →** Can I state **one paragraph** concrete change surface before editing?
43
+
44
+ ### 2) Decide specs
45
+
46
+ - Apply Non-negotiable triggers above; if doubt favors **implement-only** **only when** genuinely low-risk localized.
47
+ - If specs: broken path ⇒ **`recover-missing-plan`** then **`generate-spec`** (templates, clarification loop, approval). Parallel batch rules per **`generate-spec`**. If **not** specs: complete step 2 with “no specs” rationale, then continue with steps 3–6 (still run official-doc pass when external surfaces change).
48
+ - **Pause →** Am I dodging specs just to avoid bureaucracy while scope is multi-team/critical?
49
+
50
+ ### 3) Authoritative docs
51
+
52
+ - Official docs / Context7 / web for libs used in change.
53
+
54
+ ### 4) Implement
55
+
56
+ - Minimal diffs preserving behavior unless tasked otherwise; specs ⇒ every in-scope unchecked item delivered; intermediate milestones ≠ user’s final asked outcome unless rescoped.
57
+
58
+ ### 5) Testing (always for non-trivial)
59
+
60
+ - **`test-case-strategy`**: inventory risk tests with oracles run/fix.
61
+
62
+ ### 6) Completion
63
+
64
+ - With specs: backfill **`spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md`** (+ **`coordination.md`** if batch truth moved). **`spec.md`** requirement status honest. Strip template noise / `N/A` properly.
65
+ - Without specs: concise summary citing tests/results/`N/A` reasons.
66
+
67
+ ## Sample hints
68
+
69
+ - **Spec yes**: Adds new permission model affecting API+DB+UI—the blast radius crosses layers.
70
+ - **Spec no**: Off-by-one in existing pagination restoring documented behavior—fix + regression test.
71
+ - **Split**: Touches auth, billing, infra—**three plans** capped modules, **`coordination.md`** collision map.
139
72
 
140
73
  ## References
141
74
 
142
- - `$generate-spec`: shared planning and approval workflow.
143
- - `$test-case-strategy`: shared test selection, oracle design, and unit drift-check workflow.
75
+ - **`generate-spec`**: planning/backfill lifecycle
76
+ - **`test-case-strategy`**: tests + drift philosophy
77
+ - **`recover-missing-plan`**: heal missing dirs