@laitszkin/apollo-toolkit 2.12.8 → 2.13.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.
package/AGENTS.md CHANGED
@@ -44,6 +44,7 @@ This repository enables users to install and run a curated set of reusable agent
44
44
  - Users can configure OpenClaw from official documentation, including `~/.openclaw/openclaw.json`, skills loading, SecretRefs, CLI edits, and validation or repair workflows.
45
45
  - Users can investigate production or local simulation runs, calibrate reusable presets, and fix toolchain realism gaps between harness behavior and expected on-chain behavior.
46
46
  - Users can record multi-account spending and balance changes in monthly Excel ledgers with summary analytics and charts.
47
+ - Users can recover missing or archived `docs/plans/...` spec sets from issue context, git history, and repository evidence before continuing feature work.
47
48
  - Users can review the current git change set from an unbiased reviewer perspective to find abstraction opportunities and simplification candidates.
48
49
  - Users can process GitHub pull request review comments and resolve addressed threads.
49
50
  - Users can perform repository-wide code reviews and publish confirmed findings as GitHub issues.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,18 @@ All notable changes to this repository are documented in this file.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [v2.13.0] - 2026-04-05
8
+
9
+ ### Added
10
+ - Add `recover-missing-plan` for restoring or reconstructing missing `docs/plans/...` plan sets from repository evidence, git history, and authoritative issue context before implementation continues.
11
+ - Expand `generate-spec` with standardized `contract.md` and `design.md` templates plus generator support so plan sets can capture external dependency contracts and architecture deltas alongside `spec.md`, `tasks.md`, and `checklist.md`.
12
+
13
+ ### Changed
14
+ - Update `develop-new-features`, `enhance-existing-features`, `archive-specs`, and related agent prompts to treat `contract.md` and `design.md` as first-class planning artifacts wherever `generate-spec` is used.
15
+ - Update `ship-github-issue-fix` to require `recover-missing-plan` when a referenced `docs/plans/...` path is missing or archived unexpectedly.
16
+ - Expand repository capability docs and skill inventory to include `recover-missing-plan` and the broader five-file planning workflow.
17
+ - Strengthen `weekly-financial-event-report` so it checks for an existing report covering the same research window before regenerating output, and requires exact calendar dates for exchange/session timing when reporting market-sensitive follow-up.
18
+
7
19
  ## [v2.12.7] - 2026-04-02
8
20
 
9
21
  ### Added
package/README.md CHANGED
@@ -36,6 +36,7 @@ A curated skill catalog for Codex, OpenClaw, and Trae with a managed installer t
36
36
  - openai-text-to-image-storyboard
37
37
  - openclaw-configuration
38
38
  - production-sim-debug
39
+ - recover-missing-plan
39
40
  - record-spending
40
41
  - resolve-review-comments
41
42
  - review-change-set
@@ -146,6 +147,7 @@ The install commands below were checked with the Skills CLI unless otherwise not
146
147
  Compatibility note:
147
148
 
148
149
  - `generate-spec` is a local skill used by `develop-new-features` and `enhance-existing-features`.
150
+ - `recover-missing-plan` is a local skill used by `enhance-existing-features` and `ship-github-issue-fix` when a referenced `docs/plans/...` spec set is missing or archived.
149
151
  - `maintain-skill-catalog` can conditionally use `find-skills`, but its install source is not verified in this repository, so it is intentionally omitted from the table.
150
152
  - `read-github-issue` uses GitHub CLI (`gh`) directly for remote issue discovery and inspection, so it does not add any extra skill dependency.
151
153
 
@@ -4,7 +4,7 @@ A documentation skill that converts completed spec files into standardized proje
4
4
 
5
5
  ## Core capabilities
6
6
 
7
- - Scans `spec.md`, `tasks.md`, and `checklist.md` collections as documentation input.
7
+ - Scans `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` collections as documentation input.
8
8
  - Reconciles spec claims against code, config, scripts, and deployment files.
9
9
  - Standardizes both new and existing project docs into topic-based files for setup, configuration, architecture, features, and developer onboarding.
10
10
  - Provides dedicated reference templates for the top-level README, the documentation index/reference list, and each category document.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: archive-specs
3
- description: Convert completed project spec sets into maintainable project documentation and archive the consumed planning files. Use when users want to consolidate `spec.md`/`tasks.md`/`checklist.md` files into evidence-backed docs covering installation and deployment, configuration, external service setup, architecture, feature introductions, and developer onboarding context.
3
+ description: Convert completed project plan sets into maintainable project documentation and archive the consumed planning files. Use when users want to consolidate `spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md` files into evidence-backed docs covering installation and deployment, configuration, external service setup, architecture, feature introductions, and developer onboarding context.
4
4
  ---
5
5
 
6
6
  # Archive Specs
@@ -27,7 +27,7 @@ Convert completed planning artifacts into stable, standardized project documenta
27
27
 
28
28
  ### 1) Inventory documentation sources
29
29
 
30
- - Find all relevant planning files such as `docs/plans/**/spec.md`, `tasks.md`, and `checklist.md`.
30
+ - Find all relevant planning files such as `docs/plans/**/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`.
31
31
  - Read existing `README*`, deployment scripts, manifests, env examples, infra files, CI configs, and representative source modules.
32
32
  - Build a source map for setup commands, environments, external services, module boundaries, and implemented features.
33
33
 
@@ -89,7 +89,7 @@ Ensure the split project docs cover all of the following:
89
89
  ### 7) Archive superseded spec files after successful conversion
90
90
 
91
91
  - After the standardized project docs are complete and verified, archive the old source spec files that were converted.
92
- - Prefer moving the consumed `spec.md`, `tasks.md`, and `checklist.md` files, or their containing plan directory, into a clearly marked archive path instead of leaving them mixed with active docs.
92
+ - Prefer moving the consumed `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` files, or their containing plan directory, into a clearly marked archive path instead of leaving them mixed with active docs.
93
93
  - Delete converted spec files only when the repository clearly does not need historical retention.
94
94
  - Do not archive or delete any spec file that is still actively needed for unfinished implementation work.
95
95
  - Treat a spec file as active when it still records pending gaps, planned later phases, follow-up integration work, or unresolved design decisions for the same change, even if one implementation commit has already shipped.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "archive-specs"
3
3
  short_description: "Convert completed specs into project docs and archive the consumed plans"
4
- default_prompt: "Use $archive-specs to inventory the project's spec.md/tasks.md/checklist.md files, reconcile them with the current repository, rewrite existing project docs into a standardized categorized structure when needed, generate or update a concise README plus split project docs for getting started, configuration, architecture, features, and developer guidance, maintain a docs/README.md reference list, then archive the consumed source specs after successful conversion, deleting them only when the repository clearly does not need historical retention."
4
+ default_prompt: "Use $archive-specs to inventory the project's spec.md/tasks.md/checklist.md/contract.md/design.md files, reconcile them with the current repository, rewrite existing project docs into a standardized categorized structure when needed, generate or update a concise README plus split project docs for getting started, configuration, architecture, features, and developer guidance, maintain a docs/README.md reference list, then archive the consumed source plans after successful conversion, deleting them only when the repository clearly does not need historical retention."
@@ -5,10 +5,10 @@ A spec-first feature development skill for new behavior and greenfield work. It
5
5
  ## Key capabilities
6
6
 
7
7
  - Requires `generate-spec` before any implementation starts.
8
- - Treats `spec.md`, `tasks.md`, and `checklist.md` as approval-gated artifacts, not optional notes.
8
+ - Treats `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` as approval-gated artifacts, not optional notes.
9
9
  - Covers unit, regression, property-based, integration, E2E, and adversarial testing based on actual risk.
10
10
  - Reuses existing architecture and avoids speculative expansion.
11
- - Backfills `spec.md`, `tasks.md`, and `checklist.md` after implementation and testing complete.
11
+ - Backfills `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` after implementation and testing complete.
12
12
  - Once approval is granted and implementation starts, finishes all in-scope planned tasks and applicable checklist items before yielding unless the user defers work or an external blocker prevents safe completion.
13
13
 
14
14
  ## Repository layout
@@ -33,7 +33,7 @@ A spec-first feature development skill for new behavior and greenfield work. It
33
33
  2. Run `generate-spec` to create and maintain `docs/plans/{YYYY-MM-DD}_{change_name}/`.
34
34
  3. Wait for explicit approval on the spec set.
35
35
  4. Implement the approved behavior with minimal changes.
36
- 5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, and `checklist.md`.
36
+ 5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`.
37
37
 
38
38
  ## Testing expectations
39
39
 
@@ -20,7 +20,7 @@ description: >-
20
20
 
21
21
  ## Dependencies
22
22
 
23
- - Required: `generate-spec` for `spec.md`, `tasks.md`, `checklist.md`, clarification handling, approval gating, and completion-status backfill.
23
+ - Required: `generate-spec` for `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, clarification handling, approval gating, and completion-status backfill.
24
24
  - Conditional: none.
25
25
  - Optional: none.
26
26
  - Fallback: If `generate-spec` is unavailable, stop and report the missing dependency.
@@ -54,15 +54,17 @@ Use a shared spec-generation workflow for non-trivial new feature work, then imp
54
54
  - simple configuration, constant, feature-flag, dependency, or content updates confined to one small area
55
55
  - small refactors, naming cleanups, or internal code-health work with no externally visible behavior change
56
56
  - narrowly scoped adjustments that touch only a few files/modules and do not require cross-team alignment or approval artifacts
57
- - In those cases, do not create `spec.md` / `tasks.md` / `checklist.md`; instead use the appropriate direct implementation workflow (for example `enhance-existing-features` for small brownfield adjustments or `systematic-debug` for bug fixes).
57
+ - 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).
58
58
  - Specs are required when the request is truly a non-trivial new feature, product behavior change, or greenfield project that needs shared planning.
59
59
  - Treat each spec set as a narrowly scoped workstream that covers at most three modules.
60
60
  - If the requested change would require edits across more than three modules, do not force it into one oversized spec set.
61
61
  - Instead, split the work into multiple independent spec sets, each covering no more than three modules.
62
62
  - 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.
63
63
  - Follow `$generate-spec` completely for:
64
- - generating `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, and `checklist.md`
64
+ - generating `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`
65
65
  - filling BDD requirements and risk-driven test plans
66
+ - documenting external dependency contracts in `contract.md` when they materially constrain the feature
67
+ - documenting the architecture/design delta in `design.md`
66
68
  - handling clarification responses
67
69
  - obtaining explicit approval before coding
68
70
  - backfilling document status after implementation and testing, including requirement completion in `spec.md`
@@ -108,10 +110,12 @@ Rules:
108
110
 
109
111
  ### 6) Completion updates
110
112
 
111
- - Backfill `spec.md`, `tasks.md`, and `checklist.md` through `$generate-spec` workflow after implementation and testing.
113
+ - Backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` through `$generate-spec` workflow after implementation and testing.
112
114
  - 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.
113
115
  - Mark every completed task in `tasks.md`.
114
116
  - In `checklist.md`, update only the items that are actually applicable to the approved scope and executed validation.
117
+ - In `contract.md`, keep the final external dependency contract records aligned with the implementation and verified upstream constraints.
118
+ - In `design.md`, keep the final architecture/design description aligned with the implementation that actually shipped.
115
119
  - Do not mark template alternatives, unused example rows, or non-applicable decision branches as completed just to make the file look fully checked.
116
120
  - Rewrite, remove, or leave `N/A` on template-only sections so the final checklist reflects the real work rather than the starter template.
117
121
  - Explicitly label any truly remaining applicable item as deferred or blocked with the reason.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Develop New Features"
3
3
  short_description: "Spec-first feature development that depends on generate-spec"
4
- default_prompt: "Use $develop-new-features to design new behavior through a spec-first workflow: review the required external docs, run $generate-spec to create and maintain docs/plans/<date>_<change_name>/{spec.md,tasks.md,checklist.md}, wait for explicit approval, then complete the approved implementation end-to-end with risk-driven tests and full backfill of spec.md, tasks.md, and checklist.md before yielding, unless the user changes scope or an external blocker prevents safe completion."
4
+ default_prompt: "Use $develop-new-features to design new behavior through a spec-first workflow: review the required external docs, run $generate-spec to create and maintain docs/plans/<date>_<change_name>/{spec.md,tasks.md,checklist.md,contract.md,design.md}, wait for explicit approval, document material external dependency contracts in contract.md, document the architecture/design delta in design.md, then complete the approved implementation end-to-end with risk-driven tests and full backfill of spec.md, tasks.md, checklist.md, contract.md, and design.md before yielding, unless the user changes scope or an external blocker prevents safe completion."
@@ -33,7 +33,7 @@ A brownfield feature-extension skill: map dependencies first, decide whether sha
33
33
  2. Trigger `generate-spec` only when the change is high complexity, hits a critical module, or crosses module boundaries.
34
34
  3. Wait for explicit approval if planning docs were generated.
35
35
  4. Implement the smallest safe brownfield change.
36
- 5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, and `checklist.md` when specs exist.
36
+ 5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` when specs exist.
37
37
 
38
38
  ## Test requirements
39
39
 
@@ -2,7 +2,7 @@
2
2
  name: enhance-existing-features
3
3
  description: >-
4
4
  Extend brownfield features by exploring the codebase first, then deciding
5
- whether shared specs (`spec.md`/`tasks.md`/`checklist.md`) are required
5
+ whether shared planning docs (`spec.md`/`tasks.md`/`checklist.md`/`contract.md`/`design.md`) are required
6
6
  before coding. When specs are needed, use `generate-spec` for planning,
7
7
  clarification, approval, and backfill, and complete approved in-scope tasks
8
8
  before yielding unless scope changes or an external blocker prevents safe
@@ -17,7 +17,7 @@ description: >-
17
17
  ## Dependencies
18
18
 
19
19
  - Required: `generate-spec` for shared planning docs when spec-trigger conditions are met.
20
- - Conditional: none.
20
+ - Conditional: `recover-missing-plan` when the user points to a required `docs/plans/...` spec set that is missing, archived, or mismatched in the current workspace.
21
21
  - Optional: none.
22
22
  - Fallback: If specs are required and `generate-spec` is unavailable, stop and report the missing dependency.
23
23
 
@@ -64,12 +64,15 @@ Do not generate specs when the work is clearly small and localized, such as:
64
64
  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.
65
65
 
66
66
  If triggered:
67
+ - 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.
67
68
  - Run `$generate-spec` and follow its workflow completely.
68
- - Use it to create or update `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, and `checklist.md`.
69
+ - Use it to create or update `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`.
69
70
  - Keep each spec set scoped to at most three modules.
70
71
  - 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.
71
72
  - 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.
72
73
  - Ensure planned behaviors and edge cases cover external dependency states, abuse/adversarial paths, and any relevant authorization/idempotency/concurrency/data-integrity risks.
74
+ - When external dependencies materially constrain the change, make sure `contract.md` captures their official-source-backed invocation surface, constraints, and caller obligations.
75
+ - Make sure `design.md` captures the architecture/design delta, affected modules, control flow, and tradeoff decisions for the approved scope.
73
76
  - After implementation and testing, update the same plan set so `spec.md` reflects requirement completion status in addition to task and checklist progress.
74
77
  - If users answer clarification questions, update the planning docs and obtain explicit approval again before implementation.
75
78
  - Do not modify implementation code before approval.
@@ -120,10 +123,12 @@ Rules:
120
123
 
121
124
  ### 6) Completion updates
122
125
 
123
- - If specs were used, backfill `spec.md`, `tasks.md`, and `checklist.md` through `$generate-spec` workflow based on actual completion and test outcomes.
126
+ - 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.
124
127
  - 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.
125
128
  - If specs were used, mark every completed task in `tasks.md`.
126
129
  - If specs were used, update only the applicable checklist items that correspond to real scope, chosen test strategy, and actual execution.
130
+ - If specs were used, update `contract.md` so the documented dependency obligations and constraints match the implemented reality.
131
+ - If specs were used, update `design.md` so the architecture/design record matches the delivered implementation.
127
132
  - Do not mark unused template examples, mutually exclusive alternatives, or non-applicable branches as completed.
128
133
  - Remove, rewrite, or leave `N/A` on starter-template items when they do not belong to the real change.
129
134
  - Explicitly label any still-applicable remaining item as deferred or blocked with the reason.
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "enhance-existing-features"
3
3
  short_description: "Extend brownfield features with conditional generate-spec planning and risk-driven tests"
4
- default_prompt: "Use $enhance-existing-features to extend a brownfield feature: map the affected code and dependencies first, decide whether the change is high complexity / critical module / cross-module, run $generate-spec when specs are required, wait for explicit approval before coding, and always add risk-driven tests plus clear N/A reasons when a category truly does not apply; if a spec set exists, finish the approved tasks and applicable checklist items and backfill spec.md, tasks.md, and checklist.md before yielding unless the user changes scope or an external blocker prevents safe completion."
4
+ default_prompt: "Use $enhance-existing-features to extend a brownfield feature: map the affected code and dependencies first, decide whether the change is high complexity / critical module / cross-module, run $generate-spec when specs are required, wait for explicit approval before coding, document material external dependency contracts in contract.md, document the architecture/design delta in design.md, and always add risk-driven tests plus clear N/A reasons when a category truly does not apply; if a spec set exists, finish the approved tasks and applicable checklist items and backfill spec.md, tasks.md, checklist.md, contract.md, and design.md before yielding unless the user changes scope or an external blocker prevents safe completion."
@@ -1,14 +1,15 @@
1
1
  # generate-spec
2
2
 
3
- A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, and `checklist.md` so other skills can reuse one consistent approval-gated spec workflow.
3
+ A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` so other skills can reuse one consistent approval-gated spec workflow.
4
4
 
5
5
  ## Core capabilities
6
6
 
7
- - Generates `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, and `checklist.md` in one step.
7
+ - Generates `docs/plans/{YYYY-MM-DD}_{change_name}/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` in one step.
8
8
  - Uses shared templates so spec-first and brownfield workflows follow the same planning structure.
9
9
  - Requires clarification handling and explicit user approval before implementation starts.
10
10
  - Backfills task and checklist status after implementation and testing.
11
11
  - Keeps requirement, task, and test coverage mapping traceable.
12
+ - Standardizes external dependency contracts in `contract.md` and architecture/design deltas in `design.md`.
12
13
 
13
14
  ## Repository layout
14
15
 
@@ -23,7 +24,9 @@ A shared planning skill for feature work. It centralizes creation and maintenanc
23
24
  │ └── templates/
24
25
  │ ├── spec.md
25
26
  │ ├── tasks.md
26
- └── checklist.md
27
+ ├── checklist.md
28
+ │ ├── contract.md
29
+ │ └── design.md
27
30
  └── scripts/
28
31
  └── create-specs
29
32
  ```
@@ -45,7 +48,9 @@ Default output:
45
48
  docs/plans/<today>_membership-upgrade-flow/
46
49
  ├── spec.md
47
50
  ├── tasks.md
48
- └── checklist.md
51
+ ├── checklist.md
52
+ ├── contract.md
53
+ └── design.md
49
54
  ```
50
55
 
51
56
  ## Authoring rules
@@ -53,6 +58,8 @@ docs/plans/<today>_membership-upgrade-flow/
53
58
  - `spec.md`: use BDD keywords `GIVEN / WHEN / THEN / AND / Requirements`.
54
59
  - `tasks.md`: use `## **Task N: ...**`, `- N. [ ]`, and `- N.x [ ]`.
55
60
  - `checklist.md`: use `- [ ]` only, adapt items to real scope, and record actual results.
61
+ - `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.
62
+ - `design.md`: record the architecture/design delta in the standard format, including affected modules, flow, invariants, tradeoffs, and validation plan.
56
63
  - If clarification responses change the plan, update the docs and obtain approval again before coding.
57
64
 
58
65
  ## 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`) from standard templates with clarification tracking, approval gating, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update `docs/plans/{YYYY-MM-DD}_{change_name}/` planning docs.
3
+ description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`) from standard templates with clarification tracking, approval gating, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update `docs/plans/{YYYY-MM-DD}_{change_name}/` planning docs.
4
4
  ---
5
5
 
6
6
  # Generate Spec
@@ -15,8 +15,8 @@ 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 first, complete them with traceable requirements and risks, handle clarification updates, then wait for explicit approval before implementation.
19
- - Quality: Keep `spec.md`, `tasks.md`, and `checklist.md` synchronized, map each planned test to a concrete risk or requirement, and tailor the templates so only applicable items remain active.
18
+ - Execution: Generate the planning files first, keep each spec set tightly scoped, split broader work into multiple independent spec sets when needed, 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, map each planned test to a concrete risk or requirement, and tailor the templates so only applicable items remain active.
20
20
  - Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}_{change_name}/` and keep them concise, executable, and easy to update.
21
21
 
22
22
  ## Goal
@@ -32,7 +32,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
32
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
33
  - Treat official documentation lookup as mandatory evidence gathering, not an optional refinement step.
34
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`.
35
+ - Record the references that should appear in `spec.md` and the dependency evidence that should appear in `contract.md`.
36
36
  - Inspect existing `docs/plans/` directories before deciding whether to edit an existing plan set.
37
37
  - Reuse an existing plan set only when it clearly matches the same requested issue/change scope.
38
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.
@@ -40,6 +40,11 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
40
40
  ### 2) Generate the planning files
41
41
 
42
42
  - Resolve paths from this skill directory, not the target project directory.
43
+ - Before generating files, identify the concrete modules that would be touched by the requested change.
44
+ - Keep each spec set scoped to at most three modules.
45
+ - If the requested work would span more than three modules, do not draft one oversized coupled plan.
46
+ - Instead, split the work into multiple spec sets, each independently valid and each covering no more than three modules.
47
+ - 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.
43
48
  - Use:
44
49
  - `SKILL_ROOT=<path_to_generate-spec_skill>`
45
50
  - `WORKSPACE_ROOT=<target_project_root>`
@@ -48,6 +53,8 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
48
53
  - `references/templates/spec.md`
49
54
  - `references/templates/tasks.md`
50
55
  - `references/templates/checklist.md`
56
+ - `references/templates/contract.md`
57
+ - `references/templates/design.md`
51
58
  - Save files under `docs/plans/{YYYY-MM-DD}_{change_name}/`.
52
59
 
53
60
  ### 3) Fill `spec.md`
@@ -67,7 +74,21 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
67
74
  - Use `- N. [ ]` for tasks and `- N.x [ ]` for subtasks.
68
75
  - Include explicit tasks for testing, mocks/fakes, regression coverage, and adversarial or edge-case hardening when relevant.
69
76
 
70
- ### 5) Fill `checklist.md`
77
+ ### 5) Fill `contract.md`
78
+
79
+ - 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.
80
+ - 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.
81
+ - Record constraints and forbidden assumptions explicitly so later implementation and review do not rely on unstated expectations.
82
+ - If no external dependency materially constrains the change, write `None` and a brief scope-based reason instead of inventing a fake dependency record.
83
+
84
+ ### 6) Fill `design.md`
85
+
86
+ - Write the architecture/design delta related to the current spec in a standardized format.
87
+ - Identify the affected modules, current baseline, proposed architecture, component responsibilities, control flow, data/state impact, and risk/tradeoff decisions.
88
+ - Cross-reference relevant requirement IDs from `spec.md` and any external dependency records from `contract.md`.
89
+ - Make architecture boundaries, invariants, and rollback/fallback expectations explicit when they matter to safe implementation.
90
+
91
+ ### 7) Fill `checklist.md`
71
92
 
72
93
  - Use checkbox format `- [ ]` for checklist items, except structured placeholder fields that are intentionally left for later fill-in.
73
94
  - Treat the template as a starting point and adapt it to the actual scope.
@@ -79,18 +100,20 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
79
100
  - 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.
80
101
  - 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.
81
102
 
82
- ### 6) Process clarifications and approval
103
+ ### 8) Process clarifications and approval
83
104
 
84
105
  - When the user answers clarification questions, first update the clarification and approval section in `checklist.md`.
85
- - Review whether `spec.md`, `tasks.md`, and `checklist.md` must be updated.
106
+ - Review whether `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` must be updated.
86
107
  - After any clarification-driven update, obtain explicit approval on the updated spec set again.
87
108
  - Do not modify implementation code before approval.
88
109
  - 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`.
89
110
 
90
- ### 7) Backfill after implementation and testing
111
+ ### 9) Backfill after implementation and testing
91
112
 
92
113
  - Mark completed tasks in `tasks.md`.
93
114
  - Update `checklist.md` with real test outcomes, `N/A` reasons, and any scope adjustments.
115
+ - Update `contract.md` when the final dependency usage, obligations, or verified constraints differ from the planning draft.
116
+ - Update `design.md` when the approved architecture changes during implementation, and record the final chosen design rather than leaving stale placeholders.
94
117
  - Only mark checklist items complete when the work actually happened or the recorded decision actually applies.
95
118
  - Do not check off unused examples, placeholder rows, or non-selected decision options.
96
119
  - If different flows use different test strategies, preserve separate decision records in the final checklist instead of merging them into a misleading single summary.
@@ -101,7 +124,11 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
101
124
 
102
125
  - By default, write planning docs in the user's language.
103
126
  - Keep requirement IDs, task IDs, and test IDs traceable across all three files.
127
+ - Never allow one spec set to cover more than three modules.
128
+ - When a request exceeds that scope, split it into independent, non-conflicting, non-dependent spec sets before approval.
104
129
  - Prefer realistic coverage over boilerplate: add or remove checklist items based on actual risk.
130
+ - When external dependencies materially shape the change, `contract.md` is required and must capture the official-source-backed contract in the standardized record format.
131
+ - `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.
105
132
  - Finalized planning docs should read like the actual approved plan and execution record, not like a fully checked starter template.
106
133
  - If official documentation materially constrains implementation choices, reflect that constraint explicitly in the spec instead of leaving it implicit.
107
134
  - Use kebab-case for `change_name`; avoid spaces and special characters.
@@ -114,3 +141,5 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
114
141
  - `references/templates/spec.md`: BDD requirement template.
115
142
  - `references/templates/tasks.md`: task breakdown template.
116
143
  - `references/templates/checklist.md`: behavior-to-test alignment template.
144
+ - `references/templates/contract.md`: external dependency contract template.
145
+ - `references/templates/design.md`: architecture/design delta 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 docs/plans/<date>_<change_name>/{spec.md,tasks.md,checklist.md} from shared templates, fill BDD requirements and risk-driven test planning, process clarification updates, and wait for explicit approval before implementation."
4
+ default_prompt: "Use $generate-spec to create or update docs/plans/<date>_<change_name>/{spec.md,tasks.md,checklist.md,contract.md,design.md} from shared templates, fill BDD requirements and risk-driven test planning, 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."
@@ -17,7 +17,7 @@
17
17
 
18
18
  ## Clarification & Approval Gate (required when clarification replies exist)
19
19
  - [ ] User clarification responses are recorded (map to `spec.md`; if none, mark `N/A`).
20
- - [ ] Affected specs are reviewed/updated (`spec.md` / `tasks.md` / `checklist.md`; if no updates needed, mark `N/A` + reason).
20
+ - [ ] Affected plans are reviewed/updated (`spec.md` / `tasks.md` / `checklist.md` / `contract.md` / `design.md`; if no updates needed, mark `N/A` + reason).
21
21
  - [ ] Explicit user approval on updated specs is obtained (date/conversation reference: [to be filled]).
22
22
 
23
23
  ## Behavior-to-Test Checklist (customizable)
@@ -0,0 +1,65 @@
1
+ # Contract: [Feature Name]
2
+
3
+ - Date: [YYYY-MM-DD]
4
+ - Feature: [Feature Name]
5
+ - Change Name: [change_name]
6
+
7
+ ## Purpose
8
+ [Describe why external dependency contracts matter for this change.]
9
+
10
+ ## Usage Rule
11
+ - Write one dependency record per external library, framework, SDK, API, CLI, platform service, or hosted system that materially constrains implementation.
12
+ - If no external dependency materially affects the change, write `None` under `## Dependency Records` and briefly explain why this document is not needed for the current scope.
13
+ - Every claim in this file must be backed by the official documentation or the verified upstream source actually used during planning.
14
+
15
+ ## Dependency Records
16
+
17
+ ### Dependency 1: [Dependency Name]
18
+ - Type: [library / framework / SDK / API / CLI / hosted service / platform]
19
+ - Version / Scope: [exact version, major line, API version, or `Not fixed`]
20
+ - Official Source: [link]
21
+ - Why It Matters: [what this dependency is responsible for in the change]
22
+ - Invocation Surface:
23
+ - Entry points: [package import / endpoint / command / webhook / queue topic]
24
+ - Call pattern: [sync / async / streaming / webhook / batch / polling]
25
+ - Required inputs: [auth, headers, env vars, config keys, payload fields]
26
+ - Expected outputs: [return shape, side effects, emitted events, persisted state]
27
+ - Constraints:
28
+ - Supported behavior: [documented supported modes relevant to this change]
29
+ - Limits: [rate limits, payload limits, timeout, ordering, pagination, size, quota]
30
+ - Compatibility: [runtime / platform / version / region / account constraints]
31
+ - Security / access: [auth model, scopes, permissions, secret handling]
32
+ - Failure Contract:
33
+ - Error modes: [documented errors, degraded states, retries, eventual consistency]
34
+ - Caller obligations: [retry rules, idempotency keys, backoff, validation, cleanup]
35
+ - Forbidden assumptions: [what the implementation must not assume]
36
+ - Verification Plan:
37
+ - Spec mapping: [R?.?]
38
+ - Design mapping: [section in `design.md`]
39
+ - Planned coverage: [UT / PBT / IT / E2E / mock scenario IDs]
40
+ - Evidence notes: [specific doc section or source snippet summary]
41
+
42
+ ### Dependency 2: [Dependency Name]
43
+ - Type: [library / framework / SDK / API / CLI / hosted service / platform]
44
+ - Version / Scope: [exact version, major line, API version, or `Not fixed`]
45
+ - Official Source: [link]
46
+ - Why It Matters: [what this dependency is responsible for in the change]
47
+ - Invocation Surface:
48
+ - Entry points: [package import / endpoint / command / webhook / queue topic]
49
+ - Call pattern: [sync / async / streaming / webhook / batch / polling]
50
+ - Required inputs: [auth, headers, env vars, config keys, payload fields]
51
+ - Expected outputs: [return shape, side effects, emitted events, persisted state]
52
+ - Constraints:
53
+ - Supported behavior: [documented supported modes relevant to this change]
54
+ - Limits: [rate limits, payload limits, timeout, ordering, pagination, size, quota]
55
+ - Compatibility: [runtime / platform / version / region / account constraints]
56
+ - Security / access: [auth model, scopes, permissions, secret handling]
57
+ - Failure Contract:
58
+ - Error modes: [documented errors, degraded states, retries, eventual consistency]
59
+ - Caller obligations: [retry rules, idempotency keys, backoff, validation, cleanup]
60
+ - Forbidden assumptions: [what the implementation must not assume]
61
+ - Verification Plan:
62
+ - Spec mapping: [R?.?]
63
+ - Design mapping: [section in `design.md`]
64
+ - Planned coverage: [UT / PBT / IT / E2E / mock scenario IDs]
65
+ - Evidence notes: [specific doc section or source snippet summary]
@@ -0,0 +1,65 @@
1
+ # Design: [Feature Name]
2
+
3
+ - Date: [YYYY-MM-DD]
4
+ - Feature: [Feature Name]
5
+ - Change Name: [change_name]
6
+
7
+ ## Design Goal
8
+ [Describe the architecture/design objective for this spec change.]
9
+
10
+ ## Change Summary
11
+ - Requested change: [one sentence]
12
+ - Existing baseline: [current architecture or behavior relevant to the change]
13
+ - Proposed design delta: [what will change structurally]
14
+
15
+ ## Scope Mapping
16
+ - Spec requirements covered: [R?.?]
17
+ - Affected modules: [module/file/service list]
18
+ - External contracts involved: [dependency names from `contract.md`, or `None`]
19
+
20
+ ## Current Architecture
21
+ [Describe the relevant current components, data flow, control flow, and boundaries.]
22
+
23
+ ## Proposed Architecture
24
+ [Describe the new or updated structure, ownership boundaries, and interaction flow.]
25
+
26
+ ## Component Changes
27
+
28
+ ### Component 1: [Name]
29
+ - Responsibility: [what this component owns after the change]
30
+ - Inputs: [events, params, payloads, config]
31
+ - Outputs: [return values, writes, emitted events, calls]
32
+ - Dependencies: [internal modules and external contracts]
33
+ - Invariants: [business or technical rules that must hold]
34
+
35
+ ### Component 2: [Name]
36
+ - Responsibility: [what this component owns after the change]
37
+ - Inputs: [events, params, payloads, config]
38
+ - Outputs: [return values, writes, emitted events, calls]
39
+ - Dependencies: [internal modules and external contracts]
40
+ - Invariants: [business or technical rules that must hold]
41
+
42
+ ## Sequence / Control Flow
43
+ 1. [Step 1]
44
+ 2. [Step 2]
45
+ 3. [Step 3]
46
+
47
+ ## Data / State Impact
48
+ - Created or updated data: [schemas, fields, caches, files, queues, config]
49
+ - Consistency rules: [ordering, transactionality, idempotency, deduplication]
50
+ - Migration / rollout needs: [if none, write `None`]
51
+
52
+ ## Risk and Tradeoffs
53
+ - Key risks: [failure, concurrency, authorization, partial-write, dependency risk]
54
+ - Rejected alternatives: [alternative + why it was not chosen]
55
+ - Operational constraints: [performance, quota, observability, deployment coupling]
56
+
57
+ ## Validation Plan
58
+ - Tests: [UT / PBT / IT / E2E / adversarial]
59
+ - Contract checks: [how `contract.md` constraints will be validated]
60
+ - Rollback / fallback: [how to contain or reverse impact]
61
+
62
+ ## Open Questions
63
+ [Write `None` if the design is settled.]
64
+ - [Question 1]
65
+ - [Question 2]
@@ -6,7 +6,13 @@ import re
6
6
  from datetime import date
7
7
  from pathlib import Path
8
8
 
9
- TEMPLATE_FILENAMES = ("spec.md", "tasks.md", "checklist.md")
9
+ TEMPLATE_FILENAMES = (
10
+ "spec.md",
11
+ "tasks.md",
12
+ "checklist.md",
13
+ "contract.md",
14
+ "design.md",
15
+ )
10
16
  PLACEHOLDERS = ("[Feature Name]", "[功能名稱]")
11
17
 
12
18
 
@@ -32,7 +38,7 @@ def _render(content: str, today: str, feature_name: str, change_name: str) -> st
32
38
  def main() -> int:
33
39
  parser = argparse.ArgumentParser(
34
40
  description=(
35
- "Create planning docs (spec.md, tasks.md, checklist.md) "
41
+ "Create planning docs (spec.md, tasks.md, checklist.md, contract.md, design.md) "
36
42
  "from templates with folder format docs/plans/{date}_{change_name}."
37
43
  ),
38
44
  )
@@ -54,7 +60,7 @@ def main() -> int:
54
60
  parser.add_argument(
55
61
  "--template-dir",
56
62
  default=str(_default_template_dir()),
57
- help="Directory containing spec.md/tasks.md/checklist.md templates",
63
+ help="Directory containing planning document templates",
58
64
  )
59
65
  parser.add_argument(
60
66
  "--force",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laitszkin/apollo-toolkit",
3
- "version": "2.12.8",
3
+ "version": "2.13.0",
4
4
  "description": "Apollo Toolkit npm installer for managed skill copying across Codex, OpenClaw, and Trae.",
5
5
  "license": "MIT",
6
6
  "author": "LaiTszKin",
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: recover-missing-plan
3
+ description: Recover a missing or mismatched `docs/plans/...` plan set by verifying the path, checking archives and git history, reading the authoritative issue context, and restoring or reconstructing `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` before implementation continues.
4
+ ---
5
+
6
+ # Recover Missing Plan
7
+
8
+ ## Dependencies
9
+
10
+ - Required: `read-github-issue` and `generate-spec`.
11
+ - Conditional: none.
12
+ - Optional: none.
13
+ - Fallback: If the authoritative issue context cannot be read and no archived or historical plan evidence exists, stop and report the missing evidence instead of guessing the scope.
14
+
15
+ ## Standards
16
+
17
+ - Evidence: Confirm the requested plan path really is missing, search the repository and git history, and use authoritative issue context before restoring or recreating planning files.
18
+ - Execution: Prefer restoring the original plan set when trustworthy evidence exists; reconstruct only the minimum required files and only after establishing the intended issue scope.
19
+ - Quality: Do not invent requirements, do not overwrite a different issue's plan set, and keep active-vs-archived placement aligned with the actual delivery state.
20
+ - Output: Leave behind the correct `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` set plus a short evidence trail explaining whether the plan was restored, reconstructed, or redirected to an archived location.
21
+
22
+ ## Overview
23
+
24
+ Use this skill when the user points to `docs/plans/{date}_{change}/...` but the directory is missing, only `docs/plans/README.md` exists, the matching files were already archived, or the workspace is detached / incomplete and the plan evidence must be recovered before coding or archiving can proceed.
25
+
26
+ Typical triggers:
27
+ - The user references a specific `docs/plans/...` directory that is absent from the current worktree.
28
+ - A feature workflow expects approved spec files, but the plan was archived, never checked out, or exists only in another branch/worktree.
29
+ - An implementation task must continue from GitHub issue context because the original planning artifacts are missing.
30
+
31
+ ## Workflow
32
+
33
+ ### 1) Prove the path mismatch first
34
+
35
+ - Confirm the requested path exactly.
36
+ - List `docs/plans/`, `docs/archive/plans/`, and any nearby plan directories with similar names.
37
+ - Search the repository for the issue number, `change_name`, and user-provided path fragment.
38
+ - Check whether the plan is genuinely missing, merely archived, or present under a slightly different normalized directory name.
39
+
40
+ ### 2) Search for trustworthy local recovery sources
41
+
42
+ - Inspect git-tracked history for the missing plan files before recreating anything.
43
+ - Check other local branches or worktrees when the repository uses parallel issue branches.
44
+ - If the user asked to finish already-completed work, verify whether the correct action is to update `docs/archive/plans/...` instead of creating a new active plan.
45
+ - Treat archived specs, prior commits, and clearly matching neighboring plan sets as recovery evidence, not as permission to infer new scope.
46
+
47
+ ### 3) Read authoritative issue context when local evidence is incomplete
48
+
49
+ - Use `$read-github-issue` to read the actual remote issue and comments.
50
+ - Prefer repository helpers when they work, but immediately fall back to raw `gh issue view` when wrappers return empty or incomplete output.
51
+ - Use the issue to recover acceptance criteria, constraints, and naming only after confirming it is the same scope as the missing plan.
52
+ - If the issue and local evidence disagree, stop and report the conflict instead of blending them.
53
+
54
+ ### 4) Decide restore vs reconstruct vs redirect
55
+
56
+ Choose one path explicitly:
57
+ - Restore: reuse the original plan content when a trustworthy historical copy exists.
58
+ - Reconstruct: create a fresh plan set only when the issue scope is clear and the files truly do not exist anywhere trustworthy.
59
+ - Redirect: if the work is already completed and the correct files live under `docs/archive/plans/...`, use the archived location and continue the requested archival or reporting workflow from there.
60
+
61
+ Rules:
62
+ - Never overwrite a neighboring issue's plan set just because the technical area overlaps.
63
+ - Keep reconstructed scope limited to the same issue only.
64
+ - If reconstruction would touch more than three modules, split the work through `$generate-spec` instead of drafting an oversized recovered plan.
65
+
66
+ ### 5) Rebuild the plan set carefully
67
+
68
+ - When reconstruction is required, use `$generate-spec` to create the canonical `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` skeleton.
69
+ - Fill the recovered plan from verified evidence only: issue text, codebase inspection, official docs when relevant, and already-landed implementation facts if the work was partially completed.
70
+ - Keep the recovered planning docs in the user's language unless repository conventions require otherwise.
71
+ - When the user asked to continue implementation immediately, recover only the current issue's plan set and then hand control back to the owning workflow skill.
72
+
73
+ ### 6) Backfill completion state honestly
74
+
75
+ - If code already exists, mark only the tasks and checklist items supported by actual evidence and tests.
76
+ - If work is still pending, leave the recovered plan active under `docs/plans/...`.
77
+ - If work is already complete and the project archives finished plans, move or keep the recovered set under `docs/archive/plans/...` and update any relevant plan index.
78
+ - Record exactly which evidence source justified the recovery choice.
79
+
80
+ ## Working Rules
81
+
82
+ - Missing plan recovery is an evidence-restoration workflow, not a shortcut to skip planning discipline.
83
+ - Prefer archived or historical files over freshly rewritten prose whenever a reliable source exists.
84
+ - When the repository's issue helper scripts fail, use direct `gh` commands instead of stalling.
85
+ - Do not silently continue implementation with no recovered plan when the owning workflow depends on one.
86
+
87
+ ## References
88
+
89
+ - `$read-github-issue`: authoritative remote issue retrieval.
90
+ - `$generate-spec`: canonical spec/task/checklist generation and backfill workflow.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Recover Missing Plan"
3
+ short_description: "Recover missing docs/plans spec sets from evidence"
4
+ default_prompt: "Use $recover-missing-plan when the user references a docs/plans plan set that is missing from the current workspace or appears to have been archived unexpectedly; verify the path mismatch, search the repository and git history, read the authoritative GitHub issue when needed, restore or reconstruct the correct spec.md/tasks.md/checklist.md/contract.md/design.md set from evidence, and only then continue the requested implementation or archival workflow."
@@ -7,7 +7,7 @@ description: Resolve a GitHub issue in an existing repository and submit the fix
7
7
 
8
8
  ## Dependencies
9
9
 
10
- - Required: `read-github-issue`, `enhance-existing-features`, and `commit-and-push`.
10
+ - Required: `read-github-issue`, `enhance-existing-features`, `recover-missing-plan`, and `commit-and-push`.
11
11
  - Conditional: `systematic-debug` when the issue is primarily a bug investigation or failing behavior report.
12
12
  - Optional: none.
13
13
  - Fallback: If any required dependency is unavailable, stop and report which dependency blocked the workflow.
@@ -36,6 +36,7 @@ Use this skill for the recurring workflow where the user wants one GitHub issue
36
36
  ### 2) Explore the codebase and decide whether specs are required
37
37
 
38
38
  - After reading the issue, inspect the real entrypoints, affected modules, tests, and existing planning files.
39
+ - If the user references an expected `docs/plans/...` path that is missing or archived unexpectedly, run `$recover-missing-plan` before treating the issue as unspecced work.
39
40
  - Run `$enhance-existing-features` to decide whether specs are required from the actual change surface.
40
41
  - Default to direct implementation for clearly localized bug fixes, regressions, narrow optimizations, or small workflow corrections, even when the issue wording sounds broad.
41
42
  - Require specs when the explored change touches critical money movement, permissions, high-risk concurrency, or multi-module behavior changes that need approval traceability.
@@ -15,7 +15,7 @@ description: Read a user-specified PDF that marks the week's key financial event
15
15
  ## Standards
16
16
 
17
17
  - Evidence: Research only events explicitly marked in the source PDF plus clearly material breaking developments, and verify claims with current authoritative sources.
18
- - Execution: Read the PDF first, prefer `pdf` for extraction but fall back to the bundled macOS PDFKit extractor when local PDF tooling is missing, lock the research window, research each marked event, then hand the final briefing to `pdf` for rendering and QA with deterministic table-safe layout rules when needed.
18
+ - Execution: Read the PDF first, prefer `pdf` for extraction but fall back to the bundled macOS PDFKit extractor when local PDF tooling is missing, lock the research window, check for an existing report covering that same window before duplicating work, research each marked event, then hand the final briefing to `pdf` for rendering and QA with deterministic table-safe layout rules when needed.
19
19
  - Quality: Keep the report concise, Chinese-compatible, explicit about source-versus-breaking events, conflicts, uncertainty, PDF font safety, and long-text table legibility.
20
20
  - Output: Save only the final standardized PDF under the month folder using the financial-event-report naming scheme.
21
21
 
@@ -57,6 +57,7 @@ Do not guess any input that materially changes the research window or report sco
57
57
  - company filings or official releases
58
58
  - Use high-quality financial reporting to triangulate facts, surface timelines, or explain market reactions.
59
59
  - Record the event date or publication date for every material claim.
60
+ - Use exact calendar dates for market holidays, exchange closures, and "next session" timing instead of relative wording such as "today" or "next Monday" alone.
60
61
  - Separate confirmed facts from interpretation.
61
62
  - Distinguish between:
62
63
  - events explicitly marked in the source PDF
@@ -91,6 +92,16 @@ swift scripts/extract_pdf_text_pdfkit.swift /absolute/path/to/source.pdf
91
92
  - If the research window remains unclear, report the ambiguity instead of assuming one.
92
93
  - State exact calendar dates and timezone in the report.
93
94
 
95
+ ### 2.5) Check for an existing report before regenerating
96
+
97
+ - Before drafting a new report, inspect the target month folder for an existing `financial-event-report` PDF that already covers the same exact date range.
98
+ - If an existing report already covers the locked window, read it first and compare it with the newly confirmed marked events plus any newly discovered breaking developments.
99
+ - Reuse the existing report as the baseline when it already covers the same window, and regenerate only when at least one of these is true:
100
+ - the source PDF reveals a marked event that the existing report missed
101
+ - a material breaking event landed after the prior report was generated
102
+ - the earlier report used an incorrect or incomplete research window
103
+ - If the existing report is still complete and current for the same window, stop and report that no refresh is needed instead of rewriting the same deliverable.
104
+
94
105
  ### 3) Research each marked event deeply
95
106
 
96
107
  - For every marked event, gather:
@@ -114,6 +125,7 @@ swift scripts/extract_pdf_text_pdfkit.swift /absolute/path/to/source.pdf
114
125
  - geopolitical shocks with direct market spillovers
115
126
  - unexpected company events with broad market consequences
116
127
  - Label these clearly as newly added breaking events rather than source-PDF items.
128
+ - When a breaking event affects how an already published data point should be interpreted at the next market session, state the exact upcoming trading date or reopening date.
117
129
 
118
130
  ### 5) Write the standardized report
119
131