@atlashub/smartstack-cli 4.17.1 → 4.19.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 (167) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-reader.md +86 -80
  3. package/templates/agents/ba-writer.md +321 -413
  4. package/templates/agents/docs-context-reader.md +3 -3
  5. package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
  6. package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
  7. package/templates/skills/apex/SKILL.md +29 -16
  8. package/templates/skills/apex/_shared.md +62 -9
  9. package/templates/skills/apex/references/analysis-methods.md +8 -6
  10. package/templates/skills/apex/references/challenge-questions.md +5 -5
  11. package/templates/skills/apex/references/core-seed-data.md +68 -45
  12. package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
  13. package/templates/skills/apex/references/parallel-execution.md +156 -0
  14. package/templates/skills/apex/references/person-extension-pattern.md +12 -12
  15. package/templates/skills/apex/references/post-checks.md +1748 -1726
  16. package/templates/skills/apex/references/smartstack-api.md +63 -57
  17. package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
  18. package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
  19. package/templates/skills/apex/references/smartstack-layers.md +98 -145
  20. package/templates/skills/apex/steps/step-00-init.md +30 -6
  21. package/templates/skills/apex/steps/step-01-analyze.md +27 -23
  22. package/templates/skills/apex/steps/step-02-plan.md +12 -12
  23. package/templates/skills/apex/steps/step-03-execute.md +198 -143
  24. package/templates/skills/apex/steps/step-04-examine.md +24 -93
  25. package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
  26. package/templates/skills/apex/steps/step-06-resolve.md +9 -9
  27. package/templates/skills/apex/steps/step-07-tests.md +3 -1
  28. package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
  29. package/templates/skills/business-analyse/SKILL.md +182 -301
  30. package/templates/skills/business-analyse/_shared.md +119 -336
  31. package/templates/skills/business-analyse/html/ba-interactive.html +703 -82
  32. package/templates/skills/business-analyse/html/build-html.js +41 -3
  33. package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
  34. package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
  35. package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
  36. package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
  37. package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
  38. package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
  39. package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
  40. package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
  41. package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
  42. package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
  43. package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
  44. package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
  45. package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
  46. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
  47. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +31 -5
  48. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
  49. package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
  50. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
  51. package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
  52. package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
  53. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +142 -0
  54. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +94 -0
  55. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +150 -0
  56. package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
  57. package/templates/skills/business-analyse/questionnaire.md +23 -280
  58. package/templates/skills/business-analyse/react/application-viewer.md +2 -2
  59. package/templates/skills/business-analyse/react/components.md +4 -4
  60. package/templates/skills/business-analyse/react/i18n-template.md +1 -1
  61. package/templates/skills/business-analyse/react/schema.md +14 -14
  62. package/templates/skills/business-analyse/references/acceptance-criteria.md +25 -25
  63. package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
  64. package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +7 -7
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +14 -12
  67. package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
  68. package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
  69. package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
  70. package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
  71. package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
  72. package/templates/skills/business-analyse/references/robustness-checks.md +36 -33
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
  76. package/templates/skills/business-analyse/references/validation-checklist.md +9 -6
  77. package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
  78. package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
  79. package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
  80. package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
  81. package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
  82. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
  83. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
  84. package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
  85. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
  86. package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -3
  87. package/templates/skills/business-analyse/steps/step-00-init.md +93 -134
  88. package/templates/skills/business-analyse/steps/step-01-cadrage.md +136 -172
  89. package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
  90. package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
  91. package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
  92. package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
  93. package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
  94. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  95. package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
  96. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
  97. package/templates/skills/business-analyse/templates-react.md +2 -2
  98. package/templates/skills/derive-prd/SKILL.md +92 -0
  99. package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
  100. package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
  101. package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
  102. package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
  103. package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
  104. package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -258
  105. package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
  106. package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
  107. package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
  108. package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
  109. package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
  110. package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
  111. package/templates/skills/ralph-loop/SKILL.md +10 -4
  112. package/templates/skills/ralph-loop/references/category-completeness.md +20 -4
  113. package/templates/skills/ralph-loop/references/compact-loop.md +80 -48
  114. package/templates/skills/ralph-loop/references/init-resume-recovery.md +4 -2
  115. package/templates/skills/ralph-loop/references/parallel-execution.md +27 -27
  116. package/templates/skills/ralph-loop/steps/step-00-init.md +19 -9
  117. package/templates/skills/ralph-loop/steps/step-01-task.md +12 -4
  118. package/templates/skills/ralph-loop/steps/step-02-execute.md +9 -4
  119. package/templates/skills/ralph-loop/steps/step-03-commit.md +1 -1
  120. package/templates/skills/ralph-loop/steps/step-04-check.md +5 -21
  121. package/templates/skills/ralph-loop/steps/step-05-report.md +6 -1
  122. package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
  123. package/templates/skills/business-analyse/_architecture.md +0 -124
  124. package/templates/skills/business-analyse/_elicitation.md +0 -206
  125. package/templates/skills/business-analyse/_module-loop.md +0 -115
  126. package/templates/skills/business-analyse/_suggestions.md +0 -34
  127. package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
  128. package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
  129. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
  130. package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
  131. package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
  132. package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
  133. package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
  134. package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
  135. package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
  136. package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
  137. package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -43
  138. package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
  139. package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
  140. package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
  141. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
  142. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
  143. package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -362
  144. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
  145. package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
  146. package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
  147. package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
  148. package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
  149. package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
  150. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
  151. package/templates/skills/business-analyse/references/team-orchestration.md +0 -1022
  152. package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
  153. package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
  154. package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
  155. package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
  156. package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -506
  157. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -301
  158. package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -425
  159. package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -611
  160. package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -783
  161. package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
  162. package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
  163. package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
  164. package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
  165. package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -840
  166. package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
  167. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
@@ -0,0 +1,220 @@
1
+ ---
2
+ name: step-05-deploy
3
+ description: Deploy interactive HTML document from analysis data
4
+ model: sonnet
5
+ next_step: steps/step-06-review.md
6
+ ---
7
+
8
+ > **Context files:** `_shared.md` | `references/html-data-mapping.md`
9
+
10
+ # Step 5: Deploy - Interactive HTML Document
11
+
12
+ ## MANDATORY EXECUTION RULES
13
+
14
+ - **ALWAYS** verify PRD exists before proceeding (`.ralph/prd-{module}.json`)
15
+ - **ALWAYS** pre-populate HTML with FEATURE_DATA + EMBEDDED_ARTIFACTS (no empty templates)
16
+ - **FEATURE_DATA.moduleSpecs** must have ONE entry per module (empty = BROKEN)
17
+ - **FEATURE_DATA.cadrage.scope** uses HTML keys (vital/important/optional/excluded)
18
+ - **ALWAYS** deploy SINGLE interactive HTML (multi-app or single-app per config)
19
+
20
+ ## YOUR TASK
21
+
22
+ Deploy the single interactive HTML document pre-populated with all analysis data across all modules and applications. PRD and handoff data must already exist (generated by `/derive-prd`).
23
+
24
+ ---
25
+
26
+ ## EXECUTION SEQUENCE
27
+
28
+ ### 1. Verify PRD Exists
29
+
30
+ For each module, verify PRD file exists:
31
+
32
+ ```
33
+ FOR each module in modules:
34
+ prdPath = ".ralph/prd-{moduleCode}.json"
35
+ IF NOT exists(prdPath):
36
+ BLOCKING ERROR: "PRD not found: {prdPath} — Run /derive-prd first"
37
+ STOP
38
+ IF fileSize(prdPath) < 100:
39
+ BLOCKING ERROR: "PRD file too small: {prdPath} — Run /derive-prd to regenerate"
40
+ STOP
41
+ ```
42
+
43
+ Verify consolidation status:
44
+
45
+ ```
46
+ IF workflow.mode === "project":
47
+ projectFeature = ba-reader.findProjectFeature()
48
+ FOR each app in projectFeature.applications:
49
+ appFeature = ba-reader.findFeature(app.featureJsonPath)
50
+ IF appFeature.status !== "consolidated":
51
+ BLOCKING ERROR: "Application {app.code} not consolidated"
52
+ ELSE:
53
+ feature = ba-reader.findFeature({feature_id})
54
+ IF feature.status !== "consolidated":
55
+ BLOCKING ERROR: "Feature status: {feature.status}, expected consolidated"
56
+ ```
57
+
58
+ Display:
59
+ ```
60
+ PRD verified: {module_count} modules
61
+ .ralph/prd-{module1}.json ({size} bytes)
62
+ .ralph/prd-{module2}.json ({size} bytes)
63
+ → Proceeding to HTML generation...
64
+ ```
65
+
66
+ ---
67
+
68
+ ### 2. Build FEATURE_DATA Object
69
+
70
+ Read from index.json (master module JSON files):
71
+
72
+ For EACH module:
73
+ - Read complete index.json for each module
74
+ - Map to FEATURE_DATA structure per `references/html-data-mapping.md`
75
+
76
+ **FEATURE_DATA structure:**
77
+ - metadata (analysisMode="interactive", workflowMode, versions, timestamps)
78
+ - cadrage (scope using HTML keys: vital/important/optional/excluded; objectives, constraints, assumptions)
79
+ - modules[] (all modules with all fields from index.json)
80
+ - moduleSpecs{} (one entry PER module with analysis, specification sections from index.json)
81
+ - consolidation (cross-module interactions)
82
+ - handoff (complexity, filesToCreate summary, totalFiles, totalTasks)
83
+
84
+ **Critical requirements:**
85
+ - moduleSpecs MUST have ONE entry per module (empty = BUG)
86
+ - cadrage.scope converts: mustHave->vital, shouldHave->important, couldHave->optional, outOfScope->excluded
87
+ - metadata.analysisMode from master.metadata.analysisMode (always "interactive")
88
+ - PROJECT MODE: include applications[], consolidation.crossApplicationInteractions
89
+
90
+ ---
91
+
92
+ ### 3. Build EMBEDDED_ARTIFACTS Object
93
+
94
+ Collect from FEATURE_DATA:
95
+ - **wireframes**: Per-module ASCII + SVG (if generated) — fields: format, content, svgContent
96
+ - **e2eFlows**: E2E diagrams from consolidated.e2eFlows
97
+ - **dependencyGraph**: From dependencyGraph section
98
+
99
+ **Field name mapping (CRITICAL):**
100
+ - wireframes use: `format`, `content`, `svgContent` (NOT mockupFormat/mockup)
101
+
102
+ ---
103
+
104
+ ### 4. Generate SVG Wireframes (Parallel, Optional)
105
+
106
+ > **After EMBEDDED_ARTIFACTS built but BEFORE HTML write.**
107
+ > This step is NEVER blocking — ASCII-only wireframes acceptable.
108
+ > **Reference:** Read `references/wireframe-svg-style-guide.md` for full agent prompt template
109
+
110
+ 1. Collect all wireframes where `mockup` exists and `svgContent` is null
111
+ 2. Spawn parallel Task(sonnet) agents — ONE per wireframe
112
+ 3. Validate results: strip markdown fences, verify SVG syntax
113
+ 4. Inject valid SVGs into `EMBEDDED_ARTIFACTS.wireframes[moduleCode][index].svgContent`
114
+ 5. Display: "SVG wireframe generation: {successCount}/{total} generated, {failCount} fallback (ASCII)"
115
+
116
+ ---
117
+
118
+ ### 5. Replace Placeholders & Write HTML
119
+
120
+ 1. Read HTML template from skill: `html/ba-interactive.html`
121
+ 2. Serialize FEATURE_DATA and EMBEDDED_ARTIFACTS as JSON (2-space indent)
122
+ 3. Replace 8 placeholders:
123
+ - `{{FEATURE_DATA}}` — Full FEATURE_DATA JSON object
124
+ - `{{EMBEDDED_ARTIFACTS}}` — Wireframes, E2E, dependency graph
125
+ - `{{APPLICATION_NAME}}` — From master.metadata.application
126
+ - Others per template
127
+
128
+ 4. **Output path:**
129
+ - Multi-app (project mode): `docs/business-analyse/v{version}/ba-interactive.html`
130
+ - Single-app: `docs/{app}/business-analyse/v{version}/ba-interactive.html`
131
+
132
+ 5. Write to file
133
+
134
+ ---
135
+
136
+ ### 6. Verify Deployment
137
+
138
+ **POST-CHECK (BLOCKING):**
139
+
140
+ 1. **File size > 100KB** (indicates pre-populated)
141
+ ```
142
+ if [ $(stat --format=%s ba-interactive.html) -lt 100000 ]; then
143
+ BLOCKING_ERROR("ba-interactive.html not pre-populated")
144
+ fi
145
+ ```
146
+
147
+ 2. **moduleSpecs present in HTML** (must be serialized)
148
+ ```
149
+ if ! grep -q '"moduleSpecs"' ba-interactive.html; then
150
+ BLOCKING_ERROR("moduleSpecs not found — FEATURE_DATA not serialized")
151
+ fi
152
+ ```
153
+
154
+ 3. **cadrage.scope uses HTML keys** (vital/important/optional/excluded)
155
+ ```
156
+ if grep -q '"mustHave"' ba-interactive.html; then
157
+ BLOCKING_ERROR("cadrage.scope still has JSON keys")
158
+ fi
159
+ ```
160
+
161
+ 4. **Wireframe field names correct** (format/content, NOT mockupFormat/mockup)
162
+ ```
163
+ if grep -q '"mockupFormat"' ba-interactive.html; then
164
+ BLOCKING_ERROR("Wireframes use 'mockupFormat' — must be 'format'")
165
+ fi
166
+ ```
167
+
168
+ 5. **All modules have specs AND wireframes**
169
+ ```
170
+ FOR each module in FEATURE_DATA.modules:
171
+ IF FEATURE_DATA.moduleSpecs[module.code] undefined:
172
+ BLOCKING_ERROR("Module not in moduleSpecs")
173
+ IF EMBEDDED_ARTIFACTS.wireframes[module.code] undefined:
174
+ BLOCKING_ERROR("Module not in wireframes")
175
+ ```
176
+
177
+ ---
178
+
179
+ ### 7. Display Completion Summary
180
+
181
+ ```
182
+ ══════════════════════════════════════════════════════════════
183
+ [OK] HTML DEPLOY COMPLETE — {application_name}
184
+ ══════════════════════════════════════════════════════════════
185
+
186
+ Modules: {count} ({names})
187
+
188
+ [DIR] Artifact generated:
189
+ ba-interactive.html — Interactive document
190
+ Path: {output_path}
191
+ Pre-populated: {module_count} modules, {total_uc} use cases,
192
+ {total_br} business rules, {total_wireframes} wireframes
193
+
194
+ [NEXT] Review & Validation:
195
+ 1. Open ba-interactive.html in browser
196
+ 2. Review all modules, use cases, business rules
197
+ 3. Validate wireframes and permissions
198
+ 4. If OK: /derive-prd then /ralph-loop to begin development
199
+ 5. If changes needed: /business-analyse to iterate
200
+
201
+ ══════════════════════════════════════════════════════════════
202
+ ```
203
+
204
+ ---
205
+
206
+ ## SELF-VERIFICATION (BEFORE COMPLETION)
207
+
208
+ 1. `ba-interactive.html` exists and >100KB
209
+ 2. FEATURE_DATA.moduleSpecs has entries for ALL modules
210
+ 3. cadrage.scope uses HTML keys (vital/important/optional/excluded)
211
+ 4. Wireframes use format/content fields (not mockupFormat/mockup)
212
+ 5. POST-CHECK verification all passed
213
+
214
+ **IF any check fails -> generate missing artifact before completing.**
215
+
216
+ ---
217
+
218
+ ## NEXT STEP
219
+
220
+ Load: `steps/step-06-review.md`
@@ -19,17 +19,15 @@ Apply corrections exported from the interactive HTML review (`ba-review.json`) t
19
19
  ## Flow
20
20
 
21
21
  1. Read and validate ba-review.json
22
- 2. Read existing master feature.json
22
+ 2. Read existing master index.json and version directory
23
23
  3. Create new version
24
24
  4. Apply cadrage corrections (reverse mapping)
25
25
  5. Apply module corrections
26
26
  6. Apply consolidation corrections
27
27
  7. Preserve review comments
28
- 8. Regenerate PRD
29
- 9. Regenerate progress.txt
30
- 10. Update manifest
31
- 11. Regenerate HTML
32
- 12. Display completion summary
28
+ 8. Regenerate HTML
29
+ 9. Update manifest
30
+ 10. Display completion summary
33
31
 
34
32
  ---
35
33
 
@@ -55,13 +53,14 @@ source_version: _reviewMeta.sourceVersion
55
53
  change_summary: _reviewMeta.changeSummary
56
54
  ```
57
55
 
58
- ## Step 2: Read Existing Master Feature.json
56
+ ## Step 2: Read Existing Master Index.json
59
57
 
60
58
  ```
61
- 1. Locate master feature.json from docs_dir
59
+ 1. Locate master index.json from docs_dir (e.g., docs/{app}/business-analyse/v{X.Y}/index.json)
62
60
  2. Read and parse
63
- 3. Verify metadata.application matches _reviewMeta.sourceApplicationId
64
- 4. Store as existing_master
61
+ 3. Verify metadata.applicationId matches _reviewMeta.sourceApplicationId
62
+ 4. Store as existing_master_index
63
+ 5. Read all thematic files referenced in index.json (cadrage.json, entities.json, rules.json, etc.)
65
64
  ```
66
65
 
67
66
  ## Step 3: Create New Version
@@ -81,17 +80,17 @@ Call ba-writer.createVersion(existing_master.id, "Review corrections applied fro
81
80
  ```yaml
82
81
  new_version: string (e.g., "1.1" or "2.0")
83
82
  new_docs_dir: path to new version directory
84
- new_master_path: path to new master feature.json
83
+ new_version_dir: path to new version directory (contains index.json + thematic files)
85
84
  ```
86
85
 
87
86
  ## Step 4: Apply Cadrage Corrections
88
87
 
89
88
  > **Reference:** `references/review-data-mapping.md` for exact field mapping
90
89
 
91
- Read the new master feature.json and apply reverse mapping from review data:
90
+ Read the new version's cadrage.json and apply reverse mapping from review data:
92
91
 
93
92
  ```
94
- 1. Scope mapping (review → feature.json):
93
+ 1. Scope mapping (review → cadrage.json):
95
94
  - cadrage.scope.vital[] → cadrage.globalScope.mustHave[]
96
95
  - cadrage.scope.important[] → cadrage.globalScope.shouldHave[]
97
96
  - cadrage.scope.optional[] → cadrage.globalScope.couldHave[]
@@ -119,33 +118,34 @@ Read the new master feature.json and apply reverse mapping from review data:
119
118
  5. Acceptance criteria:
120
119
  - cadrage.success.definition → cadrage.acceptanceCriteria[] (split by newline, generate AC-NNN IDs)
121
120
 
122
- Call ba-writer.enrichSection(new_master.id, "cadrage", updated_cadrage)
121
+ Update cadrage.json with corrected data and update its hash in index.json
123
122
  ```
124
123
 
125
124
  ## Step 5: Apply Module Corrections
126
125
 
127
126
  ```
128
127
  FOR EACH moduleCode in review_data.moduleSpecifications:
129
- 1. Check if module exists in current master.modules[]
128
+ 1. Check if module exists in current index.json.modules[]
130
129
  - If NEW module (in change_summary.modulesAdded):
131
- a. Add to master.modules[] with metadata from review
132
- b. Create module directory and feature.json via ba-writer.create(scope:"module")
130
+ a. Add to index.json.modules[] with metadata from review
131
+ b. Create module directory and entities.json, rules.json, usecases.json, etc. via ba-writer
133
132
  - If REMOVED module (in change_summary.modulesRemoved):
134
- a. Mark module status as "removed" in master (do NOT delete files)
133
+ a. Mark module status as "removed" in index.json (do NOT delete files)
135
134
  - If EXISTING module:
136
- a. Read module feature.json
135
+ a. Update module's thematic files
137
136
 
138
137
  2. Reverse-map module specification data:
139
- - review.useCases[] → specification.useCases[]
138
+ - review.useCases[] → usecases.json.useCases[]
140
139
  (name→name, actor→primaryActor, steps→mainScenario (split by \n), alternative→alternativeScenarios)
141
- - review.businessRules[] → analysis.businessRules[]
140
+ - review.businessRules[] → rules.json.businessRules[]
142
141
  (name→name, category→category, statement→statement, example→examples[])
143
- - review.entities[] → analysis.entities[]
142
+ - review.entities[] → entities.json.entities[]
144
143
  (name→name, description→description, attributes→attributes, relationships→relationships)
145
- - review.permissions[] → specification.permissionMatrix
144
+ - review.permissions[] → permissions.json.permissionMatrix
146
145
  (reverse "Role|Action" format → {permissions[], roleAssignments[]})
147
146
 
148
- 3. Write updated module feature.json via ba-writer.enrichSection()
147
+ 3. Update each module's thematic files via ba-writer.enrichSection()
148
+ 4. Update hashes in index.json for modified files
149
149
  ```
150
150
 
151
151
  ## Step 6: Apply Consolidation Corrections
@@ -153,19 +153,19 @@ FOR EACH moduleCode in review_data.moduleSpecifications:
153
153
  ```
154
154
  IF review_data.consolidation exists:
155
155
  1. Reverse-map interactions:
156
- - consolidation.interactions[] → consolidation.crossModuleInteractions[]
156
+ - consolidation.interactions[] → consolidation.json.crossModuleInteractions[]
157
157
  (from→fromModule, to→toModule, description→description)
158
158
 
159
159
  2. Reverse-map E2E flows:
160
- - consolidation.e2eFlows[] → consolidation.e2eFlows[]
160
+ - consolidation.e2eFlows[] → consolidation.json.e2eFlows[]
161
161
  (name→name, steps→steps, actors preserved)
162
162
 
163
- Call ba-writer.enrichSection(new_master.id, "consolidation", updated_consolidation)
163
+ 3. Update consolidation.json and update hash in index.json
164
164
  ```
165
165
 
166
166
  ## Step 7: Preserve Review Comments
167
167
 
168
- Store all review feedback in a new `review` section of the master feature.json:
168
+ Store all review feedback in a new review.json file:
169
169
 
170
170
  ```
171
171
  review_section = {
@@ -177,58 +177,41 @@ review_section = {
177
177
  changeSummary: change_summary
178
178
  }
179
179
 
180
- Call ba-writer.enrichSection(new_master.id, "review", review_section)
180
+ Create review.json with review_section and update hash in index.json
181
181
  ```
182
182
 
183
- ## Step 8: Regenerate PRD
184
-
185
- ```
186
- FOR EACH module in master.modules[] WHERE status != "removed":
187
- Run: ss derive-prd --application {new_master_path} --module {moduleCode}
188
- Verify: .ralph/prd-{moduleCode}.json exists and has filesToCreate
189
- ```
190
-
191
- > `ss derive-prd` is a deterministic CLI command (no LLM), safe for regeneration.
192
-
193
- ## Step 9: Regenerate progress.txt
194
-
195
- ```
196
- Write .ralph/progress.txt with:
197
- - Link to new master feature.json
198
- - Link to each module feature.json
199
- - Link to ba-interactive.html (new version)
200
- - Summary of review changes applied
201
- ```
202
-
203
- ## Step 10: Update Manifest
204
-
205
- ```
206
- 1. Read docs/index.json
207
- 2. Find entry for this application
208
- 3. Update version, lastModified, status
209
- 4. If entry doesn't exist, create it
210
- 5. Write docs/index.json
211
- ```
212
-
213
- ## Step 11: Regenerate Interactive HTML
183
+ ## Step 8: Regenerate Interactive HTML
214
184
 
215
185
  > **Reference:** `references/html-data-mapping.md` for FEATURE_DATA and EMBEDDED_ARTIFACTS mapping
216
186
 
217
187
  ```
218
188
  1. Read ba-interactive.html template from skill templates
219
- 2. Build FEATURE_DATA from NEW master + module feature.json files
189
+ 2. Build FEATURE_DATA from NEW version:
190
+ - Read index.json for metadata
191
+ - Read cadrage.json for cadrage section
192
+ - Read entities.json, rules.json, usecases.json, etc.
220
193
  (follow exact mapping from html-data-mapping.md)
221
- 3. Build EMBEDDED_ARTIFACTS from NEW module feature.json files
194
+ 3. Build EMBEDDED_ARTIFACTS from thematic files
222
195
  (wireframes, e2eFlows, dependencyGraph)
223
196
  4. Replace placeholders:
224
197
  - {{FEATURE_DATA}} → serialized FEATURE_DATA JSON
225
198
  - {{EMBEDDED_ARTIFACTS}} → serialized EMBEDDED_ARTIFACTS JSON
226
199
  - {{APPLICATION_NAME}} → application_name
227
200
  - {{APPLICATION_ID}} → feature_id
228
- 5. Write to new version directory: {new_docs_dir}/ba-interactive.html
201
+ 5. Write to new version directory: {new_version_dir}/ba-interactive.html
202
+ ```
203
+
204
+ ## Step 9: Update Manifest
205
+
206
+ ```
207
+ 1. Read docs/index.json
208
+ 2. Find entry for this application
209
+ 3. Update version, lastModified, status
210
+ 4. If entry doesn't exist, create it
211
+ 5. Write docs/index.json
229
212
  ```
230
213
 
231
- ## Step 12: Display Completion Summary
214
+ ## Step 10: Display Completion Summary
232
215
 
233
216
  ```
234
217
  ═══════════════════════════════════════════════════════════════
@@ -254,10 +237,9 @@ Changes applied:
254
237
  Artifacts regenerated:
255
238
  | Artifact | Path |
256
239
  |----------------------|--------------------------------------|
257
- | Master feature.json | {new_master_path} |
258
- | ba-interactive.html | {new_docs_dir}/ba-interactive.html |
259
- | PRD files | .ralph/prd-*.json |
260
- | progress.txt | .ralph/progress.txt |
240
+ | Master index.json | {new_version_dir}/index.json |
241
+ | ba-interactive.html | {new_version_dir}/ba-interactive.html|
242
+ | Thematic files | {new_version_dir}/*.json |
261
243
  | Manifest | docs/index.json |
262
244
 
263
245
  NEXT STEPS:
@@ -274,5 +256,5 @@ NEXT STEPS:
274
256
  | ba-review.json malformed | Display structure errors, STOP |
275
257
  | Source version mismatch | Warn but continue (corrections may still apply) |
276
258
  | Module not found for update | Skip module, warn user |
277
- | PRD generation fails | Warn but continue (can be re-run manually) |
259
+ | HTML generation fails | Warn but continue (can be re-run manually) |
278
260
  | Manifest update fails | Warn but continue |
@@ -1,7 +1,7 @@
1
1
  # Template Functional Requirements Document
2
2
 
3
3
  > **Usage:** Template for 3-functional-specification.md
4
- > **Loaded in:** step-03a1-setup.md
4
+ > **Loaded in:** step-03-specify.md
5
5
 
6
6
  ---
7
7
 
@@ -1,7 +1,7 @@
1
1
  # Template Development Handoff
2
2
 
3
- > **Usage:** Template for step-04-handoff.md
4
- > **Data source:** feature.json (sections: metadata, analysis, specification, handoff)
3
+ > **Usage:** Template for step-05-deploy.md
4
+ > **Data source:** index.json (sections: metadata, analysis, specification, handoff)
5
5
 
6
6
  ---
7
7
 
@@ -10,8 +10,8 @@
10
10
 
11
11
  > **Module:** {application}/{module}
12
12
  > **Version:** {version}
13
- > **Validated Specs:** feature.json (validation.decision = APPROVED)
14
- > **Source:** `docs/{app}/{module}/business-analyse/v{version}/feature.json`
13
+ > **Validated Specs:** index.json (validation.decision = APPROVED)
14
+ > **Source:** `docs/{app}/{module}/business-analyse/v{version}/index.json`
15
15
  > **Implementation:** `/ralph-loop`
16
16
 
17
17
  ## DEVELOPER INSTRUCTIONS
@@ -39,6 +39,8 @@ This document is a self-contained prompt for Claude Code.
39
39
  | Table Prefix | `{prefix}_` |
40
40
  | Complexity | {feature.handoff.complexity} |
41
41
 
42
+ > **Source:** Read from index.json
43
+
42
44
  ## 2. [EXPLORE] EXISTING PATTERNS
43
45
 
44
46
  BEFORE coding, explore these files to understand the patterns:
@@ -66,7 +68,7 @@ FRONTEND:
66
68
 
67
69
  ## 3. FILES TO CREATE
68
70
 
69
- > **Source:** `feature.handoff.filesToCreate[]` in feature.json
71
+ > **Source:** `index.json.handoff.filesToCreate[]`
70
72
 
71
73
  ### 3.1 Backend
72
74
 
@@ -83,18 +85,18 @@ FRONTEND:
83
85
 
84
86
  ### 3.2 SeedData Core (CRITICAL -- without these, module is invisible and returns 403)
85
87
 
86
- > **Source:** `feature.json.specification.seedDataCore` (generated in step-02)
88
+ > **Source:** `index.json.specification.seedDataCore` (generated in step-03)
87
89
  > **5 core files + NavigationSectionSeedData when sections are defined** for every new module.
88
90
  > Derive content EXACTLY from `specification.seedDataCore` sections (navigationModules, navigationSections, navigationTranslations, permissions, rolePermissions, permissionConstants).
89
91
 
90
- | # | File | Layer | Content |
91
- |---|------|-------|---------|
92
- | 1 | `NavigationModuleConfiguration.cs` | Infrastructure (HasData) | Module entry in `nav_Modules` |
93
- | 2 | `NavigationSectionSeedData.cs` | Infrastructure (HasData) | Section entries (list, dashboard, etc.) with full absolute routes. **MANDATORY when sections defined.** |
94
- | 3 | `NavigationTranslationConfiguration.cs` | Infrastructure (HasData) | 4 translations (fr, en, it, de) per nav entity |
95
- | 4 | `PermissionConfiguration.cs` | Infrastructure (HasData) | Wildcard + CRUD permissions in `nav_Permissions` |
96
- | 5 | `Permissions.cs` | Application (code) | Compile-time constants for `[RequirePermission]` |
97
- | 6 | `RolePermissionConfiguration.cs` | Infrastructure (HasData) | Role->Permission for {App} Admin, {App} Manager, {App} Contributor, {App} Viewer |
92
+ | # | File | Layer | Content | Source |
93
+ |---|------|-------|---------|--------|
94
+ | 1 | `NavigationModuleConfiguration.cs` | Infrastructure (HasData) | Module entry in `nav_Modules` | index.json.specification.seedDataCore.navigationModules |
95
+ | 2 | `NavigationSectionSeedData.cs` | Infrastructure (HasData) | Section entries (list, dashboard, etc.) with full absolute routes. **MANDATORY when sections defined.** | index.json.specification.seedDataCore.navigationSections |
96
+ | 3 | `NavigationTranslationConfiguration.cs` | Infrastructure (HasData) | 4 translations (fr, en, it, de) per nav entity | index.json.specification.seedDataCore.navigationTranslations |
97
+ | 4 | `PermissionConfiguration.cs` | Infrastructure (HasData) | Wildcard + CRUD permissions in `nav_Permissions` | index.json.specification.seedDataCore.permissions |
98
+ | 5 | `Permissions.cs` | Application (code) | Compile-time constants for `[RequirePermission]` | index.json.specification.seedDataCore.permissionConstants |
99
+ | 6 | `RolePermissionConfiguration.cs` | Infrastructure (HasData) | Role->Permission for {App} Admin, {App} Manager, {App} Contributor, {App} Viewer | index.json.specification.seedDataCore.rolePermissions |
98
100
 
99
101
  ### 3.3 Frontend
100
102
 
@@ -107,7 +109,7 @@ FRONTEND:
107
109
 
108
110
  ## 4. DETAILED SPECIFICATIONS
109
111
 
110
- > **Source:** Read from feature.json sections: `analysis.entities[]`, `specification.apiEndpoints[]`, `analysis.businessRules[]`, `specification.navigation`, `specification.permissionMatrix`
112
+ > **Source:** Read from index.json sections: `analysis.entities[]`, `specification.apiEndpoints[]`, `analysis.businessRules[]`, `specification.sections[]`, `specification.permissionMatrix`
111
113
 
112
114
  ### 4.1 Entity
113
115
 
@@ -132,10 +134,11 @@ From: `feature.handoff.brToCodeMapping[]`
132
134
 
133
135
  ### 4.4 SeedData Specifications
134
136
 
135
- From: `feature.specification.seedDataCore` (5 core files), `feature.specification.navigation` and `feature.specification.permissionMatrix`
137
+ From: `index.json.specification.seedDataCore` and `index.json.specification.permissionMatrix`
136
138
 
137
- > **IMPORTANT :** Les données des 5 fichiers SeedData Core doivent être dérivées de `specification.seedDataCore` :
139
+ > **IMPORTANT :** Les données des 6 fichiers SeedData Core doivent être dérivées de `index.json.specification.seedDataCore` :
138
140
  > - `navigationModules` → NavigationModuleConfiguration.cs
141
+ > - `navigationSections` → NavigationSectionSeedData.cs
139
142
  > - `navigationTranslations` → NavigationTranslationConfiguration.cs
140
143
  > - `permissions` → PermissionConfiguration.cs (module-level: `{app}.{module}.{action}`, section-level: `{app}.{module}.{section}.{action}`)
141
144
  > - `rolePermissions` → RolePermissionConfiguration.cs
@@ -1,6 +1,6 @@
1
1
  # Skill Launch Display Templates (templates/tpl-launch-displays.md)
2
2
 
3
- > **Used by:** step-05b-deploy (Completion Summary)
3
+ > **Used by:** step-05-deploy (Completion Summary)
4
4
  > **Purpose:** User-facing display templates for BA completion
5
5
  > **Note:** No emojis - uses text markers per Claude Code conventions
6
6
 
@@ -23,7 +23,7 @@ Complexity: {complexity}
23
23
  Effort: {total_days} days ({total_hours} hours)
24
24
 
25
25
  [DIR] Artefacts générés:
26
- feature.json (master + per-module) - spécification complète
26
+ index.json (master + per-module) - spécification complète
27
27
  ✓ .ralph/prd.json or .ralph/prd-{module}.json - task breakdown
28
28
  ✓ .ralph/progress.txt - tracker de progression
29
29
  ✓ ba-interactive.html - document de revue interactif
@@ -51,7 +51,7 @@ import {
51
51
  Database
52
52
  } from 'lucide-react';
53
53
 
54
- // Types for documentation data
54
+ // Types for documentation data (loaded from index.json)
55
55
  interface UseCase {
56
56
  id: string;
57
57
  name: string;
@@ -83,7 +83,7 @@ interface DocData {
83
83
  permissions: Permission[];
84
84
  }
85
85
 
86
- // Data loaded from feature.json (to be generated dynamically)
86
+ // Data loaded from index.json (to be generated dynamically)
87
87
  const docData: DocData = {
88
88
  featureId: 'FEAT-XXX',
89
89
  moduleName: '{ModuleName}',
@@ -0,0 +1,92 @@
1
+ ---
2
+ name: derive-prd
3
+ description: "Transform consolidated business analysis into handoff data (8 categories) and PRD files for /ralph-loop consumption."
4
+ model: sonnet
5
+ user_invocable: true
6
+ ---
7
+
8
+ # /derive-prd — v1
9
+
10
+ ## Purpose
11
+
12
+ Bridge between `/business-analyse` (understand) and `/ralph-loop` (execute).
13
+ Transforms consolidated BA data into structured handoff and PRD files.
14
+
15
+ ```
16
+ /business-analyse → /derive-prd → /ralph-loop
17
+ (comprendre) (planifier) (executer)
18
+ ```
19
+
20
+ ## Architecture
21
+
22
+ **3 steps** — "Validate, Transform, Export"
23
+
24
+ | Step | File | Model | Role |
25
+ |------|------|-------|------|
26
+ | 00 | `step-00-validate.md` | Sonnet | Detect input, validate BA readiness, AC gate |
27
+ | 01 | `step-01-transform.md` | Sonnet | Build handoff data per module (8 categories) |
28
+ | 02 | `step-02-export.md` | Sonnet | Generate PRD files, verify, output progress |
29
+
30
+ ## Input
31
+
32
+ - Consolidated BA feature (`status = "consolidated"`)
33
+ - Source: `docs/{app}/{module}/business-analyse/v{X.Y}/index.json`
34
+ - Usage: `--feature <path>` or auto-detection from `docs/`
35
+
36
+ ## Output
37
+
38
+ | Artifact | Path | Description |
39
+ |----------|------|-------------|
40
+ | Handoff data | Written to module `handoff.json` via ba-writer | 8-category file mapping + BR-to-code + API summary |
41
+ | PRD files | `.ralph/prd-{moduleCode}.json` | Deterministic extraction via `ss derive-prd` |
42
+ | Progress tracker | `.ralph/progress.txt` | Task breakdown per module |
43
+ | Module queue | `.ralph/modules-queue.json` | Topological order (if 2+ modules) |
44
+ | BA manifest | `docs/index.json` | Updated with "handed-off" status |
45
+
46
+ ## Handoff Categories (8)
47
+
48
+ | Category | Source | Key rules |
49
+ |----------|--------|-----------|
50
+ | **domain** | `analysis.entities[]` | Entities, ValueObjects, Enums |
51
+ | **application** | `analysis.useCases[]` | Services, DTOs, Validators |
52
+ | **infrastructure** | `analysis.entities[]` | EF Configurations, DbSet |
53
+ | **api** | `specification.apiEndpoints[]` | Controllers (exact copy) |
54
+ | **frontend** | `specification.uiWireframes[]` | Pages, Components, Hooks |
55
+ | **seedData** | `specification.seedDataCore` | CORE + business |
56
+ | **tests** | All layers | Unit, Integration, Security tests |
57
+ | **documentation** | All layers | Technical docs, user guides, API specs |
58
+
59
+ ## Agents
60
+
61
+ | Agent | Role | Operations |
62
+ |-------|------|------------|
63
+ | `ba-writer` | Write handoff data | enrichModuleHandoff() |
64
+ | `ba-reader` | Read feature data | findFeature, readSection, getModuleStatus |
65
+
66
+ ## References
67
+
68
+ | File | Content |
69
+ |------|---------|
70
+ | `references/prd-generation.md` | PRD v3.0 structure & validation rules |
71
+ | `references/handoff-mappings.md` | BR-to-code & API summary mapping |
72
+ | `references/handoff-seeddata-generation.md` | SeedData core generation reference |
73
+ | `references/handoff-file-templates.md` | Handoff file structure (8 categories) |
74
+ | `references/acceptance-criteria.md` | Module acceptance criteria (AC-01 to AC-17) |
75
+ | `references/entity-domain-mapping.md` | Entity BA to Domain file mapping |
76
+ | `references/readiness-scoring.md` | Readiness scoring algorithm |
77
+
78
+ ## Schema
79
+
80
+ | File | Content |
81
+ |------|---------|
82
+ | `schemas/handoff-schema.json` | Handoff data schema (8 categories) |
83
+
84
+ ## Templates
85
+
86
+ | File | Content |
87
+ |------|---------|
88
+ | `templates/tpl-progress.md` | Progress tracker template |
89
+
90
+ ## Entry Point
91
+
92
+ **FIRST ACTION:** Load `steps/step-00-validate.md`