@rashidee/co2 1.3.11 → 1.3.13
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/dist/.co2-dat/app.db +0 -0
- package/dist/.co2-dat/app.db-shm +0 -0
- package/dist/.co2-dat/app.db-wal +0 -0
- package/dist/index.js +254 -73
- package/package.json +41 -41
- package/plugin/.claude-plugin/marketplace.json +1 -1
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugin/README.md +3 -1
- package/plugin/SKILLS.md +5 -2
- package/plugin/skills/conductor-feature-develop/SKILL.md +13 -0
- package/plugin/skills/conductor-feature-prepare/SKILL.md +39 -11
- package/plugin/skills/specgen-custom/SKILL.md +442 -0
- package/plugin/skills/specgen-custom/references/spec-template.md +271 -0
- package/plugin/skills/specgen-custom/references/stack-doc-template.md +154 -0
- package/plugin/skills/util-gencicdscript/references/cicd-app-template.md +798 -796
- package/plugin/skills/util-plancicd/SKILL.md +1 -1
- package/static/assets/{abnfDiagram-VRR7QNED-DBzgA_2G.js → abnfDiagram-VRR7QNED-Qm0Wk_H_.js} +1 -1
- package/static/assets/{arc-Bc02_4l6.js → arc-Cfk6Kt0D.js} +1 -1
- package/static/assets/{architectureDiagram-ZJ3FMSHR-ixN9wSDW.js → architectureDiagram-ZJ3FMSHR-DQTlZaUK.js} +1 -1
- package/static/assets/{blockDiagram-677ZJIJ3-Ob4lZkCY.js → blockDiagram-677ZJIJ3-D-4ibdoX.js} +1 -1
- package/static/assets/{c4Diagram-LMCZKHZV-BeJY3Zks.js → c4Diagram-LMCZKHZV-CHuqcdJm.js} +1 -1
- package/static/assets/channel-H9DRrduO.js +1 -0
- package/static/assets/{chunk-2Q5K7J3B-DTFIWNGb.js → chunk-2Q5K7J3B-MB9pWQe1.js} +1 -1
- package/static/assets/{chunk-32BRIVSS-DLTvoPpT.js → chunk-32BRIVSS-BttYlwU1.js} +1 -1
- package/static/assets/{chunk-5VM5RSS4-BKlvf6hI.js → chunk-5VM5RSS4-oyt0Tagd.js} +1 -1
- package/static/assets/{chunk-EX3LRPZG-B9ej8_ma.js → chunk-EX3LRPZG-DaTxdTWl.js} +1 -1
- package/static/assets/{chunk-JWPE2WC7-DAYaiy17.js → chunk-JWPE2WC7-CNgDxPAD.js} +1 -1
- package/static/assets/{chunk-MOJQB5TN-D6rRKzWc.js → chunk-MOJQB5TN-CoAudO3B.js} +1 -1
- package/static/assets/{chunk-RYQCIY6F-CE4CHN6p.js → chunk-RYQCIY6F-BrkDEEha.js} +1 -1
- package/static/assets/{chunk-V7JOEXUC-BR-Kl6S2.js → chunk-V7JOEXUC-D14rGvBO.js} +1 -1
- package/static/assets/{chunk-VR4S4FIN-Bo9J3WGe.js → chunk-VR4S4FIN-CAtas2vF.js} +1 -1
- package/static/assets/{chunk-XXDRQBXY-DjI5dJHR.js → chunk-XXDRQBXY-DcVAnNUQ.js} +1 -1
- package/static/assets/classDiagram-OUVF2IWQ-DRNPM383.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-DRNPM383.js +1 -0
- package/static/assets/{cose-bilkent-JH36ORCC-DLciz-3w.js → cose-bilkent-JH36ORCC-B7y4MI6Z.js} +1 -1
- package/static/assets/{cynefin-VYW2F7L2-DqfVJKpm.js → cynefin-VYW2F7L2-D2mnk-iJ.js} +1 -1
- package/static/assets/{cynefinDiagram-TSTJHNR4-D14oLdNM.js → cynefinDiagram-TSTJHNR4-DNzQJhG7.js} +1 -1
- package/static/assets/{dagre-VKFMJZFB-BduMbW80.js → dagre-VKFMJZFB-NMSyTo8N.js} +1 -1
- package/static/assets/{diagram-FQU43EPY-CLQg7RWT.js → diagram-FQU43EPY-CdqS5Ike.js} +1 -1
- package/static/assets/{diagram-G47NLZAW-Dq3Ymr1b.js → diagram-G47NLZAW-Bsb4T5JI.js} +1 -1
- package/static/assets/{diagram-NH7WQ7WH-BPjov8S5.js → diagram-NH7WQ7WH-Z-PyzBSC.js} +1 -1
- package/static/assets/{diagram-OA4YK3LP-BgQgpiJD.js → diagram-OA4YK3LP-BZBTYbxg.js} +1 -1
- package/static/assets/{diagram-WEI45ONY-BeOPSl27.js → diagram-WEI45ONY-BL2LA5H_.js} +1 -1
- package/static/assets/{ebnfDiagram-CCIWWBDH-DFsTw8OM.js → ebnfDiagram-CCIWWBDH-BGtukMeo.js} +1 -1
- package/static/assets/{erDiagram-Q63AITRT-scBEBawL.js → erDiagram-Q63AITRT-B6OJ4YCl.js} +1 -1
- package/static/assets/{flowDiagram-23GEKE2U-BfX-2ZO-.js → flowDiagram-23GEKE2U-BBkMgJ1i.js} +1 -1
- package/static/assets/{ganttDiagram-NO4QXBWP-BR5IJ1mv.js → ganttDiagram-NO4QXBWP-Cv8KHFBD.js} +1 -1
- package/static/assets/{gitGraphDiagram-IHSO6WYX-zPu_QDUM.js → gitGraphDiagram-IHSO6WYX-hYxDNjWx.js} +1 -1
- package/static/assets/{index-Dnp-sAA_.js → index-DnYGyYET.js} +81 -79
- package/static/assets/{infoDiagram-FWYZ7A6U-CpyKTQb9.js → infoDiagram-FWYZ7A6U-WuQIiedv.js} +1 -1
- package/static/assets/{ishikawaDiagram-FXEZZL3T-C2SXt-2Y.js → ishikawaDiagram-FXEZZL3T-BJGOD-IY.js} +1 -1
- package/static/assets/{journeyDiagram-5HDEW3XC-DJavk0C4.js → journeyDiagram-5HDEW3XC-Ba_NXseS.js} +1 -1
- package/static/assets/{kanban-definition-HUTT4EX6-xN4pVGL7.js → kanban-definition-HUTT4EX6-C5RMm9uF.js} +1 -1
- package/static/assets/{linear-BMWKojRX.js → linear-CLKppNoj.js} +1 -1
- package/static/assets/{mindmap-definition-LN4V7U3C-DOaDf7u0.js → mindmap-definition-LN4V7U3C-ClSG_qmQ.js} +1 -1
- package/static/assets/{pegDiagram-2B236MQR-B1px906A.js → pegDiagram-2B236MQR-C_JEZqk3.js} +1 -1
- package/static/assets/{pieDiagram-ENE6RG2P-s0vEagFS.js → pieDiagram-ENE6RG2P-D0lx7wDi.js} +1 -1
- package/static/assets/{quadrantDiagram-ABIIQ3AL-BEhIl8IZ.js → quadrantDiagram-ABIIQ3AL-BBKy0PVs.js} +1 -1
- package/static/assets/{railroadDiagram-RFXS5EU6-fFsin92S.js → railroadDiagram-RFXS5EU6-C1Badu5q.js} +1 -1
- package/static/assets/{requirementDiagram-TGXJPOKE-Cf9J7tii.js → requirementDiagram-TGXJPOKE-1j59jBQH.js} +1 -1
- package/static/assets/{sankeyDiagram-HTMAVEWB-Cy5gaZqM.js → sankeyDiagram-HTMAVEWB-BLR5S8aZ.js} +1 -1
- package/static/assets/{sequenceDiagram-DBY2YBRQ-DI61Vnk1.js → sequenceDiagram-DBY2YBRQ-BlqdK4qm.js} +1 -1
- package/static/assets/{sizeCapture-X5ZJPWSS-CmUBUW3B.js → sizeCapture-X5ZJPWSS-C27ndGIT.js} +1 -1
- package/static/assets/{stateDiagram-2N3HPSRC-CBMhhwuE.js → stateDiagram-2N3HPSRC-DOu4536_.js} +1 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-DvP1ZCp8.js +1 -0
- package/static/assets/{swimlanes-5IMT3BWC-CtZlr9wD.js → swimlanes-5IMT3BWC-BpGitR9A.js} +2 -2
- package/static/assets/swimlanesDiagram-G3AALYLV-B5cf18Ey.js +8 -0
- package/static/assets/{timeline-definition-FHXFAJF6-BC69PWR-.js → timeline-definition-FHXFAJF6-JIvdjH7z.js} +1 -1
- package/static/assets/{vennDiagram-L72KCM5P-jEaqKPSP.js → vennDiagram-L72KCM5P-DulnqLWm.js} +1 -1
- package/static/assets/{wardleyDiagram-EHGQE667-CKFWi3EK.js → wardleyDiagram-EHGQE667--MhZNL8M.js} +1 -1
- package/static/assets/{xychartDiagram-FW5EYKEG-CjyCKfOu.js → xychartDiagram-FW5EYKEG-CjnNgnMQ.js} +1 -1
- package/static/index.html +1 -1
- package/static/assets/channel-CJFxgMC1.js +0 -1
- package/static/assets/classDiagram-OUVF2IWQ-B5OYUyBf.js +0 -1
- package/static/assets/classDiagram-v2-EOCWNBFH-B5OYUyBf.js +0 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-BD1I889C.js +0 -1
- package/static/assets/swimlanesDiagram-G3AALYLV-BfEZlw_9.js +0 -8
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specgen-custom
|
|
3
|
+
model: claude-opus-4-8
|
|
4
|
+
effort: high
|
|
5
|
+
description: >
|
|
6
|
+
Generate a detailed technical specification for an application whose technology stack
|
|
7
|
+
is described by a USER-AUTHORED custom stack spec markdown file — instead of one of the
|
|
8
|
+
built-in stack-specific specgen-* variants. Reads the stack doc (declared in PRD.md
|
|
9
|
+
`# Architecture Principle` or the application's CLAUDE.md entry as "Stack per custom
|
|
10
|
+
stack spec at `<path>`", passed via stack:<path>, or found at well-known paths) and
|
|
11
|
+
produces the SAME artifact shape as every other specgen: context/specification/
|
|
12
|
+
SPECIFICATION.md plus one self-contained per-module SPEC.md, with complete code samples
|
|
13
|
+
in the stack doc's declared languages/frameworks and full traceability tables. Also
|
|
14
|
+
serves as the FALLBACK generator when no built-in specgen-* matches the inferred
|
|
15
|
+
technology stack (invoked with stack-desc:"<inferred stack>"), synthesizing a stack
|
|
16
|
+
definition and annotating every assumption with [TODO]. Standardized input: application
|
|
17
|
+
name (mandatory), version (mandatory), module (optional), stack:<path> (optional),
|
|
18
|
+
stack-desc:"<text>" (optional).
|
|
19
|
+
Use this skill whenever the user asks to create a spec for a custom, bespoke,
|
|
20
|
+
unsupported or "bring your own" technology stack, says "spec from my stack doc",
|
|
21
|
+
"use my custom stack spec", "no specgen matches my stack", or when a custom stack spec
|
|
22
|
+
file is declared in PRD.md/CLAUDE.md. Do NOT use this skill when a built-in specgen-*
|
|
23
|
+
variant matches the application's stack AND no custom stack spec is declared — the
|
|
24
|
+
stack-specific variant always produces a deeper specification.
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
# Custom Stack Application Specification Generator
|
|
28
|
+
|
|
29
|
+
This skill generates a comprehensive specification document (Markdown) for an application
|
|
30
|
+
whose technology stack is **defined by the user**, not by a built-in `specgen-*` variant.
|
|
31
|
+
The spec is intended to be followed by a developer or coding agent (normally
|
|
32
|
+
`conductor-feature-develop`) to produce a fully functional application — without the
|
|
33
|
+
develop phase ever having to re-infer or guess the stack.
|
|
34
|
+
|
|
35
|
+
The specification does NOT generate code. It produces a detailed technical document
|
|
36
|
+
describing every layer of the application — project layout, build pipeline, data layer,
|
|
37
|
+
service composition, testing — so that implementation becomes a mechanical exercise.
|
|
38
|
+
|
|
39
|
+
## Operating Modes
|
|
40
|
+
|
|
41
|
+
The skill runs in one of two modes, resolved during Stack Doc Resolution below:
|
|
42
|
+
|
|
43
|
+
- **Mode 1 — Stack-doc-driven (primary).** A custom stack spec markdown authored by the
|
|
44
|
+
user is resolved. That document is the **authoritative stack definition**: where the
|
|
45
|
+
coding agent's general stack habits or preferences conflict with the stack doc, **the
|
|
46
|
+
stack doc wins**. Technologies listed in the stack doc's `# Exclusions` section must
|
|
47
|
+
never appear in the spec.
|
|
48
|
+
- **Mode 2 — Inferred-stack fallback.** No stack doc exists; the invoker (normally
|
|
49
|
+
`conductor-feature-prepare` Step 1.8, after no built-in `specgen-*` matched) passes the
|
|
50
|
+
inferred stack as `stack-desc:"<free text>"`. The skill synthesizes a stack definition
|
|
51
|
+
from that description plus CLAUDE.md, records every assumption in the Determination
|
|
52
|
+
Summary, and annotates each assumption inline in the generated spec with
|
|
53
|
+
`[TODO: confirm — defaulted by specgen-custom]`.
|
|
54
|
+
|
|
55
|
+
## Stack Definition Source
|
|
56
|
+
|
|
57
|
+
Unlike the stack-specific `specgen-*` variants, this skill has **no fixed technology
|
|
58
|
+
table and no opinionated version pins**. The Technology Stack table in the generated
|
|
59
|
+
`SPECIFICATION.md` is rendered from the stack doc (Mode 1) or the synthesized definition
|
|
60
|
+
(Mode 2) — never from this skill's own preferences.
|
|
61
|
+
|
|
62
|
+
- A library named in the stack doc without a version gets "latest stable as of the
|
|
63
|
+
generation date" plus a `[TODO: pin version]` marker in the spec.
|
|
64
|
+
- Never silently substitute a technology the stack doc names or excludes. If a stack doc
|
|
65
|
+
choice is unworkable (e.g., two mutually incompatible libraries), flag the conflict to
|
|
66
|
+
the user instead of quietly resolving it.
|
|
67
|
+
|
|
68
|
+
## When the Skill Triggers
|
|
69
|
+
|
|
70
|
+
Generate the spec when the user (or the prepare conductor) provides an **application
|
|
71
|
+
name** and **version** that corresponds to one of the custom applications defined in
|
|
72
|
+
`CLAUDE.md`, and the application's stack is custom (declared stack doc) or unmatched by
|
|
73
|
+
any built-in `specgen-*` variant.
|
|
74
|
+
|
|
75
|
+
Example invocations:
|
|
76
|
+
- `/specgen-custom my_app v1.0.0`
|
|
77
|
+
- `/specgen-custom my_app v1.0.0 stack:shared_context/STACK.md`
|
|
78
|
+
- `/specgen-custom my_app v1.0.0 module:Inventory`
|
|
79
|
+
- `/specgen-custom my_app v1.0.0 stack-desc:"Go 1.23 + Gin + PostgreSQL server-rendered app"`
|
|
80
|
+
|
|
81
|
+
## Version Gate
|
|
82
|
+
|
|
83
|
+
Before starting any work, resolve the application folder first (see Input Resolution below), then check `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`):
|
|
84
|
+
|
|
85
|
+
1. If `<app_folder>/CHANGELOG.md` does not exist, skip this check (first-ever execution for this application).
|
|
86
|
+
2. If `<app_folder>/CHANGELOG.md` exists, scan all `## vX.Y.Z` headings and determine the **highest version** using semantic versioning comparison.
|
|
87
|
+
3. Compare the requested version against the highest version:
|
|
88
|
+
- If requested version **>=** highest version: proceed normally.
|
|
89
|
+
- If requested version **<** highest version: **STOP immediately**. Print: `"Version {requested} is lower than the current application version {highest} recorded in <app_folder>/CHANGELOG.md. Execution rejected."` Do NOT proceed with any work.
|
|
90
|
+
|
|
91
|
+
## Input Resolution
|
|
92
|
+
|
|
93
|
+
This skill uses standardized input resolution. Provide:
|
|
94
|
+
|
|
95
|
+
| Argument | Required | Example | Description |
|
|
96
|
+
|----------|----------|---------|-------------|
|
|
97
|
+
| `<application>` | Yes | `my_app` | Application name to locate the context folder |
|
|
98
|
+
| `<version>` | Yes | `v1.0.0` | Version to scope processing |
|
|
99
|
+
| `module:<name>` | No | `module:Inventory` | Limit generation to a single module |
|
|
100
|
+
| `stack:<path>` | No | `stack:shared_context/STACK.md` | Explicit path to the custom stack spec doc |
|
|
101
|
+
| `stack-desc:<text>` | No | `stack-desc:"Go + Gin + PostgreSQL"` | Inferred-stack fallback description (Mode 2); used only when no stack doc resolves |
|
|
102
|
+
|
|
103
|
+
### Application Folder Resolution
|
|
104
|
+
|
|
105
|
+
The application name is matched against root-level application folders:
|
|
106
|
+
1. Strip any leading `<number>_` prefix from folder names (e.g., `1_my_app` → `my_app`)
|
|
107
|
+
2. Match case-insensitively against the provided application name
|
|
108
|
+
3. Accept snake_case, kebab-case, or title-case input (all match the same folder)
|
|
109
|
+
4. If no match found, list available applications and stop
|
|
110
|
+
|
|
111
|
+
### Auto-Resolved Paths
|
|
112
|
+
|
|
113
|
+
| File | Resolved Path |
|
|
114
|
+
|------|---------------|
|
|
115
|
+
| PRD.md | `<app_folder>/context/PRD.md` |
|
|
116
|
+
| Module Models | `<app_folder>/context/model/` |
|
|
117
|
+
| HTML Mockups | `<app_folder>/context/mockup/` |
|
|
118
|
+
| Output (specification) | `<app_folder>/context/specification/` |
|
|
119
|
+
|
|
120
|
+
### Version Filtering
|
|
121
|
+
|
|
122
|
+
When a version is provided, only include user stories, NFRs, and constraints from versions
|
|
123
|
+
<= the provided version. For example, if `v1.0.4` is specified:
|
|
124
|
+
- Include items tagged `[v1.0.0]` through `[v1.0.4]`
|
|
125
|
+
- Exclude items tagged `[v1.0.5]` or later
|
|
126
|
+
- Version comparison uses semantic versioning order
|
|
127
|
+
|
|
128
|
+
### Module Filtering
|
|
129
|
+
|
|
130
|
+
When `module:<name>` is provided:
|
|
131
|
+
- Only generate the `SPEC.md` for that specific module
|
|
132
|
+
- Other existing module spec files remain untouched
|
|
133
|
+
- `SPECIFICATION.md` (root) gets a partial update — only that module's entry in the TOC
|
|
134
|
+
is added or updated; all other TOC entries are preserved as-is
|
|
135
|
+
|
|
136
|
+
## Stack Doc Resolution
|
|
137
|
+
|
|
138
|
+
Resolve the custom stack spec document in this priority order (first hit wins):
|
|
139
|
+
|
|
140
|
+
1. **`stack:<path>` argument** — resolve relative to the project root first, then
|
|
141
|
+
relative to `<app_folder>`. If the argument is given but the file does not exist,
|
|
142
|
+
**STOP** and report the dangling path.
|
|
143
|
+
2. **PRD.md `# Architecture Principle` section** — a statement matching
|
|
144
|
+
``Stack per custom stack spec at `<path>` `` or any markdown link to a stack spec
|
|
145
|
+
markdown file (e.g., `[STACK.md](reference/STACK.md)`). Resolve the path relative to
|
|
146
|
+
PRD.md, then relative to the project root.
|
|
147
|
+
3. **CLAUDE.md application entry** — the same ``Stack per custom stack spec at `<path>` ``
|
|
148
|
+
convention in the application's description under `# Custom Applications` (this
|
|
149
|
+
mirrors the existing "Stack per the `specgen-<variant>` CO2 specgen variant" comment
|
|
150
|
+
convention used for built-in variants).
|
|
151
|
+
4. **Well-known paths**, checked in order:
|
|
152
|
+
- `<app_folder>/context/reference/STACK.md`
|
|
153
|
+
- `<app_folder>/context/STACK.md`
|
|
154
|
+
- `<project_root>/shared_context/STACK.md`
|
|
155
|
+
5. **Nothing found**:
|
|
156
|
+
- If `stack-desc:` was provided → enter **Mode 2** (inferred-stack fallback).
|
|
157
|
+
- Otherwise → **STOP** and print: `"No custom stack spec found for <application>.
|
|
158
|
+
Copy the template at co2-skills/skills/specgen-custom/references/stack-doc-template.md
|
|
159
|
+
into your project (e.g., <app_folder>/context/reference/STACK.md), fill every
|
|
160
|
+
REQUIRED section, and declare it in PRD.md under '# Architecture Principle' as:
|
|
161
|
+
Stack per custom stack spec at '<path>'."`
|
|
162
|
+
|
|
163
|
+
Record the resolved mode and stack doc path — they are printed in the Determination
|
|
164
|
+
Summary and written into the changelog row.
|
|
165
|
+
|
|
166
|
+
## Stack Doc Validation (Mode 1)
|
|
167
|
+
|
|
168
|
+
Validate the resolved stack doc against the template sections before generating anything.
|
|
169
|
+
|
|
170
|
+
**Required sections — STOP if missing (never guess fundamentals):**
|
|
171
|
+
|
|
172
|
+
| Section | Why it cannot be defaulted |
|
|
173
|
+
|---------|---------------------------|
|
|
174
|
+
| `# Languages & Frameworks` (with the primary framework named) | Defines the languages every code sample is written in |
|
|
175
|
+
| `# Architecture Style` | Defines module boundaries and layering of the whole spec |
|
|
176
|
+
| `# Project Layout` | Defines where every generated blueprint file lives |
|
|
177
|
+
| `# Build, Run & Test Commands` | conductor-feature-develop executes these verbatim |
|
|
178
|
+
|
|
179
|
+
If any required section is missing or empty, **STOP** and print a checklist of exactly
|
|
180
|
+
which sections must be added to the stack doc. Guessing fundamentals defeats the purpose
|
|
181
|
+
of a user-authored stack definition.
|
|
182
|
+
|
|
183
|
+
**Recommended sections — apply a sensible default + inline `[TODO]` when missing:**
|
|
184
|
+
|
|
185
|
+
| Section | Default when absent |
|
|
186
|
+
|---------|--------------------|
|
|
187
|
+
| Versions on individual libraries | Latest stable + `[TODO: pin version]` |
|
|
188
|
+
| `# Testing Stack` | The stack's dominant unit-test framework + Playwright E2E (the CO2 `testgen-functional` / develop-phase convention) |
|
|
189
|
+
| `# Packaging & Deployment` | Run from source + `[TODO: confirm packaging]`; primary manifest carries the app version |
|
|
190
|
+
| `# Coding Conventions` | The language's community standard + `[TODO: confirm conventions]` |
|
|
191
|
+
| `# Key Libraries` | Chosen per capability need, each choice marked `[TODO: confirm library]` |
|
|
192
|
+
| `# Authentication & Security` | Derived from PRD.md auth stories; if PRD has none, no auth layer |
|
|
193
|
+
| `# Data & Persistence` | Derived from the module model files + CLAUDE.md dependency list |
|
|
194
|
+
|
|
195
|
+
Every applied default MUST appear in **both** places:
|
|
196
|
+
1. The pre-generation **Determination Summary** (so the user can override), and
|
|
197
|
+
2. An inline `[TODO: confirm — defaulted by specgen-custom]` annotation at the point of
|
|
198
|
+
use in the generated spec.
|
|
199
|
+
|
|
200
|
+
In **Mode 2** the entire stack definition is synthesized (from `stack-desc:`, CLAUDE.md
|
|
201
|
+
and the model/mockup artifacts), so every table row of the Technology Stack and every
|
|
202
|
+
defaulted section carries the `[TODO]` convention above.
|
|
203
|
+
|
|
204
|
+
## Gathering Input
|
|
205
|
+
|
|
206
|
+
The specification is driven by **six input sources** read from the project's context
|
|
207
|
+
files, plus the stack doc:
|
|
208
|
+
|
|
209
|
+
### Input 1: Application Name (from CLAUDE.md)
|
|
210
|
+
|
|
211
|
+
From CLAUDE.md (already loaded in context), locate the target application under the
|
|
212
|
+
**Custom Applications** section. Extract:
|
|
213
|
+
|
|
214
|
+
- **Application name**: The section heading
|
|
215
|
+
- **Application description**: The description paragraph below the heading
|
|
216
|
+
- **Dependencies**: The "Depends on" list — external services become integration points
|
|
217
|
+
in the spec, wired through the mechanisms the stack doc declares (HTTP client, queue
|
|
218
|
+
driver, etc.)
|
|
219
|
+
|
|
220
|
+
### Input 2: User Stories (from PRD.md)
|
|
221
|
+
|
|
222
|
+
Read `<app_folder>/context/PRD.md`. This file contains all user stories organized by
|
|
223
|
+
module. Extract:
|
|
224
|
+
|
|
225
|
+
- **System modules**: Modules under `# System Module` (e.g., Authentication, User
|
|
226
|
+
Management) — each becomes a module blueprint using the stack doc's auth approach.
|
|
227
|
+
- **Business modules**: Modules under `# Business Module`. Each becomes a feature area in
|
|
228
|
+
the stack doc's project layout and a `<module>/SPEC.md`.
|
|
229
|
+
- **Command/terminal-facing stories** (if the stack doc declares a CLI surface) map to
|
|
230
|
+
commands.
|
|
231
|
+
|
|
232
|
+
**Important:** Items with strikethrough (`~~text~~`) are deprecated — do NOT include them
|
|
233
|
+
as active requirements. List them in the "Removed / Replaced" subsection of the
|
|
234
|
+
traceability table. Track the `[v1.0.x]` version tag for each item and carry it through
|
|
235
|
+
to the generated specification's traceability section.
|
|
236
|
+
|
|
237
|
+
### Input 3: Non-Functional Requirements (from PRD.md)
|
|
238
|
+
|
|
239
|
+
Each module's `### Non Functional Requirement` section informs:
|
|
240
|
+
|
|
241
|
+
- Pagination, filtering, and list-size decisions
|
|
242
|
+
- Validation rules (character limits, formats) → the stack doc's validation mechanism
|
|
243
|
+
- Performance constraints (response budgets, concurrency expectations)
|
|
244
|
+
- Security posture layered onto the stack doc's `# Authentication & Security` section
|
|
245
|
+
|
|
246
|
+
### Input 4: Constraints (from PRD.md)
|
|
247
|
+
|
|
248
|
+
Each module's `### Constraint` section defines hard boundaries:
|
|
249
|
+
|
|
250
|
+
- Status enum values → schema-level enums in the stack doc's persistence layer
|
|
251
|
+
- Business rules → service-layer invariants with tests
|
|
252
|
+
- Access control (e.g., "only ADMIN can ...") → guard configuration in the stack doc's
|
|
253
|
+
auth mechanism
|
|
254
|
+
|
|
255
|
+
### Input 5: Module Model (from model/ folder)
|
|
256
|
+
|
|
257
|
+
Read `<app_folder>/context/model/MODEL.md` first as the index, then the individual module
|
|
258
|
+
model files (e.g., `model/inventory/model.md` + `schemas.json`). The module model maps to
|
|
259
|
+
the **persistence layer defined in the stack doc** — ORM entities, schema definitions,
|
|
260
|
+
migration files, or document models, whichever the stack doc names — field-for-field, not
|
|
261
|
+
placeholder. If the model family (relational vs NoSQL) mismatches the stack doc's
|
|
262
|
+
datastore, map the structures across and note every mapping decision in the spec.
|
|
263
|
+
|
|
264
|
+
### Input 6: HTML Mockup Screens (from mockup/ folder)
|
|
265
|
+
|
|
266
|
+
Read `<app_folder>/context/mockup/MOCKUP.html` first as the index, then the HTML files
|
|
267
|
+
organized by role in subfolders. The mockups map to the **UI layer defined in the stack
|
|
268
|
+
doc** — pages, templates, components, or views, whichever the stack doc names:
|
|
269
|
+
|
|
270
|
+
- One UI blueprint per screen, using the stack doc's UI technology
|
|
271
|
+
- Navigation structure and per-role menu items
|
|
272
|
+
- Design tokens (colors, font, radius) extracted from mockup CSS
|
|
273
|
+
|
|
274
|
+
**Role folders inform access control, NOT URL paths.** `mockup/admin/users.html` means
|
|
275
|
+
the route requires the `admin` role — the URL is `/users`, never `/admin/users`.
|
|
276
|
+
|
|
277
|
+
If the stack doc declares a **headless stack** (API-only, CLI, batch, library), skip this
|
|
278
|
+
input with an explicit note in the Determination Summary — do not invent a UI layer.
|
|
279
|
+
|
|
280
|
+
## PRD.md Extended Sections
|
|
281
|
+
|
|
282
|
+
Before determining capabilities, check PRD.md for the following extended sections:
|
|
283
|
+
|
|
284
|
+
### Architecture Principle Extraction
|
|
285
|
+
|
|
286
|
+
If PRD.md contains an `# Architecture Principle` section, its statements are **constraints
|
|
287
|
+
to honor** — unlike the stack-specific variants, this skill has no fixed architecture
|
|
288
|
+
model to defend. Precedence rules:
|
|
289
|
+
|
|
290
|
+
- **Technology choices**: the stack doc wins. If PRD.md names a technology the stack doc
|
|
291
|
+
excludes or contradicts, flag the contradiction to the user — do not silently pick one.
|
|
292
|
+
- **Requirements and principles** (offline-first, audit logging, deployment posture):
|
|
293
|
+
PRD.md wins; the spec must realize them with the stack doc's technologies.
|
|
294
|
+
|
|
295
|
+
### Design System Extraction
|
|
296
|
+
|
|
297
|
+
If PRD.md contains a `# Design System` section with a file reference, resolve and read
|
|
298
|
+
it, then map design tokens into the styling mechanism the stack doc declares. If absent,
|
|
299
|
+
derive tokens from the mockup CSS.
|
|
300
|
+
|
|
301
|
+
### High Level Process Flow Extraction
|
|
302
|
+
|
|
303
|
+
If PRD.md contains a `# High Level Process Flow` section, flows inform service-method
|
|
304
|
+
sequencing, status enums surfaced in list filters, and the E2E test scenario order.
|
|
305
|
+
If absent, derive flow from user stories only.
|
|
306
|
+
|
|
307
|
+
## Determination Summary
|
|
308
|
+
|
|
309
|
+
After resolving the stack and analyzing all inputs, produce a determination summary
|
|
310
|
+
before generating the spec. Present it to the user for confirmation:
|
|
311
|
+
|
|
312
|
+
```
|
|
313
|
+
Mode: Stack-doc-driven (Mode 1)
|
|
314
|
+
Stack Doc: <app_folder>/context/reference/STACK.md
|
|
315
|
+
Technology Stack:
|
|
316
|
+
<the rendered Layer | Technology | Version table>
|
|
317
|
+
Applied Defaults:
|
|
318
|
+
- Testing Stack: <framework> + Playwright E2E [TODO — stack doc section missing]
|
|
319
|
+
- <library> version: latest stable [TODO — unpinned in stack doc]
|
|
320
|
+
Capability Determination (from NFRs/stories, mapped to the stack doc's Key Libraries):
|
|
321
|
+
- DataGrid: yes → <library from stack doc, or [TODO: choose library]>
|
|
322
|
+
- Charts: no
|
|
323
|
+
- FileUpload: yes → <mechanism>
|
|
324
|
+
- Jobs: no
|
|
325
|
+
Modules: <list of modules to generate>
|
|
326
|
+
UI Layer: <UI technology, or "headless — mockup input skipped">
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
If the user disagrees with any determination, allow them to override before proceeding.
|
|
330
|
+
When invoked non-interactively by `conductor-feature-prepare`, print the summary into the
|
|
331
|
+
run output and proceed — the `[TODO]` markers in the spec remain the review surface.
|
|
332
|
+
|
|
333
|
+
## Generating the Specification
|
|
334
|
+
|
|
335
|
+
Once inputs are gathered and the stack is determined, generate the specification as a
|
|
336
|
+
**multi-file output split by module**. Read the generic spec template at
|
|
337
|
+
`references/spec-template.md` for the exact structure and content of each section — it is
|
|
338
|
+
the authoritative guide.
|
|
339
|
+
|
|
340
|
+
This skill ships **no stack pattern reference files**. Where a stack-specific variant
|
|
341
|
+
would read `auth-patterns.md` or `server-patterns.md`, this skill derives patterns from:
|
|
342
|
+
|
|
343
|
+
1. The stack doc's `# Coding Conventions`, `# Key Libraries` and
|
|
344
|
+
`# Authentication & Security` sections, and
|
|
345
|
+
2. The framework's idiomatic community patterns for anything the stack doc leaves open
|
|
346
|
+
(each such derivation marked `[TODO: confirm — defaulted by specgen-custom]`).
|
|
347
|
+
|
|
348
|
+
The specification is split into two categories:
|
|
349
|
+
|
|
350
|
+
1. **Root `SPECIFICATION.md`** — TOC, project overview with the stack-doc-rendered
|
|
351
|
+
Technology Stack table, project structure & build configuration (including the
|
|
352
|
+
mandatory **Application Version Configuration** subsection), data & persistence,
|
|
353
|
+
application composition, authentication (if applicable), UI shell (UI stacks only),
|
|
354
|
+
testing strategy, and build/run/packaging.
|
|
355
|
+
2. **Per-module `<module-name>/SPEC.md`** — Each module gets its own folder with a
|
|
356
|
+
self-contained blueprint spanning its data model, schemas/validation, service logic,
|
|
357
|
+
API/routes/commands, UI feature (if applicable), and tests.
|
|
358
|
+
|
|
359
|
+
An auth/user-management module SPEC.md is generated **only when** PRD.md defines
|
|
360
|
+
authentication/user stories or the stack doc declares an `# Authentication & Security`
|
|
361
|
+
section — a custom stack may legitimately be a headless API or batch application with no
|
|
362
|
+
auth surface. When generated, PRD story IDs merge into its traceability tables.
|
|
363
|
+
|
|
364
|
+
**Important:** The generated spec must use **real application data** from the context
|
|
365
|
+
files, not generic placeholders:
|
|
366
|
+
|
|
367
|
+
- **Modules** use actual module names from PRD.md and MODEL.md
|
|
368
|
+
- **Entities/schemas and types** match the model files field-for-field
|
|
369
|
+
- **Routes/commands and services** map to actual user stories
|
|
370
|
+
- **UI blueprints** map to actual mockup screens; URL paths are module-based, not
|
|
371
|
+
role-prefixed
|
|
372
|
+
- **Validation** enforces the actual PRD constraints
|
|
373
|
+
- **Version tags** on every user story ID, NFR ID, constraint ID, and mockup screen in
|
|
374
|
+
traceability tables (e.g., `USMA00003 [v1.0.2]`); **ALL traceability sub-tables MUST
|
|
375
|
+
include the `| Version |` column**
|
|
376
|
+
- **Removed / Replaced** subsection lists deprecated items with the removing version,
|
|
377
|
+
replacement ID (if any), and reason
|
|
378
|
+
|
|
379
|
+
### Output Structure
|
|
380
|
+
|
|
381
|
+
```
|
|
382
|
+
<app_folder>/context/specification/
|
|
383
|
+
├── SPECIFICATION.md ← Root: TOC + shared infrastructure per the stack doc
|
|
384
|
+
├── <module-1>/
|
|
385
|
+
│ └── SPEC.md ← Module blueprint (data + service + API/UI per the stack doc)
|
|
386
|
+
├── <module-2>/
|
|
387
|
+
│ └── SPEC.md
|
|
388
|
+
└── ... ← One folder per module from PRD.md
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
**Sample code is mandatory.** Every component described in any spec file must include a
|
|
392
|
+
complete, self-explanatory code sample **written in the stack doc's declared languages
|
|
393
|
+
and frameworks**. The code must be continuous (no `// ...` gaps) and usable as a direct
|
|
394
|
+
reference by a coding agent.
|
|
395
|
+
|
|
396
|
+
## Changelog Append
|
|
397
|
+
|
|
398
|
+
After all specification files are successfully generated, append an entry to `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`):
|
|
399
|
+
|
|
400
|
+
1. Read `<app_folder>/CHANGELOG.md`. If it does not exist, create it with:
|
|
401
|
+
```markdown
|
|
402
|
+
# Changelog
|
|
403
|
+
|
|
404
|
+
- This file tracks all skill executions by version for this application.
|
|
405
|
+
- The highest version recorded here is the current application version.
|
|
406
|
+
- Skills MUST NOT execute for a version lower than the highest version in this file.
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
```
|
|
410
|
+
2. Search for a `## {version}` heading matching the current version.
|
|
411
|
+
3. If the section **exists**: append a new row to its table.
|
|
412
|
+
4. If the section **does not exist**: insert a new section after the `---` below the context header and before any existing `## vX.Y.Z` section (newest-first ordering), with a new table header and the first row.
|
|
413
|
+
5. Row format: `| {YYYY-MM-DD} | {application_name} | specgen-custom | {module or "All"} | Generated technical specification from custom stack spec ({stack doc path, or "inferred stack (Mode 2)"}) |`
|
|
414
|
+
6. **Never modify or delete existing rows.**
|
|
415
|
+
|
|
416
|
+
## Constraints (Non-Negotiable)
|
|
417
|
+
|
|
418
|
+
These constraints apply to the generated spec regardless of the stack. Where the coding
|
|
419
|
+
agent's habits conflict with them, these constraints win.
|
|
420
|
+
|
|
421
|
+
**The spec must be self-sufficient for `conductor-feature-develop`.** The develop
|
|
422
|
+
conductor extracts exactly these from `SPECIFICATION.md` and must find them without
|
|
423
|
+
consulting the stack doc:
|
|
424
|
+
|
|
425
|
+
- The **Technology Stack table** with versions (from the stack doc)
|
|
426
|
+
- The **Project Layout tree** with actual module names substituted
|
|
427
|
+
- The **Build, Run & Test Commands** verbatim from the stack doc
|
|
428
|
+
- An **Application Version Configuration** subsection naming the manifest file/field and
|
|
429
|
+
environment variable that carry the application version (from the stack doc's
|
|
430
|
+
`# Packaging & Deployment` section; if the stack doc names none, pick the stack's
|
|
431
|
+
primary manifest and mark it `[TODO: confirm version carrier]`), and how the running
|
|
432
|
+
application surfaces it (footer, `--version` flag, or info endpoint)
|
|
433
|
+
|
|
434
|
+
**Stack doc supremacy.** Never substitute a technology the stack doc names, never
|
|
435
|
+
introduce one it excludes. Conflicts are flagged to the user, not silently resolved.
|
|
436
|
+
|
|
437
|
+
**`[TODO]` greppability.** Every assumption or default must be annotated with a marker
|
|
438
|
+
that literally contains `[TODO` so a single grep surfaces the full review list.
|
|
439
|
+
|
|
440
|
+
**Traceability completeness.** Every user story, NFR and constraint in scope for the
|
|
441
|
+
requested version appears in exactly one module's traceability tables, with the
|
|
442
|
+
`| Version |` column present in every sub-table.
|