@laitszkin/apollo-toolkit 2.14.5 → 2.14.7
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 +2 -2
- package/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/archive-specs/README.md +3 -2
- package/archive-specs/SKILL.md +6 -3
- package/archive-specs/agents/openai.yaml +1 -1
- package/develop-new-features/README.md +2 -1
- package/develop-new-features/SKILL.md +5 -1
- package/develop-new-features/agents/openai.yaml +1 -1
- package/enhance-existing-features/CHANGELOG.md +1 -1
- package/enhance-existing-features/README.md +1 -0
- package/enhance-existing-features/SKILL.md +4 -1
- package/enhance-existing-features/agents/openai.yaml +1 -1
- package/generate-spec/README.md +31 -6
- package/generate-spec/SKILL.md +21 -3
- package/generate-spec/agents/openai.yaml +1 -1
- package/generate-spec/references/templates/coordination.md +58 -0
- package/generate-spec/references/templates/design.md +1 -0
- package/generate-spec/scripts/create-specs +54 -3
- package/implement-specs-with-worktree/SKILL.md +8 -2
- package/implement-specs-with-worktree/agents/openai.yaml +1 -1
- package/merge-changes-from-local-branches/SKILL.md +17 -1
- package/merge-changes-from-local-branches/agents/openai.yaml +1 -1
- package/package.json +1 -1
- package/recover-missing-plan/SKILL.md +1 -1
package/AGENTS.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
This repository enables users to install and run a curated set of reusable agent skills for software delivery, research, repository maintenance, and media-generation workflows.
|
|
13
13
|
|
|
14
14
|
- Users can align project documentation with the current codebase.
|
|
15
|
-
- Users can consolidate completed project specs into a standardized README and categorized project documentation set, then archive the consumed planning files.
|
|
15
|
+
- Users can consolidate completed project specs and batch-level coordination plans into a standardized README and categorized project documentation set, then archive only the truly consumed planning files.
|
|
16
16
|
- Users can investigate application logs, slice them to precise time windows, search by keyword or regex, and produce evidence-backed root-cause findings.
|
|
17
17
|
- Users can answer repository-backed questions with additional web research when needed.
|
|
18
18
|
- Users can commit and push local changes without performing version or release work.
|
|
@@ -22,7 +22,7 @@ This repository enables users to install and run a curated set of reusable agent
|
|
|
22
22
|
- Users can turn a marked weekly finance PDF into a concise evidence-based financial event report.
|
|
23
23
|
- Users can install Apollo Toolkit through npm or npx and interactively choose one or more target skill directories to populate with copied skills.
|
|
24
24
|
- Users can design and implement new features through a spec-first workflow.
|
|
25
|
-
- Users can generate shared feature
|
|
25
|
+
- Users can generate shared feature planning artifacts for approval-gated workflows, including parallel multi-spec batches coordinated through one batch-level `coordination.md`.
|
|
26
26
|
- Users can convert text or documents into audio files with subtitle timelines.
|
|
27
27
|
- Users can turn lecture slides, past papers, and answer books into mock exams, worked solutions, study notes, or graded PDFs with KaTeX-rendered math.
|
|
28
28
|
- Users can extend existing features in a brownfield codebase with required tests and approvals.
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All notable changes to this repository are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [v2.14.7] - 2026-04-08
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
- Update `merge-changes-from-local-branches` so it removes successfully merged source branches and any detached worktrees only after the merge commit and verification both succeed, while refusing forced deletion for branches that are not actually merged.
|
|
11
|
+
|
|
12
|
+
## [v2.14.6] - 2026-04-08
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- Add batch-level `coordination.md` support to `generate-spec` so one planning request can create multiple parallel spec workstreams under `docs/plans/{YYYY-MM-DD}/{batch_name}/`, while keeping shared field preparation, ownership boundaries, merge order, and legacy-replacement direction in one canonical coordination file.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- Update `develop-new-features`, `enhance-existing-features`, and `implement-specs-with-worktree` so multi-spec worktree execution reads and maintains shared `coordination.md` state instead of duplicating cross-spec rules inside each `design.md`.
|
|
19
|
+
- Update `archive-specs` and `recover-missing-plan` so the newer nested `docs/plans/{YYYY-MM-DD}/...` layout and batch-level `coordination.md` files are recognized during archival, reconciliation, and recovery workflows.
|
|
20
|
+
|
|
7
21
|
## [v2.14.5] - 2026-04-08
|
|
8
22
|
|
|
9
23
|
### Changed
|
package/README.md
CHANGED
|
@@ -147,7 +147,7 @@ The install commands below were checked with the Skills CLI unless otherwise not
|
|
|
147
147
|
|
|
148
148
|
Compatibility note:
|
|
149
149
|
|
|
150
|
-
- `generate-spec` is a local skill used by `develop-new-features` and `enhance-existing-features`.
|
|
150
|
+
- `generate-spec` is a local skill used by `develop-new-features` and `enhance-existing-features`, and it can produce either a single spec set under `docs/plans/{YYYY-MM-DD}/{change_name}/` or a coordinated parallel batch under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` with shared `coordination.md`.
|
|
151
151
|
- `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.
|
|
152
152
|
- `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.
|
|
153
153
|
- `read-github-issue` uses GitHub CLI (`gh`) directly for remote issue discovery and inspection, so it does not add any extra skill dependency.
|
package/archive-specs/README.md
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
# archive-specs
|
|
2
2
|
|
|
3
|
-
A documentation skill that converts completed spec files into standardized project docs and archives the consumed planning files. It produces a concise `README.md` plus a categorized document set grounded in real repository evidence.
|
|
3
|
+
A documentation skill that converts completed spec files and batch-level coordination files into standardized project docs and archives the consumed planning files. It produces a concise `README.md` plus a categorized document set grounded in real repository evidence.
|
|
4
4
|
|
|
5
5
|
## Core capabilities
|
|
6
6
|
|
|
7
|
-
- Scans `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `
|
|
7
|
+
- Scans `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and batch-level `coordination.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.
|
|
11
11
|
- Archives superseded spec source files after a successful conversion, and deletes them only when the repository clearly does not need historical retention.
|
|
12
|
+
- Preserves active batch coordination files until no remaining spec set still depends on their shared preparation or replacement direction.
|
|
12
13
|
- Keeps unknown or unverifiable details explicit instead of guessing.
|
|
13
14
|
|
|
14
15
|
## Repository layout
|
package/archive-specs/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: archive-specs
|
|
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`
|
|
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` and any batch-level `coordination.md` 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`, `checklist.md`, `contract.md`, and `
|
|
30
|
+
- Find all relevant planning files such as `docs/plans/**/spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and any batch-level `coordination.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
|
|
|
@@ -40,6 +40,7 @@ Convert completed planning artifacts into stable, standardized project documenta
|
|
|
40
40
|
4. existing docs
|
|
41
41
|
- When specs disagree with the codebase, keep the codebase truth and note the mismatch while updating docs.
|
|
42
42
|
- Merge repeated or overlapping feature descriptions into one stable capability summary.
|
|
43
|
+
- Use `coordination.md` to understand shared preparation, ownership boundaries, legacy cutover direction, and which old features or paths were intentionally replaced across multiple spec sets.
|
|
43
44
|
- Distinguish between completed scope that should become durable docs and still-active scope that remains planning material for follow-up work.
|
|
44
45
|
|
|
45
46
|
### 3) Standardize existing project docs into categorized outputs
|
|
@@ -91,11 +92,12 @@ Ensure the split project docs cover all of the following:
|
|
|
91
92
|
### 7) Archive superseded spec files after successful conversion
|
|
92
93
|
|
|
93
94
|
- After the standardized project docs are complete and verified, archive the old source spec files that were converted.
|
|
94
|
-
- Prefer moving the consumed `spec.md`, `tasks.md`, `checklist.md`, `contract.md`,
|
|
95
|
+
- Prefer moving the consumed `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when applicable their shared `coordination.md`, or the containing batch/spec plan directory, into a clearly marked archive path instead of leaving them mixed with active docs.
|
|
95
96
|
- Delete converted spec files only when the repository clearly does not need historical retention.
|
|
96
97
|
- Do not archive or delete any spec file that is still actively needed for unfinished implementation work.
|
|
97
98
|
- 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.
|
|
98
99
|
- If only part of a plan set is complete, convert or summarize only the truly completed scope and leave the active plan set in place unless the repository has a separate archival convention for partial phases.
|
|
100
|
+
- If only part of a coordinated batch is complete, archive only the fully consumed spec subdirectories and keep the batch-level `coordination.md` active until no remaining spec set relies on it.
|
|
99
101
|
|
|
100
102
|
## Working Rules
|
|
101
103
|
|
|
@@ -105,6 +107,7 @@ Ensure the split project docs cover all of the following:
|
|
|
105
107
|
- When a section cannot be completed from evidence, keep an explicit `Unknown` or `TBD (missing repository evidence)` marker.
|
|
106
108
|
- The final repository state should not keep both standardized docs and redundant active spec files for the same completed scope.
|
|
107
109
|
- Do not equate "code was committed" with "planning scope is complete"; archive only when the remaining notes no longer guide future implementation.
|
|
110
|
+
- Do not archive a batch `coordination.md` while it still governs active replacement work, shared field preparation, or unresolved cross-spec merge sequencing.
|
|
108
111
|
|
|
109
112
|
## References
|
|
110
113
|
|
|
@@ -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/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."
|
|
4
|
+
default_prompt: "Use $archive-specs to inventory the project's spec.md/tasks.md/checklist.md/contract.md/design.md files plus any batch-level coordination.md, reconcile them with the current repository, use coordination.md to understand shared preparation and legacy-replacement direction across parallel plan sets, 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 and keeping coordination.md active while any spec set still depends on it."
|
|
@@ -30,10 +30,11 @@ A spec-first feature development skill for new behavior and greenfield work. It
|
|
|
30
30
|
## Workflow summary
|
|
31
31
|
|
|
32
32
|
1. Review only the official docs and code paths needed for the feature.
|
|
33
|
-
2. Run `generate-spec` to create and maintain `docs/plans/{YYYY-MM-DD}
|
|
33
|
+
2. Run `generate-spec` to create and maintain `docs/plans/{YYYY-MM-DD}/{change_name}/`, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` plus `coordination.md` for parallel batches.
|
|
34
34
|
3. Wait for explicit approval on the spec set.
|
|
35
35
|
4. Implement the approved behavior with minimal changes.
|
|
36
36
|
5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md`.
|
|
37
|
+
6. For parallel batches, keep shared preparation and replacement direction in `coordination.md`.
|
|
37
38
|
|
|
38
39
|
## Testing expectations
|
|
39
40
|
|
|
@@ -60,11 +60,13 @@ Use a shared spec-generation workflow for non-trivial new feature work, then imp
|
|
|
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
|
+
- 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.
|
|
63
64
|
- Follow `$generate-spec` completely for:
|
|
64
|
-
- generating `docs/plans/{YYYY-MM-DD}
|
|
65
|
+
- 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
|
|
65
66
|
- filling BDD requirements and risk-driven test plans
|
|
66
67
|
- documenting external dependency contracts in `contract.md` when they materially constrain the feature
|
|
67
68
|
- documenting the architecture/design delta in `design.md`
|
|
69
|
+
- documenting shared preparation and implementation direction in `coordination.md` when multiple spec sets will be implemented in parallel
|
|
68
70
|
- handling clarification responses
|
|
69
71
|
- obtaining explicit approval before coding
|
|
70
72
|
- backfilling document status after implementation and testing, including requirement completion in `spec.md`
|
|
@@ -111,6 +113,7 @@ Rules:
|
|
|
111
113
|
### 6) Completion updates
|
|
112
114
|
|
|
113
115
|
- Backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` through `$generate-spec` workflow after implementation and testing.
|
|
116
|
+
- If the feature used a parallel batch, also backfill `coordination.md` with any final shared preparation, cutover, or ownership changes that emerged during execution.
|
|
114
117
|
- 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.
|
|
115
118
|
- Mark every completed task in `tasks.md`.
|
|
116
119
|
- In `checklist.md`, update only the items that are actually applicable to the approved scope and executed validation.
|
|
@@ -126,6 +129,7 @@ Rules:
|
|
|
126
129
|
- By default, write planning docs in the user's language.
|
|
127
130
|
- Keep implementation traceable to approved requirement IDs and planned risks.
|
|
128
131
|
- Keep each spec set limited to at most three modules; split larger changes into independent, non-conflicting, non-dependent spec sets before approval.
|
|
132
|
+
- 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`.
|
|
129
133
|
- Prefer realism over rigid templates: add or remove test coverage only when the risk profile justifies it.
|
|
130
134
|
- Every planned test should justify a distinct risk; remove shallow duplicates that only prove the code "still runs".
|
|
131
135
|
- Treat starter template alternatives as mutually exclusive options, not as boxes that all need to be checked.
|
|
@@ -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
|
|
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>/... for single-spec work or docs/plans/<date>/<batch_name>/<change_name>/... plus coordination.md for parallel batches, wait for explicit approval, document material external dependency contracts in contract.md, document the architecture/design delta in design.md, record shared preparation and legacy-replacement direction in coordination.md when multiple specs will be implemented in parallel, then complete the approved implementation end-to-end with risk-driven tests and full backfill of spec.md, tasks.md, checklist.md, contract.md, design.md, and when applicable coordination.md before yielding, unless the user changes scope or an external blocker prevents safe completion."
|
|
@@ -10,7 +10,7 @@ All notable changes to this project are documented in this file.
|
|
|
10
10
|
- Added explicit rule that test coverage is required even when specs are not used.
|
|
11
11
|
|
|
12
12
|
### Added
|
|
13
|
-
- Added `scripts/create-specs` for generating specs into `docs/plans/{YYYY-MM-DD}
|
|
13
|
+
- Added `scripts/create-specs` for generating specs into `docs/plans/{YYYY-MM-DD}/{change_name}/`.
|
|
14
14
|
- Added reusable templates under `references/templates/`.
|
|
15
15
|
|
|
16
16
|
## [v0.1.2] - 2026-02-12
|
|
@@ -34,6 +34,7 @@ A brownfield feature-extension skill: map dependencies first, decide whether sha
|
|
|
34
34
|
3. Wait for explicit approval if planning docs were generated.
|
|
35
35
|
4. Implement the smallest safe brownfield change.
|
|
36
36
|
5. Run risk-driven tests and backfill `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `design.md` when specs exist.
|
|
37
|
+
6. If the work is split into parallel spec sets, maintain one batch-level `coordination.md` for shared preparation, ownership, and replacement direction.
|
|
37
38
|
|
|
38
39
|
## Test requirements
|
|
39
40
|
|
|
@@ -66,10 +66,11 @@ When in doubt, prefer direct implementation for genuinely low-risk localized cha
|
|
|
66
66
|
If triggered:
|
|
67
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.
|
|
68
68
|
- Run `$generate-spec` and follow its workflow completely.
|
|
69
|
-
- Use it to create or update `docs/plans/{YYYY-MM-DD}
|
|
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`.
|
|
70
70
|
- Keep each spec set scoped to at most three modules.
|
|
71
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.
|
|
72
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.
|
|
73
|
+
- 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.
|
|
73
74
|
- Ensure planned behaviors and edge cases cover external dependency states, abuse/adversarial paths, and any relevant authorization/idempotency/concurrency/data-integrity risks.
|
|
74
75
|
- When external dependencies materially constrain the change, make sure `contract.md` captures their official-source-backed invocation surface, constraints, and caller obligations.
|
|
75
76
|
- Make sure `design.md` captures the architecture/design delta, affected modules, control flow, and tradeoff decisions for the approved scope.
|
|
@@ -124,6 +125,7 @@ Rules:
|
|
|
124
125
|
### 6) Completion updates
|
|
125
126
|
|
|
126
127
|
- 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.
|
|
128
|
+
- If the change used a parallel batch, update `coordination.md` whenever shared preparation, legacy replacement direction, or merge constraints changed during execution.
|
|
127
129
|
- 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.
|
|
128
130
|
- If specs were used, mark every completed task in `tasks.md`.
|
|
129
131
|
- If specs were used, update only the applicable checklist items that correspond to real scope, chosen test strategy, and actual execution.
|
|
@@ -139,6 +141,7 @@ Rules:
|
|
|
139
141
|
- Keep the solution minimal and executable.
|
|
140
142
|
- Always decide the need for specs only after exploring the existing codebase.
|
|
141
143
|
- 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.
|
|
144
|
+
- 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`.
|
|
142
145
|
- Maintain traceability between requirements, tasks, and tests when specs are present.
|
|
143
146
|
- Treat checklists as living artifacts: adjust items to match real change scope.
|
|
144
147
|
- Treat mutually exclusive template choices as a decision to record, not multiple boxes to finish.
|
|
@@ -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, 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
|
|
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 when one change is split into parallel spec sets maintain a shared coordination.md for common preparation, ownership boundaries, and legacy-replacement direction; 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, design.md, and when applicable coordination.md before yielding unless the user changes scope or an external blocker prevents safe completion."
|
package/generate-spec/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# generate-spec
|
|
2
2
|
|
|
3
|
-
A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, and `
|
|
3
|
+
A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed `coordination.md` so other skills can reuse one consistent approval-gated spec workflow.
|
|
4
4
|
|
|
5
5
|
## Core capabilities
|
|
6
6
|
|
|
7
|
-
- Generates `docs/plans/{YYYY-MM-DD}
|
|
7
|
+
- Generates single-spec plans under `docs/plans/{YYYY-MM-DD}/{change_name}/`.
|
|
8
|
+
- Generates multi-spec parallel batches under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` with a shared `coordination.md`.
|
|
8
9
|
- Uses shared templates so spec-first and brownfield workflows follow the same planning structure.
|
|
9
10
|
- Requires clarification handling and explicit user approval before implementation starts.
|
|
10
11
|
- Backfills task and checklist status after implementation and testing.
|
|
@@ -26,7 +27,8 @@ A shared planning skill for feature work. It centralizes creation and maintenanc
|
|
|
26
27
|
│ ├── tasks.md
|
|
27
28
|
│ ├── checklist.md
|
|
28
29
|
│ ├── contract.md
|
|
29
|
-
│
|
|
30
|
+
│ ├── design.md
|
|
31
|
+
│ └── coordination.md
|
|
30
32
|
└── scripts/
|
|
31
33
|
└── create-specs
|
|
32
34
|
```
|
|
@@ -42,10 +44,10 @@ python3 "$SKILL_ROOT/scripts/create-specs" "Membership upgrade flow" \
|
|
|
42
44
|
--output-dir "$WORKSPACE_ROOT/docs/plans"
|
|
43
45
|
```
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
Single-spec output:
|
|
46
48
|
|
|
47
49
|
```text
|
|
48
|
-
docs/plans/<today
|
|
50
|
+
docs/plans/<today>/membership-upgrade-flow/
|
|
49
51
|
├── spec.md
|
|
50
52
|
├── tasks.md
|
|
51
53
|
├── checklist.md
|
|
@@ -53,6 +55,28 @@ docs/plans/<today>_membership-upgrade-flow/
|
|
|
53
55
|
└── design.md
|
|
54
56
|
```
|
|
55
57
|
|
|
58
|
+
Parallel batch output:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python3 "$SKILL_ROOT/scripts/create-specs" "Membership write path" \
|
|
62
|
+
--change-name membership-write-path \
|
|
63
|
+
--batch-name membership-cutover \
|
|
64
|
+
--with-coordination \
|
|
65
|
+
--template-dir "$SKILL_ROOT/references/templates" \
|
|
66
|
+
--output-dir "$WORKSPACE_ROOT/docs/plans"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
docs/plans/<today>/membership-cutover/
|
|
71
|
+
├── coordination.md
|
|
72
|
+
└── membership-write-path/
|
|
73
|
+
├── spec.md
|
|
74
|
+
├── tasks.md
|
|
75
|
+
├── checklist.md
|
|
76
|
+
├── contract.md
|
|
77
|
+
└── design.md
|
|
78
|
+
```
|
|
79
|
+
|
|
56
80
|
## Authoring rules
|
|
57
81
|
|
|
58
82
|
- `spec.md`: use BDD keywords `GIVEN / WHEN / THEN / AND / Requirements`.
|
|
@@ -60,9 +84,10 @@ docs/plans/<today>_membership-upgrade-flow/
|
|
|
60
84
|
- `checklist.md`: use `- [ ]` only, adapt items to real scope, and record actual results.
|
|
61
85
|
- `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
86
|
- `design.md`: record the architecture/design delta in the standard format, including affected modules, flow, invariants, tradeoffs, and validation plan.
|
|
87
|
+
- `coordination.md`: for multi-spec batches only, record shared preparation, ownership boundaries, replacement direction, merge order, and cross-spec integration checkpoints.
|
|
63
88
|
- If clarification responses change the plan, update the docs and obtain approval again before coding.
|
|
64
89
|
|
|
65
90
|
## Notes
|
|
66
91
|
|
|
67
92
|
- `scripts/...` and `references/...` are skill-folder paths, not project-folder paths.
|
|
68
|
-
- The generator replaces `[YYYY-MM-DD]`, `[Feature Name]`, `[功能名稱]`, and `[
|
|
93
|
+
- The generator replaces `[YYYY-MM-DD]`, `[Feature Name]`, `[功能名稱]`, `[change_name]`, and `[batch_name]` placeholders.
|
package/generate-spec/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: generate-spec
|
|
3
|
-
description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`) 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}
|
|
3
|
+
description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed `coordination.md`) from standard templates with clarification tracking, approval gating, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update planning docs under `docs/plans/{YYYY-MM-DD}/...`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Generate Spec
|
|
@@ -17,7 +17,7 @@ description: Generate and maintain shared feature planning artifacts (`spec.md`,
|
|
|
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
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
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
|
-
- Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}
|
|
20
|
+
- Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}/{change_name}/` for single-spec work, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` plus `coordination.md` for multi-spec parallel work, and keep them concise, executable, and easy to update.
|
|
21
21
|
|
|
22
22
|
## Goal
|
|
23
23
|
|
|
@@ -49,13 +49,17 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
49
49
|
- `SKILL_ROOT=<path_to_generate-spec_skill>`
|
|
50
50
|
- `WORKSPACE_ROOT=<target_project_root>`
|
|
51
51
|
- `python3 "$SKILL_ROOT/scripts/create-specs" "<feature_name>" --change-name <kebab-case> --template-dir "$SKILL_ROOT/references/templates" --output-dir "$WORKSPACE_ROOT/docs/plans"`
|
|
52
|
+
- For parallel multi-spec generation, also use:
|
|
53
|
+
- `--batch-name <kebab-case-batch-name>`
|
|
54
|
+
- `--with-coordination`
|
|
52
55
|
- Always generate:
|
|
53
56
|
- `references/templates/spec.md`
|
|
54
57
|
- `references/templates/tasks.md`
|
|
55
58
|
- `references/templates/checklist.md`
|
|
56
59
|
- `references/templates/contract.md`
|
|
57
60
|
- `references/templates/design.md`
|
|
58
|
-
-
|
|
61
|
+
- Generate `references/templates/coordination.md` at the batch root when multiple spec sets are intentionally created for parallel implementation.
|
|
62
|
+
- Save files under `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`.
|
|
59
63
|
|
|
60
64
|
### 3) Fill `spec.md`
|
|
61
65
|
|
|
@@ -87,6 +91,17 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
87
91
|
- Identify the affected modules, current baseline, proposed architecture, component responsibilities, control flow, data/state impact, and risk/tradeoff decisions.
|
|
88
92
|
- Cross-reference relevant requirement IDs from `spec.md` and any external dependency records from `contract.md`.
|
|
89
93
|
- Make architecture boundaries, invariants, and rollback/fallback expectations explicit when they matter to safe implementation.
|
|
94
|
+
- When the spec belongs to a parallel batch, add a short reference to the parent `coordination.md` and keep `design.md` focused on the single-spec delta rather than duplicating cross-spec ownership rules.
|
|
95
|
+
|
|
96
|
+
### 6.5) Fill `coordination.md` for parallel multi-spec batches
|
|
97
|
+
|
|
98
|
+
- Create `coordination.md` only when one user request is intentionally split into multiple spec sets that may be implemented in parallel.
|
|
99
|
+
- Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/coordination.md`.
|
|
100
|
+
- Use it as the batch-level source of truth for shared preparation, ownership boundaries, merge order, and cross-spec constraints.
|
|
101
|
+
- Record shared fields, shared contracts, or shared data-shape preparation that multiple spec sets must align on before implementation starts.
|
|
102
|
+
- When one spec set replaces or removes legacy behavior, state that direction explicitly so all worktrees implement toward the same target rather than preserving the old behavior accidentally.
|
|
103
|
+
- Capture which spec set may touch which modules, which files require coordination, and whether any landing order or cutover sequence must be respected.
|
|
104
|
+
- Keep single-spec concerns in that spec's own `design.md`; reserve `coordination.md` for batch-wide rules only.
|
|
90
105
|
|
|
91
106
|
### 7) Fill `checklist.md`
|
|
92
107
|
|
|
@@ -114,6 +129,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
114
129
|
- Update `checklist.md` with real test outcomes, `N/A` reasons, and any scope adjustments.
|
|
115
130
|
- Update `contract.md` when the final dependency usage, obligations, or verified constraints differ from the planning draft.
|
|
116
131
|
- Update `design.md` when the approved architecture changes during implementation, and record the final chosen design rather than leaving stale placeholders.
|
|
132
|
+
- Update `coordination.md` when shared ownership, replacement sequencing, or cross-spec preparation changed during implementation or merge planning.
|
|
117
133
|
- Only mark checklist items complete when the work actually happened or the recorded decision actually applies.
|
|
118
134
|
- Do not check off unused examples, placeholder rows, or non-selected decision options.
|
|
119
135
|
- If different flows use different test strategies, preserve separate decision records in the final checklist instead of merging them into a misleading single summary.
|
|
@@ -126,6 +142,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
126
142
|
- Keep requirement IDs, task IDs, and test IDs traceable across all three files.
|
|
127
143
|
- Never allow one spec set to cover more than three modules.
|
|
128
144
|
- When a request exceeds that scope, split it into independent, non-conflicting, non-dependent spec sets before approval.
|
|
145
|
+
- When multiple spec sets are created for one batch, keep their shared implementation direction in one `coordination.md` instead of duplicating cross-spec rules in every `design.md`.
|
|
129
146
|
- Prefer realistic coverage over boilerplate: add or remove checklist items based on actual risk.
|
|
130
147
|
- 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
148
|
- `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.
|
|
@@ -143,3 +160,4 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
143
160
|
- `references/templates/checklist.md`: behavior-to-test alignment template.
|
|
144
161
|
- `references/templates/contract.md`: external dependency contract template.
|
|
145
162
|
- `references/templates/design.md`: architecture/design delta template.
|
|
163
|
+
- `references/templates/coordination.md`: parallel batch coordination 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
|
|
4
|
+
default_prompt: "Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with a shared coordination.md, 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, record shared preparation and legacy-replacement direction in coordination.md when multiple specs will be implemented in parallel, process clarification updates, and wait for explicit approval before implementation."
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Coordination: [Feature Name]
|
|
2
|
+
|
|
3
|
+
- Date: [YYYY-MM-DD]
|
|
4
|
+
- Batch: [batch_name]
|
|
5
|
+
|
|
6
|
+
## Coordination Goal
|
|
7
|
+
[Describe the shared implementation goal across this batch of parallel spec sets.]
|
|
8
|
+
|
|
9
|
+
## Batch Scope
|
|
10
|
+
- Included spec sets: [[spec-name-1], [spec-name-2]]
|
|
11
|
+
- Shared outcome: [what the batch delivers when all spec sets land]
|
|
12
|
+
- Out of scope: [shared exclusions for the batch]
|
|
13
|
+
|
|
14
|
+
## Shared Context
|
|
15
|
+
- Current baseline: [the current system shape that all spec sets must assume]
|
|
16
|
+
- Shared constraints: [runtime, rollout, compatibility, or ownership constraints]
|
|
17
|
+
- Shared invariants: [rules every spec set must preserve]
|
|
18
|
+
|
|
19
|
+
## Shared Preparation
|
|
20
|
+
|
|
21
|
+
### Shared Fields / Contracts
|
|
22
|
+
- Shared fields to introduce or reuse: [field / config / API shape / event schema]
|
|
23
|
+
- Canonical source of truth: [which module or data owner defines them]
|
|
24
|
+
- Required preparation before implementation: [migration, adapter, stub, flag, fallback, fixture]
|
|
25
|
+
|
|
26
|
+
### Replacement / Legacy Direction
|
|
27
|
+
- Legacy behavior being replaced: [feature / flow / module / endpoint / UI]
|
|
28
|
+
- Required implementation direction: [replace in place / shadow then cut over / adapter bridge / phased removal]
|
|
29
|
+
- Compatibility window: [None / temporary coexistence period]
|
|
30
|
+
- Cleanup required after cutover: [delete flag / remove adapter / drop old field / remove old tests]
|
|
31
|
+
|
|
32
|
+
## Spec Ownership Map
|
|
33
|
+
|
|
34
|
+
### Spec Set 1: [spec-name-1]
|
|
35
|
+
- Primary concern: [what this spec owns]
|
|
36
|
+
- Allowed touch points: [files/modules it may change]
|
|
37
|
+
- Must not change: [files/modules owned by another spec unless explicitly coordinated]
|
|
38
|
+
- Depends on shared preparation: [None / specific shared item above]
|
|
39
|
+
|
|
40
|
+
### Spec Set 2: [spec-name-2]
|
|
41
|
+
- Primary concern: [what this spec owns]
|
|
42
|
+
- Allowed touch points: [files/modules it may change]
|
|
43
|
+
- Must not change: [files/modules owned by another spec unless explicitly coordinated]
|
|
44
|
+
- Depends on shared preparation: [None / specific shared item above]
|
|
45
|
+
|
|
46
|
+
## Conflict Boundaries
|
|
47
|
+
- Shared files requiring coordination: [file/module list or `None`]
|
|
48
|
+
- Merge order / landing order: [independent / explicit order]
|
|
49
|
+
- Worktree notes: [branch naming, rebase expectations, or `None`]
|
|
50
|
+
|
|
51
|
+
## Integration Checkpoints
|
|
52
|
+
- Combined behaviors to verify after merge: [cross-spec outcome]
|
|
53
|
+
- Required final test scope: [integration / E2E / migration / rollback]
|
|
54
|
+
- Rollback notes: [how to contain partial batch rollout]
|
|
55
|
+
|
|
56
|
+
## Open Questions
|
|
57
|
+
[Write `None` if the batch coordination is settled.]
|
|
58
|
+
- [Question 1]
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
- Spec requirements covered: [R?.?]
|
|
17
17
|
- Affected modules: [module/file/service list]
|
|
18
18
|
- External contracts involved: [dependency names from `contract.md`, or `None`]
|
|
19
|
+
- Coordination reference: [`../coordination.md` or `None`]
|
|
19
20
|
|
|
20
21
|
## Current Architecture
|
|
21
22
|
[Describe the relevant current components, data flow, control flow, and boundaries.]
|
|
@@ -13,6 +13,7 @@ TEMPLATE_FILENAMES = (
|
|
|
13
13
|
"contract.md",
|
|
14
14
|
"design.md",
|
|
15
15
|
)
|
|
16
|
+
COORDINATION_TEMPLATE = "coordination.md"
|
|
16
17
|
PLACEHOLDERS = ("[Feature Name]", "[功能名稱]")
|
|
17
18
|
|
|
18
19
|
|
|
@@ -27,11 +28,18 @@ def _default_template_dir() -> Path:
|
|
|
27
28
|
return Path(__file__).resolve().parent.parent / "references" / "templates"
|
|
28
29
|
|
|
29
30
|
|
|
30
|
-
def _render(
|
|
31
|
+
def _render(
|
|
32
|
+
content: str,
|
|
33
|
+
today: str,
|
|
34
|
+
feature_name: str,
|
|
35
|
+
change_name: str,
|
|
36
|
+
batch_name: str | None,
|
|
37
|
+
) -> str:
|
|
31
38
|
rendered = content.replace("[YYYY-MM-DD]", today)
|
|
32
39
|
for placeholder in PLACEHOLDERS:
|
|
33
40
|
rendered = rendered.replace(placeholder, feature_name)
|
|
34
41
|
rendered = rendered.replace("[change_name]", change_name)
|
|
42
|
+
rendered = rendered.replace("[batch_name]", batch_name or "None")
|
|
35
43
|
return rendered
|
|
36
44
|
|
|
37
45
|
|
|
@@ -39,7 +47,8 @@ def main() -> int:
|
|
|
39
47
|
parser = argparse.ArgumentParser(
|
|
40
48
|
description=(
|
|
41
49
|
"Create planning docs (spec.md, tasks.md, checklist.md, contract.md, design.md) "
|
|
42
|
-
"from templates with folder format docs/plans/{date}
|
|
50
|
+
"from templates with folder format docs/plans/{date}/{change_name} "
|
|
51
|
+
"or docs/plans/{date}/{batch_name}/{change_name}."
|
|
43
52
|
),
|
|
44
53
|
)
|
|
45
54
|
parser.add_argument("feature_name", help="Display name used in generated documents")
|
|
@@ -52,6 +61,21 @@ def main() -> int:
|
|
|
52
61
|
"Defaults to slugified feature_name when omitted."
|
|
53
62
|
),
|
|
54
63
|
)
|
|
64
|
+
parser.add_argument(
|
|
65
|
+
"--batch-name",
|
|
66
|
+
help=(
|
|
67
|
+
"Optional batch folder used for parallel spec generation. "
|
|
68
|
+
"When provided, specs are written under docs/plans/{date}/{batch_name}/{change_name}."
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
parser.add_argument(
|
|
72
|
+
"--with-coordination",
|
|
73
|
+
action="store_true",
|
|
74
|
+
help=(
|
|
75
|
+
"When used with --batch-name, also create or update "
|
|
76
|
+
"docs/plans/{date}/{batch_name}/coordination.md from the shared template."
|
|
77
|
+
),
|
|
78
|
+
)
|
|
55
79
|
parser.add_argument(
|
|
56
80
|
"--output-dir",
|
|
57
81
|
default="docs/plans",
|
|
@@ -81,6 +105,10 @@ def main() -> int:
|
|
|
81
105
|
"Unable to build change_name. Provide --change-name with ASCII letters/numbers."
|
|
82
106
|
)
|
|
83
107
|
|
|
108
|
+
batch_name = args.batch_name.strip() if args.batch_name else None
|
|
109
|
+
if args.with_coordination and not batch_name:
|
|
110
|
+
raise SystemExit("--with-coordination requires --batch-name")
|
|
111
|
+
|
|
84
112
|
template_dir = Path(args.template_dir).expanduser().resolve()
|
|
85
113
|
if not template_dir.exists() or not template_dir.is_dir():
|
|
86
114
|
raise SystemExit(f"Template directory not found: {template_dir}")
|
|
@@ -88,15 +116,22 @@ def main() -> int:
|
|
|
88
116
|
missing_templates = [
|
|
89
117
|
name for name in TEMPLATE_FILENAMES if not (template_dir / name).exists()
|
|
90
118
|
]
|
|
119
|
+
if args.with_coordination and not (template_dir / COORDINATION_TEMPLATE).exists():
|
|
120
|
+
missing_templates.append(COORDINATION_TEMPLATE)
|
|
91
121
|
if missing_templates:
|
|
92
122
|
missing = ", ".join(missing_templates)
|
|
93
123
|
raise SystemExit(f"Missing template files in {template_dir}: {missing}")
|
|
94
124
|
|
|
95
125
|
output_dir = Path(args.output_dir).expanduser().resolve()
|
|
96
126
|
today = date.today().isoformat()
|
|
97
|
-
|
|
127
|
+
date_root = output_dir / today
|
|
128
|
+
batch_root = date_root / batch_name if batch_name else None
|
|
129
|
+
output_root = (batch_root / change_name) if batch_root else (date_root / change_name)
|
|
98
130
|
|
|
99
131
|
output_paths = [output_root / name for name in TEMPLATE_FILENAMES]
|
|
132
|
+
coordination_path = (
|
|
133
|
+
batch_root / COORDINATION_TEMPLATE if args.with_coordination and batch_root else None
|
|
134
|
+
)
|
|
100
135
|
existing_files = [path for path in output_paths if path.exists()]
|
|
101
136
|
if existing_files and not args.force:
|
|
102
137
|
existing = ", ".join(str(path) for path in existing_files)
|
|
@@ -116,12 +151,28 @@ def main() -> int:
|
|
|
116
151
|
today=today,
|
|
117
152
|
feature_name=feature_name,
|
|
118
153
|
change_name=change_name,
|
|
154
|
+
batch_name=batch_name,
|
|
155
|
+
),
|
|
156
|
+
encoding="utf-8",
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
if coordination_path and (args.force or not coordination_path.exists()):
|
|
160
|
+
coordination_template = template_dir / COORDINATION_TEMPLATE
|
|
161
|
+
coordination_path.write_text(
|
|
162
|
+
_render(
|
|
163
|
+
content=coordination_template.read_text(encoding="utf-8"),
|
|
164
|
+
today=today,
|
|
165
|
+
feature_name=feature_name,
|
|
166
|
+
change_name=change_name,
|
|
167
|
+
batch_name=batch_name,
|
|
119
168
|
),
|
|
120
169
|
encoding="utf-8",
|
|
121
170
|
)
|
|
122
171
|
|
|
123
172
|
for output_path in output_paths:
|
|
124
173
|
print(output_path)
|
|
174
|
+
if coordination_path:
|
|
175
|
+
print(coordination_path)
|
|
125
176
|
return 0
|
|
126
177
|
|
|
127
178
|
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
name: implement-specs-with-worktree
|
|
3
3
|
description: >-
|
|
4
4
|
Read a specs planning set (spec.md, tasks.md, checklist.md, contract.md, design.md)
|
|
5
|
-
from `docs/plans/{YYYY-MM-DD}
|
|
5
|
+
from `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`
|
|
6
|
+
plus parent `coordination.md` when present, and implement the approved tasks
|
|
6
7
|
within an isolated git worktree. Use when the user asks to implement from an
|
|
7
8
|
existing spec set, execute a spec plan, or work on a feature branch without
|
|
8
9
|
affecting the main working tree. If not already in a worktree, create a new
|
|
@@ -34,15 +35,17 @@ Implement approved spec planning sets in an isolated git worktree, ensuring main
|
|
|
34
35
|
|
|
35
36
|
### 1) Identify and read the specs set
|
|
36
37
|
|
|
37
|
-
- Locate the specs directory. The path format is `docs/plans/{YYYY-MM-DD}
|
|
38
|
+
- Locate the specs directory. The path format is `docs/plans/{YYYY-MM-DD}/{change_name}/` for single-spec work, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` for coordinated multi-spec work.
|
|
38
39
|
- If the user provides a specific path, use that directly.
|
|
39
40
|
- If only a `change_name` or date is given, search for matching directories under `docs/plans/`.
|
|
41
|
+
- When the plan sits under a batch directory, also read the sibling `coordination.md` before implementation.
|
|
40
42
|
- Read all five spec files:
|
|
41
43
|
- `spec.md` — requirements and BDD behaviors
|
|
42
44
|
- `tasks.md` — task breakdown
|
|
43
45
|
- `checklist.md` — behavior-to-test alignment and completion tracking
|
|
44
46
|
- `contract.md` — API/interface contracts
|
|
45
47
|
- `design.md` — design decisions and architecture notes
|
|
48
|
+
- If `coordination.md` exists in the parent batch directory, read it as the shared source of truth for ownership boundaries, shared preparation, replacement direction, merge order, and cross-spec integration checkpoints.
|
|
46
49
|
- Understand the scope, requirements, and planned tasks before proceeding.
|
|
47
50
|
|
|
48
51
|
### 2) Check current worktree state
|
|
@@ -70,6 +73,7 @@ Use branch naming from `references/branch-naming.md`.
|
|
|
70
73
|
|
|
71
74
|
- Explore the existing codebase relevant to the planned tasks.
|
|
72
75
|
- Verify latest authoritative docs for involved stacks/integrations.
|
|
76
|
+
- When `coordination.md` exists, respect its shared-field preparation, legacy-replacement direction, and allowed touch-point boundaries before editing.
|
|
73
77
|
- Implement each task in `tasks.md` systematically.
|
|
74
78
|
- For each implemented change, add appropriate tests:
|
|
75
79
|
- Unit tests for changed logic
|
|
@@ -88,6 +92,7 @@ After implementation and testing:
|
|
|
88
92
|
- Update `spec.md` with actual completion state for each requirement.
|
|
89
93
|
- Mark completed tasks in `tasks.md`.
|
|
90
94
|
- Update `checklist.md` with test execution results, N/A reasons, and any scope adjustments.
|
|
95
|
+
- If the shared implementation direction changed, update the parent `coordination.md` as well before finishing.
|
|
91
96
|
- Do not mark unused template examples or non-applicable items as complete.
|
|
92
97
|
|
|
93
98
|
### 6) Commit changes
|
|
@@ -113,6 +118,7 @@ After implementation and testing:
|
|
|
113
118
|
- Always work in an isolated worktree to keep main clean.
|
|
114
119
|
- Complete all planned tasks before committing; do not stop with partial work.
|
|
115
120
|
- Treat the specs as the source of truth for scope — do not deviate without user approval.
|
|
121
|
+
- When `coordination.md` exists, treat it as the source of truth for batch-level ownership and cutover direction.
|
|
116
122
|
- Follow the testing standards from `enhance-existing-features` and `develop-new-features`.
|
|
117
123
|
- Do not push to remote unless the user explicitly requests it.
|
|
118
124
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Implement Specs with Worktree"
|
|
3
3
|
short_description: "Implement an approved spec set inside an isolated git worktree"
|
|
4
|
-
default_prompt: "Use $implement-specs-with-worktree to read the full plan set under docs/plans, create or reuse an isolated git worktree, implement all approved tasks
|
|
4
|
+
default_prompt: "Use $implement-specs-with-worktree to read the full plan set under docs/plans, including parent coordination.md when the spec belongs to a parallel batch, create or reuse an isolated git worktree, implement all approved tasks within the shared ownership and replacement-direction constraints, backfill completion status into the planning docs, and commit the result to the local worktree branch without affecting main."
|
|
@@ -23,7 +23,7 @@ description: >-
|
|
|
23
23
|
## Standards
|
|
24
24
|
|
|
25
25
|
- Evidence: Inspect the current branch state, local branches, ahead/behind status, and actual conflicting files before deciding what to merge.
|
|
26
|
-
- Execution: Merge only the relevant local branches into `main` sequentially, resolve conflicts by reading both sides and editing the merged result to preserve shipped behavior, verify the merged state, then hand the final local branch state to `commit-and-push` so commit/changelog/spec-archival work happens through the shared submission workflow.
|
|
26
|
+
- Execution: Merge only the relevant local branches into `main` sequentially, resolve conflicts by reading both sides and editing the merged result to preserve shipped behavior, verify the merged state, delete each successfully merged branch and its detached worktree only after the merged result is confirmed, then hand the final local branch state to `commit-and-push` so commit/changelog/spec-archival work happens through the shared submission workflow.
|
|
27
27
|
- Quality: Never use blanket timestamp rules or default `-X ours/theirs` conflict resolution as the primary merge strategy, and do not declare success until the final `main` state has been checked and verified.
|
|
28
28
|
- Output: Produce a clean local main branch with all local changes integrated and ready for the shared submit workflow.
|
|
29
29
|
|
|
@@ -98,6 +98,21 @@ For each local branch (excluding main):
|
|
|
98
98
|
|
|
99
99
|
### 5) Hand off the merged result for shared submission handling
|
|
100
100
|
|
|
101
|
+
- After a branch has been merged successfully and the merged `main` state has been verified, remove the source branch worktree if one exists:
|
|
102
|
+
```bash
|
|
103
|
+
git worktree list
|
|
104
|
+
git worktree remove <worktree-path>
|
|
105
|
+
```
|
|
106
|
+
- Delete only branches that were merged successfully:
|
|
107
|
+
```bash
|
|
108
|
+
git branch -d <branch-name>
|
|
109
|
+
```
|
|
110
|
+
- If a branch still has an attached worktree, remove the worktree before deleting the branch.
|
|
111
|
+
- Never delete:
|
|
112
|
+
- `main`
|
|
113
|
+
- the currently checked-out branch
|
|
114
|
+
- branches that were skipped, failed to merge, or still need manual follow-up
|
|
115
|
+
- If `git branch -d` refuses deletion because the branch is not actually merged, stop and report the branch instead of forcing deletion with `-D`.
|
|
101
116
|
- Once merge verification passes, invoke `commit-and-push` for the authoritative local branch so the final submission flow owns:
|
|
102
117
|
- `CHANGELOG.md` readiness
|
|
103
118
|
- any required `archive-specs` run
|
|
@@ -123,6 +138,7 @@ For each local branch (excluding main):
|
|
|
123
138
|
- Keep the main branch history clean and readable.
|
|
124
139
|
- If a branch's merge breaks tests, resolve the conflict differently before committing.
|
|
125
140
|
- Do not stash or discard unrelated work automatically; stop when the working tree state makes the merge ambiguous.
|
|
141
|
+
- Delete merged source branches and their detached worktrees only after the merge commit and verification both succeed.
|
|
126
142
|
|
|
127
143
|
## Conflict Resolution Examples
|
|
128
144
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Merge Changes from Local Branches"
|
|
3
3
|
short_description: "Merge relevant local branches into main with verified conflict resolution"
|
|
4
|
-
default_prompt: "Use $merge-changes-from-local-branches to inventory local branches, merge only the relevant ones into local main, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, and leave remote state untouched."
|
|
4
|
+
default_prompt: "Use $merge-changes-from-local-branches to inventory local branches, merge only the relevant ones into local main, resolve conflicts by reading and composing the correct behavior instead of relying on blanket merge strategies, run targeted verification after conflictful merges, delete successfully merged source branches and detached worktrees only after verification succeeds, and leave remote state untouched."
|
package/package.json
CHANGED
|
@@ -21,7 +21,7 @@ description: Recover a missing or mismatched `docs/plans/...` plan set by verify
|
|
|
21
21
|
|
|
22
22
|
## Overview
|
|
23
23
|
|
|
24
|
-
Use this skill when the user points to `docs/plans/{date}
|
|
24
|
+
Use this skill when the user points to `docs/plans/{date}/{change}/...` or `docs/plans/{date}/{batch}/{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
25
|
|
|
26
26
|
Typical triggers:
|
|
27
27
|
- The user references a specific `docs/plans/...` directory that is absent from the current worktree.
|