@laitszkin/apollo-toolkit 3.6.0 → 3.6.2
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 +1 -1
- package/CHANGELOG.md +14 -0
- package/analyse-app-logs/scripts/__pycache__/filter_logs_by_time.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/log_cli_utils.cpython-312.pyc +0 -0
- package/analyse-app-logs/scripts/__pycache__/search_logs.cpython-312.pyc +0 -0
- package/archive-specs/SKILL.md +4 -4
- package/commit-and-push/agents/openai.yaml +1 -1
- package/docs-to-voice/scripts/__pycache__/docs_to_voice.cpython-312.pyc +0 -0
- package/feature-propose/README.md +2 -2
- package/feature-propose/SKILL.md +9 -9
- package/generate-spec/README.md +19 -3
- package/generate-spec/SKILL.md +34 -9
- package/generate-spec/agents/openai.yaml +1 -1
- package/generate-spec/references/templates/coordination.md +2 -11
- package/generate-spec/references/templates/preparation.md +69 -0
- package/generate-spec/scripts/__pycache__/create-specscpython-312.pyc +0 -0
- package/generate-spec/scripts/create-specs +34 -1
- package/generate-spec/tests/test_create_specs.py +35 -1
- package/implement-specs-with-subagents/SKILL.md +26 -6
- package/implement-specs-with-subagents/agents/openai.yaml +1 -1
- package/implement-specs-with-worktree/SKILL.md +10 -6
- package/iterative-code-performance/README.md +1 -1
- package/iterative-code-performance/SKILL.md +3 -3
- package/iterative-code-performance/agents/openai.yaml +1 -1
- package/iterative-code-performance/references/iteration-gates.md +1 -1
- package/iterative-code-performance/references/repository-scan.md +1 -1
- package/iterative-code-quality/README.md +1 -1
- package/iterative-code-quality/SKILL.md +3 -3
- package/iterative-code-quality/agents/openai.yaml +1 -1
- package/iterative-code-quality/references/iteration-gates.md +1 -1
- package/iterative-code-quality/references/module-boundaries.md +1 -1
- package/iterative-code-quality/references/repository-scan.md +1 -1
- package/katex/scripts/__pycache__/render_katex.cpython-312.pyc +0 -0
- package/maintain-project-constraints/SKILL.md +15 -15
- package/maintain-project-constraints/agents/openai.yaml +2 -2
- package/maintain-skill-catalog/README.md +1 -1
- package/maintain-skill-catalog/SKILL.md +2 -2
- package/merge-changes-from-local-branches/SKILL.md +1 -1
- package/open-github-issue/scripts/__pycache__/open_github_issue.cpython-312.pyc +0 -0
- package/package.json +1 -1
- package/read-github-issue/scripts/__pycache__/find_issues.cpython-312.pyc +0 -0
- package/read-github-issue/scripts/__pycache__/read_issue.cpython-312.pyc +0 -0
- package/resolve-review-comments/scripts/__pycache__/review_threads.cpython-312.pyc +0 -0
- package/ship-github-issue-fix/SKILL.md +2 -2
- package/submission-readiness-check/SKILL.md +5 -5
- package/text-to-short-video/scripts/__pycache__/enforce_video_aspect_ratio.cpython-312.pyc +0 -0
- package/version-release/SKILL.md +1 -1
- package/version-release/agents/openai.yaml +1 -1
package/AGENTS.md
CHANGED
|
@@ -26,7 +26,7 @@ This repository enables users to install and run a curated set of reusable agent
|
|
|
26
26
|
- Users can choose between symlink mode (auto-update via git pull) and copy mode (stable snapshot) with `--symlink` / `--copy` flags.
|
|
27
27
|
- Users can run bundled helper tools through `apltk tools` and direct `apltk <tool>` commands for selected packaged skill scripts.
|
|
28
28
|
- Users can design and implement new features through a spec-first workflow.
|
|
29
|
-
- Users can generate shared feature planning artifacts for approval-gated workflows, including parallel multi-spec batches coordinated through
|
|
29
|
+
- Users can generate shared feature planning artifacts for approval-gated workflows, including parallel multi-spec batches coordinated through `coordination.md` and, only when needed, minimal non-business prerequisite work in `preparation.md`.
|
|
30
30
|
- Users can convert text or documents into audio files with subtitle timelines.
|
|
31
31
|
- Users can turn lecture slides, past papers, and answer books into mock exams, worked solutions, study notes, or graded PDFs with KaTeX-rendered math.
|
|
32
32
|
- Users can extend existing features in a brownfield codebase with required tests and approvals.
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ All notable changes to this repository are documented in this file.
|
|
|
7
7
|
### Added
|
|
8
8
|
- (None yet)
|
|
9
9
|
|
|
10
|
+
## [v3.6.2] - 2026-04-28
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
- Normalize `AGENTS.md` references to `AGENTS.md/CLAUDE.md` across the skill catalog for CLAUDE.md awareness.
|
|
14
|
+
|
|
15
|
+
## [v3.6.1] - 2026-04-28
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
- Add an optional `generate-spec` `preparation.md` template and `apltk create-specs --with-preparation` support for minimal non-business prerequisite work before parallel spec implementation.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Tighten `implement-specs-with-subagents` so the coordinating agent completes and commits documented prerequisite preparation before launching implementation subagents.
|
|
22
|
+
- Keep `coordination.md` focused on ownership and collision rules by removing preparation-task fields from its template.
|
|
23
|
+
|
|
10
24
|
## [v3.6.0] - 2026-04-28
|
|
11
25
|
|
|
12
26
|
### Added
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/archive-specs/SKILL.md
CHANGED
|
@@ -7,7 +7,7 @@ description: Convert completed project plan sets into maintainable project docum
|
|
|
7
7
|
|
|
8
8
|
## Dependencies
|
|
9
9
|
|
|
10
|
-
- Required: `align-project-documents` to align repository docs with current code before archiving, and `maintain-project-constraints` to synchronize `AGENTS.md` after the doc update.
|
|
10
|
+
- Required: `align-project-documents` to align repository docs with current code before archiving, and `maintain-project-constraints` to synchronize `AGENTS.md/CLAUDE.md` after the doc update.
|
|
11
11
|
- Conditional: none.
|
|
12
12
|
- Optional: none.
|
|
13
13
|
- Fallback: not applicable.
|
|
@@ -15,9 +15,9 @@ description: Convert completed project plan sets into maintainable project docum
|
|
|
15
15
|
## Standards
|
|
16
16
|
|
|
17
17
|
- Evidence: Treat code, config, deployment files, and current spec files as evidence sources; never guess when a detail is missing.
|
|
18
|
-
- Execution: Inventory all relevant specs first, reconcile them with the current repository, use `align-project-documents` to update durable project docs, use `maintain-project-constraints` to refresh `AGENTS.md` when repository guidance changed, then archive only the truly consumed planning artifacts.
|
|
18
|
+
- Execution: Inventory all relevant specs first, reconcile them with the current repository, use `align-project-documents` to update durable project docs, use `maintain-project-constraints` to refresh `AGENTS.md/CLAUDE.md` when repository guidance changed, then archive only the truly consumed planning artifacts.
|
|
19
19
|
- Quality: Prefer source-of-truth behavior over stale plan text, align existing docs to the same standard structure, and call out unknowns explicitly instead of inventing missing setup details.
|
|
20
|
-
- Output: Produce synchronized durable docs (`README.md`, categorized project docs, and `AGENTS.md` when needed), then archive or remove superseded spec files after the conversion is complete.
|
|
20
|
+
- Output: Produce synchronized durable docs (`README.md`, categorized project docs, and `AGENTS.md/CLAUDE.md` when needed), then archive or remove superseded spec files after the conversion is complete.
|
|
21
21
|
|
|
22
22
|
## Goal
|
|
23
23
|
|
|
@@ -87,7 +87,7 @@ Ensure the split project docs cover all of the following:
|
|
|
87
87
|
- `docs/README.md` should act as the reference list for the categorized docs.
|
|
88
88
|
- Each category doc should stay focused on one topic instead of acting like another monolithic handbook.
|
|
89
89
|
- Remove template placeholders and stale planning language before finishing.
|
|
90
|
-
- After the docs are aligned, run `maintain-project-constraints` whenever the documentation changes imply `AGENTS.md` needs to reflect updated workflows, commands, or repository capabilities.
|
|
90
|
+
- After the docs are aligned, run `maintain-project-constraints` whenever the documentation changes imply `AGENTS.md/CLAUDE.md` needs to reflect updated workflows, commands, or repository capabilities.
|
|
91
91
|
|
|
92
92
|
### 7) Archive superseded spec files after successful conversion
|
|
93
93
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "Commit and Push"
|
|
3
3
|
short_description: "Submit local changes with commit and push only"
|
|
4
|
-
default_prompt: "Use $commit-and-push to inspect the current git state and classify the diff. Treat every conditional gate whose scenario is met as blocking before any commit: if the change set includes code changes, run $review-change-set; if the reviewed risk profile says edge-case or security review is needed, run $discover-edge-cases and $harden-app-security as blocking gates too; if completed specs should be converted or docs need normalization, ensure $archive-specs runs through $submission-readiness-check; if changelog synchronization is needed, complete it before continuing. Then run any additional required code-quality skills, hand the repository to $submission-readiness-check so it can synchronize completed plan archives, project docs, AGENTS.md, and CHANGELOG.md before any commit, confirm root CHANGELOG.md Unreleased reflects the actual pending change set, preserve user staging intent, create a concise Conventional Commit, and push to the intended branch without any versioning or release steps."
|
|
4
|
+
default_prompt: "Use $commit-and-push to inspect the current git state and classify the diff. Treat every conditional gate whose scenario is met as blocking before any commit: if the change set includes code changes, run $review-change-set; if the reviewed risk profile says edge-case or security review is needed, run $discover-edge-cases and $harden-app-security as blocking gates too; if completed specs should be converted or docs need normalization, ensure $archive-specs runs through $submission-readiness-check; if changelog synchronization is needed, complete it before continuing. Then run any additional required code-quality skills, hand the repository to $submission-readiness-check so it can synchronize completed plan archives, project docs, AGENTS.md/CLAUDE.md, and CHANGELOG.md before any commit, confirm root CHANGELOG.md Unreleased reflects the actual pending change set, preserve user staging intent, create a concise Conventional Commit, and push to the intended branch without any versioning or release steps."
|
|
Binary file
|
|
@@ -7,8 +7,8 @@ It guides the agent to:
|
|
|
7
7
|
2. Classify user-facing functions into MVP / Important / Enhancement / Performance.
|
|
8
8
|
3. Propose numbered feature recommendations with clear implementation direction.
|
|
9
9
|
4. Publish accepted proposals through `open-github-issue` with reason and suggested architecture.
|
|
10
|
-
5. Record accepted feature proposals in `AGENTS.md`.
|
|
11
|
-
6. Remove implemented proposals from `AGENTS.md` after delivery.
|
|
10
|
+
5. Record accepted feature proposals in `AGENTS.md/CLAUDE.md`.
|
|
11
|
+
6. Remove implemented proposals from `AGENTS.md/CLAUDE.md` after delivery.
|
|
12
12
|
|
|
13
13
|
## Repository layout
|
|
14
14
|
|
package/feature-propose/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: feature-propose
|
|
3
|
-
description: Professional product-management workflow for proposing features from an existing codebase. Use when the user asks to understand an application, classify features from a user perspective into MVP/Important/Enhancement/Performance tiers, ask 3-5 clarifying questions when needed, propose numbered feature recommendations, publish accepted proposals through `open-github-issue`, record accepted items in AGENTS.md, and remove implemented items from AGENTS.md.
|
|
3
|
+
description: Professional product-management workflow for proposing features from an existing codebase. Use when the user asks to understand an application, classify features from a user perspective into MVP/Important/Enhancement/Performance tiers, ask 3-5 clarifying questions when needed, propose numbered feature recommendations, publish accepted proposals through `open-github-issue`, record accepted items in AGENTS.md/CLAUDE.md, and remove implemented items from AGENTS.md/CLAUDE.md.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Feature Propose
|
|
@@ -10,7 +10,7 @@ description: Professional product-management workflow for proposing features fro
|
|
|
10
10
|
- Required: none.
|
|
11
11
|
- Conditional: `open-github-issue` for accepted features that should be published as GitHub issues.
|
|
12
12
|
- Optional: none.
|
|
13
|
-
- Fallback: If issue publication is skipped or unavailable, keep accepted proposals synchronized in `AGENTS.md` and report the publication state explicitly.
|
|
13
|
+
- Fallback: If issue publication is skipped or unavailable, keep accepted proposals synchronized in `AGENTS.md/CLAUDE.md` and report the publication state explicitly.
|
|
14
14
|
|
|
15
15
|
## Standards
|
|
16
16
|
|
|
@@ -21,7 +21,7 @@ description: Professional product-management workflow for proposing features fro
|
|
|
21
21
|
|
|
22
22
|
## Overview
|
|
23
23
|
|
|
24
|
-
Act as a professional PM: build a complete understanding of the current product from code, classify capabilities by user value, propose prioritized features, publish accepted proposals through `open-github-issue`, persist accepted proposals in `AGENTS.md`, and keep the list clean by removing implemented items.
|
|
24
|
+
Act as a professional PM: build a complete understanding of the current product from code, classify capabilities by user value, propose prioritized features, publish accepted proposals through `open-github-issue`, persist accepted proposals in `AGENTS.md/CLAUDE.md`, and keep the list clean by removing implemented items.
|
|
25
25
|
|
|
26
26
|
## References
|
|
27
27
|
|
|
@@ -36,7 +36,7 @@ Load these references as needed during classification:
|
|
|
36
36
|
|
|
37
37
|
### 1) Explore the codebase before proposing anything
|
|
38
38
|
|
|
39
|
-
- Read repo-level guidance first (`AGENTS.md`, `README`, major docs).
|
|
39
|
+
- Read repo-level guidance first (`AGENTS.md/CLAUDE.md`, `README`, major docs).
|
|
40
40
|
- Map architecture, entrypoints, user-facing flows, data models, and external integrations.
|
|
41
41
|
- Identify implemented features, obvious gaps, and technical constraints from code and tests.
|
|
42
42
|
- Summarize findings before moving to prioritization.
|
|
@@ -72,17 +72,17 @@ Load these references as needed during classification:
|
|
|
72
72
|
- Acceptance criteria
|
|
73
73
|
- Keep proposals focused and minimal; avoid over-engineering.
|
|
74
74
|
|
|
75
|
-
### 5) Persist accepted features to AGENTS.md, publish them, and clean up after implementation
|
|
75
|
+
### 5) Persist accepted features to AGENTS.md/CLAUDE.md, publish them, and clean up after implementation
|
|
76
76
|
|
|
77
77
|
- Ask the user to accept/reject/edit features by number.
|
|
78
|
-
- Once accepted, update repo-root `AGENTS.md` with a dedicated section:
|
|
78
|
+
- Once accepted, update repo-root `AGENTS.md/CLAUDE.md` with a dedicated section:
|
|
79
79
|
- `## Accepted Feature Proposals`
|
|
80
80
|
- Append accepted features as a numbered list with:
|
|
81
81
|
- Date (`YYYY-MM-DD`)
|
|
82
82
|
- Type (`MVP`, `Important`, `Enhancement`, `Performance`)
|
|
83
83
|
- Short feature statement
|
|
84
|
-
- Preserve existing `AGENTS.md` content and style; do not rewrite unrelated sections.
|
|
85
|
-
- If `AGENTS.md` does not exist, ask before creating it.
|
|
84
|
+
- Preserve existing `AGENTS.md/CLAUDE.md` content and style; do not rewrite unrelated sections.
|
|
85
|
+
- If `AGENTS.md/CLAUDE.md` does not exist, ask before creating it.
|
|
86
86
|
- For each accepted feature, invoke `open-github-issue` exactly once with feature-proposal content.
|
|
87
87
|
- Default to publishing accepted features unless the user explicitly says not to create GitHub issues.
|
|
88
88
|
- Pass these fields to `open-github-issue`:
|
|
@@ -94,7 +94,7 @@ Load these references as needed during classification:
|
|
|
94
94
|
- `repo`: target repository in `owner/repo` format when known
|
|
95
95
|
- If invoking the publisher CLI directly, pass accepted proposal details through `apltk open-github-issue --payload-file <json>` or `@file` inputs rather than inline shell arguments so Markdown and code identifiers remain literal.
|
|
96
96
|
- Reuse the returned `mode`, `issue_url`, and `publish_error` in the response.
|
|
97
|
-
- After the related feature is implemented, remove that feature entry from `## Accepted Feature Proposals` in `AGENTS.md`.
|
|
97
|
+
- After the related feature is implemented, remove that feature entry from `## Accepted Feature Proposals` in `AGENTS.md/CLAUDE.md`.
|
|
98
98
|
- Remove only implemented items; keep unimplemented accepted items untouched.
|
|
99
99
|
|
|
100
100
|
## Output template
|
package/generate-spec/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# generate-spec
|
|
2
2
|
|
|
3
|
-
A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed `coordination.md` so other skills can reuse one consistent approval-gated spec workflow with risk-driven test planning from `test-case-strategy`.
|
|
3
|
+
A shared planning skill for feature work. It centralizes creation and maintenance of `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed shared `coordination.md` or `preparation.md` so other skills can reuse one consistent approval-gated spec workflow with risk-driven test planning from `test-case-strategy`.
|
|
4
4
|
|
|
5
5
|
## Core capabilities
|
|
6
6
|
|
|
7
7
|
- Generates single-spec plans under `docs/plans/{YYYY-MM-DD}/{change_name}/`.
|
|
8
8
|
- Generates multi-spec parallel batches under `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` with a shared `coordination.md`, while keeping every batch spec independently completable and safe to implement concurrently.
|
|
9
|
+
- Optionally generates a batch-level `preparation.md` only when minimal non-business prerequisite work must land before specs can be implemented in parallel.
|
|
9
10
|
- Uses shared templates so spec-first and brownfield workflows follow the same planning structure.
|
|
10
11
|
- Requires clarification handling and explicit user approval before implementation starts.
|
|
11
12
|
- Backfills task and checklist status after implementation and testing.
|
|
@@ -29,7 +30,8 @@ A shared planning skill for feature work. It centralizes creation and maintenanc
|
|
|
29
30
|
│ ├── checklist.md
|
|
30
31
|
│ ├── contract.md
|
|
31
32
|
│ ├── design.md
|
|
32
|
-
│
|
|
33
|
+
│ ├── coordination.md
|
|
34
|
+
│ └── preparation.md
|
|
33
35
|
└── scripts/
|
|
34
36
|
└── create-specs
|
|
35
37
|
```
|
|
@@ -64,6 +66,19 @@ apltk create-specs "Membership write path" \
|
|
|
64
66
|
--output-dir "$WORKSPACE_ROOT/docs/plans"
|
|
65
67
|
```
|
|
66
68
|
|
|
69
|
+
Parallel batch with prerequisite preparation:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
apltk create-specs "Membership write path" \
|
|
73
|
+
--change-name membership-write-path \
|
|
74
|
+
--batch-name membership-cutover \
|
|
75
|
+
--with-coordination \
|
|
76
|
+
--with-preparation \
|
|
77
|
+
--output-dir "$WORKSPACE_ROOT/docs/plans"
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Use `--with-preparation` only when shared prerequisite work is required before parallel implementation. That file must stay minimal and must not contain core business logic, target user behavior, or member-spec implementation tasks.
|
|
81
|
+
|
|
67
82
|
```text
|
|
68
83
|
docs/plans/<today>/membership-cutover/
|
|
69
84
|
├── coordination.md
|
|
@@ -82,7 +97,8 @@ docs/plans/<today>/membership-cutover/
|
|
|
82
97
|
- `checklist.md`: use `- [ ]` only, adapt items to real scope, record actual results, and map behavior risks to test IDs plus oracles selected through `test-case-strategy`.
|
|
83
98
|
- `contract.md`: when external dependencies materially shape the change, record their official-source-backed invocation surface, constraints, and caller obligations in the standard dependency-record format.
|
|
84
99
|
- `design.md`: record the architecture/design delta in the standard format, including affected modules, flow, invariants, tradeoffs, and validation plan.
|
|
85
|
-
- `coordination.md`: for multi-spec batches only, record
|
|
100
|
+
- `coordination.md`: for multi-spec batches only, record ownership boundaries, replacement direction, file ownership guardrails, known collision candidates, pre-agreed edit rules for shared surfaces, shared API/schema freeze or additive-only rules, compatibility-shim retention rules, merge order, and cross-spec integration checkpoints, but never use it to make one spec depend on another spec's implementation before it can be completed.
|
|
101
|
+
- `preparation.md`: optional batch-level prerequisite plan used only when specs cannot be made parallel-safe without prior shared work; keep it tasks-like, minimal, verified, and free of core business logic or target outcomes.
|
|
86
102
|
- If clarification responses change the plan, update the docs and obtain approval again before coding.
|
|
87
103
|
|
|
88
104
|
## Notes
|
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`, and when needed `coordination.md`) from standard templates with clarification tracking, approval gating, unit drift-check planning, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update planning docs under `docs/plans/{YYYY-MM-DD}/...`.
|
|
3
|
+
description: Generate and maintain shared feature planning artifacts (`spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and when needed shared `coordination.md` or `preparation.md`) from standard templates with clarification tracking, approval gating, unit drift-check planning, and post-implementation backfill. Use when a workflow needs specs before coding, or when another skill needs to create/update planning docs under `docs/plans/{YYYY-MM-DD}/...`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Generate Spec
|
|
@@ -15,9 +15,9 @@ description: Generate and maintain shared feature planning artifacts (`spec.md`,
|
|
|
15
15
|
## Standards
|
|
16
16
|
|
|
17
17
|
- Evidence: Review the relevant code, configs, and authoritative docs before filling requirements or test plans; when external dependencies, libraries, frameworks, APIs, or platforms are involved, checking their official documentation is mandatory during spec creation.
|
|
18
|
-
- Execution: Generate the planning files from this skill's current templates first, keep each spec set tightly scoped, split broader work into multiple independent spec sets when needed, ensure every batch spec is independently completable and truly parallel-implementable without depending on another spec set to land first, surface shared-file or shared-contract collision risks during planning, resolve those coordination rules before implementation starts, complete
|
|
19
|
-
- Quality: Keep `spec.md`, `tasks.md`, `checklist.md`, `contract.md`,
|
|
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
|
|
18
|
+
- Execution: Generate the planning files from this skill's current templates first, keep each spec set tightly scoped, split broader work into multiple independent spec sets when needed, ensure every batch spec is independently completable and truly parallel-implementable without depending on another spec set to land first, surface shared-file or shared-contract collision risks during planning, resolve those coordination rules before implementation starts, add `preparation.md` only when the specs cannot be made parallel-safe without prior shared work, keep that preparation minimal and free of core business logic or target outcomes, complete plans with traceable requirements and risks, handle clarification updates, then wait for explicit approval before implementation.
|
|
19
|
+
- Quality: Keep `spec.md`, `tasks.md`, `checklist.md`, `contract.md`, `design.md`, and any shared batch docs synchronized, use `test-case-strategy` to map each planned test to a concrete risk or requirement, preserve the actual headings and field structure from this skill's templates, and tailor the templates so only applicable items remain active.
|
|
20
|
+
- Output: Store planning artifacts under `docs/plans/{YYYY-MM-DD}/{change_name}/` for single-spec work, or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/` plus shared `coordination.md` for multi-spec parallel work. Add shared `preparation.md` at the batch root only when prerequisite work must land before member specs can run in parallel, and keep individual specs concise, executable, non-overlapping with that preparation, and easy to update.
|
|
21
21
|
|
|
22
22
|
## Goal
|
|
23
23
|
|
|
@@ -48,15 +48,20 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
48
48
|
- Instead, split the work into multiple spec sets, each independently valid and each covering no more than three modules.
|
|
49
49
|
- Define those spec sets so they do not conflict with each other and do not require another spec set to land first in order to be approved or implemented safely.
|
|
50
50
|
- For batch generation, treat cross-spec implementation dependency as a planning bug: if Spec B cannot be completed safely until Spec A lands, they should be one spec set or be re-sliced so each spec has its own self-contained outcome.
|
|
51
|
-
-
|
|
51
|
+
- Use `preparation.md`, not individual spec files, when the only safe way to parallelize a batch is to land shared prerequisite work before any spec starts.
|
|
52
|
+
- Keep `preparation.md` as small as possible: it may define enabling scaffolds, shared test fixtures, naming/contract stubs, mechanical migrations, or non-business compatibility surfaces, but it must not implement core business logic, the target user behavior, or any member spec's actual outcome.
|
|
53
|
+
- If the required pre-work would change business behavior, implement target logic, or satisfy a meaningful requirement by itself, re-slice it into one or more normal spec sets instead of placing it in `preparation.md`.
|
|
54
|
+
- Allow shared preparation only when it is completed before parallel implementation begins; do not hide required pre-work inside one member spec while other specs depend on it.
|
|
52
55
|
- Treat any unresolved shared-file collision, overlapping ownership, or incompatible contract change across spec sets as a planning bug to resolve before approval, not an implementation-time surprise.
|
|
53
|
-
- If two candidate spec sets would still need to edit the same non-additive surface, either merge them into one spec set
|
|
56
|
+
- If two candidate spec sets would still need to edit the same non-additive surface, either merge them into one spec set, record a concrete ownership split plus additive-only rule that makes parallel work safe, or move the shared pre-work into `preparation.md` when the pre-work can be completed once before all specs.
|
|
54
57
|
- Use:
|
|
55
58
|
- `WORKSPACE_ROOT=<target_project_root>`
|
|
56
59
|
- `apltk create-specs "<feature_name>" --change-name <kebab-case> --output-dir "$WORKSPACE_ROOT/docs/plans"`
|
|
57
60
|
- For parallel multi-spec generation, also use:
|
|
58
61
|
- `--batch-name <kebab-case-batch-name>`
|
|
59
62
|
- `--with-coordination`
|
|
63
|
+
- If and only if multiple spec sets cannot be made parallel-safe without prior shared work, also use:
|
|
64
|
+
- `--with-preparation`
|
|
60
65
|
- Always generate:
|
|
61
66
|
- `references/templates/spec.md`
|
|
62
67
|
- `references/templates/tasks.md`
|
|
@@ -64,6 +69,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
64
69
|
- `references/templates/contract.md`
|
|
65
70
|
- `references/templates/design.md`
|
|
66
71
|
- Generate `references/templates/coordination.md` at the batch root when multiple spec sets are intentionally created for parallel implementation.
|
|
72
|
+
- Generate `references/templates/preparation.md` at the batch root only when required prerequisite work must be completed before member specs can be parallel-implemented.
|
|
67
73
|
- Save files under `docs/plans/{YYYY-MM-DD}/{change_name}/` or `docs/plans/{YYYY-MM-DD}/{batch_name}/{change_name}/`.
|
|
68
74
|
- After generation, fill the files in place without renaming, removing, or collapsing template headings unless a heading is explicitly template-only and not applicable to the real scope.
|
|
69
75
|
- Before approval, compare the drafted files against the current template headings and required fields; fix any drift caused by following older project examples.
|
|
@@ -105,6 +111,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
105
111
|
- Cross-reference relevant requirement IDs from `spec.md` and any external dependency records from `contract.md`.
|
|
106
112
|
- Make architecture boundaries, invariants, and rollback/fallback expectations explicit when they matter to safe implementation.
|
|
107
113
|
- When the spec belongs to a parallel batch, add a short reference to the parent `coordination.md`, state the exact assumptions that let this spec be implemented in parallel, and keep `design.md` focused on the single-spec delta rather than duplicating cross-spec ownership rules.
|
|
114
|
+
- When the batch uses `preparation.md`, write each spec's implementation guidance as if the preparation has already been completed and committed; do not duplicate preparation tasks, verification, or shared setup in member specs.
|
|
108
115
|
|
|
109
116
|
### 6.5) Fill `coordination.md` for parallel multi-spec batches
|
|
110
117
|
|
|
@@ -112,8 +119,8 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
112
119
|
- Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/coordination.md`.
|
|
113
120
|
- Use it as the batch-level source of truth for shared preparation, ownership boundaries, merge order, and cross-spec constraints.
|
|
114
121
|
- Record explicitly that each spec set must remain independently completable and must not rely on another spec set's code changes, unfinished tasks, or merge order to achieve its own approved outcome.
|
|
115
|
-
- Record shared fields, shared contracts, or shared data-shape
|
|
116
|
-
- Record whether the batch is ready for parallel implementation now; if not,
|
|
122
|
+
- Record shared fields, shared contracts, or shared data-shape assumptions that multiple spec sets must align on.
|
|
123
|
+
- Record whether the batch is ready for parallel implementation now; if not, point to `preparation.md` for executable prerequisite work or list coordination decisions that must still be settled.
|
|
117
124
|
- When one spec set replaces or removes legacy behavior, state that direction explicitly so all worktrees implement toward the same target rather than preserving the old behavior accidentally.
|
|
118
125
|
- Capture which spec set may touch which modules, which files require coordination, and whether any landing order or cutover sequence must be respected.
|
|
119
126
|
- Treat `coordination.md` as a merge-conflict prevention contract, not just a planning summary.
|
|
@@ -125,6 +132,20 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
125
132
|
- If the batch still needs a recommended merge order, make that order operationally convenient rather than functionally required for any single spec to work correctly.
|
|
126
133
|
- Keep single-spec concerns in that spec's own `design.md`; reserve `coordination.md` for batch-wide rules only.
|
|
127
134
|
|
|
135
|
+
### 6.6) Fill `preparation.md` only for prerequisite work
|
|
136
|
+
|
|
137
|
+
- Create `preparation.md` only when multiple spec sets cannot be implemented safely in parallel until shared prerequisite work is completed first.
|
|
138
|
+
- Place it at `docs/plans/{YYYY-MM-DD}/{batch_name}/preparation.md`.
|
|
139
|
+
- Treat it as a pre-parallel implementation queue for the coordinating/main agent, not as another member spec.
|
|
140
|
+
- Write it in a tasks-like style with atomic preparation items, explicit outputs, completion conditions, and verification hooks.
|
|
141
|
+
- Include only the smallest shared prerequisite work that every affected spec can assume after it lands.
|
|
142
|
+
- Exclude core business logic, target business outcomes, user-visible behavior changes, and member-spec implementation guidance; those belong in normal spec files.
|
|
143
|
+
- Include relevant validation work for the preparation itself.
|
|
144
|
+
- Do not include member-spec implementation tasks in `preparation.md`.
|
|
145
|
+
- Remove overlapping instructions from member specs; specs must reference the prepared baseline as an assumption instead of repeating the setup tasks.
|
|
146
|
+
- If the required work is large enough to become its own product behavior slice, or if it carries core business logic, re-slice the batch instead of hiding that slice in `preparation.md`.
|
|
147
|
+
- If the batch can be made parallel-safe through ownership rules, additive-only constraints, or re-slicing, do not create `preparation.md`.
|
|
148
|
+
|
|
128
149
|
### 7) Fill `checklist.md`
|
|
129
150
|
|
|
130
151
|
- Use checkbox format `- [ ]` for checklist items, except structured placeholder fields that are intentionally left for later fill-in.
|
|
@@ -153,6 +174,7 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
153
174
|
- Update `contract.md` when the final dependency usage, obligations, or verified constraints differ from the planning draft.
|
|
154
175
|
- Update `design.md` when the approved architecture changes during implementation, and record the final chosen design rather than leaving stale placeholders.
|
|
155
176
|
- Update `coordination.md` when shared ownership, replacement sequencing, or cross-spec preparation changed during implementation or merge planning.
|
|
177
|
+
- Update `preparation.md` when prerequisite work was completed, verified, skipped with an approved reason, or changed during implementation.
|
|
156
178
|
- Only mark checklist items complete when the work actually happened or the recorded decision actually applies.
|
|
157
179
|
- Do not check off unused examples, placeholder rows, or non-selected decision options.
|
|
158
180
|
- If different flows use different test strategies, preserve separate decision records in the final checklist instead of merging them into a misleading single summary.
|
|
@@ -167,8 +189,10 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
167
189
|
- Never allow one spec set to cover more than three modules.
|
|
168
190
|
- When a request exceeds that scope, split it into independent, non-conflicting, non-dependent spec sets before approval.
|
|
169
191
|
- For batch specs, independence is mandatory: each spec must describe a complete slice that can be implemented, tested, reviewed, and merged without waiting for another spec in the same batch.
|
|
170
|
-
- For batch specs, parallel readiness is also mandatory: each spec must be safe to implement concurrently, with shared-file collisions and ownership rules settled in `coordination.md` before coding begins.
|
|
192
|
+
- For batch specs, parallel readiness is also mandatory: each spec must be safe to implement concurrently after any approved `preparation.md` work is completed, with shared-file collisions and ownership rules settled in `coordination.md` before coding begins.
|
|
193
|
+
- Use `preparation.md` sparingly: it is allowed only for explicit, minimal, non-business pre-parallel shared work, not for normal cross-spec coordination or member-spec implementation.
|
|
171
194
|
- When multiple spec sets are created for one batch, keep their shared implementation direction in one `coordination.md` instead of duplicating cross-spec rules in every `design.md`.
|
|
195
|
+
- When `preparation.md` exists, every member spec must avoid duplicating its tasks and must state its implementation assumptions against the post-preparation baseline.
|
|
172
196
|
- For parallel worktree batches, make `coordination.md` specific enough that another engineer can tell which files they may edit, which shared contracts are frozen or additive-only, which shims must remain in place, and what combined behaviors need verification after merge.
|
|
173
197
|
- Prefer realistic coverage over boilerplate: add or remove checklist items based on actual risk.
|
|
174
198
|
- When external dependencies materially shape the change, `contract.md` is required and must capture the official-source-backed contract in the standardized record format.
|
|
@@ -191,3 +215,4 @@ Own the shared planning-doc lifecycle for feature work so other skills can reuse
|
|
|
191
215
|
- `references/templates/contract.md`: external dependency contract template.
|
|
192
216
|
- `references/templates/design.md`: architecture/design delta template.
|
|
193
217
|
- `references/templates/coordination.md`: parallel batch coordination template.
|
|
218
|
+
- `references/templates/preparation.md`: optional pre-parallel prerequisite work template.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "generate-spec"
|
|
3
3
|
short_description: "Generate shared feature spec, task, and checklist docs before coding"
|
|
4
|
-
default_prompt: "Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with
|
|
4
|
+
default_prompt: "Use $generate-spec to create or update single-spec plans under docs/plans/<date>/<change_name>/ or parallel batches under docs/plans/<date>/<batch_name>/<change_name>/ with shared coordination.md and, only when specs cannot be parallel-safe without prior shared work, a minimal non-business preparation.md; treat this skill's current references/templates/*.md files as the binding format even when older project specs use different layouts, ensure member specs assume preparation is already complete and do not duplicate its tasks, surface shared-file or shared-contract collision risks during planning, settle ownership and additive-only rules in coordination.md before implementation starts, fill BDD requirements, use $test-case-strategy for risk-driven test planning and unit drift checks, make tasks.md an atomic implementation queue with concrete outputs and verification hooks, document external dependency contracts in contract.md when they materially constrain the change, write the architecture/design delta in design.md, process clarification updates, and wait for explicit approval before implementation."
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
## Parallel Readiness Gate
|
|
10
10
|
- Ready for parallel implementation now: [Yes / No]
|
|
11
11
|
- Blocking coordination items before coding: [None / list concrete ownership or contract decisions that must be settled first]
|
|
12
|
+
- Preparation document required before parallel work: [No / Yes, see `preparation.md`]
|
|
12
13
|
- Re-coordination trigger: [what kind of new overlap or contract change forces the batch to stop and re-align]
|
|
13
14
|
|
|
14
15
|
## Batch Scope
|
|
@@ -22,15 +23,7 @@
|
|
|
22
23
|
- Shared constraints: [runtime, rollout, compatibility, or ownership constraints]
|
|
23
24
|
- Shared invariants: [rules every spec set must preserve]
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
### Shared Fields / Contracts
|
|
28
|
-
- Shared fields to introduce or reuse: [field / config / API shape / event schema]
|
|
29
|
-
- Canonical source of truth: [which module or data owner defines them]
|
|
30
|
-
- Required preparation before implementation: [migration, adapter, stub, flag, fallback, fixture]
|
|
31
|
-
- Additive-only rule during batch: [what may be added safely without breaking parallel work, or `None`]
|
|
32
|
-
|
|
33
|
-
### Replacement / Legacy Direction
|
|
26
|
+
## Replacement / Legacy Direction
|
|
34
27
|
- Legacy behavior being replaced: [feature / flow / module / endpoint / UI]
|
|
35
28
|
- Required implementation direction: [replace in place / shadow then cut over / adapter bridge / phased removal]
|
|
36
29
|
- Compatibility window: [None / temporary coexistence period]
|
|
@@ -42,14 +35,12 @@
|
|
|
42
35
|
- Primary concern: [what this spec owns]
|
|
43
36
|
- Allowed touch points: [files/modules it may change]
|
|
44
37
|
- Must not change: [files/modules owned by another spec unless explicitly coordinated]
|
|
45
|
-
- Depends on shared preparation: [None / specific shared item above that already exists or can be completed within this spec]
|
|
46
38
|
- Cross-spec implementation dependency: [None; if not None, re-slice the batch]
|
|
47
39
|
|
|
48
40
|
### Spec Set 2: [spec-name-2]
|
|
49
41
|
- Primary concern: [what this spec owns]
|
|
50
42
|
- Allowed touch points: [files/modules it may change]
|
|
51
43
|
- Must not change: [files/modules owned by another spec unless explicitly coordinated]
|
|
52
|
-
- Depends on shared preparation: [None / specific shared item above that already exists or can be completed within this spec]
|
|
53
44
|
- Cross-spec implementation dependency: [None; if not None, re-slice the batch]
|
|
54
45
|
|
|
55
46
|
## Conflict Boundaries
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Preparation: [Feature Name]
|
|
2
|
+
|
|
3
|
+
- Date: [YYYY-MM-DD]
|
|
4
|
+
- Batch: [batch_name]
|
|
5
|
+
|
|
6
|
+
## Preparation Goal
|
|
7
|
+
[Describe the smallest shared prerequisite state that must exist before member specs can be implemented in parallel. This must not implement core business logic or deliver the batch target outcome.]
|
|
8
|
+
|
|
9
|
+
## Use Condition
|
|
10
|
+
- Why this file exists: [explain why the batch cannot be safely parallelized without this prerequisite work]
|
|
11
|
+
- Minimality rule: [why this is the smallest viable prerequisite, not a member-spec implementation slice]
|
|
12
|
+
- Core business boundary: [state `No core business logic or target outcome is implemented here`; if that is false, re-slice the specs instead]
|
|
13
|
+
- Specs that rely on this preparation: [[spec-name-1], [spec-name-2]]
|
|
14
|
+
- Parallel implementation starts after: [commit / verification / approval condition]
|
|
15
|
+
- Out of scope: [member-spec implementation work that must remain in the individual spec files]
|
|
16
|
+
|
|
17
|
+
## Prepared Baseline
|
|
18
|
+
- Current baseline before preparation: [current state]
|
|
19
|
+
- Required baseline after preparation: [state all member specs may assume]
|
|
20
|
+
- Shared files or contracts prepared here: [files/modules/API/schema/config/test fixtures]
|
|
21
|
+
- Member specs must not repeat: [tasks/edits/verification covered by this file]
|
|
22
|
+
- Core business behavior changed here: [No; if yes, this file is being misused]
|
|
23
|
+
|
|
24
|
+
## Preparation Tasks
|
|
25
|
+
|
|
26
|
+
### **Task P1: [Preparation Task Title]**
|
|
27
|
+
- Purpose: [why this minimal non-business prerequisite is required before parallel work]
|
|
28
|
+
- Affected specs: [[spec-name-1], [spec-name-2]]
|
|
29
|
+
- Allowed scope: [files/modules this preparation task may touch]
|
|
30
|
+
- Out-of-scope guardrails: [core business logic, target outcome, and member-spec behavior that must stay out of preparation]
|
|
31
|
+
- Inputs: [coordination/design/contract/official-doc evidence]
|
|
32
|
+
- Expected output: [concrete prepared artifact or code/doc state]
|
|
33
|
+
- Completion condition: [observable state that proves the task is done]
|
|
34
|
+
- Verification hook: [command/check/review step]
|
|
35
|
+
- Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
|
|
36
|
+
- P1. [ ] [Atomic preparation action with one concrete output]
|
|
37
|
+
- P1. [ ] [Atomic verification or regression action]
|
|
38
|
+
|
|
39
|
+
### **Task P2: [Preparation Task Title]**
|
|
40
|
+
- Purpose: [why this minimal non-business prerequisite is required before parallel work]
|
|
41
|
+
- Affected specs: [[spec-name-1], [spec-name-2]]
|
|
42
|
+
- Allowed scope: [files/modules this preparation task may touch]
|
|
43
|
+
- Out-of-scope guardrails: [core business logic, target outcome, and member-spec behavior that must stay out of preparation]
|
|
44
|
+
- Inputs: [coordination/design/contract/official-doc evidence]
|
|
45
|
+
- Expected output: [concrete prepared artifact or code/doc state]
|
|
46
|
+
- Completion condition: [observable state that proves the task is done]
|
|
47
|
+
- Verification hook: [command/check/review step]
|
|
48
|
+
- Unit drift check: [UT-xx target unit; expected result/assertion, or N/A with reason]
|
|
49
|
+
- P2. [ ] [Atomic preparation action with one concrete output]
|
|
50
|
+
- P2. [ ] [Atomic verification or regression action]
|
|
51
|
+
|
|
52
|
+
## Validation Plan
|
|
53
|
+
- Required verification before subagents start: [commands/checks]
|
|
54
|
+
- Expected results/assertions: [what proves the prepared baseline is usable]
|
|
55
|
+
- Regression risks covered: [risk IDs or behavior slices]
|
|
56
|
+
- Verification owner: [main/coordinating agent]
|
|
57
|
+
|
|
58
|
+
## Handoff Contract For Member Specs
|
|
59
|
+
- Preparation commit required before subagents start: [Yes]
|
|
60
|
+
- Member specs assume: [prepared baseline assumptions]
|
|
61
|
+
- Member specs must not change: [prepared surfaces that are now frozen/additive-only]
|
|
62
|
+
- Member specs own all business behavior: [Yes]
|
|
63
|
+
- If preparation changes later: [stop condition and re-coordination rule]
|
|
64
|
+
|
|
65
|
+
## Completion Record
|
|
66
|
+
- Preparation status: [Not started / In progress / Complete / Blocked / N/A]
|
|
67
|
+
- Preparation commit: [commit hash or `None yet`]
|
|
68
|
+
- Verification executed: [commands/checks/results]
|
|
69
|
+
- Remaining blockers before parallel implementation: [None / list]
|
|
Binary file
|
|
@@ -14,6 +14,7 @@ TEMPLATE_FILENAMES = (
|
|
|
14
14
|
"design.md",
|
|
15
15
|
)
|
|
16
16
|
COORDINATION_TEMPLATE = "coordination.md"
|
|
17
|
+
PREPARATION_TEMPLATE = "preparation.md"
|
|
17
18
|
PLACEHOLDERS = ("[Feature Name]", "[功能名稱]")
|
|
18
19
|
|
|
19
20
|
|
|
@@ -49,7 +50,8 @@ def main() -> int:
|
|
|
49
50
|
"Create planning docs (spec.md, tasks.md, checklist.md, contract.md, design.md) "
|
|
50
51
|
"from templates with folder format docs/plans/{date}/{change_name} "
|
|
51
52
|
"or docs/plans/{date}/{batch_name}/{change_name}, including coordination "
|
|
52
|
-
"templates for
|
|
53
|
+
"and optional preparation templates for batch specs that need shared "
|
|
54
|
+
"pre-work before parallel implementation."
|
|
53
55
|
),
|
|
54
56
|
)
|
|
55
57
|
parser.add_argument("feature_name", help="Display name used in generated documents")
|
|
@@ -78,6 +80,15 @@ def main() -> int:
|
|
|
78
80
|
"for up-front ownership and collision coordination."
|
|
79
81
|
),
|
|
80
82
|
)
|
|
83
|
+
parser.add_argument(
|
|
84
|
+
"--with-preparation",
|
|
85
|
+
action="store_true",
|
|
86
|
+
help=(
|
|
87
|
+
"When used with --batch-name, also create or update "
|
|
88
|
+
"docs/plans/{date}/{batch_name}/preparation.md from the shared template "
|
|
89
|
+
"for prerequisite work that must be completed before parallel implementation."
|
|
90
|
+
),
|
|
91
|
+
)
|
|
81
92
|
parser.add_argument(
|
|
82
93
|
"--output-dir",
|
|
83
94
|
default="docs/plans",
|
|
@@ -110,6 +121,8 @@ def main() -> int:
|
|
|
110
121
|
batch_name = args.batch_name.strip() if args.batch_name else None
|
|
111
122
|
if args.with_coordination and not batch_name:
|
|
112
123
|
raise SystemExit("--with-coordination requires --batch-name")
|
|
124
|
+
if args.with_preparation and not batch_name:
|
|
125
|
+
raise SystemExit("--with-preparation requires --batch-name")
|
|
113
126
|
|
|
114
127
|
template_dir = Path(args.template_dir).expanduser().resolve()
|
|
115
128
|
if not template_dir.exists() or not template_dir.is_dir():
|
|
@@ -120,6 +133,8 @@ def main() -> int:
|
|
|
120
133
|
]
|
|
121
134
|
if args.with_coordination and not (template_dir / COORDINATION_TEMPLATE).exists():
|
|
122
135
|
missing_templates.append(COORDINATION_TEMPLATE)
|
|
136
|
+
if args.with_preparation and not (template_dir / PREPARATION_TEMPLATE).exists():
|
|
137
|
+
missing_templates.append(PREPARATION_TEMPLATE)
|
|
123
138
|
if missing_templates:
|
|
124
139
|
missing = ", ".join(missing_templates)
|
|
125
140
|
raise SystemExit(f"Missing template files in {template_dir}: {missing}")
|
|
@@ -134,6 +149,9 @@ def main() -> int:
|
|
|
134
149
|
coordination_path = (
|
|
135
150
|
batch_root / COORDINATION_TEMPLATE if args.with_coordination and batch_root else None
|
|
136
151
|
)
|
|
152
|
+
preparation_path = (
|
|
153
|
+
batch_root / PREPARATION_TEMPLATE if args.with_preparation and batch_root else None
|
|
154
|
+
)
|
|
137
155
|
existing_files = [path for path in output_paths if path.exists()]
|
|
138
156
|
if existing_files and not args.force:
|
|
139
157
|
existing = ", ".join(str(path) for path in existing_files)
|
|
@@ -171,10 +189,25 @@ def main() -> int:
|
|
|
171
189
|
encoding="utf-8",
|
|
172
190
|
)
|
|
173
191
|
|
|
192
|
+
if preparation_path and (args.force or not preparation_path.exists()):
|
|
193
|
+
preparation_template = template_dir / PREPARATION_TEMPLATE
|
|
194
|
+
preparation_path.write_text(
|
|
195
|
+
_render(
|
|
196
|
+
content=preparation_template.read_text(encoding="utf-8"),
|
|
197
|
+
today=today,
|
|
198
|
+
feature_name=feature_name,
|
|
199
|
+
change_name=change_name,
|
|
200
|
+
batch_name=batch_name,
|
|
201
|
+
),
|
|
202
|
+
encoding="utf-8",
|
|
203
|
+
)
|
|
204
|
+
|
|
174
205
|
for output_path in output_paths:
|
|
175
206
|
print(output_path)
|
|
176
207
|
if coordination_path:
|
|
177
208
|
print(coordination_path)
|
|
209
|
+
if preparation_path:
|
|
210
|
+
print(preparation_path)
|
|
178
211
|
return 0
|
|
179
212
|
|
|
180
213
|
|
|
@@ -64,7 +64,7 @@ class CreateSpecsTests(unittest.TestCase):
|
|
|
64
64
|
self.assertIn("batch-safe-planner", rendered)
|
|
65
65
|
self.assertIn("parallel-batch", rendered)
|
|
66
66
|
|
|
67
|
-
def
|
|
67
|
+
def test_main_creates_spec_files_and_shared_batch_files(self) -> None:
|
|
68
68
|
with tempfile.TemporaryDirectory() as temp_dir:
|
|
69
69
|
root = Path(temp_dir)
|
|
70
70
|
template_dir = root / "templates"
|
|
@@ -80,6 +80,10 @@ class CreateSpecsTests(unittest.TestCase):
|
|
|
80
80
|
"coordination [YYYY-MM-DD] [Feature Name] [change_name] [batch_name]\n",
|
|
81
81
|
encoding="utf-8",
|
|
82
82
|
)
|
|
83
|
+
(template_dir / MODULE.PREPARATION_TEMPLATE).write_text(
|
|
84
|
+
"preparation [YYYY-MM-DD] [Feature Name] [change_name] [batch_name]\n",
|
|
85
|
+
encoding="utf-8",
|
|
86
|
+
)
|
|
83
87
|
|
|
84
88
|
argv = [
|
|
85
89
|
"create-specs",
|
|
@@ -87,6 +91,7 @@ class CreateSpecsTests(unittest.TestCase):
|
|
|
87
91
|
"--batch-name",
|
|
88
92
|
"parallel-batch",
|
|
89
93
|
"--with-coordination",
|
|
94
|
+
"--with-preparation",
|
|
90
95
|
"--output-dir",
|
|
91
96
|
str(output_dir),
|
|
92
97
|
"--template-dir",
|
|
@@ -110,6 +115,35 @@ class CreateSpecsTests(unittest.TestCase):
|
|
|
110
115
|
coordination = output_dir / "2026-04-18" / "parallel-batch" / "coordination.md"
|
|
111
116
|
self.assertTrue(coordination.is_file())
|
|
112
117
|
self.assertIn(str(coordination), stdout.getvalue())
|
|
118
|
+
preparation = output_dir / "2026-04-18" / "parallel-batch" / "preparation.md"
|
|
119
|
+
self.assertTrue(preparation.is_file())
|
|
120
|
+
self.assertIn("preparation", preparation.read_text(encoding="utf-8"))
|
|
121
|
+
self.assertIn(str(preparation), stdout.getvalue())
|
|
122
|
+
|
|
123
|
+
def test_main_requires_batch_name_for_preparation_file(self) -> None:
|
|
124
|
+
with tempfile.TemporaryDirectory() as temp_dir:
|
|
125
|
+
template_dir = Path(temp_dir) / "templates"
|
|
126
|
+
template_dir.mkdir(parents=True)
|
|
127
|
+
for name in MODULE.TEMPLATE_FILENAMES:
|
|
128
|
+
(template_dir / name).write_text("template\n", encoding="utf-8")
|
|
129
|
+
(template_dir / MODULE.PREPARATION_TEMPLATE).write_text(
|
|
130
|
+
"preparation\n",
|
|
131
|
+
encoding="utf-8",
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
argv = [
|
|
135
|
+
"create-specs",
|
|
136
|
+
"My Feature",
|
|
137
|
+
"--with-preparation",
|
|
138
|
+
"--template-dir",
|
|
139
|
+
str(template_dir),
|
|
140
|
+
]
|
|
141
|
+
|
|
142
|
+
with patch.object(sys, "argv", argv):
|
|
143
|
+
with self.assertRaises(SystemExit) as context:
|
|
144
|
+
MODULE.main()
|
|
145
|
+
|
|
146
|
+
self.assertIn("--with-preparation requires --batch-name", str(context.exception))
|
|
113
147
|
|
|
114
148
|
def test_main_rejects_existing_files_without_force(self) -> None:
|
|
115
149
|
with tempfile.TemporaryDirectory() as temp_dir:
|