@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
@@ -10,8 +10,8 @@ model: sonnet
10
10
 
11
11
  ## MANDATORY EXECUTION RULES
12
12
 
13
- - **ALWAYS** generate PRD via `ss derive-prd` CLI command (deterministic, never LLM)
14
- - **ALWAYS** verify PRD structure: $version=3.0.0, implementation.filesToCreate, 8 categories
13
+ - **ALWAYS** generate PRD via `ss business-analyse-handoff` CLI command (deterministic, never LLM)
14
+ - **ALWAYS** verify PRD structure: $version=3.0.0 or 4.0.0, implementation.filesToCreate (v3) or expectedFiles (v4), 8 categories
15
15
  - **ALWAYS** verify file counts match between PRD and handoff
16
16
  - **ALWAYS** generate progress.txt from template
17
17
  - **ALWAYS** update BA manifest (docs/index.json)
@@ -33,47 +33,60 @@ For EACH module:
33
33
 
34
34
  ```bash
35
35
  # Single module:
36
- ss derive-prd --ba-dir {moduleBaDir} --output .ralph/prd-{moduleCode}.json
36
+ ss business-analyse-handoff --ba-dir {moduleBaDir} --output .ralph/prd-{moduleCode}.json
37
37
 
38
38
  # All modules from app-level index.json:
39
- ss derive-prd --ba-app {appIndexPath}
39
+ ss business-analyse-handoff --ba-app {appIndexPath}
40
40
  ```
41
41
 
42
42
  **Option B — Legacy feature.json:**
43
43
 
44
44
  ```bash
45
- ss derive-prd --feature {moduleFeaturePath} --output .ralph/prd-{moduleCode}.json
45
+ ss business-analyse-handoff --feature {moduleFeaturePath} --output .ralph/prd-{moduleCode}.json
46
46
  ```
47
47
 
48
+ **Option C — v4 spec-oriented PRD (1M context + compaction):**
49
+
50
+ ```bash
51
+ ss business-analyse-handoff --ba-app {appIndexPath} --v4
52
+ ```
53
+
54
+ Generates `prd-{moduleCode}.json` with `$version: "4.0.0"` containing:
55
+ - `objectives[]` with acceptance criteria (instead of pre-computed tasks)
56
+ - `expectedFiles` (same 8 categories, for file reconciliation)
57
+ - `gates` (declarative quality gate definitions)
58
+ - Architecture, business rules, BR mapping, seed data (same as v3)
59
+
48
60
  ### 2. POST-CHECK PRD (BLOCKING)
49
61
 
50
- > **Reference:** Read `references/prd-generation.md` for complete validation rules.
62
+ > **Reference:** See loaded context `prd-generation.md` for complete validation rules.
51
63
 
52
64
  ```javascript
53
65
  const prd = readJSON(`.ralph/prd-${moduleCode}.json`);
54
66
  const featureHandoff = moduleFeature.handoff.filesToCreate;
55
67
 
56
68
  // Check 1: Version
57
- if (prd.$version !== "3.0.0") {
58
- BLOCKING_ERROR("PRD version must be 3.0.0, got: " + prd.$version);
69
+ if (prd.$version !== "3.0.0" && prd.$version !== "4.0.0") {
70
+ BLOCKING_ERROR("PRD version must be 3.0.0 or 4.0.0, got: " + prd.$version);
59
71
  }
60
72
 
61
- // Check 2: filesToCreate under implementation (not root)
62
- if (prd.filesToCreate && !prd.implementation?.filesToCreate) {
63
- BLOCKING_ERROR("prd.json has filesToCreate at ROOT — not from ss derive-prd");
73
+ // Check 2: filesToCreate location (v3: implementation.filesToCreate, v4: expectedFiles)
74
+ const ftc = prd.$version === "4.0.0" ? prd.expectedFiles : prd.implementation?.filesToCreate;
75
+ if (!ftc) {
76
+ BLOCKING_ERROR("prd.json missing file manifest (v3: implementation.filesToCreate, v4: expectedFiles)");
64
77
  STOP;
65
78
  }
66
79
 
67
80
  // Check 3: All 8 categories present
68
81
  const categories = ['domain', 'application', 'infrastructure', 'api', 'frontend', 'seedData', 'tests', 'documentation'];
69
- const missingCategories = categories.filter(cat => !prd.implementation.filesToCreate[cat]);
82
+ const missingCategories = categories.filter(cat => !ftc[cat]);
70
83
  if (missingCategories.length > 0) {
71
84
  BLOCKING_ERROR("Missing categories: " + missingCategories.join(', '));
72
85
  }
73
86
 
74
87
  // Check 4: File counts match
75
88
  for (const cat of categories) {
76
- const prdCount = prd.implementation.filesToCreate[cat]?.length ?? 0;
89
+ const prdCount = ftc[cat]?.length ?? 0;
77
90
  const featureCount = featureHandoff[cat]?.length ?? 0;
78
91
  if (prdCount !== featureCount) {
79
92
  BLOCKING_ERROR(`${cat}: prd=${prdCount} but feature=${featureCount}`);
@@ -100,7 +113,7 @@ Write to: `.ralph/modules-queue.json`
100
113
 
101
114
  ### 4. Generate progress.txt
102
115
 
103
- > **Template:** Read `templates/tpl-progress.md` for complete structure.
116
+ > **Template:** See loaded context `tpl-progress.md` for complete structure.
104
117
  > **Data source:** Populate with module-specific data from index.json.
105
118
 
106
119
  - One section per module in topological order
@@ -111,6 +124,13 @@ Write to: `.ralph/modules-queue.json`
111
124
  - Summary with totals across all modules
112
125
  - Cross-module tasks IF multi-module
113
126
 
127
+ Before writing:
128
+ ```
129
+ IF .ralph/progress.txt exists AND contains "Iteration" entries:
130
+ WARN: "progress.txt contains development progress — appending handoff section instead of overwriting"
131
+ APPEND instead of WRITE
132
+ ```
133
+
114
134
  Write to: `.ralph/progress.txt`
115
135
 
116
136
  ### 5. Update BA Manifest (docs/index.json)
@@ -172,7 +192,7 @@ Artifacts generated:
172
192
  docs/index.json — BA manifest (status: handed-off)
173
193
 
174
194
  [NEXT] Development:
175
- 1. Run /ralph-loop to begin implementation
195
+ 1. Run /business-analyse-develop to begin implementation
176
196
  2. Modules will be processed in topological order
177
197
  3. Each module PRD contains {total_files} files across 8 categories
178
198
 
@@ -187,7 +207,7 @@ Artifacts generated:
187
207
  2. `.ralph/progress.txt` exists (>500 bytes)
188
208
  3. `.ralph/modules-queue.json` exists (if 2+ modules)
189
209
  4. `docs/index.json` updated with correct entry count and status "handed-off"
190
- 5. All PRD files have $version=3.0.0, implementation.filesToCreate, 8 categories
210
+ 5. All PRD files have $version=3.0.0 or 4.0.0, file manifest present, 8 categories
191
211
  6. File counts match between PRD and handoff for all categories
192
212
 
193
213
  **IF any check fails -> fix before completing.**
@@ -1,19 +1,19 @@
1
1
  ---
2
- name: ba-generate-html
2
+ name: business-analyse-html
3
3
  description: "Generate the interactive HTML document from business analysis JSON data"
4
4
  model: opus
5
5
  user_invocable: true
6
6
  ---
7
7
 
8
- # /ba-generate-html
8
+ # /business-analyse-html
9
9
 
10
10
  Generate the interactive HTML document of the business analysis from the JSON analysis files.
11
11
 
12
12
  ## Triggers
13
13
 
14
- - Explicit invocation: `/ba-generate-html <feature-id>`
14
+ - Explicit invocation: `/business-analyse-html <feature-id>`
15
15
  - After `/business-analyse` step-04 (consolidation complete)
16
- - Delegation from `/ba-review` (after review corrections applied)
16
+ - Delegation from `/business-analyse-review` (after review corrections applied)
17
17
 
18
18
  ## Parameters
19
19