@atlashub/smartstack-cli 3.9.0 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/index.js +2544 -2461
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +479 -6185
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/agents/ba-writer.md +178 -0
  7. package/templates/agents/db-reader.md +149 -0
  8. package/templates/skills/application/references/application-roles-template.md +227 -0
  9. package/templates/skills/application/references/provider-template.md +30 -6
  10. package/templates/skills/application/steps/step-03-roles.md +45 -7
  11. package/templates/skills/application/steps/step-03b-provider.md +13 -6
  12. package/templates/skills/business-analyse/SKILL.md +56 -4
  13. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +477 -0
  14. package/templates/skills/business-analyse/references/cache-warming-strategy.md +578 -0
  15. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +9 -19
  16. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +12 -2
  17. package/templates/skills/business-analyse/references/deploy-data-build.md +36 -25
  18. package/templates/skills/business-analyse/references/detection-strategies.md +424 -0
  19. package/templates/skills/business-analyse/references/html-data-mapping.md +4 -0
  20. package/templates/skills/business-analyse/references/prd-generation.md +258 -0
  21. package/templates/skills/business-analyse/references/robustness-checks.md +538 -0
  22. package/templates/skills/business-analyse/references/validate-incremental-html.md +47 -4
  23. package/templates/skills/business-analyse/references/validation-checklist.md +281 -0
  24. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +33 -1
  25. package/templates/skills/business-analyse/steps/step-00-init.md +70 -75
  26. package/templates/skills/business-analyse/steps/step-01-cadrage.md +8 -22
  27. package/templates/skills/business-analyse/steps/step-03a-data.md +20 -410
  28. package/templates/skills/business-analyse/steps/step-03a1-setup.md +356 -0
  29. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +143 -0
  30. package/templates/skills/business-analyse/steps/step-03b-ui.md +3 -0
  31. package/templates/skills/business-analyse/steps/step-03c-compile.md +72 -3
  32. package/templates/skills/business-analyse/steps/step-03d-validate.md +36 -3
  33. package/templates/skills/business-analyse/steps/step-04-consolidation.md +21 -440
  34. package/templates/skills/business-analyse/steps/step-04a-collect.md +304 -0
  35. package/templates/skills/business-analyse/steps/step-04b-analyze.md +239 -0
  36. package/templates/skills/business-analyse/steps/step-04c-decide.md +186 -0
  37. package/templates/skills/business-analyse/steps/step-05a-handoff.md +44 -0
  38. package/templates/skills/business-analyse/steps/step-05b-deploy.md +42 -2
  39. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +518 -0
  40. package/templates/skills/controller/steps/step-03-generate.md +184 -24
  41. package/templates/skills/controller/templates.md +11 -2
  42. package/templates/skills/debug/SKILL.md +156 -53
  43. package/templates/skills/debug/references/team-protocol.md +232 -0
  44. package/templates/skills/ralph-loop/references/category-rules.md +46 -0
  45. package/templates/skills/ralph-loop/references/compact-loop.md +32 -2
  46. package/templates/skills/ralph-loop/references/core-seed-data.md +233 -21
  47. package/templates/skills/ralph-loop/steps/step-00-init.md +64 -1
  48. package/templates/skills/ralph-loop/steps/step-04-check.md +27 -2
@@ -0,0 +1,258 @@
1
+ # PRD v3.0 Structure & Validation Rules
2
+
3
+ Source: business-analyse step-05c-ralph-readiness.md
4
+
5
+ ## PRD File Format v3.0
6
+
7
+ ### File Location
8
+
9
+ ```
10
+ .ralph/prd-{moduleCode}.json
11
+ ```
12
+
13
+ Example: `.ralph/prd-Projects.json`, `.ralph/prd-TimeTracking.json`
14
+
15
+ ---
16
+
17
+ ## Structure Requirements
18
+
19
+ ### 1. Version Field (MANDATORY)
20
+
21
+ ```json
22
+ {
23
+ "$version": "3.0.0"
24
+ }
25
+ ```
26
+
27
+ **Validation:**
28
+ - MUST be exactly `"3.0.0"`
29
+ - BLOCKING if missing or wrong version
30
+
31
+ **Common Error:**
32
+ ```
33
+ BLOCKING_ERROR: PRD version must be 3.0.0, got: 2.1.0
34
+ Fix: Re-run ss derive-prd with latest version
35
+ ```
36
+
37
+ ---
38
+
39
+ ### 2. Implementation Section (MANDATORY)
40
+
41
+ **CRITICAL:** `filesToCreate` MUST be under `implementation`, NOT at root level.
42
+
43
+ **Correct Structure:**
44
+ ```json
45
+ {
46
+ "$version": "3.0.0",
47
+ "implementation": {
48
+ "filesToCreate": {
49
+ "domain": [...],
50
+ "application": [...],
51
+ "infrastructure": [...],
52
+ "api": [...],
53
+ "frontend": [...],
54
+ "seedData": [...],
55
+ "tests": [...]
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ **Wrong Structure (v2.x legacy):**
62
+ ```json
63
+ {
64
+ "$version": "3.0.0",
65
+ "filesToCreate": { // ❌ WRONG - at root level
66
+ "domain": [...]
67
+ }
68
+ }
69
+ ```
70
+
71
+ **Validation:**
72
+ - IF `prd.filesToCreate` exists at root level → BLOCKING ERROR
73
+ - IF `prd.implementation.filesToCreate` missing → BLOCKING ERROR
74
+
75
+ **Fix Command:**
76
+ ```bash
77
+ ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json
78
+ ```
79
+
80
+ ---
81
+
82
+ ### 3. Seven Categories (MANDATORY)
83
+
84
+ All PRD files MUST include these 7 categories under `implementation.filesToCreate`:
85
+
86
+ | Category | Description | Examples |
87
+ |----------|-------------|----------|
88
+ | **domain** | Domain entities, value objects, domain services | `Project.cs`, `ProjectStatus.cs` |
89
+ | **application** | Application services, DTOs, interfaces | `ProjectService.cs`, `CreateProjectDto.cs` |
90
+ | **infrastructure** | Data access, repositories, EF Core config | `ProjectRepository.cs`, `ProjectConfiguration.cs` |
91
+ | **api** | Controllers, API endpoints | `ProjectsController.cs` |
92
+ | **frontend** | React pages, components, hooks | `ProjectsPage.tsx`, `useProjects.ts` |
93
+ | **seedData** | Seed data classes | `ProjectSeedData.cs` |
94
+ | **tests** | Unit tests, integration tests | `ProjectServiceTests.cs`, `ProjectsControllerTests.cs` |
95
+
96
+ **Validation:**
97
+ ```javascript
98
+ const categories = ['domain', 'application', 'infrastructure', 'api', 'frontend', 'seedData', 'tests'];
99
+ const missingCategories = categories.filter(cat => !prd.implementation.filesToCreate[cat]);
100
+
101
+ if (missingCategories.length > 0) {
102
+ BLOCKING_ERROR(`Missing categories: ${missingCategories.join(', ')}`);
103
+ }
104
+ ```
105
+
106
+ **Common Errors:**
107
+ - Missing `tests` category → often forgotten
108
+ - Missing `seedData` category → sometimes omitted for modules without seed data
109
+ - Empty arrays allowed (e.g., `"seedData": []`) if genuinely no files needed
110
+
111
+ ---
112
+
113
+ ### 4. File Count Consistency (MANDATORY)
114
+
115
+ **Validation:** PRD file counts MUST match feature.json handoff counts.
116
+
117
+ ```javascript
118
+ const featureHandoff = moduleFeature.handoff.filesToCreate;
119
+ const categories = ['domain', 'application', 'infrastructure', 'api', 'frontend', 'seedData', 'tests'];
120
+
121
+ for (const cat of categories) {
122
+ const prdCount = prd.implementation.filesToCreate[cat]?.length ?? 0;
123
+ const featureCount = featureHandoff[cat]?.length ?? 0;
124
+
125
+ if (prdCount !== featureCount) {
126
+ BLOCKING_ERROR(`${cat}: prd has ${prdCount} files but feature.json has ${featureCount}`);
127
+ }
128
+ }
129
+ ```
130
+
131
+ **Why this matters:**
132
+ - Ensures PRD was derived from the correct feature.json
133
+ - Catches stale PRD files (derived from old version)
134
+ - Validates handoff integrity before ralph-loop
135
+
136
+ **Fix:**
137
+ - Re-derive PRD from latest feature.json
138
+ - Check that feature.json handoff section is complete
139
+
140
+ ---
141
+
142
+ ### 5. File Entry Schema
143
+
144
+ Each file entry in a category array must have:
145
+
146
+ ```json
147
+ {
148
+ "path": "src/SmartStack.HumanResources.Domain/Projects/Project.cs",
149
+ "type": "Entity",
150
+ "module": "Projects"
151
+ }
152
+ ```
153
+
154
+ **Required Fields:**
155
+ - `path` (string): Absolute or relative path where file will be created
156
+ - `type` (string): File type hint (Entity, Service, Controller, Page, Test, etc.)
157
+ - `module` (string): Module code this file belongs to
158
+
159
+ **Optional Fields:**
160
+ - `description` (string): Brief description of what the file does
161
+ - `dependencies` (array): Other files this depends on
162
+
163
+ ---
164
+
165
+ ## Validation Checklist
166
+
167
+ Use this checklist when validating PRD files:
168
+
169
+ | Check | Validation | Status |
170
+ |-------|-----------|--------|
171
+ | **Version** | `$version === "3.0.0"` | PASS/FAIL |
172
+ | **Structure** | `implementation.filesToCreate` exists (not root) | PASS/FAIL |
173
+ | **Categories** | All 7 categories present | PASS/FAIL |
174
+ | **File Counts** | PRD counts match feature.json handoff | PASS/FAIL |
175
+ | **File Schemas** | All files have path, type, module | PASS/FAIL |
176
+
177
+ **All checks must PASS before proceeding to /ralph-loop**
178
+
179
+ ---
180
+
181
+ ## Common Errors & Fixes
182
+
183
+ ### Error 1: Wrong Version
184
+ ```
185
+ BLOCKING_ERROR: PRD version must be 3.0.0, got: 2.1.0
186
+ ```
187
+ **Fix:** Re-run `ss derive-prd` with latest SmartStack.mcp version
188
+
189
+ ### Error 2: filesToCreate at Root Level
190
+ ```
191
+ BLOCKING_ERROR: filesToCreate is at ROOT level (wrong structure)
192
+ ```
193
+ **Fix:** Re-run `ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json`
194
+
195
+ ### Error 3: Missing Categories
196
+ ```
197
+ BLOCKING_ERROR: Missing categories: seedData, tests
198
+ ```
199
+ **Fix:**
200
+ - Check feature.json handoff.filesToCreate has all 7 categories
201
+ - Re-derive PRD after fixing feature.json
202
+ - If genuinely no files needed, use empty array: `"seedData": []`
203
+
204
+ ### Error 4: File Count Mismatch
205
+ ```
206
+ BLOCKING_ERROR: api: prd has 8 files but feature.json has 12
207
+ ```
208
+ **Fix:**
209
+ - PRD is stale (derived from old feature.json)
210
+ - Re-derive PRD from latest feature.json: `ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json`
211
+
212
+ ---
213
+
214
+ ## Generation Command Reference
215
+
216
+ **Derive PRD from feature.json:**
217
+ ```bash
218
+ ss derive-prd \
219
+ --feature docs/business/{App}/{Module}/business-analyse/v1.0/feature.json \
220
+ --output .ralph/prd-{ModuleCode}.json
221
+ ```
222
+
223
+ **Example:**
224
+ ```bash
225
+ ss derive-prd \
226
+ --feature docs/business/HumanResources/Projects/business-analyse/v1.0/feature.json \
227
+ --output .ralph/prd-Projects.json
228
+ ```
229
+
230
+ **Batch generation for all modules:**
231
+ ```bash
232
+ # Typically done in step-05a-handoff.md
233
+ for module in $(modules); do
234
+ ss derive-prd --feature {module_feature_path} --output .ralph/prd-${module}.json
235
+ done
236
+ ```
237
+
238
+ ---
239
+
240
+ ## Why PRD Validation Matters
241
+
242
+ | Risk | Without Validation | With Validation |
243
+ |------|-------------------|-----------------|
244
+ | **Wrong structure** | ralph-loop fails mid-execution | Caught before development starts |
245
+ | **Stale PRD** | Generates code from old spec | Detects version mismatch |
246
+ | **Missing files** | Incomplete implementation | Ensures all layers covered |
247
+ | **Count mismatch** | Silent data loss | Guarantees integrity |
248
+
249
+ **Bottom line:** Ralph-loop depends on correct PRD structure. Validating upfront saves hours of debugging.
250
+
251
+ ---
252
+
253
+ ## Related Files
254
+
255
+ - `step-05a-handoff.md`: Generates PRD files via `ss derive-prd`
256
+ - `step-05c-ralph-readiness.md`: Validates PRD structure before ralph-loop
257
+ - `feature-schema.json`: Schema for feature.json (source of PRD)
258
+ - `/ralph-loop` skill: Consumes PRD files for implementation