@rashidee/co2 1.3.12 → 1.3.14
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 +145 -9
- package/package.json +1 -1
- 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/static/assets/{abnfDiagram-VRR7QNED-Qm0Wk_H_.js → abnfDiagram-VRR7QNED-D8RafkEP.js} +1 -1
- package/static/assets/{arc-Cfk6Kt0D.js → arc-Coo8djJL.js} +1 -1
- package/static/assets/{architectureDiagram-ZJ3FMSHR-DQTlZaUK.js → architectureDiagram-ZJ3FMSHR-D7fGTL3b.js} +1 -1
- package/static/assets/{blockDiagram-677ZJIJ3-D-4ibdoX.js → blockDiagram-677ZJIJ3-CjI7s86S.js} +1 -1
- package/static/assets/{c4Diagram-LMCZKHZV-CHuqcdJm.js → c4Diagram-LMCZKHZV-Ao3qCcFi.js} +1 -1
- package/static/assets/channel-Ci11n54j.js +1 -0
- package/static/assets/{chunk-2Q5K7J3B-MB9pWQe1.js → chunk-2Q5K7J3B-lUK_s3cG.js} +1 -1
- package/static/assets/{chunk-32BRIVSS-BttYlwU1.js → chunk-32BRIVSS-PA889NNs.js} +1 -1
- package/static/assets/{chunk-5VM5RSS4-oyt0Tagd.js → chunk-5VM5RSS4-CxACsgKF.js} +1 -1
- package/static/assets/{chunk-EX3LRPZG-DaTxdTWl.js → chunk-EX3LRPZG-BuSTKl3j.js} +1 -1
- package/static/assets/{chunk-JWPE2WC7-CNgDxPAD.js → chunk-JWPE2WC7-CuKFDdbM.js} +1 -1
- package/static/assets/{chunk-MOJQB5TN-CoAudO3B.js → chunk-MOJQB5TN-CVXUJZuG.js} +1 -1
- package/static/assets/{chunk-RYQCIY6F-BrkDEEha.js → chunk-RYQCIY6F-DrMs0YPQ.js} +1 -1
- package/static/assets/{chunk-V7JOEXUC-D14rGvBO.js → chunk-V7JOEXUC-DJopV6W1.js} +1 -1
- package/static/assets/{chunk-VR4S4FIN-CAtas2vF.js → chunk-VR4S4FIN-CcNBYiui.js} +1 -1
- package/static/assets/{chunk-XXDRQBXY-DcVAnNUQ.js → chunk-XXDRQBXY-CCFhxbN4.js} +1 -1
- package/static/assets/classDiagram-OUVF2IWQ-D8JGj9_e.js +1 -0
- package/static/assets/classDiagram-v2-EOCWNBFH-D8JGj9_e.js +1 -0
- package/static/assets/{cose-bilkent-JH36ORCC-B7y4MI6Z.js → cose-bilkent-JH36ORCC-DXoH0ywa.js} +1 -1
- package/static/assets/{cynefin-VYW2F7L2-D2mnk-iJ.js → cynefin-VYW2F7L2-DH8W0rE6.js} +1 -1
- package/static/assets/{cynefinDiagram-TSTJHNR4-DNzQJhG7.js → cynefinDiagram-TSTJHNR4-BW_IHnv8.js} +1 -1
- package/static/assets/{dagre-VKFMJZFB-NMSyTo8N.js → dagre-VKFMJZFB-Biw6PsWK.js} +1 -1
- package/static/assets/{diagram-FQU43EPY-CdqS5Ike.js → diagram-FQU43EPY-TtNOYp5j.js} +1 -1
- package/static/assets/{diagram-G47NLZAW-Bsb4T5JI.js → diagram-G47NLZAW-CQk6Jt_6.js} +1 -1
- package/static/assets/{diagram-NH7WQ7WH-Z-PyzBSC.js → diagram-NH7WQ7WH-DTY1BO9B.js} +1 -1
- package/static/assets/{diagram-OA4YK3LP-BZBTYbxg.js → diagram-OA4YK3LP-DEnO6Eyl.js} +1 -1
- package/static/assets/{diagram-WEI45ONY-BL2LA5H_.js → diagram-WEI45ONY-WKF4avWj.js} +1 -1
- package/static/assets/{ebnfDiagram-CCIWWBDH-BGtukMeo.js → ebnfDiagram-CCIWWBDH-K4uJ1i6v.js} +1 -1
- package/static/assets/{erDiagram-Q63AITRT-B6OJ4YCl.js → erDiagram-Q63AITRT-B4wRa3fY.js} +1 -1
- package/static/assets/{flowDiagram-23GEKE2U-BBkMgJ1i.js → flowDiagram-23GEKE2U-SnSUCnHl.js} +1 -1
- package/static/assets/{ganttDiagram-NO4QXBWP-Cv8KHFBD.js → ganttDiagram-NO4QXBWP-CsdfAP2-.js} +1 -1
- package/static/assets/{gitGraphDiagram-IHSO6WYX-hYxDNjWx.js → gitGraphDiagram-IHSO6WYX-C8xab2KC.js} +1 -1
- package/static/assets/{index-DKI3BgkF.css → index-D58A6Kf1.css} +1 -1
- package/static/assets/{index-DnYGyYET.js → index-D74-2ULy.js} +93 -93
- package/static/assets/{infoDiagram-FWYZ7A6U-WuQIiedv.js → infoDiagram-FWYZ7A6U-CjUSYyJV.js} +1 -1
- package/static/assets/{ishikawaDiagram-FXEZZL3T-BJGOD-IY.js → ishikawaDiagram-FXEZZL3T-DGEbhYY4.js} +1 -1
- package/static/assets/{journeyDiagram-5HDEW3XC-Ba_NXseS.js → journeyDiagram-5HDEW3XC-Bn8WZeF-.js} +1 -1
- package/static/assets/{kanban-definition-HUTT4EX6-C5RMm9uF.js → kanban-definition-HUTT4EX6-DD9QNPz9.js} +1 -1
- package/static/assets/{linear-CLKppNoj.js → linear-CREoNC-Z.js} +1 -1
- package/static/assets/{mindmap-definition-LN4V7U3C-ClSG_qmQ.js → mindmap-definition-LN4V7U3C-BLCKbp6n.js} +1 -1
- package/static/assets/{pegDiagram-2B236MQR-C_JEZqk3.js → pegDiagram-2B236MQR-DLyLfiFi.js} +1 -1
- package/static/assets/{pieDiagram-ENE6RG2P-D0lx7wDi.js → pieDiagram-ENE6RG2P-B7v1-Mow.js} +1 -1
- package/static/assets/{quadrantDiagram-ABIIQ3AL-BBKy0PVs.js → quadrantDiagram-ABIIQ3AL-Dnt728yI.js} +1 -1
- package/static/assets/{railroadDiagram-RFXS5EU6-C1Badu5q.js → railroadDiagram-RFXS5EU6-BZ0m-G9m.js} +1 -1
- package/static/assets/{requirementDiagram-TGXJPOKE-1j59jBQH.js → requirementDiagram-TGXJPOKE-3SCMjIUR.js} +1 -1
- package/static/assets/{sankeyDiagram-HTMAVEWB-BLR5S8aZ.js → sankeyDiagram-HTMAVEWB-BoK8Wh3S.js} +1 -1
- package/static/assets/{sequenceDiagram-DBY2YBRQ-BlqdK4qm.js → sequenceDiagram-DBY2YBRQ-B89bqSYK.js} +1 -1
- package/static/assets/{sizeCapture-X5ZJPWSS-C27ndGIT.js → sizeCapture-X5ZJPWSS-BVTk4iE2.js} +1 -1
- package/static/assets/{stateDiagram-2N3HPSRC-DOu4536_.js → stateDiagram-2N3HPSRC-Q5DLz7JU.js} +1 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-CU_q9WoS.js +1 -0
- package/static/assets/{swimlanes-5IMT3BWC-BpGitR9A.js → swimlanes-5IMT3BWC-1LqBZGZu.js} +2 -2
- package/static/assets/swimlanesDiagram-G3AALYLV-CilhyDV0.js +8 -0
- package/static/assets/{timeline-definition-FHXFAJF6-JIvdjH7z.js → timeline-definition-FHXFAJF6-Bk8mm9PQ.js} +1 -1
- package/static/assets/{vennDiagram-L72KCM5P-DulnqLWm.js → vennDiagram-L72KCM5P-qS4AIIXn.js} +1 -1
- package/static/assets/{wardleyDiagram-EHGQE667--MhZNL8M.js → wardleyDiagram-EHGQE667-BjnQ0zER.js} +1 -1
- package/static/assets/{xychartDiagram-FW5EYKEG-CjnNgnMQ.js → xychartDiagram-FW5EYKEG-Xtl5bYjl.js} +1 -1
- package/static/index.html +2 -2
- package/static/assets/channel-H9DRrduO.js +0 -1
- package/static/assets/classDiagram-OUVF2IWQ-DRNPM383.js +0 -1
- package/static/assets/classDiagram-v2-EOCWNBFH-DRNPM383.js +0 -1
- package/static/assets/stateDiagram-v2-6OUMAXLB-DvP1ZCp8.js +0 -1
- package/static/assets/swimlanesDiagram-G3AALYLV-B5cf18Ey.js +0 -8
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# Specification Template — Custom Stack Application
|
|
2
|
+
|
|
3
|
+
This is the authoritative template for the generated specification. It is
|
|
4
|
+
**stack-agnostic**: every technology-specific value is rendered from the resolved custom
|
|
5
|
+
stack spec doc (Mode 1) or the synthesized stack definition (Mode 2) — see SKILL.md. The
|
|
6
|
+
specification is split into **two types of files**:
|
|
7
|
+
|
|
8
|
+
1. **`SPECIFICATION.md`** (root) — Table of Contents, project overview, project structure
|
|
9
|
+
& build configuration, data & persistence, application composition, authentication
|
|
10
|
+
(if applicable), UI shell (UI stacks only), testing, build/run/packaging. Generated
|
|
11
|
+
once per application.
|
|
12
|
+
2. **`<module-name>/SPEC.md`** (per-module) — Self-contained module blueprint spanning
|
|
13
|
+
every layer the stack doc declares. Generated once per module from PRD.md.
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
specification/
|
|
17
|
+
├── SPECIFICATION.md
|
|
18
|
+
├── <module-1>/
|
|
19
|
+
│ └── SPEC.md
|
|
20
|
+
├── <module-2>/
|
|
21
|
+
│ └── SPEC.md
|
|
22
|
+
└── ...
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Placeholders use `{{VARIABLE}}` syntax and must be replaced with actual values. Sections
|
|
26
|
+
marked *[UI stacks only]* are omitted for headless stacks (API/CLI/batch/library);
|
|
27
|
+
sections marked *[if applicable]* are included only when their capability exists.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
# Part A: Root SPECIFICATION.md
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Table of Contents
|
|
36
|
+
|
|
37
|
+
Generate a TOC with anchor links. Include a **Modules** section linking to each module's
|
|
38
|
+
`SPEC.md`:
|
|
39
|
+
|
|
40
|
+
```markdown
|
|
41
|
+
## Table of Contents
|
|
42
|
+
|
|
43
|
+
### Shared Infrastructure
|
|
44
|
+
- [1. Project Overview](#1-project-overview)
|
|
45
|
+
- [2. Project Structure & Build Configuration](#2-project-structure--build-configuration)
|
|
46
|
+
- ...
|
|
47
|
+
|
|
48
|
+
### Modules
|
|
49
|
+
- [{{Module 1}}]({{module-1}}/SPEC.md)
|
|
50
|
+
- ...
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Section 1: Project Overview
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
# {{APPLICATION_NAME}} — Technical Specification
|
|
59
|
+
|
|
60
|
+
## 1. Project Overview
|
|
61
|
+
|
|
62
|
+
**Application Name**: {{APPLICATION_NAME}}
|
|
63
|
+
**Application Type**: {{web | api | cli | mobile | batch | library — from the stack doc}}
|
|
64
|
+
**Description**: {{APP_DESCRIPTION}}
|
|
65
|
+
**Versions Covered**: v1.0.0 — v{{LATEST_VERSION}}
|
|
66
|
+
**Stack Definition**: {{path to the custom stack spec doc, or "inferred (Mode 2) — see [TODO] markers"}}
|
|
67
|
+
|
|
68
|
+
### Architecture Model
|
|
69
|
+
{{The Architecture Style from the stack doc, expanded into 1–2 paragraphs: process
|
|
70
|
+
model, layering, module boundary rules, communication style. Cite compatible PRD.md
|
|
71
|
+
Architecture Principle statements here.}}
|
|
72
|
+
|
|
73
|
+
### Technology Stack
|
|
74
|
+
{{Render the full Layer | Technology | Version table from the stack doc, plus any
|
|
75
|
+
capability-driven additions from Key Libraries. Unpinned versions carry
|
|
76
|
+
[TODO: pin version]; Mode 2 rows carry [TODO: confirm — defaulted by specgen-custom].}}
|
|
77
|
+
|
|
78
|
+
### Capability Determination (Auto-Determined from PRD)
|
|
79
|
+
{{The capability list from the Determination Summary — grids, charts, file upload,
|
|
80
|
+
background jobs, integrations — each mapped to the stack doc's Key Libraries entry or
|
|
81
|
+
marked [TODO: choose library].}}
|
|
82
|
+
|
|
83
|
+
### User Roles [if applicable]
|
|
84
|
+
| Role | Source (mockup folder) | Capabilities summary |
|
|
85
|
+
|------|------------------------|----------------------|
|
|
86
|
+
| {{role}} | mockup/{{role}}/ | {{...}} |
|
|
87
|
+
|
|
88
|
+
### Module Index
|
|
89
|
+
| Module | Spec File | {{Persistence Units}} | {{Routes / Commands / Screens}} |
|
|
90
|
+
|--------|-----------|----------------------|--------------------------------|
|
|
91
|
+
| {{Module}} | [{{module}}/SPEC.md]({{module}}/SPEC.md) | {{tables/collections/files}} | {{...}} |
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Section 2: Project Structure & Build Configuration
|
|
97
|
+
|
|
98
|
+
- Render the **Project Layout tree from the stack doc** with actual module names from
|
|
99
|
+
PRD.md substituted into the module slots.
|
|
100
|
+
- Complete, copy-pasteable **manifest and build configuration files** (whatever the stack
|
|
101
|
+
uses: `go.mod` + `Makefile`, `pyproject.toml`, `pom.xml`, `package.json`, ...), with
|
|
102
|
+
every dependency from the Technology Stack table at its pinned version.
|
|
103
|
+
- State the **structural rules** from the stack doc's Coding Conventions (naming,
|
|
104
|
+
file-size limits, error handling, forbidden patterns). Defaulted conventions carry
|
|
105
|
+
`[TODO: confirm conventions]`.
|
|
106
|
+
|
|
107
|
+
### Section 2a: Application Version Configuration (MANDATORY)
|
|
108
|
+
|
|
109
|
+
This subsection is never omitted — `conductor-feature-develop` reads it on every version
|
|
110
|
+
increment:
|
|
111
|
+
|
|
112
|
+
- **Version carrier**: the manifest file + field ({{from the stack doc's Packaging &
|
|
113
|
+
Deployment section, e.g., "`version` in `pyproject.toml`"}}) MUST be set to the version
|
|
114
|
+
from skill invocation (highest, if multiple).
|
|
115
|
+
- **Environment variable**: {{e.g., APP_VERSION}} mirrors the manifest value.
|
|
116
|
+
- **Surfacing**: how the running application exposes the version — {{UI footer / CLI
|
|
117
|
+
`--version` flag / info endpoint, per application type}} — with a complete code sample.
|
|
118
|
+
- If the stack doc named no version carrier, name the stack's primary manifest here and
|
|
119
|
+
mark the choice `[TODO: confirm version carrier]`.
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Section 3: Data & Persistence
|
|
124
|
+
|
|
125
|
+
From the stack doc's Data & Persistence section and the module model files:
|
|
126
|
+
|
|
127
|
+
- Datastore, access layer (ORM / query builder / driver) and connection management —
|
|
128
|
+
complete configuration sample
|
|
129
|
+
- Migration tool and workflow (file location, generation command, when migrations run)
|
|
130
|
+
- The **complete schema/entity definitions** for shared/system tables; per-module tables
|
|
131
|
+
live in each module's SPEC.md
|
|
132
|
+
- If the model family (relational vs NoSQL) mismatches the stack doc's datastore, the
|
|
133
|
+
mapping decisions are documented here
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Section 4: Application Composition
|
|
138
|
+
|
|
139
|
+
The application's entry point and composition root, in the stack doc's framework:
|
|
140
|
+
|
|
141
|
+
- Entry point sample (main function / bootstrap / CLI program) — complete
|
|
142
|
+
- Middleware/interceptor order or command wiring (request ID, logging, auth resolution,
|
|
143
|
+
guards, routes/commands)
|
|
144
|
+
- Configuration loading (env vars / config file per the stack doc), validated at startup —
|
|
145
|
+
complete sample
|
|
146
|
+
- Logging setup per the stack doc's logging library
|
|
147
|
+
- Health/status surface ({{endpoint / command}}) used by tests and operations
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Section 5: Authentication & Security [if applicable]
|
|
152
|
+
|
|
153
|
+
Only when PRD.md defines auth stories or the stack doc declares Authentication & Security:
|
|
154
|
+
|
|
155
|
+
- The auth mechanism from the stack doc (sessions / OIDC / API keys / ...) with complete
|
|
156
|
+
samples: credential verification, session/token issue + resolve + revoke, guards
|
|
157
|
+
- Password/credential policy as validation schemas shared by UI and API
|
|
158
|
+
- Role model and route/command guard configuration
|
|
159
|
+
- Security invariants as explicit, testable statements (e.g., "cannot delete the last
|
|
160
|
+
admin"), each mapped to a PRD constraint ID where one exists
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Section 6: UI Shell [UI stacks only]
|
|
165
|
+
|
|
166
|
+
- The UI technology setup from the stack doc (SPA build config / template engine layout /
|
|
167
|
+
mobile navigation shell) — complete samples
|
|
168
|
+
- Design tokens from the PRD Design System file or mockup CSS, mapped into the stack
|
|
169
|
+
doc's styling mechanism
|
|
170
|
+
- Shared layout (navigation, topbar/sidebar, footer rendering `v{{VERSION}}` from the
|
|
171
|
+
version surface defined in Section 2a)
|
|
172
|
+
- Route/screen registration pattern and role-guarded navigation derived from mockup role
|
|
173
|
+
folders
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Section 7: Testing Strategy
|
|
178
|
+
|
|
179
|
+
From the stack doc's Testing Stack section (or the CO2 default: dominant unit framework +
|
|
180
|
+
Playwright E2E, marked `[TODO]` when defaulted):
|
|
181
|
+
|
|
182
|
+
- Unit/integration test setup — real persistence layer in tests where the stack allows
|
|
183
|
+
(in-memory / testcontainers), never a fully mocked data layer
|
|
184
|
+
- The mandatory coverage list: every PRD constraint invariant, auth invariants (if
|
|
185
|
+
applicable), and one regression assertion per `### Bug` entry in PRD.md
|
|
186
|
+
- E2E setup and the scenario ordering (from High Level Process Flow when present)
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Section 8: Build, Run & Packaging
|
|
191
|
+
|
|
192
|
+
- The **verbatim command table** from the stack doc (install / build / run-dev /
|
|
193
|
+
run-prod / test / lint) — `conductor-feature-develop` executes these as-is
|
|
194
|
+
- Packaging: artifact type and production run model from the stack doc's Packaging &
|
|
195
|
+
Deployment section
|
|
196
|
+
- Configuration reference: every env var / config key, type, and default
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
# Part B: Per-Module `<module-name>/SPEC.md`
|
|
201
|
+
|
|
202
|
+
Every module file is **self-contained** — a coding agent implements it independently
|
|
203
|
+
after the shared infrastructure exists. Layer sections use the stack doc's layer names;
|
|
204
|
+
the generic names below are placeholders to be renamed accordingly (e.g., "Routes" →
|
|
205
|
+
"Handlers" for Gin, "Commands" for a CLI, "Screens" for mobile).
|
|
206
|
+
|
|
207
|
+
## Template
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
# {{MODULE_NAME}} — Module Specification
|
|
211
|
+
|
|
212
|
+
> Part of [{{APPLICATION_NAME}} Technical Specification](../SPECIFICATION.md).
|
|
213
|
+
> Implement after the shared infrastructure (root spec sections 2–{{N}}) is in place.
|
|
214
|
+
|
|
215
|
+
## 1. Traceability
|
|
216
|
+
|
|
217
|
+
### User Stories
|
|
218
|
+
| ID | Version | Summary | Implemented By |
|
|
219
|
+
|----|---------|---------|----------------|
|
|
220
|
+
| {{USXX00001}} | [v1.0.0] | {{summary}} | {{handler / service / screen file}} |
|
|
221
|
+
|
|
222
|
+
### Non-Functional Requirements
|
|
223
|
+
| ID | Version | Requirement | Technical Decision |
|
|
224
|
+
|----|---------|-------------|--------------------|
|
|
225
|
+
|
|
226
|
+
### Constraints
|
|
227
|
+
| ID | Version | Constraint | Enforcement Point |
|
|
228
|
+
|----|---------|------------|-------------------|
|
|
229
|
+
|
|
230
|
+
### Mockup Screens [UI stacks only]
|
|
231
|
+
| Screen | Role | Route/Screen | Component/Template |
|
|
232
|
+
|--------|------|--------------|--------------------|
|
|
233
|
+
|
|
234
|
+
### Removed / Replaced
|
|
235
|
+
| Removed ID | Removed In | Replaced By | Reason |
|
|
236
|
+
|-----------|------------|-------------|--------|
|
|
237
|
+
|
|
238
|
+
## 2. Data Model
|
|
239
|
+
The module's persistence definitions (tables / collections / entities) in the stack
|
|
240
|
+
doc's access layer — field-for-field from the model files, with relations and the
|
|
241
|
+
migration file name. Complete sample.
|
|
242
|
+
|
|
243
|
+
## 3. Schemas & Validation
|
|
244
|
+
The module's input/output schemas in the stack doc's validation mechanism — entity,
|
|
245
|
+
create/update inputs, query params — with derived types where the language supports it.
|
|
246
|
+
Complete sample.
|
|
247
|
+
|
|
248
|
+
## 4. Service / Business Logic
|
|
249
|
+
The module's service layer — pure business logic taking the data access handle;
|
|
250
|
+
business rules from PRD constraints as explicit invariants. No transport concerns.
|
|
251
|
+
Complete sample.
|
|
252
|
+
|
|
253
|
+
## 5. API / Routes / Commands
|
|
254
|
+
The module's transport surface in the stack doc's framework — every route/command with
|
|
255
|
+
validation, guards, and typed responses; wired into the composition root (Section 4 of
|
|
256
|
+
the root spec). Complete sample. Surface table: {{method+path or command}}, guard,
|
|
257
|
+
request schema, response, story IDs.
|
|
258
|
+
|
|
259
|
+
## 6. UI Feature [UI stacks only]
|
|
260
|
+
- One UI blueprint per mockup screen in the stack doc's UI technology, matching the
|
|
261
|
+
mockup layout
|
|
262
|
+
- Forms bound to the Section 3 schemas
|
|
263
|
+
- Data access via the pattern defined in the root spec
|
|
264
|
+
- Route/screen registration + role-guarded navigation entries
|
|
265
|
+
Complete samples for every component.
|
|
266
|
+
|
|
267
|
+
## 7. Tests
|
|
268
|
+
- Unit/integration: service + transport tests per the root Testing Strategy; every
|
|
269
|
+
constraint invariant has a test; every `### Bug` entry has a regression assertion
|
|
270
|
+
- E2E: the module's user-visible flows appended to the E2E suite [UI stacks only]
|
|
271
|
+
```
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
CUSTOM STACK SPEC TEMPLATE (CO2 / specgen-custom)
|
|
3
|
+
|
|
4
|
+
Copy this file into your project — recommended location:
|
|
5
|
+
<app_folder>/context/reference/STACK.md
|
|
6
|
+
(also discovered at <app_folder>/context/STACK.md and <root>/shared_context/STACK.md)
|
|
7
|
+
|
|
8
|
+
Fill every REQUIRED section, then declare it in the application's PRD.md under
|
|
9
|
+
`# Architecture Principle` as:
|
|
10
|
+
|
|
11
|
+
Stack per custom stack spec at `context/reference/STACK.md`
|
|
12
|
+
|
|
13
|
+
(or equivalently in the application's CLAUDE.md entry under # Custom Applications).
|
|
14
|
+
|
|
15
|
+
RECOMMENDED sections may be omitted — specgen-custom will apply a sensible default and
|
|
16
|
+
mark it inline with [TODO: confirm — defaulted by specgen-custom] for your review.
|
|
17
|
+
Replace every {{placeholder}}. Delete these comment blocks when done.
|
|
18
|
+
-->
|
|
19
|
+
|
|
20
|
+
# Stack Overview
|
|
21
|
+
|
|
22
|
+
<!-- REQUIRED context paragraph. State the application type explicitly:
|
|
23
|
+
web app / REST API / CLI / mobile app / batch job / library. -->
|
|
24
|
+
|
|
25
|
+
{{One paragraph: what kind of application this stack builds, its runtime model
|
|
26
|
+
(single process? client + server? serverless?), and how end users run or consume it.}}
|
|
27
|
+
|
|
28
|
+
**Application type**: {{web | api | cli | mobile | batch | library}}
|
|
29
|
+
|
|
30
|
+
# Languages & Frameworks
|
|
31
|
+
|
|
32
|
+
<!-- REQUIRED. The primary framework MUST be named. Versions are strongly recommended —
|
|
33
|
+
unpinned entries get "latest stable" + [TODO: pin version] in the generated spec. -->
|
|
34
|
+
|
|
35
|
+
| Layer | Technology | Version |
|
|
36
|
+
|-------|------------|---------|
|
|
37
|
+
| Language | {{e.g., Go}} | {{e.g., 1.23}} |
|
|
38
|
+
| Framework | {{e.g., Gin}} | {{e.g., 1.10}} |
|
|
39
|
+
| {{Frontend / Templates}} | {{e.g., templ + HTMX}} | {{...}} |
|
|
40
|
+
| {{...}} | {{...}} | {{...}} |
|
|
41
|
+
|
|
42
|
+
# Architecture Style
|
|
43
|
+
|
|
44
|
+
<!-- REQUIRED. Defines the layering and module boundaries of the whole specification. -->
|
|
45
|
+
|
|
46
|
+
- {{Monolith / modular monolith / microservices / hexagonal / layered MVC ...}}
|
|
47
|
+
- {{Module boundary rule — e.g., "one package per business module, no cross-module
|
|
48
|
+
imports except through the service interfaces"}}
|
|
49
|
+
- {{Communication style — e.g., "server-rendered pages + HTMX partials", "JSON REST",
|
|
50
|
+
"gRPC between services"}}
|
|
51
|
+
|
|
52
|
+
# Project Layout
|
|
53
|
+
|
|
54
|
+
<!-- REQUIRED. Annotated directory tree. specgen-custom substitutes actual module names
|
|
55
|
+
from PRD.md into this layout. -->
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
{{project-root/
|
|
59
|
+
├── cmd/server/main.go # entry point
|
|
60
|
+
├── internal/
|
|
61
|
+
│ ├── <module>/ # one package per business module
|
|
62
|
+
│ │ ├── handler.go
|
|
63
|
+
│ │ ├── service.go
|
|
64
|
+
│ │ └── repo.go
|
|
65
|
+
│ └── platform/ # shared: db, config, auth, logging
|
|
66
|
+
├── migrations/ # SQL migrations
|
|
67
|
+
├── web/ # templates + static assets
|
|
68
|
+
└── Makefile}}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
# Build, Run & Test Commands
|
|
72
|
+
|
|
73
|
+
<!-- REQUIRED. conductor-feature-develop runs these verbatim — they must be exact. -->
|
|
74
|
+
|
|
75
|
+
| Purpose | Command |
|
|
76
|
+
|---------|---------|
|
|
77
|
+
| Install dependencies | {{e.g., go mod download}} |
|
|
78
|
+
| Build | {{e.g., go build -o bin/app ./cmd/server}} |
|
|
79
|
+
| Run (dev) | {{e.g., go run ./cmd/server}} |
|
|
80
|
+
| Run (prod) | {{e.g., ./bin/app}} |
|
|
81
|
+
| Unit/integration tests | {{e.g., go test ./...}} |
|
|
82
|
+
| E2E tests | {{e.g., npx playwright test}} |
|
|
83
|
+
| Lint/format | {{e.g., golangci-lint run}} |
|
|
84
|
+
|
|
85
|
+
# Data & Persistence
|
|
86
|
+
|
|
87
|
+
<!-- RECOMMENDED. Default when absent: derived from the module model files and the
|
|
88
|
+
CLAUDE.md dependency list, marked [TODO]. -->
|
|
89
|
+
|
|
90
|
+
- **Datastore**: {{e.g., PostgreSQL 16}}
|
|
91
|
+
- **Access layer**: {{ORM / query builder / driver — e.g., sqlc, GORM, raw pgx}}
|
|
92
|
+
- **Migrations**: {{tool + workflow — e.g., "golang-migrate; files in migrations/,
|
|
93
|
+
applied on deploy via make migrate"}}
|
|
94
|
+
|
|
95
|
+
# Authentication & Security
|
|
96
|
+
|
|
97
|
+
<!-- RECOMMENDED. Default when absent: derived from PRD.md auth stories; omitted
|
|
98
|
+
entirely for headless stacks with no auth stories. -->
|
|
99
|
+
|
|
100
|
+
- **Mechanism**: {{e.g., session cookies / OIDC via Keycloak / API keys / none}}
|
|
101
|
+
- **Session/token handling**: {{storage, expiry, revocation}}
|
|
102
|
+
- **Role model**: {{roles and how routes/commands are guarded}}
|
|
103
|
+
|
|
104
|
+
# Testing Stack
|
|
105
|
+
|
|
106
|
+
<!-- RECOMMENDED. Default when absent: the stack's dominant unit-test framework +
|
|
107
|
+
Playwright E2E. NOTE: the CO2 pipeline (testgen-functional and the develop phase)
|
|
108
|
+
assumes Playwright E2E for UI-bearing applications — if your stack cannot run
|
|
109
|
+
Playwright (embedded, desktop-native, ...), declare the substitute here explicitly. -->
|
|
110
|
+
|
|
111
|
+
- **Unit/integration**: {{framework + conventions}}
|
|
112
|
+
- **E2E**: {{Playwright (CO2 default) or declared substitute}}
|
|
113
|
+
- **Test data**: {{fixtures / in-memory DB / testcontainers ...}}
|
|
114
|
+
|
|
115
|
+
# Key Libraries
|
|
116
|
+
|
|
117
|
+
<!-- RECOMMENDED. Capabilities not covered here get a [TODO: choose library] in the spec
|
|
118
|
+
when PRD NFRs demand them (grids, charts, file upload, background jobs, HTTP...). -->
|
|
119
|
+
|
|
120
|
+
| Purpose | Library | Version |
|
|
121
|
+
|---------|---------|---------|
|
|
122
|
+
| Validation | {{...}} | {{...}} |
|
|
123
|
+
| Logging | {{...}} | {{...}} |
|
|
124
|
+
| HTTP client | {{...}} | {{...}} |
|
|
125
|
+
| {{...}} | {{...}} | {{...}} |
|
|
126
|
+
|
|
127
|
+
# Coding Conventions
|
|
128
|
+
|
|
129
|
+
<!-- RECOMMENDED. Default when absent: the language's community standard, marked [TODO]. -->
|
|
130
|
+
|
|
131
|
+
- {{Naming conventions, file-size limits, error-handling style, typing strictness,
|
|
132
|
+
lint configuration, forbidden patterns}}
|
|
133
|
+
|
|
134
|
+
# Packaging & Deployment
|
|
135
|
+
|
|
136
|
+
<!-- RECOMMENDED but IMPORTANT: name the manifest file/field and environment variable
|
|
137
|
+
that carry the application version — conductor-feature-develop updates these on
|
|
138
|
+
every version increment and surfaces the version in the app footer/--version/info
|
|
139
|
+
endpoint. Default when absent: the stack's primary manifest + [TODO]. -->
|
|
140
|
+
|
|
141
|
+
- **Artifact**: {{e.g., single static binary / jar / npm package / container image}}
|
|
142
|
+
- **Version carrier**: {{manifest file + field, e.g., "version constant in
|
|
143
|
+
internal/platform/version.go" or "version field in pyproject.toml"}} and
|
|
144
|
+
{{env var, e.g., APP_VERSION}}
|
|
145
|
+
- **Configuration**: {{how config is supplied — env vars / config file + naming
|
|
146
|
+
conventions}}
|
|
147
|
+
|
|
148
|
+
# Exclusions
|
|
149
|
+
|
|
150
|
+
<!-- OPTIONAL. Technologies that must NOT appear in the generated spec, even where the
|
|
151
|
+
coding agent would habitually reach for them. -->
|
|
152
|
+
|
|
153
|
+
- {{e.g., No ORM — raw SQL via sqlc only}}
|
|
154
|
+
- {{e.g., No Docker}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as p,r as u,d as a}from"./chunk-MOJQB5TN-CVXUJZuG.js";import{p as f}from"./chunk-JWPE2WC7-CuKFDdbM.js";import{_ as n,l as o}from"./index-D74-2ULy.js";import{M as c,b as d}from"./cynefin-VYW2F7L2-DH8W0rE6.js";var v=d().RailroadAbnf.parser.LangiumParser,l=n(e=>{const r=e.alternatives.map(g);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformAlternation"),g=n(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformConcatenation"),b=n(e=>{if(e.includes("*")){const[t,s]=e.split("*"),i=t?parseInt(t,10):0,m=s?parseInt(s,10):1/0;return{min:i,max:m}}const r=parseInt(e,10);return{min:r,max:r}},"parseRepeat"),y=n(e=>{const r=A(e.primary);if(!e.repeat)return r;const{min:t,max:s}=b(e.repeat);return t===0&&s===1?{type:"optional",element:r}:{type:"repetition",element:r,min:t,max:s}},"transformElement"),A=n(e=>{switch(e.$type){case"AbnfStringLiteral":return{type:"terminal",value:e.value};case"AbnfNumVal":return{type:"terminal",value:e.value};case"AbnfRuleName":return{type:"nonterminal",name:e.name};case"AbnfGroup":return l(e.element);case"AbnfOptionalGroup":return{type:"optional",element:l(e.element)};default:throw new Error(`Unsupported ABNF primary node: ${e.$type}`)}},"transformPrimary"),P=n(e=>({name:e.name,definition:l(e.definition)}),"transformRule"),h=n(e=>{f(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(P(r)))},"populateDb"),R={parse:n(e=>{a.clear(),o.debug("[ABNF Parser] Starting Langium parse");const r=v.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new c(r);const t=r.value;o.debug("[ABNF Parser] Parsed rules:",t.rules.length),h(t),o.debug("[ABNF Parser] Parse complete")},"parse"),parser:{yy:a}},w={parser:R,db:a,renderer:u,styles:p};export{w as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as ln,$ as an,a0 as y,a1 as tn,a2 as F,a3 as q,a4 as _,a5 as un,a6 as rn,a7 as J,a8 as o,a9 as j,aa as sn,ab as on,ac as fn}from"./index-
|
|
1
|
+
import{Y as ln,$ as an,a0 as y,a1 as tn,a2 as F,a3 as q,a4 as _,a5 as un,a6 as rn,a7 as J,a8 as o,a9 as j,aa as sn,ab as on,ac as fn}from"./index-D74-2ULy.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function dn(l){return l.endAngle}function mn(l){return l&&l.padAngle}function pn(l,h,I,D,v,A,z,a){var O=I-l,i=D-h,n=z-v,d=a-A,u=d*O-n*i;if(!(u*u<y))return u=(n*(h-A)-d*(l-v))/u,[l+u*O,h+u*i]}function U(l,h,I,D,v,A,z){var a=l-I,O=h-D,i=(z?A:-A)/J(a*a+O*O),n=i*O,d=-i*a,u=l+n,s=h+d,f=I+n,c=D+d,B=(u+f)/2,t=(s+c)/2,m=f-u,g=c-s,R=m*m+g*g,T=v-A,P=u*c-f*s,S=(g<0?-1:1)*J(fn(0,T*T*R-P*P)),Y=(P*g-m*S)/R,$=(-P*m-g*S)/R,w=(P*g+m*S)/R,p=(-P*m+g*S)/R,x=Y-B,e=$-t,r=w-B,C=p-t;return x*x+e*e>r*r+C*C&&(Y=w,$=p),{cx:Y,cy:$,x01:-n,y01:-d,x11:Y*(v/T-1),y11:$*(v/T-1)}}function hn(){var l=cn,h=yn,I=j(0),D=null,v=gn,A=dn,z=mn,a=null,O=ln(i);function i(){var n,d,u=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-an,c=A.apply(this,arguments)-an,B=un(c-f),t=c>f;if(a||(a=n=O()),s<u&&(d=s,s=u,u=d),!(s>y))a.moveTo(0,0);else if(B>tn-y)a.moveTo(s*F(f),s*q(f)),a.arc(0,0,s,f,c,!t),u>y&&(a.moveTo(u*F(c),u*q(c)),a.arc(0,0,u,c,f,t));else{var m=f,g=c,R=f,T=c,P=B,S=B,Y=z.apply(this,arguments)/2,$=Y>y&&(D?+D.apply(this,arguments):J(u*u+s*s)),w=_(un(s-u)/2,+I.apply(this,arguments)),p=w,x=w,e,r;if($>y){var C=sn($/u*q(Y)),K=sn($/s*q(Y));(P-=C*2)>y?(C*=t?1:-1,R+=C,T-=C):(P=0,R=T=(f+c)/2),(S-=K*2)>y?(K*=t?1:-1,m+=K,g-=K):(S=0,m=g=(f+c)/2)}var G=s*F(m),H=s*q(m),L=u*F(T),M=u*q(T);if(w>y){var N=s*F(g),Q=s*q(g),V=u*F(R),W=u*q(R),E;if(B<rn)if(E=pn(G,H,V,W,N,Q,L,M)){var X=G-E[0],Z=H-E[1],b=N-E[0],k=Q-E[1],nn=1/q(on((X*b+Z*k)/(J(X*X+Z*Z)*J(b*b+k*k)))/2),en=J(E[0]*E[0]+E[1]*E[1]);p=_(w,(u-en)/(nn-1)),x=_(w,(s-en)/(nn+1))}else p=x=0}S>y?x>y?(e=U(V,W,G,H,s,x,t),r=U(N,Q,L,M,s,x,t),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<w?a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,x,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,s,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),!t),a.arc(r.cx,r.cy,x,o(r.y11,r.x11),o(r.y01,r.x01),!t))):(a.moveTo(G,H),a.arc(0,0,s,m,g,!t)):a.moveTo(G,H),!(u>y)||!(P>y)?a.lineTo(L,M):p>y?(e=U(L,M,N,Q,u,-p,t),r=U(G,H,V,W,u,-p,t),a.lineTo(e.cx+e.x01,e.cy+e.y01),p<w?a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(r.y01,r.x01),!t):(a.arc(e.cx,e.cy,p,o(e.y01,e.x01),o(e.y11,e.x11),!t),a.arc(0,0,u,o(e.cy+e.y11,e.cx+e.x11),o(r.cy+r.y11,r.cx+r.x11),t),a.arc(r.cx,r.cy,p,o(r.y11,r.x11),o(r.y01,r.x01),!t))):a.arc(0,0,u,T,R,t)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,d=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-rn/2;return[F(d)*n,q(d)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:j(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:j(+n),i):h},i.cornerRadius=function(n){return arguments.length?(I=typeof n=="function"?n:j(+n),i):I},i.padRadius=function(n){return arguments.length?(D=n==null?null:typeof n=="function"?n:j(+n),i):D},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:j(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:j(+n),i):A},i.padAngle=function(n){return arguments.length?(z=typeof n=="function"?n:j(+n),i):z},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{hn as d};
|