@atlashub/smartstack-cli 4.41.0 → 4.43.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 (142) hide show
  1. package/.documentation/apex.html +2 -2
  2. package/.documentation/business-analyse.html +26 -27
  3. package/.documentation/commands.html +6 -6
  4. package/dist/index.js +24 -13
  5. package/dist/index.js.map +1 -1
  6. package/package.json +2 -2
  7. package/templates/agents/ba-reader.md +2 -2
  8. package/templates/agents/ba-writer.md +44 -9
  9. package/templates/hooks/stop-hook.sh +6 -6
  10. package/templates/ralph/README.md +1 -1
  11. package/templates/scripts/setup-ralph-loop.sh +2 -2
  12. package/templates/skills/_resources/context-digest-template.md +1 -1
  13. package/templates/skills/_shared.md +13 -13
  14. package/templates/skills/apex/SKILL.md +14 -7
  15. package/templates/skills/apex/_shared.md +1 -1
  16. package/templates/skills/apex/references/challenge-questions.md +46 -13
  17. package/templates/skills/apex/references/core-seed-data.md +4 -4
  18. package/templates/skills/apex/references/error-classification.md +3 -3
  19. package/templates/skills/apex/references/smartstack-api.md +1 -1
  20. package/templates/skills/apex/references/smartstack-layers.md +1 -1
  21. package/templates/skills/apex/steps/step-00-init.md +46 -8
  22. package/templates/skills/apex/steps/step-01-analyze.md +1 -1
  23. package/templates/skills/apex/steps/step-02-plan.md +1 -1
  24. package/templates/skills/apex/steps/step-03-execute.md +1 -1
  25. package/templates/skills/business-analyse/SKILL.md +83 -22
  26. package/templates/skills/business-analyse/_shared.md +12 -9
  27. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +24 -9
  28. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +33 -0
  29. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +1 -1
  30. package/templates/skills/business-analyse/react/components.md +1 -22
  31. package/templates/skills/business-analyse/react/schema.md +1 -1
  32. package/templates/skills/business-analyse/references/acceptance-criteria.md +3 -3
  33. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +1 -1
  34. package/templates/skills/business-analyse/references/detection-strategies.md +2 -2
  35. package/templates/skills/business-analyse/references/entity-architecture-decision.md +1 -1
  36. package/templates/skills/business-analyse/references/naming-conventions.md +6 -6
  37. package/templates/skills/business-analyse/references/robustness-checks.md +4 -4
  38. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  39. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  40. package/templates/skills/business-analyse/schemas/feature-schema.json +1 -1
  41. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +2 -2
  42. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +3 -2
  43. package/templates/skills/business-analyse/steps/step-00-init.md +15 -5
  44. package/templates/skills/business-analyse/steps/step-01-cadrage.md +15 -6
  45. package/templates/skills/business-analyse/steps/step-02-structure.md +17 -1
  46. package/templates/skills/business-analyse/steps/step-03-specify.md +136 -26
  47. package/templates/skills/business-analyse/steps/step-04-consolidate.md +44 -8
  48. package/templates/skills/business-analyse/templates/tpl-handoff.md +5 -5
  49. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +4 -4
  50. package/templates/skills/business-analyse/templates-frd.md +4 -4
  51. package/templates/skills/{ba-design-ui → business-analyse-design}/SKILL.md +9 -9
  52. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-01-screens.md +9 -0
  53. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-03-navigation.md +9 -2
  54. package/templates/skills/business-analyse-develop/SKILL.md +248 -0
  55. package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-completeness.md +1 -1
  56. package/templates/skills/{ralph-loop → business-analyse-develop}/references/init-resume-recovery.md +8 -8
  57. package/templates/skills/{ralph-loop → business-analyse-develop}/references/multi-module-queue.md +1 -1
  58. package/templates/skills/business-analyse-develop/references/quality-gates.md +70 -0
  59. package/templates/skills/{ralph-loop → business-analyse-develop}/references/task-transform-legacy.md +1 -1
  60. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-00-init.md +20 -4
  61. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-01-task.md +3 -2
  62. package/templates/skills/business-analyse-develop/steps/step-01-v4-execute.md +131 -0
  63. package/templates/skills/business-analyse-develop/steps/step-02-v4-verify.md +156 -0
  64. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-04-check.md +1 -1
  65. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-05-report.md +1 -1
  66. package/templates/skills/{derive-prd → business-analyse-handoff}/SKILL.md +7 -7
  67. package/templates/skills/{derive-prd → business-analyse-handoff}/references/acceptance-criteria.md +5 -5
  68. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-file-templates.md +1 -1
  69. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-mappings.md +1 -1
  70. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-seeddata-generation.md +2 -2
  71. package/templates/skills/{derive-prd → business-analyse-handoff}/references/prd-generation.md +14 -14
  72. package/templates/skills/{derive-prd → business-analyse-handoff}/schemas/handoff-schema.json +2 -2
  73. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-00-validate.md +7 -7
  74. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-01-transform.md +50 -11
  75. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-02-export.md +36 -16
  76. package/templates/skills/{ba-generate-html → business-analyse-html}/SKILL.md +4 -4
  77. package/templates/skills/{ba-generate-html → business-analyse-html}/html/ba-interactive.html +714 -286
  78. package/templates/skills/{ba-generate-html → business-analyse-html}/html/build-html.js +25 -3
  79. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/01-data-init.js +54 -0
  80. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/02-navigation.js +102 -12
  81. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/03-render-cadrage.js +8 -7
  82. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/04-render-modules.js +7 -7
  83. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/05-render-specs.js +188 -85
  84. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-consolidation.js +15 -14
  85. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-mockups.js +19 -19
  86. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/07-render-handoff.js +24 -4
  87. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/08-editing.js +6 -2
  88. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/09-export.js +27 -57
  89. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/10-comments.js +67 -45
  90. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/11-review-panel.js +15 -13
  91. package/templates/skills/business-analyse-html/html/src/styles/02-layout.css +216 -0
  92. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/05-modules.css +36 -0
  93. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/template.html +22 -12
  94. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-build.md +1 -1
  95. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-mapping.md +5 -1
  96. package/templates/skills/{ba-generate-html → business-analyse-html}/references/output-modes.md +7 -7
  97. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-01-collect.md +25 -1
  98. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-02-build-data.md +33 -5
  99. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-03-render.md +2 -2
  100. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-04-verify.md +2 -2
  101. package/templates/skills/{ba-review → business-analyse-review}/SKILL.md +11 -10
  102. package/templates/skills/{ba-review → business-analyse-review}/references/review-data-mapping.md +2 -2
  103. package/templates/skills/business-analyse-review/steps/step-00-init.md +107 -0
  104. package/templates/skills/{ba-review → business-analyse-review}/steps/step-01-apply.md +19 -11
  105. package/templates/skills/business-analyse-status/SKILL.md +118 -0
  106. package/templates/skills/documentation/SKILL.md +2 -2
  107. package/templates/skills/sketch/SKILL.md +172 -0
  108. package/templates/skills/sketch/references/domain-heuristics.md +116 -0
  109. package/templates/skills/ba-generate-html/html/src/styles/02-layout.css +0 -101
  110. package/templates/skills/ralph-loop/SKILL.md +0 -240
  111. /package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-02-wireframes.md +0 -0
  112. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-rules.md +0 -0
  113. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/compact-loop.md +0 -0
  114. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/module-transition.md +0 -0
  115. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/parallel-execution.md +0 -0
  116. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/section-splitting.md +0 -0
  117. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/team-orchestration.md +0 -0
  118. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-02-execute.md +0 -0
  119. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-03-commit.md +0 -0
  120. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/entity-domain-mapping.md +0 -0
  121. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/readiness-scoring.md +0 -0
  122. /package/templates/skills/{derive-prd → business-analyse-handoff}/templates/tpl-progress.md +0 -0
  123. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-context.html +0 -0
  124. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-scope.html +0 -0
  125. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-stakeholders.html +0 -0
  126. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-success.html +0 -0
  127. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-datamodel.html +0 -0
  128. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-flows.html +0 -0
  129. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-interactions.html +0 -0
  130. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-permissions.html +0 -0
  131. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-dependencies.html +0 -0
  132. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-modules.html +0 -0
  133. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/handoff-summary.html +0 -0
  134. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/module-spec-container.html +0 -0
  135. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/01-variables.css +0 -0
  136. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/03-navigation.css +0 -0
  137. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/04-cards.css +0 -0
  138. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/06-wireframes.css +0 -0
  139. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/07-comments.css +0 -0
  140. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/08-review-panel.css +0 -0
  141. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/09-mockups-html.css +0 -0
  142. /package/templates/skills/{ba-generate-html → business-analyse-html}/references/wireframe-svg-style-guide.md +0 -0
@@ -0,0 +1,156 @@
1
+ ---
2
+ name: step-02-v4-verify
3
+ description: Final verification gates, file reconciliation, BR coverage, and report generation
4
+ model: opus
5
+ ---
6
+
7
+ # Step 02-v4: Verify + Report
8
+
9
+ ## YOUR TASK
10
+
11
+ After ALL modules are implemented, run final verification across the ENTIRE project, then generate the completion report.
12
+
13
+ ---
14
+
15
+ ## FINAL VERIFICATION SEQUENCE
16
+
17
+ ### 1. Full Solution Build
18
+
19
+ ```bash
20
+ dotnet build 2>&1
21
+ ```
22
+
23
+ This catches cross-module compilation issues that per-module builds might miss.
24
+
25
+ ### 2. Full Test Suite
26
+
27
+ ```bash
28
+ dotnet test 2>&1
29
+ ```
30
+
31
+ Run ALL tests across ALL modules. This catches cross-module integration issues.
32
+
33
+ ### 3. Frontend Verification
34
+
35
+ ```bash
36
+ npm run typecheck 2>&1
37
+ npm test -- --run 2>&1
38
+ ```
39
+
40
+ ### 4. File Reconciliation
41
+
42
+ For each module's PRD, compare `expectedFiles` against actual files on disk:
43
+
44
+ ```javascript
45
+ for (const category of ['domain', 'application', 'infrastructure', 'api', 'frontend', 'seedData', 'tests', 'documentation']) {
46
+ const expected = prd.expectedFiles[category] || [];
47
+ for (const file of expected) {
48
+ if (!existsOnDisk(file.path)) {
49
+ MISSING.push({ category, path: file.path, type: file.type });
50
+ }
51
+ }
52
+ }
53
+ ```
54
+
55
+ **If missing files found:**
56
+ - List them clearly with category and expected path
57
+ - Delegate to `/apex`: "Create missing files: {list}"
58
+ - Re-verify after creation
59
+
60
+ ### 5. Business Rule Coverage
61
+
62
+ For each BR in ALL modules' `brToCodeMapping`:
63
+ 1. Verify target file exists
64
+ 2. Verify implementation is present (grep for method/class name)
65
+ 3. Verify test coverage (grep test files for BR reference)
66
+
67
+ Output:
68
+ ```
69
+ BR Coverage: {covered}/{total} ({pct}%)
70
+ Missing: BR-VAL-INV-003 (no test), BR-CALC-INV-005 (no implementation)
71
+ ```
72
+
73
+ **If coverage < 100%:** Delegate remediation to `/apex`.
74
+
75
+ ### 6. MCP Final Scan
76
+
77
+ ```javascript
78
+ // Security validation (BLOCKING)
79
+ mcp__smartstack__validate_security({ projectPath: "." })
80
+
81
+ // Convention validation (report)
82
+ mcp__smartstack__validate_conventions({ projectPath: "." })
83
+
84
+ // Code review — semantic permission check (BLOCKING if write endpoint has Read permission)
85
+ mcp__smartstack__review_code({ files: changedFiles, focus: "security" })
86
+
87
+ // Test convention validation (report)
88
+ mcp__smartstack__validate_test_conventions({ projectPath: "." })
89
+ ```
90
+
91
+ Log results. Security and permission mismatches are BLOCKING. Convention/test findings go in the report.
92
+
93
+ ---
94
+
95
+ ## REPORT GENERATION
96
+
97
+ Generate `.ralph/reports/{feature}.md`:
98
+
99
+ ```markdown
100
+ # Feature Report: {applicationName}
101
+
102
+ **Generated:** {date}
103
+ **Modules:** {moduleCount}
104
+ **Duration:** {startTime} → {endTime}
105
+
106
+ ## Summary
107
+
108
+ | Module | Entities | BRs | Sections | Build | Tests | Coverage |
109
+ |--------|----------|-----|----------|-------|-------|----------|
110
+ | {mod1} | {n} | {n} | {n} | PASS | PASS | {pct}% |
111
+ | {mod2} | {n} | {n} | {n} | PASS | PASS | {pct}% |
112
+
113
+ ## Objectives
114
+
115
+ | Objective | Status | Acceptance Criteria |
116
+ |-----------|--------|---------------------|
117
+ | {obj.description} | PASS/FAIL | {criteria results} |
118
+
119
+ ## File Reconciliation
120
+
121
+ | Category | Expected | Present | Missing |
122
+ |----------|----------|---------|---------|
123
+ | domain | {n} | {n} | {list} |
124
+ | ... | | | |
125
+
126
+ ## Business Rule Coverage
127
+
128
+ | BR ID | Name | Implementation | Test | Status |
129
+ |-------|------|----------------|------|--------|
130
+ | {id} | {name} | {file}:{method} | {testFile} | PASS/FAIL |
131
+
132
+ ## Quality Gates
133
+
134
+ | Gate | Result |
135
+ |------|--------|
136
+ | dotnet build | PASS |
137
+ | dotnet test | PASS ({n} tests) |
138
+ | npm typecheck | PASS |
139
+ | npm test | PASS ({n} tests) |
140
+ | MCP security | {findings} |
141
+ | MCP conventions | {findings} |
142
+
143
+ ## Git Commits
144
+
145
+ {list of commits with hashes and messages}
146
+ ```
147
+
148
+ ---
149
+
150
+ ## COMPLETION
151
+
152
+ After report is generated:
153
+ 1. Display report path: `.ralph/reports/{feature}.md`
154
+ 2. Display summary stats
155
+ 3. If completion_promise was set: output the promise text
156
+ 4. Ralph-Loop is DONE
@@ -382,7 +382,7 @@ If `hasPending && iteration < max`:
382
382
  ## CRITICAL RULES — EXECUTION GUARANTEE:
383
383
 
384
384
  - **NEVER** output completion promise unless ALL tasks done (all modules if multi)
385
- - **NEVER** stop between iterations — this is the CORE PROMISE of ralph-loop
385
+ - **NEVER** stop between iterations — this is the CORE PROMISE of business-analyse-develop
386
386
  - **NEVER** ask the user "should I continue?" or "is this OK?" — JUST CONTINUE
387
387
  - **NEVER** pause to show intermediate results and wait for feedback
388
388
  - **NEVER** generate code directly — ALWAYS delegate to /apex
@@ -365,7 +365,7 @@ if (prd._sectionSplit?.enabled && prd.status === 'completed') {
365
365
  }
366
366
  delete prd._sectionSplit;
367
367
  } else if (prd._sectionSplit?.enabled && prd.status !== 'completed') {
368
- console.log(`Section-split temp files preserved (status: ${prd.status}) — use /ralph-loop -r to resume`);
368
+ console.log(`Section-split temp files preserved (status: ${prd.status}) — use /business-analyse-develop -r to resume`);
369
369
  }
370
370
 
371
371
  prd.updated_at = new Date().toISOString();
@@ -1,20 +1,20 @@
1
1
  ---
2
- name: derive-prd
3
- description: "Transform consolidated business analysis into handoff data (8 categories) and PRD files for /ralph-loop consumption."
2
+ name: business-analyse-handoff
3
+ description: "Transform consolidated business analysis into handoff data (8 categories) and PRD files for /business-analyse-develop consumption."
4
4
  model: sonnet
5
5
  user_invocable: true
6
6
  ---
7
7
 
8
- # /derive-prd — v1
8
+ # /business-analyse-handoff — v1
9
9
 
10
10
  ## Purpose
11
11
 
12
- Bridge between `/business-analyse` (understand) and `/ralph-loop` (execute).
12
+ Bridge between `/business-analyse` (understand) and `/business-analyse-develop` (execute).
13
13
  Transforms consolidated BA data into structured handoff and PRD files.
14
14
 
15
15
  ```
16
- /business-analyse → /derive-prd → /ralph-loop
17
- (comprendre) (planifier) (executer)
16
+ /business-analyse → /business-analyse-handoff → /business-analyse-develop
17
+ (comprendre) (planifier) (executer)
18
18
  ```
19
19
 
20
20
  ## Architecture
@@ -38,7 +38,7 @@ Transforms consolidated BA data into structured handoff and PRD files.
38
38
  | Artifact | Path | Description |
39
39
  |----------|------|-------------|
40
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` |
41
+ | PRD files | `.ralph/prd-{moduleCode}.json` | Deterministic extraction via `ss business-analyse-handoff` |
42
42
  | Progress tracker | `.ralph/progress.txt` | Task breakdown per module |
43
43
  | Module queue | `.ralph/modules-queue.json` | Topological order (if 2+ modules) |
44
44
  | BA manifest | `docs/index.json` | Updated with "handed-off" status |
@@ -43,7 +43,7 @@ These verify data that `/business-analyse` produces:
43
43
 
44
44
  ### Output ACs (checked in step-01 post-transform)
45
45
 
46
- These verify data that `/derive-prd` step-01 generates:
46
+ These verify data that `/business-analyse-handoff` step-01 generates:
47
47
 
48
48
  | # | Criterion | Minimum | Location | Blocking |
49
49
  |---|-----------|---------|----------|----------|
@@ -213,7 +213,7 @@ console.log('PASS: All output acceptance criteria met (AC-08 to AC-11)');
213
213
  | AC-05 | Re-run `/business-analyse` screen specification |
214
214
  | AC-06 | Re-run `/business-analyse` permission specification |
215
215
  | AC-07 | Run `/business-analyse` step-04 consolidation |
216
- | AC-08 | Re-run `/derive-prd` step-01 transform (missing categories) |
217
- | AC-09 | Re-run `/derive-prd` step-01 transform (BR mapping) |
218
- | AC-10 | Re-run `/derive-prd` step-01 transform (API endpoints) |
219
- | AC-11 | Re-run `/derive-prd` step-01 transform (seedData categories) |
216
+ | AC-08 | Re-run `/business-analyse-handoff` step-01 transform (missing categories) |
217
+ | AC-09 | Re-run `/business-analyse-handoff` step-01 transform (BR mapping) |
218
+ | AC-10 | Re-run `/business-analyse-handoff` step-01 transform (API endpoints) |
219
+ | AC-11 | Re-run `/business-analyse-handoff` step-01 transform (seedData categories) |
@@ -152,4 +152,4 @@ From `screens.json > screens[]` and `usecases.json > useCases[]`:
152
152
  ```
153
153
 
154
154
  Include: Technical documentation data, API specification files, user guides.
155
- This category can be an empty array `[]` if no documentation is planned at this stage. It will be populated by the `/documentation` skill after `/ralph-loop` completes.
155
+ This category can be an empty array `[]` if no documentation is planned at this stage. It will be populated by the `/documentation` skill after `/business-analyse-develop` completes.
@@ -44,7 +44,7 @@ When an entity has `personRoleConfig` in its entity data, it MUST be carried int
44
44
  | `personRoleConfig.userLinkMode` | Determines scaffold options: `isPersonRole: true, userLinkMode: "{mode}"` |
45
45
  | `personRoleConfig.inheritedFields` | Fields to exclude from entity (mandatory) or mark as fallback (optional) |
46
46
 
47
- The `personRoleConfig` object is passed through verbatim to ensure `/apex` and `/ralph-loop` receive the person extension configuration.
47
+ The `personRoleConfig` object is passed through verbatim to ensure `/apex` and `/business-analyse-develop` receive the person extension configuration.
48
48
 
49
49
  ---
50
50
 
@@ -289,7 +289,7 @@ function inferIconFromModule(module) {
289
289
  IF !seedDataCore.navigationApplications || seedDataCore.navigationApplications.length === 0:
290
290
  BLOCKING ERROR: "navigationApplications is empty — Application navigation will NOT be seeded. Menu will show (nothing) → Modules."
291
291
  IF seedDataCore.navigationApplications[0].icon === null || seedDataCore.navigationApplications[0].icon === undefined:
292
- BLOCKING ERROR: "Application icon is null — ralph-loop will render empty navigation"
292
+ BLOCKING ERROR: "Application icon is null — business-analyse-develop will render empty navigation"
293
293
  IF !seedDataCore.navigationApplications[0].labels?.fr || !seedDataCore.navigationApplications[0].labels?.en:
294
294
  BLOCKING ERROR: "Application labels missing fr/en — translations will fail"
295
295
  IF seedDataCore.navigationModules.length !== master.modules.length:
@@ -297,7 +297,7 @@ IF seedDataCore.navigationModules.length !== master.modules.length:
297
297
  IF seedDataCore.permissions.length === 0:
298
298
  WARNING: seedDataCore has 0 permissions — applicationRoles may be missing
299
299
  IF seedDataCore.navigationModules.some(m => !m.icon || m.icon === null):
300
- BLOCKING ERROR: "Navigation modules with null icons detected — ralph-loop will render empty navigation"
300
+ BLOCKING ERROR: "Navigation modules with null icons detected — business-analyse-develop will render empty navigation"
301
301
  → Fix: Re-run inferIconFromModule() for modules with null icons
302
302
  IF seedDataCore.navigationSections.length === 0:
303
303
  WARNING: "0 navigation sections — every module should have at least 1 section (e.g., 'list')"
@@ -31,7 +31,7 @@ Example: `.ralph/prd-Projects.json`, `.ralph/prd-TimeTracking.json`
31
31
  **Common Error:**
32
32
  ```
33
33
  BLOCKING_ERROR: PRD version must be 3.0.0, got: 2.1.0
34
- Fix: Re-run ss derive-prd with latest version
34
+ Fix: Re-run ss business-analyse-handoff with latest version
35
35
  ```
36
36
 
37
37
  ---
@@ -75,7 +75,7 @@ Fix: Re-run ss derive-prd with latest version
75
75
 
76
76
  **Fix Command:**
77
77
  ```bash
78
- ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json
78
+ ss business-analyse-handoff --feature {path} --output .ralph/prd-{moduleCode}.json
79
79
  ```
80
80
 
81
81
  ---
@@ -95,7 +95,7 @@ All PRD files MUST include these 8 categories under `implementation.filesToCreat
95
95
  | **tests** | Unit tests, integration tests | `ProjectServiceTests.cs`, `ProjectsControllerTests.cs` |
96
96
  | **documentation** | Technical docs, user guides, API specs | `doc-data.ts`, `UserGuide.md`, `api-spec.yaml` |
97
97
 
98
- > **Note `documentation`:** Cette catégorie peut contenir des fichiers générés par le skill `/documentation` après `/ralph-loop`. Elle est obligatoire dans la structure PRD (peut être un tableau vide `[]` si aucune doc n'est prévue, mais DOIT être présente).
98
+ > **Note `documentation`:** Cette catégorie peut contenir des fichiers générés par le skill `/documentation` après `/business-analyse-develop`. Elle est obligatoire dans la structure PRD (peut être un tableau vide `[]` si aucune doc n'est prévue, mais DOIT être présente).
99
99
 
100
100
  **Validation:**
101
101
  ```javascript
@@ -136,7 +136,7 @@ for (const cat of categories) {
136
136
  **Why this matters:**
137
137
  - Ensures PRD was derived from the correct index.json
138
138
  - Catches stale PRD files (derived from old version)
139
- - Validates handoff integrity before ralph-loop
139
+ - Validates handoff integrity before business-analyse-develop
140
140
 
141
141
  **Fix:**
142
142
  - Re-derive PRD from latest index.json
@@ -179,7 +179,7 @@ Use this checklist when validating PRD files:
179
179
  | **File Counts** | PRD counts match index.json handoff.filesToCreate | PASS/FAIL |
180
180
  | **File Schemas** | All files have path, type, module | PASS/FAIL |
181
181
 
182
- **All checks must PASS before proceeding to /ralph-loop**
182
+ **All checks must PASS before proceeding to /business-analyse-develop**
183
183
 
184
184
  ---
185
185
 
@@ -189,13 +189,13 @@ Use this checklist when validating PRD files:
189
189
  ```
190
190
  BLOCKING_ERROR: PRD version must be 3.0.0, got: 2.1.0
191
191
  ```
192
- **Fix:** Re-run `ss derive-prd` with latest SmartStack.mcp version
192
+ **Fix:** Re-run `ss business-analyse-handoff` with latest SmartStack.mcp version
193
193
 
194
194
  ### Error 2: filesToCreate at Root Level
195
195
  ```
196
196
  BLOCKING_ERROR: filesToCreate is at ROOT level (wrong structure)
197
197
  ```
198
- **Fix:** Re-run `ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json`
198
+ **Fix:** Re-run `ss business-analyse-handoff --feature {path} --output .ralph/prd-{moduleCode}.json`
199
199
 
200
200
  ### Error 3: Missing Categories
201
201
  ```
@@ -212,7 +212,7 @@ BLOCKING_ERROR: api: prd has 8 files but index.json has 12
212
212
  ```
213
213
  **Fix:**
214
214
  - PRD is stale (derived from old index.json)
215
- - Re-derive PRD from latest index.json: `ss derive-prd --feature {path} --output .ralph/prd-{moduleCode}.json`
215
+ - Re-derive PRD from latest index.json: `ss business-analyse-handoff --feature {path} --output .ralph/prd-{moduleCode}.json`
216
216
 
217
217
  ---
218
218
 
@@ -220,14 +220,14 @@ BLOCKING_ERROR: api: prd has 8 files but index.json has 12
220
220
 
221
221
  **Derive PRD from index.json:**
222
222
  ```bash
223
- ss derive-prd \
223
+ ss business-analyse-handoff \
224
224
  --feature docs/{App}/business-analyse/v1.0/index.json \
225
225
  --output .ralph/prd-{ModuleCode}.json
226
226
  ```
227
227
 
228
228
  **Example:**
229
229
  ```bash
230
- ss derive-prd \
230
+ ss business-analyse-handoff \
231
231
  --feature docs/HumanResources/business-analyse/v1.0/index.json \
232
232
  --output .ralph/prd-Projects.json
233
233
  ```
@@ -236,7 +236,7 @@ ss derive-prd \
236
236
  ```bash
237
237
  # Typically done in step-05-deploy.md
238
238
  for module in $(modules); do
239
- ss derive-prd --feature {module_feature_path} --output .ralph/prd-${module}.json
239
+ ss business-analyse-handoff --feature {module_feature_path} --output .ralph/prd-${module}.json
240
240
  done
241
241
  ```
242
242
 
@@ -246,7 +246,7 @@ done
246
246
 
247
247
  | Risk | Without Validation | With Validation |
248
248
  |------|-------------------|-----------------|
249
- | **Wrong structure** | ralph-loop fails mid-execution | Caught before development starts |
249
+ | **Wrong structure** | business-analyse-develop fails mid-execution | Caught before development starts |
250
250
  | **Stale PRD** | Generates code from old spec | Detects version mismatch |
251
251
  | **Missing files** | Incomplete implementation | Ensures all layers covered |
252
252
  | **Count mismatch** | Silent data loss | Guarantees integrity |
@@ -257,6 +257,6 @@ done
257
257
 
258
258
  ## Related Files
259
259
 
260
- - `step-05-deploy.md`: Generates PRD files via `ss derive-prd`
260
+ - `step-05-deploy.md`: Generates PRD files via `ss business-analyse-handoff`
261
261
  - `feature-schema.json`: Schema for index.json (source of PRD)
262
- - `/ralph-loop` skill: Consumes PRD files for implementation
262
+ - `/business-analyse-develop` skill: Consumes PRD files for implementation
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "handoff-schema.json",
4
4
  "title": "SmartStack BA - Handoff",
5
- "description": "Module-level handoff: file mapping (8 categories), BR-to-code mapping, API endpoint summary. Used by /derive-prd skill.",
5
+ "description": "Module-level handoff: file mapping (8 categories), BR-to-code mapping, API endpoint summary. Used by /business-analyse-handoff skill.",
6
6
  "type": "object",
7
7
  "properties": {
8
8
  "complexity": { "type": "string", "enum": ["simple", "medium", "complex"] },
@@ -61,7 +61,7 @@
61
61
  },
62
62
  "ralphPrd": {
63
63
  "type": "object",
64
- "description": "Embedded Ralph Loop task breakdown (also exported to .ralph/prd.json by ss derive-prd)",
64
+ "description": "Embedded Ralph Loop task breakdown (also exported to .ralph/prd.json by ss business-analyse-handoff)",
65
65
  "properties": {
66
66
  "tasks": {
67
67
  "type": "array",
@@ -11,7 +11,7 @@ next_step: steps/step-01-transform.md
11
11
 
12
12
  ## MANDATORY EXECUTION RULES
13
13
 
14
- - **ALWAYS** verify status = "consolidated" or "specified" for all modules before proceeding
14
+ - **ALWAYS** verify status = "consolidated", "specified", "designed", or "reviewed" for all modules before proceeding
15
15
  - **ALWAYS** validate **input** acceptance criteria (AC-01 to AC-07) per module
16
16
  - **ALWAYS** load flat files (entities.json, usecases.json, etc.) from module directories
17
17
  - **BLOCKING** if any module has readiness score < 100% on input ACs
@@ -33,14 +33,14 @@ IF --feature <path> provided:
33
33
  featurePath = <path>
34
34
  ELSE:
35
35
  // Auto-detect from docs/
36
- Scan docs/ for index.json files with status = "consolidated"
36
+ Scan docs/ for index.json files with status in ["consolidated", "specified", "designed", "reviewed"]
37
37
  IF found exactly 1:
38
38
  featurePath = found path
39
39
  ELSE IF found > 1:
40
40
  Display list and ask user to specify --feature <path>
41
41
  STOP
42
42
  ELSE:
43
- BLOCKING ERROR: "No consolidated BA feature found. Run /business-analyse first."
43
+ BLOCKING ERROR: "No ready BA feature found (expected status: consolidated, specified, designed, or reviewed). Run /business-analyse first."
44
44
  STOP
45
45
  ```
46
46
 
@@ -65,8 +65,8 @@ FOR each module in appIndex.modules:
65
65
  ```
66
66
  FOR each module:
67
67
  moduleIndex = READ(module.baDir/index.json)
68
- IF moduleIndex.metadata.status NOT IN ["consolidated", "specified"]:
69
- BLOCKING ERROR: "Module {module.code} status: {status}, expected consolidated or specified"
68
+ IF moduleIndex.metadata.status NOT IN ["consolidated", "specified", "designed", "reviewed"]:
69
+ BLOCKING ERROR: "Module {module.code} status: {status}, expected consolidated, specified, designed, or reviewed"
70
70
  -> Run /business-analyse to complete specification first
71
71
  ```
72
72
 
@@ -106,7 +106,7 @@ Collect results per module: PASS count, FAIL count.
106
106
 
107
107
  ### 6. Calculate Readiness Score
108
108
 
109
- > **Reference:** Read `references/readiness-scoring.md` for the full algorithm.
109
+ > **Reference:** See loaded context `readiness-scoring.md` for the full algorithm.
110
110
 
111
111
  For each module:
112
112
  - Count input ACs passed vs total (7 input ACs)
@@ -119,7 +119,7 @@ FOR each module:
119
119
  IF readiness_score < 100%:
120
120
  BLOCKING ERROR: "Module {moduleCode} readiness: {score}% -- {failed_count} input ACs failed"
121
121
  Display failed ACs with recovery actions
122
- -> Run /business-analyse to fix, then retry /derive-prd
122
+ -> Run /business-analyse to fix, then retry /business-analyse-handoff
123
123
  STOP
124
124
  ```
125
125
 
@@ -35,11 +35,22 @@ For each module, load data from separate files:
35
35
  // Module BA directory: docs/{AppCode}/{ModuleCode}/business-analyse/v{X.Y}/
36
36
  const moduleDir = module.baDir; // resolved in step-00
37
37
 
38
- const entities = READ(moduleDir + '/entities.json').entities || [];
39
- const useCases = READ(moduleDir + '/usecases.json').useCases || [];
40
- const rules = READ(moduleDir + '/rules.json').rules || [];
41
- const permissions = READ(moduleDir + '/permissions.json');
42
- const screens = READ(moduleDir + '/screens.json').screens || [];
38
+ // Read with explicit error detection (do NOT silently swallow parse failures)
39
+ const entitiesFile = READ(moduleDir + '/entities.json');
40
+ const usecasesFile = READ(moduleDir + '/usecases.json');
41
+ const rulesFile = READ(moduleDir + '/rules.json');
42
+ const permissions = READ(moduleDir + '/permissions.json');
43
+ const screensFile = READ(moduleDir + '/screens.json');
44
+
45
+ // Log missing files explicitly before falling back
46
+ if (!entitiesFile) console.warn("⚠ " + moduleDir + "/entities.json not found — using empty");
47
+ if (!usecasesFile) console.warn("⚠ " + moduleDir + "/usecases.json not found — using empty");
48
+ if (!rulesFile) console.warn("⚠ " + moduleDir + "/rules.json not found — using empty");
49
+
50
+ const entities = (entitiesFile?.entities) || [];
51
+ const useCases = (usecasesFile?.useCases) || [];
52
+ const rules = (rulesFile?.rules) || [];
53
+ const screens = (screensFile?.screens) || [];
43
54
  ```
44
55
 
45
56
  **Source mapping (flat files -> handoff categories):**
@@ -96,9 +107,27 @@ Since `/business-analyse` does not produce `apiEndpoints`, generate them from us
96
107
  // Map CRUD operations to HTTP methods
97
108
  ```
98
109
 
110
+ ### 2b. Enrich Sections with UC/BR Links
111
+
112
+ Using `sectionCode` from usecases.json and rules.json, link each UC and BR to its section:
113
+
114
+ ```javascript
115
+ // Build section-level UC/BR mapping
116
+ const sectionMap = {};
117
+ for (const section of screens) {
118
+ sectionMap[section.sectionCode || section.code] = {
119
+ useCases: useCases.filter(uc => uc.sectionCode === (section.sectionCode || section.code)).map(uc => uc.id),
120
+ businessRules: rules.filter(br => br.sectionCode === (section.sectionCode || section.code)).map(br => br.id)
121
+ };
122
+ }
123
+ // Attach to sections for PRD consumption
124
+ ```
125
+
126
+ > This mapping enables business-analyse-develop's section-splitting to know which UCs/BRs belong to which section.
127
+
99
128
  ### 3. Map Specification to Files (8 Categories)
100
129
 
101
- > **Reference:** Read `references/handoff-file-templates.md` for complete JSON templates.
130
+ > **Reference:** See loaded context `handoff-file-templates.md` for complete JSON templates.
102
131
  > All backend paths MUST include `{ApplicationName}/` hierarchy.
103
132
 
104
133
  | Category | Source | Key rules |
@@ -128,7 +157,7 @@ Since `/business-analyse` does not produce `apiEndpoints`, generate them from us
128
157
 
129
158
  ### 4. Map Business Rules to Code
130
159
 
131
- > **Reference:** Read `references/handoff-mappings.md` -- Section "Business Rules to Code Mapping"
160
+ > **Reference:** See loaded context `handoff-mappings.md` -- Section "Business Rules to Code Mapping"
132
161
 
133
162
  For each rule in `rules.json > rules[]` of EACH module:
134
163
  - ruleId, title, module, severity (from `rule.severity`)
@@ -158,11 +187,11 @@ Each seedData entry MUST include a `category` field:
158
187
  - `category: "core"` -- Navigation, Permissions, Roles (mandatory infrastructure)
159
188
  - `category: "business"` -- Domain-specific reference/lookup data
160
189
 
161
- > **Reference:** Read `references/handoff-seeddata-generation.md` for complete core seed generation.
190
+ > **Reference:** See loaded context `handoff-seeddata-generation.md` for complete core seed generation.
162
191
 
163
192
  ### 7. Map Entity to Domain File (GAP #4 Fix)
164
193
 
165
- > **Reference:** Read `references/entity-domain-mapping.md` for complete mapping rules.
194
+ > **Reference:** See loaded context `entity-domain-mapping.md` for complete mapping rules.
166
195
 
167
196
  1:1 mapping from BA entity to Domain file:
168
197
 
@@ -242,8 +271,18 @@ if (!handoff.brToCodeMapping || handoff.brToCodeMapping.length === 0) {
242
271
  BLOCKING_ERROR("Module {moduleCode}: brToCodeMapping is empty");
243
272
  }
244
273
 
245
- // 4. Display pass
246
- console.log("POST-CHECK PASS: {moduleCode} -- 8 categories, {brCount} BRs mapped");
274
+ // 4. Validate section resources have entity field (enables section-splitting)
275
+ const sections = screens || [];
276
+ for (const section of sections) {
277
+ for (const resource of (section.resources || [])) {
278
+ if (!resource.entity) {
279
+ BLOCKING_ERROR("Module {moduleCode}, section {section.code}: resource {resource.code} missing 'entity' field");
280
+ }
281
+ }
282
+ }
283
+
284
+ // 5. Display pass
285
+ console.log("POST-CHECK PASS: {moduleCode} -- 8 categories, {brCount} BRs mapped, {sections.length} sections validated");
247
286
  ```
248
287
 
249
288
  ---