@atlashub/smartstack-cli 3.8.0 → 3.10.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 (130) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +211 -0
  6. package/templates/agents/explore-codebase.md +1 -0
  7. package/templates/agents/explore-docs.md +1 -0
  8. package/templates/agents/fix-grammar.md +1 -0
  9. package/templates/agents/snipper.md +1 -0
  10. package/templates/skills/admin/SKILL.md +6 -0
  11. package/templates/skills/ai-prompt/SKILL.md +32 -136
  12. package/templates/skills/ai-prompt/steps/step-01-implementation.md +122 -0
  13. package/templates/skills/apex/SKILL.md +120 -0
  14. package/templates/skills/apex/_shared.md +86 -0
  15. package/templates/skills/apex/references/agent-teams-protocol.md +164 -0
  16. package/templates/skills/apex/references/smartstack-layers.md +173 -0
  17. package/templates/skills/apex/steps/step-00-init.md +156 -0
  18. package/templates/skills/apex/steps/step-01-analyze.md +169 -0
  19. package/templates/skills/apex/steps/step-02-plan.md +160 -0
  20. package/templates/skills/apex/steps/step-03-execute.md +166 -0
  21. package/templates/skills/apex/steps/step-04-validate.md +138 -0
  22. package/templates/skills/apex/steps/step-05-examine.md +124 -0
  23. package/templates/skills/apex/steps/step-06-resolve.md +105 -0
  24. package/templates/skills/apex/steps/step-07-tests.md +130 -0
  25. package/templates/skills/apex/steps/step-08-run-tests.md +115 -0
  26. package/templates/skills/application/SKILL.md +10 -0
  27. package/templates/skills/application/references/application-roles-template.md +227 -0
  28. package/templates/skills/application/references/backend-controller-hierarchy.md +58 -0
  29. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  30. package/templates/skills/application/references/backend-verification.md +88 -0
  31. package/templates/skills/application/references/frontend-verification.md +111 -0
  32. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  33. package/templates/skills/application/references/provider-template.md +158 -0
  34. package/templates/skills/application/references/test-frontend.md +73 -0
  35. package/templates/skills/application/references/test-prerequisites.md +72 -0
  36. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  37. package/templates/skills/application/steps/step-03-roles.md +45 -7
  38. package/templates/skills/application/steps/step-03b-provider.md +15 -132
  39. package/templates/skills/application/steps/step-04-backend.md +20 -350
  40. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  41. package/templates/skills/application/steps/step-07-tests.md +12 -132
  42. package/templates/skills/business-analyse/SKILL.md +67 -6
  43. package/templates/skills/business-analyse/html/ba-interactive.html +176 -14
  44. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +1 -0
  45. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +16 -4
  46. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +7 -2
  47. package/templates/skills/business-analyse/html/src/scripts/09-export.js +103 -0
  48. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +12 -6
  49. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +24 -2
  50. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +12 -0
  51. package/templates/skills/business-analyse/html/src/template.html +1 -0
  52. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +477 -0
  53. package/templates/skills/business-analyse/references/cache-warming-strategy.md +578 -0
  54. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  55. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  56. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  57. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  58. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  59. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  60. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  61. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  62. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  63. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  64. package/templates/skills/business-analyse/references/robustness-checks.md +538 -0
  65. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  66. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  67. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  68. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  69. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +33 -1
  70. package/templates/skills/business-analyse/steps/step-00-init.md +186 -53
  71. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  72. package/templates/skills/business-analyse/steps/step-03a-data.md +42 -49
  73. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  74. package/templates/skills/business-analyse/steps/step-03c-compile.md +71 -2
  75. package/templates/skills/business-analyse/steps/step-03d-validate.md +277 -48
  76. package/templates/skills/business-analyse/steps/step-04-consolidation.md +175 -104
  77. package/templates/skills/business-analyse/steps/step-05a-handoff.md +66 -438
  78. package/templates/skills/business-analyse/steps/step-05b-deploy.md +35 -184
  79. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +526 -0
  80. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  81. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  82. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  83. package/templates/skills/check-version/SKILL.md +7 -0
  84. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  85. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  86. package/templates/skills/controller/steps/step-03-generate.md +166 -158
  87. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  88. package/templates/skills/controller/templates.md +11 -2
  89. package/templates/skills/debug/SKILL.md +7 -0
  90. package/templates/skills/explore/SKILL.md +6 -0
  91. package/templates/skills/feature-full/SKILL.md +39 -142
  92. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  93. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  94. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  95. package/templates/skills/gitflow/references/plan-template.md +69 -0
  96. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  97. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  98. package/templates/skills/gitflow/steps/step-init.md +18 -289
  99. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  100. package/templates/skills/gitflow/steps/step-start.md +16 -126
  101. package/templates/skills/mcp/SKILL.md +9 -213
  102. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  103. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  104. package/templates/skills/notification/SKILL.md +7 -0
  105. package/templates/skills/quick-search/SKILL.md +5 -0
  106. package/templates/skills/ralph-loop/SKILL.md +99 -381
  107. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  108. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  109. package/templates/skills/ralph-loop/references/core-seed-data.md +173 -21
  110. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  111. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  112. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  113. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  114. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  115. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  116. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  117. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  118. package/templates/skills/refactor/SKILL.md +12 -176
  119. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  120. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  121. package/templates/skills/review-code/SKILL.md +19 -257
  122. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  123. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  124. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  125. package/templates/skills/ui-components/SKILL.md +7 -0
  126. package/templates/skills/utils/SKILL.md +6 -0
  127. package/templates/skills/validate/SKILL.md +6 -0
  128. package/templates/skills/validate-feature/SKILL.md +8 -0
  129. package/templates/skills/workflow/SKILL.md +40 -118
  130. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -0,0 +1,189 @@
1
+ # Team Orchestration — Multi-Module Parallel Execution
2
+
3
+ > **Loaded by:** step-00 when multi-module detected (PRD_COUNT > 1)
4
+ > **Purpose:** Parallelize independent modules via Agent Teams.
5
+ > **Rule:** Single module = NO team. Only create team for 2+ modules.
6
+
7
+ ---
8
+
9
+ ## 1. Layer Detection
10
+
11
+ Read dependency graph from master feature.json:
12
+
13
+ ```javascript
14
+ const master = readJSON(MASTER_FEATURE);
15
+ const layers = master.metadata?.workflow?.dependencyGraph?.layers
16
+ || master.dependencyGraph?.layers;
17
+
18
+ // Example layers:
19
+ // [
20
+ // { layer: 0, modules: ["employees"], reason: "foundation" },
21
+ // { layer: 1, modules: ["timetracking", "leavemanagement"], reason: "depends on employees" },
22
+ // { layer: 2, modules: ["reporting"], reason: "depends on all" }
23
+ // ]
24
+
25
+ // Fallback: if no layers, treat all modules as sequential (layer 0, 1, 2...)
26
+ if (!layers) {
27
+ const modules = queue.modules.map((m, i) => ({
28
+ layer: i, modules: [m.code], reason: "sequential"
29
+ }));
30
+ }
31
+ ```
32
+
33
+ ---
34
+
35
+ ## 2. Team Setup
36
+
37
+ ```javascript
38
+ // Create team
39
+ TeamCreate({ team_name: `ralph-${appName}` });
40
+
41
+ // Store team context
42
+ const teamContext = {
43
+ teamName: `ralph-${appName}`,
44
+ layers: layers,
45
+ currentLayer: 0,
46
+ teammates: {} // name → agentId mapping (populated after spawn)
47
+ };
48
+ ```
49
+
50
+ ---
51
+
52
+ ## 3. Teammate Spawn — Per Layer
53
+
54
+ For each layer, spawn teammates IN PARALLEL (single message, multiple Task calls):
55
+
56
+ ```javascript
57
+ for (const layer of layers) {
58
+ // Wait for previous layer to complete (except layer 0)
59
+ if (layer.layer > 0) {
60
+ // WAIT: check for MODULE_COMPLETE messages from all previous layer teammates
61
+ // Messages are automatically delivered via SendMessage
62
+ }
63
+
64
+ // Spawn all modules in this layer in parallel
65
+ for (const moduleCode of layer.modules) {
66
+ const prdFile = `.ralph/prd-${moduleCode}.json`;
67
+ const prdContent = readJSON(prdFile);
68
+
69
+ Task({
70
+ subagent_type: "general-purpose",
71
+ team_name: `ralph-${appName}`,
72
+ name: `mod-${moduleCode}`,
73
+ mode: "bypassPermissions",
74
+ prompt: TEAMMATE_PROMPT(moduleCode, prdContent),
75
+ description: `Module ${moduleCode}`
76
+ });
77
+ }
78
+ }
79
+ ```
80
+
81
+ ---
82
+
83
+ ## 4. Teammate Prompt Template
84
+
85
+ Each teammate receives a self-contained prompt with all context:
86
+
87
+ ```
88
+ You are a Ralph Loop module worker for module "${moduleCode}".
89
+
90
+ ## Your Mission
91
+ Implement ALL tasks in the PRD below, following SmartStack conventions.
92
+ Execute autonomously: domain → infrastructure → MIGRATION → seed data → application → api → frontend → i18n → tests → validation.
93
+
94
+ ## PRD (your task list)
95
+ ${JSON.stringify(prdContent, null, 2)}
96
+
97
+ ## Execution Rules
98
+ 1. Read the skill file at: templates/skills/ralph-loop/references/category-rules.md
99
+ 2. For seed data tasks, also read: templates/skills/ralph-loop/references/core-seed-data.md
100
+ 3. Follow SmartStack conventions (MCP validation after each batch)
101
+ 4. MIGRATION is MANDATORY after EF configs: mcp suggest_migration → dotnet ef migrations add → database update
102
+ 5. Tests MUST pass before proceeding (dotnet test = 0 failures)
103
+ 6. Frontend in src/pages/{Context}/{App}/{Module}/ (NOT flat)
104
+ 7. Commit after each batch: git add + git commit
105
+
106
+ ## Communication Protocol
107
+ - After domain + infrastructure + migration are done and build passes:
108
+ SendMessage({ type: "message", recipient: "team-lead", content: "LAYER_READY:${moduleCode}", summary: "${moduleCode} foundation ready" })
109
+ - When ALL tasks complete:
110
+ SendMessage({ type: "message", recipient: "team-lead", content: "MODULE_COMPLETE:${moduleCode}", summary: "${moduleCode} complete" })
111
+ - On blocking error:
112
+ SendMessage({ type: "message", recipient: "team-lead", content: "ERROR:${moduleCode}:{error}", summary: "${moduleCode} blocked" })
113
+
114
+ ## Project Context
115
+ - Project path: ${projectPath}
116
+ - Branch: ${branch}
117
+ - Application: ${appName}
118
+ - Context: ${contextCode}
119
+ ```
120
+
121
+ ---
122
+
123
+ ## 5. Team Lead Wait Logic
124
+
125
+ After spawning a layer, the team lead waits for completion:
126
+
127
+ ```javascript
128
+ // Track expected messages
129
+ const expectedMessages = layer.modules.length;
130
+ let receivedComplete = 0;
131
+ let receivedReady = 0;
132
+ let errors = [];
133
+
134
+ // Messages arrive automatically via SendMessage
135
+ // When a teammate sends "MODULE_COMPLETE:xxx", increment counter
136
+ // When a teammate sends "ERROR:xxx:yyy", record error
137
+
138
+ // For LAYER_READY: wait until all layer 0 modules signal before spawning layer 1
139
+ // For MODULE_COMPLETE: wait until all layer N modules complete before spawning layer N+1
140
+
141
+ // If error received:
142
+ // - Log to progress.txt
143
+ // - Decide: retry module or mark as partial
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 6. Cross-Module Verification
149
+
150
+ After all layers complete, team lead runs:
151
+
152
+ ```bash
153
+ # Full solution build
154
+ dotnet build --no-restore
155
+
156
+ # Full test suite
157
+ dotnet test --no-build
158
+
159
+ # MCP validation
160
+ mcp__smartstack__validate_conventions checks=["all"]
161
+ ```
162
+
163
+ ---
164
+
165
+ ## 7. Cleanup
166
+
167
+ After all modules done and report generated:
168
+
169
+ ```javascript
170
+ // Shutdown all teammates
171
+ for (const [name, _] of Object.entries(teamContext.teammates)) {
172
+ SendMessage({ type: "shutdown_request", recipient: name, content: "All modules complete" });
173
+ }
174
+
175
+ // Wait for shutdown confirmations, then:
176
+ TeamDelete();
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Decision Matrix
182
+
183
+ | Condition | Action |
184
+ |-----------|--------|
185
+ | 1 module | NO team, classic compact loop |
186
+ | 2+ modules, no dependency graph | Sequential layers (one at a time) |
187
+ | 2+ modules, with layers | Parallel within each layer |
188
+ | Teammate error | Log, try to continue other modules |
189
+ | All modules done | Cross-module verify → step-05 → TeamDelete |