@atlashub/smartstack-cli 4.40.0 → 4.42.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 (149) 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 +15 -7
  15. package/templates/skills/apex/_shared.md +1 -1
  16. package/templates/skills/apex/references/analysis-methods.md +24 -0
  17. package/templates/skills/apex/references/challenge-questions.md +46 -13
  18. package/templates/skills/apex/references/core-seed-data.md +4 -4
  19. package/templates/skills/apex/references/error-classification.md +3 -3
  20. package/templates/skills/apex/references/smartstack-api.md +1 -1
  21. package/templates/skills/apex/references/smartstack-layers.md +1 -1
  22. package/templates/skills/apex/steps/step-00-init.md +48 -8
  23. package/templates/skills/apex/steps/step-01-analyze.md +42 -2
  24. package/templates/skills/apex/steps/step-02-plan.md +3 -1
  25. package/templates/skills/apex/steps/step-03-execute.md +3 -1
  26. package/templates/skills/apex/steps/step-03a-layer0-domain.md +2 -0
  27. package/templates/skills/apex/steps/step-03b-layer1-seed.md +111 -3
  28. package/templates/skills/apex/steps/step-03c-layer2-backend.md +2 -0
  29. package/templates/skills/apex/steps/step-03d-layer3-frontend.md +2 -0
  30. package/templates/skills/apex/steps/step-03e-layer4-devdata.md +2 -0
  31. package/templates/skills/apex/steps/step-04-examine.md +18 -0
  32. package/templates/skills/business-analyse/SKILL.md +83 -22
  33. package/templates/skills/business-analyse/_shared.md +12 -9
  34. package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +13 -0
  35. package/templates/skills/business-analyse/questionnaire/03-data-ui.md +33 -0
  36. package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +1 -1
  37. package/templates/skills/business-analyse/react/components.md +1 -1
  38. package/templates/skills/business-analyse/react/schema.md +1 -1
  39. package/templates/skills/business-analyse/references/acceptance-criteria.md +3 -3
  40. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +1 -1
  41. package/templates/skills/business-analyse/references/detection-strategies.md +2 -2
  42. package/templates/skills/business-analyse/references/entity-architecture-decision.md +1 -1
  43. package/templates/skills/business-analyse/references/naming-conventions.md +6 -6
  44. package/templates/skills/business-analyse/references/robustness-checks.md +4 -4
  45. package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
  46. package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
  47. package/templates/skills/business-analyse/schemas/feature-schema.json +1 -1
  48. package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +2 -2
  49. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +3 -2
  50. package/templates/skills/business-analyse/steps/step-00-init.md +15 -5
  51. package/templates/skills/business-analyse/steps/step-01-cadrage.md +14 -5
  52. package/templates/skills/business-analyse/steps/step-02-structure.md +17 -1
  53. package/templates/skills/business-analyse/steps/step-03-specify.md +136 -26
  54. package/templates/skills/business-analyse/steps/step-04-consolidate.md +44 -8
  55. package/templates/skills/business-analyse/templates/tpl-handoff.md +5 -5
  56. package/templates/skills/business-analyse/templates/tpl-launch-displays.md +4 -4
  57. package/templates/skills/business-analyse/templates-frd.md +4 -4
  58. package/templates/skills/{ba-design-ui → business-analyse-design}/SKILL.md +9 -9
  59. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-01-screens.md +9 -0
  60. package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-03-navigation.md +9 -2
  61. package/templates/skills/business-analyse-develop/SKILL.md +248 -0
  62. package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-completeness.md +1 -1
  63. package/templates/skills/{ralph-loop → business-analyse-develop}/references/init-resume-recovery.md +8 -8
  64. package/templates/skills/{ralph-loop → business-analyse-develop}/references/multi-module-queue.md +1 -1
  65. package/templates/skills/business-analyse-develop/references/quality-gates.md +70 -0
  66. package/templates/skills/{ralph-loop → business-analyse-develop}/references/task-transform-legacy.md +1 -1
  67. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-00-init.md +20 -4
  68. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-01-task.md +3 -2
  69. package/templates/skills/business-analyse-develop/steps/step-01-v4-execute.md +131 -0
  70. package/templates/skills/business-analyse-develop/steps/step-02-v4-verify.md +156 -0
  71. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-04-check.md +1 -1
  72. package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-05-report.md +1 -1
  73. package/templates/skills/{derive-prd → business-analyse-handoff}/SKILL.md +7 -7
  74. package/templates/skills/{derive-prd → business-analyse-handoff}/references/acceptance-criteria.md +5 -5
  75. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-file-templates.md +1 -1
  76. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-mappings.md +1 -1
  77. package/templates/skills/{derive-prd → business-analyse-handoff}/references/handoff-seeddata-generation.md +2 -2
  78. package/templates/skills/{derive-prd → business-analyse-handoff}/references/prd-generation.md +14 -14
  79. package/templates/skills/{derive-prd → business-analyse-handoff}/schemas/handoff-schema.json +2 -2
  80. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-00-validate.md +6 -6
  81. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-01-transform.md +46 -7
  82. package/templates/skills/{derive-prd → business-analyse-handoff}/steps/step-02-export.md +34 -14
  83. package/templates/skills/{ba-generate-html → business-analyse-html}/SKILL.md +4 -4
  84. package/templates/skills/{ba-generate-html → business-analyse-html}/html/ba-interactive.html +709 -277
  85. package/templates/skills/{ba-generate-html → business-analyse-html}/html/build-html.js +25 -3
  86. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/01-data-init.js +54 -0
  87. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/02-navigation.js +97 -3
  88. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/03-render-cadrage.js +8 -7
  89. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/04-render-modules.js +7 -7
  90. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/05-render-specs.js +188 -85
  91. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-consolidation.js +15 -14
  92. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/06-render-mockups.js +19 -19
  93. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/07-render-handoff.js +24 -4
  94. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/08-editing.js +6 -2
  95. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/09-export.js +27 -57
  96. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/10-comments.js +67 -45
  97. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/scripts/11-review-panel.js +15 -13
  98. package/templates/skills/business-analyse-html/html/src/styles/02-layout.css +216 -0
  99. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/05-modules.css +36 -0
  100. package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/template.html +22 -12
  101. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-build.md +1 -1
  102. package/templates/skills/{ba-generate-html → business-analyse-html}/references/data-mapping.md +5 -1
  103. package/templates/skills/{ba-generate-html → business-analyse-html}/references/output-modes.md +7 -7
  104. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-01-collect.md +25 -1
  105. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-02-build-data.md +33 -5
  106. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-03-render.md +2 -2
  107. package/templates/skills/{ba-generate-html → business-analyse-html}/steps/step-04-verify.md +2 -2
  108. package/templates/skills/{ba-review → business-analyse-review}/SKILL.md +11 -10
  109. package/templates/skills/{ba-review → business-analyse-review}/references/review-data-mapping.md +2 -2
  110. package/templates/skills/business-analyse-review/steps/step-00-init.md +107 -0
  111. package/templates/skills/{ba-review → business-analyse-review}/steps/step-01-apply.md +19 -11
  112. package/templates/skills/business-analyse-status/SKILL.md +118 -0
  113. package/templates/skills/documentation/SKILL.md +2 -2
  114. package/templates/skills/sketch/SKILL.md +172 -0
  115. package/templates/skills/sketch/references/domain-heuristics.md +116 -0
  116. package/templates/skills/ba-generate-html/html/src/styles/02-layout.css +0 -101
  117. package/templates/skills/ralph-loop/SKILL.md +0 -240
  118. /package/templates/skills/{ba-design-ui → business-analyse-design}/steps/step-02-wireframes.md +0 -0
  119. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/category-rules.md +0 -0
  120. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/compact-loop.md +0 -0
  121. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/module-transition.md +0 -0
  122. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/parallel-execution.md +0 -0
  123. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/section-splitting.md +0 -0
  124. /package/templates/skills/{ralph-loop → business-analyse-develop}/references/team-orchestration.md +0 -0
  125. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-02-execute.md +0 -0
  126. /package/templates/skills/{ralph-loop → business-analyse-develop}/steps/step-03-commit.md +0 -0
  127. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/entity-domain-mapping.md +0 -0
  128. /package/templates/skills/{derive-prd → business-analyse-handoff}/references/readiness-scoring.md +0 -0
  129. /package/templates/skills/{derive-prd → business-analyse-handoff}/templates/tpl-progress.md +0 -0
  130. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-context.html +0 -0
  131. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-scope.html +0 -0
  132. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-stakeholders.html +0 -0
  133. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/cadrage-success.html +0 -0
  134. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-datamodel.html +0 -0
  135. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-flows.html +0 -0
  136. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-interactions.html +0 -0
  137. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/consol-permissions.html +0 -0
  138. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-dependencies.html +0 -0
  139. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/decomp-modules.html +0 -0
  140. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/handoff-summary.html +0 -0
  141. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/partials/module-spec-container.html +0 -0
  142. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/01-variables.css +0 -0
  143. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/03-navigation.css +0 -0
  144. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/04-cards.css +0 -0
  145. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/06-wireframes.css +0 -0
  146. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/07-comments.css +0 -0
  147. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/08-review-panel.css +0 -0
  148. /package/templates/skills/{ba-generate-html → business-analyse-html}/html/src/styles/09-mockups-html.css +0 -0
  149. /package/templates/skills/{ba-generate-html → business-analyse-html}/references/wireframe-svg-style-guide.md +0 -0
@@ -1,17 +1,17 @@
1
1
  ---
2
- name: ba-review
2
+ name: business-analyse-review
3
3
  description: "Apply client corrections from ba-review.json and regenerate the interactive HTML document"
4
4
  model: opus
5
5
  user_invocable: true
6
6
  ---
7
7
 
8
- # /ba-review
8
+ # /business-analyse-review
9
9
 
10
10
  Apply corrections exported from the interactive HTML review (`ba-review.json`) to create a new version of the business analysis, then regenerate the HTML document.
11
11
 
12
12
  ## Triggers
13
13
 
14
- - Explicit invocation: `/ba-review`
14
+ - Explicit invocation: `/business-analyse-review`
15
15
  - When `ba-review.json` is detected in the project root
16
16
 
17
17
  ## Parameters
@@ -30,12 +30,13 @@ Apply corrections exported from the interactive HTML review (`ba-review.json`) t
30
30
 
31
31
  | Step | File | Role |
32
32
  |------|------|------|
33
- | 01 | `steps/step-01-apply.md` | Read ba-review.json, create new version, apply corrections to JSON files |
33
+ | 00 | `steps/step-00-init.md` | Locate ba-review.json, detect feature, initialize variables |
34
+ | 01 | `steps/step-01-apply.md` | Create new version, apply corrections to JSON files |
34
35
 
35
36
  After step-01 completes:
36
37
  1. Determine correction scope (analysis data vs UI design vs both)
37
38
  2. Route to the appropriate phase for re-execution
38
- 3. Regenerate HTML via `/ba-generate-html`
39
+ 3. Regenerate HTML via `/business-analyse-html`
39
40
 
40
41
  ## Correction Routing
41
42
 
@@ -44,10 +45,10 @@ After applying corrections, ask the client which phase to re-execute:
44
45
  | Correction type | Route to | Reason |
45
46
  |-----------------|----------|--------|
46
47
  | Entities, rules, UCs, permissions changed | `/business-analyse` step-03 (specify) | Re-run analysis for affected modules |
47
- | Screens, wireframes, navigation changed | `/ba-design-ui` | Re-run UI design for affected modules |
48
- | Both analysis and UI changed | `/business-analyse` step-03, then `/ba-design-ui` | Full re-specification |
49
- | Only cadrage/scope corrections | `/ba-generate-html` | Just regenerate HTML |
50
- | Client approves (no corrections) | `/derive-prd` | Proceed to PRD generation |
48
+ | Screens, wireframes, navigation changed | `/business-analyse-design` | Re-run UI design for affected modules |
49
+ | Both analysis and UI changed | `/business-analyse` step-03, then `/business-analyse-design` | Full re-specification |
50
+ | Only cadrage/scope corrections | `/business-analyse-html` | Just regenerate HTML |
51
+ | Client approves (no corrections) | `/business-analyse-handoff` | Proceed to PRD generation |
51
52
 
52
53
  ## References
53
54
 
@@ -57,4 +58,4 @@ After applying corrections, ask the client which phase to re-execute:
57
58
 
58
59
  ## Entry Point
59
60
 
60
- **FIRST ACTION:** Load `steps/step-01-apply.md`
61
+ **FIRST ACTION:** Load `steps/step-00-init.md`
@@ -1,8 +1,8 @@
1
1
  # Review Data Mapping Reference (references/review-data-mapping.md)
2
2
 
3
- > **Used by:** /ba-review step-01-apply (Apply Review Corrections)
3
+ > **Used by:** /business-analyse-review step-01-apply (Apply Review Corrections)
4
4
  > **Purpose:** Reverse mapping from ba-review.json (HTML export) back to module JSON files format
5
- > **Complement of:** `/ba-generate-html/references/data-mapping.md` (forward mapping)
5
+ > **Complement of:** `/business-analyse-html/references/data-mapping.md` (forward mapping)
6
6
 
7
7
  ---
8
8
 
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: step-00-init
3
+ description: Initialize review workflow — locate ba-review.json, detect feature, set variables
4
+ model: sonnet
5
+ next_step: steps/step-01-apply.md
6
+ ---
7
+
8
+ # Step 00: Initialize Review
9
+
10
+ ## YOUR TASK
11
+
12
+ Locate `ba-review.json`, identify the target feature, and initialize variables for step-01-apply.
13
+
14
+ ---
15
+
16
+ ## EXECUTION SEQUENCE
17
+
18
+ ### 1. Locate ba-review.json
19
+
20
+ ```javascript
21
+ // Search order:
22
+ // 1. Project root: ./ba-review.json
23
+ // 2. docs/ subdirectories: docs/**/ba-review.json
24
+ const candidates = [
25
+ './ba-review.json',
26
+ ...glob('docs/**/ba-review.json')
27
+ ];
28
+
29
+ const review_json_path = candidates.find(p => existsSync(p));
30
+ if (!review_json_path) {
31
+ BLOCKING_ERROR("ba-review.json not found. Export it from the interactive HTML document first.");
32
+ }
33
+ ```
34
+
35
+ ### 2. Read Review Metadata
36
+
37
+ ```javascript
38
+ const review = readJSON(review_json_path);
39
+
40
+ // Validate structure
41
+ if (!review._reviewMeta) {
42
+ BLOCKING_ERROR("ba-review.json missing _reviewMeta — not a valid review export");
43
+ }
44
+ if (!review.metadata?.applicationId) {
45
+ BLOCKING_ERROR("ba-review.json missing metadata.applicationId");
46
+ }
47
+
48
+ const application_name = review.metadata.applicationName || review.metadata.applicationId;
49
+ const application_id = review.metadata.applicationId;
50
+ const source_version = review._reviewMeta.sourceVersion || "1.0";
51
+ ```
52
+
53
+ ### 3. Locate Feature Docs Directory
54
+
55
+ ```javascript
56
+ // Find the matching BA feature directory
57
+ const docs_dir = glob(`docs/**/business-analyse/v*/index.json`)
58
+ .map(p => dirname(p))
59
+ .find(dir => {
60
+ const index = readJSON(join(dir, 'index.json'));
61
+ return index.id === application_id || index.metadata?.application === application_name;
62
+ });
63
+
64
+ if (!docs_dir) {
65
+ BLOCKING_ERROR("Cannot find BA feature directory for application: " + application_name);
66
+ }
67
+ ```
68
+
69
+ ### 4. Verify BA Status
70
+
71
+ ```javascript
72
+ const masterIndex = readJSON(join(docs_dir, 'index.json'));
73
+ const status = masterIndex.metadata?.status || masterIndex.status;
74
+
75
+ if (!['consolidated', 'reviewed', 'specified'].includes(status)) {
76
+ BLOCKING_ERROR("Feature status is '" + status + "' — expected 'consolidated', 'reviewed', or 'specified'");
77
+ }
78
+ ```
79
+
80
+ ### 5. Set Variables
81
+
82
+ ```javascript
83
+ const workflow_type = "review";
84
+
85
+ // Variables available to step-01-apply:
86
+ // {workflow_type} = "review"
87
+ // {review_json_path} = path to ba-review.json
88
+ // {application_name} = application display name
89
+ // {docs_dir} = path to BA feature directory
90
+ // {source_version} = version the review was exported from
91
+ ```
92
+
93
+ ### 6. Display Summary
94
+
95
+ ```
96
+ REVIEW INITIALIZED
97
+ Application: {application_name}
98
+ Review file: {review_json_path}
99
+ Source version: {source_version}
100
+ Has changes: {review._reviewMeta.hasChanges}
101
+ Changes: {review._reviewMeta.changeSummary}
102
+ → Applying corrections...
103
+ ```
104
+
105
+ ## NEXT STEP
106
+
107
+ Load: `steps/step-01-apply.md`
@@ -178,6 +178,8 @@ review_section = {
178
178
  Create review.json with review_section and update hash in index.json
179
179
  ```
180
180
 
181
+ > `review.json` is an AUDIT artifact — it preserves the review trail for traceability. No downstream skill consumes it.
182
+
181
183
  ## Step 8: Determine Correction Routing
182
184
 
183
185
  Analyze the corrections applied to determine which phase needs re-execution:
@@ -204,10 +206,10 @@ ELSE:
204
206
 
205
207
  ## Step 9: Regenerate Interactive HTML
206
208
 
207
- Delegate HTML generation to `/ba-generate-html` skill:
209
+ Delegate HTML generation to `/business-analyse-html` skill:
208
210
 
209
211
  ```
210
- 1. Load skill: /ba-generate-html with feature_id
212
+ 1. Load skill: /business-analyse-html with feature_id
211
213
  2. The skill handles: collect → build → render → verify
212
214
  3. Output: {new_version_dir}/ba-interactive.html
213
215
  ```
@@ -222,6 +224,12 @@ Delegate HTML generation to `/ba-generate-html` skill:
222
224
  5. Write docs/index.json
223
225
  ```
224
226
 
227
+ ## Step 10b: Update Status
228
+
229
+ ```javascript
230
+ ba-writer.updateStatus({feature_id}, "reviewed")
231
+ ```
232
+
225
233
  ## Step 11: Display Completion Summary
226
234
 
227
235
  ```
@@ -261,25 +269,25 @@ Display next steps based on `route`:
261
269
  ```
262
270
  IF route == "analysis":
263
271
  "1. Run /business-analyse step-03 for modules: {corrected_module_list}"
264
- "2. Then run /ba-design-ui to update UI specs"
265
- "3. Then run /ba-generate-html to regenerate documentation"
272
+ "2. Then run /business-analyse-design to update UI specs"
273
+ "3. Then run /business-analyse-html to regenerate documentation"
266
274
 
267
275
  IF route == "ui":
268
- "1. Run /ba-design-ui for modules: {corrected_module_list}"
269
- "2. Then run /ba-generate-html to regenerate documentation"
276
+ "1. Run /business-analyse-design for modules: {corrected_module_list}"
277
+ "2. Then run /business-analyse-html to regenerate documentation"
270
278
 
271
279
  IF route == "both":
272
280
  "1. Run /business-analyse step-03 for modules: {analysis_corrected_modules}"
273
- "2. Then run /ba-design-ui for modules: {ui_corrected_modules}"
274
- "3. Then run /ba-generate-html to regenerate documentation"
281
+ "2. Then run /business-analyse-design for modules: {ui_corrected_modules}"
282
+ "3. Then run /business-analyse-html to regenerate documentation"
275
283
 
276
284
  IF route == "html-only":
277
285
  "HTML has been regenerated. Review the updated document."
278
- "If satisfied, run /derive-prd to generate PRD files."
286
+ "If satisfied, run /business-analyse-handoff to generate PRD files."
279
287
 
280
288
  IF no corrections (client approves):
281
- "No corrections needed. Run /derive-prd to generate PRD files."
282
- "Then run /ralph-loop to start development."
289
+ "No corrections needed. Run /business-analyse-handoff to generate PRD files."
290
+ "Then run /business-analyse-develop to start development."
283
291
  ```
284
292
 
285
293
  ```
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: business-analyse-status
3
+ description: Display the current state of business analysis cycle, show progress per module, and recommend next steps.
4
+ model: sonnet
5
+ user-invocable: true
6
+ ---
7
+
8
+ # /business-analyse-status
9
+
10
+ Display the current state of the business analysis cycle for the active feature.
11
+
12
+ ## Trigger
13
+
14
+ - Explicit: `/business-analyse-status` or `/business-analyse-status <feature-id>`
15
+ - When the user asks "where are we?", "what's the status?", "what's left to do?"
16
+
17
+ ## Execution
18
+
19
+ ### Step 1 — Locate feature
20
+
21
+ 1. If `<feature-id>` is provided, search for `docs/business/<feature-id>/index.json`
22
+ 2. If not provided, scan `docs/business/*/index.json` — if exactly 1 feature exists, use it; if multiple, list them and ask which one
23
+ 3. If no feature found, display:
24
+ ```
25
+ Aucune analyse métier trouvée dans docs/business/.
26
+ → Lancez /business-analyse pour démarrer.
27
+ ```
28
+
29
+ ### Step 2 — Read state
30
+
31
+ Read the following files (all optional — missing = not done):
32
+
33
+ | File | What it tells us |
34
+ |------|-----------------|
35
+ | `index.json` | Feature exists, metadata, status, module list |
36
+ | `cadrage.json` | Cadrage done |
37
+ | Per module: `entities.json` | Entities specified |
38
+ | Per module: `rules.json` | Business rules specified |
39
+ | Per module: `usecases.json` | Use cases specified |
40
+ | Per module: `permissions.json` | Permissions defined |
41
+ | Per module: `screens.json` | UI design done |
42
+ | Per module: `navigation.json` | Navigation tree done |
43
+ | Per module: `handoff.json` | Handoff/PRD generated |
44
+ | `ba-interactive.html` (in project root or feature dir) | HTML document generated |
45
+ | `ba-review.json` (in project root) | Client review pending |
46
+
47
+ ### Step 3 — Compute progress
48
+
49
+ For each module, determine completion of each phase:
50
+
51
+ | Phase | Required files | Skill |
52
+ |-------|---------------|-------|
53
+ | Cadrage | status >= `"framed"` AND `cadrage.json` has context/stakeholders/scope | `/business-analyse` |
54
+ | Structure | status >= `"decomposed"` AND modules[] non-empty with anticipatedSections | `/business-analyse` |
55
+ | Specification | status >= `"specified"` (per module) AND entities/rules/usecases/permissions non-empty | `/business-analyse` |
56
+ | Consolidation | status >= `"consolidated"` AND consolidation.json exists | `/business-analyse` |
57
+ | Design | status >= `"designed"` AND `screens.json` non-empty per module | `/business-analyse-design` |
58
+ | HTML | `ba-interactive.html` exists and > 100KB | `/business-analyse-html` |
59
+ | Review | status >= `"reviewed"` OR `ba-review.json` exists (pending) | `/business-analyse-review` |
60
+ | Handoff | status >= `"handed-off"` AND `.ralph/prd-*.json` exists | `/business-analyse-handoff` |
61
+
62
+ ### Step 4 — Display
63
+
64
+ Use this exact format:
65
+
66
+ ```
67
+ ══════════════════════════════════════════════════
68
+ Business Analyse — {applicationName}
69
+ Version {version} · {lastModified}
70
+ ══════════════════════════════════════════════════
71
+
72
+ {checkmark} Cadrage {status}
73
+ {checkmark} Spécification {X}/{Y} modules
74
+ {checkmark} Design UI {X}/{Y} modules
75
+ {checkmark} Document HTML {status}
76
+ {checkmark} Review client {status}
77
+ {checkmark} Handoff {status}
78
+
79
+ Détail par module :
80
+ ┌──────────────────┬──────┬────────┬────────┬──────────┐
81
+ │ Module │ Spec │ Design │ Review │ Handoff │
82
+ ├──────────────────┼──────┼────────┼────────┼──────────┤
83
+ │ {moduleName} │ ✓ │ ✓ │ ○ │ · │
84
+ │ {moduleName} │ ✓ │ ○ │ · │ · │
85
+ └──────────────────┴──────┴────────┴────────┴──────────┘
86
+
87
+ Prochaine étape recommandée :
88
+ → {recommendation}
89
+
90
+ ══════════════════════════════════════════════════
91
+ ```
92
+
93
+ Legend:
94
+ - `✓` = done (green if terminal supports it)
95
+ - `○` = in progress / partial
96
+ - `·` = not started
97
+
98
+ ### Step 5 — Recommend next step
99
+
100
+ Based on the current state, recommend ONE next action:
101
+
102
+ | State | Recommendation |
103
+ |-------|---------------|
104
+ | No cadrage | `Lancez /business-analyse pour démarrer l'analyse.` |
105
+ | Cadrage done, spec incomplete | `Continuez /business-analyse pour spécifier les modules restants.` |
106
+ | All modules specified, no design | `Lancez /business-analyse-design <feature-id> pour concevoir les interfaces.` |
107
+ | Design done, no HTML | `Lancez /business-analyse-html <feature-id> pour générer le document client.` |
108
+ | HTML generated, no review | `Envoyez ba-interactive.html au client pour review.` |
109
+ | ba-review.json exists | `Lancez /business-analyse-review pour appliquer les corrections client.` |
110
+ | Review done / approved | `Lancez /business-analyse-handoff pour générer les PRD.` |
111
+ | Handoff done | `Analyse complète ! Lancez /business-analyse-develop pour démarrer le développement.` |
112
+
113
+ ## Rules
114
+
115
+ - This skill is READ-ONLY — it never modifies any file
116
+ - Use the `ba-reader` agent to read JSON files if available
117
+ - Keep output concise — the user wants a quick overview, not a full report
118
+ - If a module has partial data (e.g., entities but no rules), show it as `○` (in progress)
@@ -23,7 +23,7 @@ Works in synergy with the `/documentation module` command.
23
23
  ## WHEN THIS SKILL ACTIVATES
24
24
 
25
25
  ### PREREQUISITE — ONLY post-implementation
26
- This skill requires the feature page to already exist (generated by /ralph-loop).
26
+ This skill requires the feature page to already exist (generated by /business-analyse-develop).
27
27
  It reads real TSX pages, controllers, and entities. Without them, nothing to document.
28
28
 
29
29
  → For reviewing/editing the analysis BEFORE implementation: use ba-interactive.html (/business-analyse step-05)
@@ -32,7 +32,7 @@ Claude automatically invokes this skill when it detects:
32
32
 
33
33
  | Trigger | Example |
34
34
  |---------|---------|
35
- | ❌ NEVER during BA | Before /ralph-loop — feature page does not exist yet |
35
+ | ❌ NEVER during BA | Before /business-analyse-develop — feature page does not exist yet |
36
36
  | Explicit request | "Document the SLA module" |
37
37
  | Documentation mention | "We should create the doc for..." |
38
38
  | After implementation | "The feature is done, generate the doc" |
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: sketch
3
+ description: |
4
+ Transform a vague idea into a precise /apex command in under 5 minutes.
5
+ Use this skill when:
6
+ - User has a vague idea ("I want an HR app with employees and absences")
7
+ - User doesn't know the exact entities, fields, or structure needed
8
+ - User needs help designing a module before running /apex
9
+ Zero MCP, zero file generation — pure domain inference.
10
+ model: opus
11
+ argument-hint: "<vague idea in natural language>"
12
+ ---
13
+
14
+ <objective>
15
+ Transform a vague user prompt into a precise, ready-to-run /apex command. /sketch is a rapid design assistant — it infers entities, properties, relationships, labels, and code patterns from minimal input using domain heuristics and LLM knowledge.
16
+
17
+ **Key principles:**
18
+ - MAX 2 questions total (1 subject guard + 1 optional confirmation)
19
+ - Zero MCP calls — pure inference (validation is /apex's job)
20
+ - Zero file generation — output is text in conversation only
21
+ - Domain heuristics ACCELERATE inference, they do NOT limit it
22
+ </objective>
23
+
24
+ <quick_start>
25
+
26
+ ```bash
27
+ /sketch une app RH avec employés et absences
28
+ /sketch I want to manage customer orders and invoices
29
+ /sketch gestion de projets avec tâches et jalons
30
+ /sketch stock management
31
+ ```
32
+
33
+ </quick_start>
34
+
35
+ <anti_patterns>
36
+ - DO NOT ask more than 2 questions total
37
+ - DO NOT generate any files (no JSON, no code, no documents)
38
+ - DO NOT call any MCP tools (validation is /apex's job)
39
+ - DO NOT scan the entire codebase (max 1 Glob for app detection)
40
+ - DO NOT duplicate business analysis logic (no stakeholders, risks, use cases)
41
+ - DO NOT output structured syntax — /apex parses natural language, not custom formats
42
+ - DO NOT call Skill("apex") directly — instruct the agent to do it based on user choice
43
+ </anti_patterns>
44
+
45
+ <algorithm>
46
+
47
+ ## 1. SUBJECT GUARD
48
+
49
+ Check if the user prompt contains at least one identifiable business object (noun that could be an entity: employees, orders, projects, invoices, etc.).
50
+
51
+ ```
52
+ IF no business object identifiable in prompt:
53
+ → AskUserQuestion: "What do you want to manage? (e.g., employees, orders, projects, invoices...)"
54
+ → Wait for answer, then continue to step 2
55
+ → This is the ONLY mandatory question
56
+ ```
57
+
58
+ ## 2. LOAD DOMAIN HEURISTICS
59
+
60
+ Read `references/domain-heuristics.md` — domain pattern table with entities, properties, FK relationships, and i18n labels for 15 common business domains.
61
+
62
+ ## 3. ULTRA THINK — Domain Inference
63
+
64
+ **ULTRA THINK deeply about the user's domain before proceeding.**
65
+
66
+ From the user prompt + domain heuristics table:
67
+
68
+ 1. **Extract keywords** from user prompt (nouns, domain terms, action verbs)
69
+ 2. **Match against heuristics table** — find the closest domain pattern(s)
70
+ 3. **If no match:** use general LLM knowledge (the table accelerates, it does NOT limit)
71
+ 4. **Infer entities:** name, key properties, types, nullable flags
72
+ 5. **Infer FK relationships:** between entities (EmployeeId→Employee, etc.)
73
+ 6. **Infer sections:** 1 section per main entity, code = plural kebab-case (e.g., "employees")
74
+ 7. **Infer i18n labels** in 4 languages (fr, en, it, de) — from table or LLM knowledge
75
+ 8. **Deduce code_patterns:** strategy = "sequential" by default, prefix = first 3 letters of entity name
76
+ 9. **Deduce tenantMode:** "strict" by default (multi-tenant)
77
+ 10. **Deduce complexity:**
78
+ - `simple-crud` if ≤ 2 entities with no workflow/status transitions
79
+ - `crud-rules` otherwise (validations, computed fields, status)
80
+ - `crud-workflow` if mentions approval, email, notification
81
+ - `complex` if > 4 entities with specific business logic
82
+
83
+ ## 4. DETECT EXISTING APPLICATION
84
+
85
+ ```
86
+ Glob("**/NavigationApplicationSeedData.cs") ← single scan, MAX 1
87
+
88
+ IF files found:
89
+ → Extract application names from seed data classes
90
+ → Check if the inferred module fits an existing application
91
+ → If multiple apps match: flag as ambiguity for step 5
92
+
93
+ IF no files found:
94
+ → New application — infer name from domain
95
+ → app_name = domain-appropriate PascalCase name (e.g., "HumanResources")
96
+ ```
97
+
98
+ ## 5. CONFIRMATION GATE — MAX 1 optional question
99
+
100
+ ```
101
+ IF real ambiguity exists (multiple matching apps, genuinely ambiguous domain):
102
+ → AskUserQuestion with specific options to resolve the ambiguity
103
+ → This is the ONLY optional question
104
+
105
+ IF no ambiguity:
106
+ → Zero questions — proceed directly to output
107
+ ```
108
+
109
+ ## 6. OUTPUT — Display result and choices
110
+
111
+ Display the design summary and generated /apex prompt using the exact format below.
112
+
113
+ </algorithm>
114
+
115
+ <output_format>
116
+
117
+ ```
118
+ ══════════════════════════════════════════════════════════
119
+ /sketch — Module Design Complete
120
+ ══════════════════════════════════════════════════════════
121
+
122
+ Application: {app_name}
123
+ Module: {module_code}
124
+ Sections: {section1_code} ({fr_label}/{en_label}/{it_label}/{de_label})
125
+ {section2_code} ({fr_label}/{en_label}/{it_label}/{de_label})
126
+ Entities: {Entity1} ({prop1}:{type}, {prop2}:{type}, {fk}:{type} FK→{Target})
127
+ {Entity2} ({prop1}:{type}, {prop2}:{type}, {fk}:{type} FK→{Target})
128
+ Complexity: {complexity}
129
+ Code: {Entity1} → {prefix}-{tenant}-00001 | {Entity2} → {prefix}-{tenant}-00001
130
+
131
+ Ready to run:
132
+ ──────────────────────────────────────────────────────
133
+ /apex add {sections} sections to {app_name} module with
134
+ {Entity1} entity ({properties with types and FKs}) and
135
+ {Entity2} entity ({properties with types and FKs}),
136
+ code patterns sequential {prefixes}, complexity {complexity}
137
+ ──────────────────────────────────────────────────────
138
+
139
+ [1] Run this /apex command now
140
+ [2] Edit before running
141
+ [3] Cancel
142
+ ```
143
+
144
+ **Rules for the generated /apex prompt:**
145
+ - Natural language, dense but readable
146
+ - Include ALL entities with their key properties and types
147
+ - Include FK relationships explicitly (e.g., "EmployeeId:Guid FK→Employee")
148
+ - Include code pattern prefixes
149
+ - Include complexity level
150
+ - Mention the target application name
151
+
152
+ </output_format>
153
+
154
+ <handoff>
155
+
156
+ Based on user selection:
157
+
158
+ ```
159
+ IF user selects [1]:
160
+ → Call: Skill("apex", args: "{the generated prompt text}")
161
+
162
+ IF user selects [2]:
163
+ → Display the generated prompt for the user to edit
164
+ → Wait for edited version
165
+ → Re-display choices [1] Run / [3] Cancel
166
+
167
+ IF user selects [3]:
168
+ → Display: "Cancelled. Run /sketch again when ready."
169
+ → STOP
170
+ ```
171
+
172
+ </handoff>
@@ -0,0 +1,116 @@
1
+ # Domain Heuristics — /sketch
2
+
3
+ > **Purpose:** Accelerate entity/property inference for common business domains.
4
+ > This table is an **accelerator**, not a limiter. If the user's domain is not listed,
5
+ > the LLM infers entities and properties from general knowledge.
6
+
7
+ ---
8
+
9
+ ## HR / Ressources Humaines
10
+
11
+ - **Employee** (FirstName:string, LastName:string, Email:string, HireDate:DateTime, DepartmentId:Guid→Department)
12
+ labels: { fr: "Employé", en: "Employee", it: "Dipendente", de: "Mitarbeiter" }
13
+ - **Department** (Name:string, Code:string, ParentDepartmentId:Guid?→Department)
14
+ labels: { fr: "Département", en: "Department", it: "Dipartimento", de: "Abteilung" }
15
+
16
+ ## Absences / Congés
17
+
18
+ - **Absence** (StartDate:DateTime, EndDate:DateTime, Type:string, Status:string, EmployeeId:Guid→Employee)
19
+ labels: { fr: "Absence", en: "Absence", it: "Assenza", de: "Abwesenheit" }
20
+ - **AbsenceType** (Name:string, Code:string, MaxDays:int, IsPaid:bool)
21
+ labels: { fr: "Type d'absence", en: "Absence Type", it: "Tipo di assenza", de: "Abwesenheitstyp" }
22
+
23
+ ## CRM / Clients
24
+
25
+ - **Customer** (FirstName:string, LastName:string, Email:string, Phone:string, CompanyName:string?)
26
+ labels: { fr: "Client", en: "Customer", it: "Cliente", de: "Kunde" }
27
+ - **Contact** (FirstName:string, LastName:string, Email:string, Phone:string, CustomerId:Guid→Customer)
28
+ labels: { fr: "Contact", en: "Contact", it: "Contatto", de: "Kontakt" }
29
+
30
+ ## Commandes / Orders
31
+
32
+ - **Order** (OrderDate:DateTime, TotalAmount:decimal, Status:string, CustomerId:Guid→Customer)
33
+ labels: { fr: "Commande", en: "Order", it: "Ordine", de: "Bestellung" }
34
+ - **OrderLine** (Quantity:int, UnitPrice:decimal, TotalPrice:decimal, ProductId:Guid→Product, OrderId:Guid→Order)
35
+ labels: { fr: "Ligne de commande", en: "Order Line", it: "Riga d'ordine", de: "Bestellposition" }
36
+
37
+ ## Facturation / Invoicing
38
+
39
+ - **Invoice** (InvoiceDate:DateTime, DueDate:DateTime, TotalAmount:decimal, Status:string, CustomerId:Guid→Customer)
40
+ labels: { fr: "Facture", en: "Invoice", it: "Fattura", de: "Rechnung" }
41
+ - **InvoiceLine** (Description:string, Quantity:int, UnitPrice:decimal, TotalPrice:decimal, InvoiceId:Guid→Invoice)
42
+ labels: { fr: "Ligne de facture", en: "Invoice Line", it: "Riga di fattura", de: "Rechnungsposition" }
43
+
44
+ ## Projets / Projects
45
+
46
+ - **Project** (Name:string, Code:string, StartDate:DateTime, EndDate:DateTime?, Status:string, ManagerId:Guid?→Employee)
47
+ labels: { fr: "Projet", en: "Project", it: "Progetto", de: "Projekt" }
48
+ - **Task** (Title:string, Description:string?, DueDate:DateTime?, Status:string, Priority:string, ProjectId:Guid→Project, AssigneeId:Guid?→Employee)
49
+ labels: { fr: "Tâche", en: "Task", it: "Attività", de: "Aufgabe" }
50
+ - **Milestone** (Name:string, DueDate:DateTime, Status:string, ProjectId:Guid→Project)
51
+ labels: { fr: "Jalon", en: "Milestone", it: "Traguardo", de: "Meilenstein" }
52
+
53
+ ## Stock / Inventaire
54
+
55
+ - **Product** (Name:string, Code:string, Description:string?, UnitPrice:decimal, CategoryId:Guid?→Category)
56
+ labels: { fr: "Produit", en: "Product", it: "Prodotto", de: "Produkt" }
57
+ - **Category** (Name:string, Code:string, ParentCategoryId:Guid?→Category)
58
+ labels: { fr: "Catégorie", en: "Category", it: "Categoria", de: "Kategorie" }
59
+ - **StockMovement** (Quantity:int, Type:string, Date:DateTime, ProductId:Guid→Product, WarehouseId:Guid?→Warehouse)
60
+ labels: { fr: "Mouvement de stock", en: "Stock Movement", it: "Movimento di stock", de: "Lagerbewegung" }
61
+
62
+ ## Contrats / Contracts
63
+
64
+ - **Contract** (Title:string, StartDate:DateTime, EndDate:DateTime?, Status:string, Amount:decimal?, CustomerId:Guid→Customer)
65
+ labels: { fr: "Contrat", en: "Contract", it: "Contratto", de: "Vertrag" }
66
+ - **ContractAmendment** (Description:string, Date:DateTime, Amount:decimal?, ContractId:Guid→Contract)
67
+ labels: { fr: "Avenant", en: "Amendment", it: "Emendamento", de: "Nachtrag" }
68
+
69
+ ## Tickets / Support
70
+
71
+ - **Ticket** (Title:string, Description:string, Priority:string, Status:string, Category:string, CustomerId:Guid?→Customer, AssigneeId:Guid?→Employee)
72
+ labels: { fr: "Ticket", en: "Ticket", it: "Ticket", de: "Ticket" }
73
+ - **TicketComment** (Content:string, IsInternal:bool, TicketId:Guid→Ticket)
74
+ labels: { fr: "Commentaire", en: "Comment", it: "Commento", de: "Kommentar" }
75
+
76
+ ## Fournisseurs / Suppliers
77
+
78
+ - **Supplier** (Name:string, Email:string, Phone:string, Address:string?, VatNumber:string?)
79
+ labels: { fr: "Fournisseur", en: "Supplier", it: "Fornitore", de: "Lieferant" }
80
+ - **PurchaseOrder** (OrderDate:DateTime, Status:string, TotalAmount:decimal, SupplierId:Guid→Supplier)
81
+ labels: { fr: "Bon de commande", en: "Purchase Order", it: "Ordine d'acquisto", de: "Bestellung" }
82
+
83
+ ## Documents / GED
84
+
85
+ - **Document** (Title:string, FileName:string, FileSize:long, MimeType:string, FolderId:Guid?→Folder)
86
+ labels: { fr: "Document", en: "Document", it: "Documento", de: "Dokument" }
87
+ - **Folder** (Name:string, ParentFolderId:Guid?→Folder)
88
+ labels: { fr: "Dossier", en: "Folder", it: "Cartella", de: "Ordner" }
89
+
90
+ ## Réservations / Bookings
91
+
92
+ - **Booking** (StartDate:DateTime, EndDate:DateTime, Status:string, ResourceId:Guid→Resource, ContactId:Guid?→Contact)
93
+ labels: { fr: "Réservation", en: "Booking", it: "Prenotazione", de: "Buchung" }
94
+ - **Resource** (Name:string, Type:string, Capacity:int?, Location:string?)
95
+ labels: { fr: "Ressource", en: "Resource", it: "Risorsa", de: "Ressource" }
96
+
97
+ ## Événements / Events
98
+
99
+ - **Event** (Title:string, Description:string?, StartDate:DateTime, EndDate:DateTime, Location:string?, MaxAttendees:int?)
100
+ labels: { fr: "Événement", en: "Event", it: "Evento", de: "Veranstaltung" }
101
+ - **Registration** (Status:string, RegisteredAt:DateTime, EventId:Guid→Event, ContactId:Guid?→Contact)
102
+ labels: { fr: "Inscription", en: "Registration", it: "Iscrizione", de: "Anmeldung" }
103
+
104
+ ## Formation / Training
105
+
106
+ - **Training** (Title:string, Description:string?, StartDate:DateTime, EndDate:DateTime, MaxParticipants:int?, TrainerId:Guid?→Employee)
107
+ labels: { fr: "Formation", en: "Training", it: "Formazione", de: "Schulung" }
108
+ - **Enrollment** (Status:string, EnrolledAt:DateTime, TrainingId:Guid→Training, EmployeeId:Guid→Employee)
109
+ labels: { fr: "Inscription", en: "Enrollment", it: "Iscrizione", de: "Anmeldung" }
110
+
111
+ ## Maintenance / Equipment
112
+
113
+ - **Equipment** (Name:string, SerialNumber:string?, Status:string, Location:string?, CategoryId:Guid?→Category)
114
+ labels: { fr: "Équipement", en: "Equipment", it: "Attrezzatura", de: "Ausrüstung" }
115
+ - **MaintenanceRequest** (Title:string, Description:string, Priority:string, Status:string, EquipmentId:Guid→Equipment, RequestedById:Guid?→Employee)
116
+ labels: { fr: "Demande de maintenance", en: "Maintenance Request", it: "Richiesta di manutenzione", de: "Wartungsanfrage" }