@atlashub/smartstack-cli 4.18.0 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/agents/ba-reader.md +86 -80
- package/templates/agents/ba-writer.md +318 -415
- package/templates/agents/docs-context-reader.md +3 -3
- package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +133 -0
- package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +126 -0
- package/templates/skills/apex/SKILL.md +29 -16
- package/templates/skills/apex/_shared.md +62 -9
- package/templates/skills/apex/references/analysis-methods.md +8 -6
- package/templates/skills/apex/references/challenge-questions.md +5 -5
- package/templates/skills/apex/references/core-seed-data.md +68 -45
- package/templates/skills/apex/references/frontend-route-wiring-app-tsx.md +26 -21
- package/templates/skills/apex/references/parallel-execution.md +156 -0
- package/templates/skills/apex/references/person-extension-pattern.md +12 -12
- package/templates/skills/apex/references/post-checks.md +1748 -1726
- package/templates/skills/apex/references/smartstack-api.md +63 -57
- package/templates/skills/apex/references/smartstack-frontend-compliance.md +594 -0
- package/templates/skills/apex/references/smartstack-frontend.md +1246 -1842
- package/templates/skills/apex/references/smartstack-layers.md +98 -145
- package/templates/skills/apex/steps/step-00-init.md +30 -6
- package/templates/skills/apex/steps/step-01-analyze.md +27 -23
- package/templates/skills/apex/steps/step-02-plan.md +12 -12
- package/templates/skills/apex/steps/step-03-execute.md +198 -143
- package/templates/skills/apex/steps/step-04-examine.md +24 -93
- package/templates/skills/apex/steps/step-05-deep-review.md +16 -16
- package/templates/skills/apex/steps/step-06-resolve.md +9 -9
- package/templates/skills/apex/steps/step-07-tests.md +3 -1
- package/templates/skills/apex/steps/step-08-run-tests.md +1 -1
- package/templates/skills/business-analyse/SKILL.md +182 -301
- package/templates/skills/business-analyse/_shared.md +119 -336
- package/templates/skills/business-analyse/html/ba-interactive.html +703 -82
- package/templates/skills/business-analyse/html/build-html.js +41 -3
- package/templates/skills/business-analyse/html/src/partials/cadrage-context.html +34 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-risks.html +48 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-scope.html +49 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-stakeholders.html +55 -0
- package/templates/skills/business-analyse/html/src/partials/cadrage-success.html +34 -0
- package/templates/skills/business-analyse/html/src/partials/consol-datamodel.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/consol-flows.html +29 -0
- package/templates/skills/business-analyse/html/src/partials/consol-interactions.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/consol-permissions.html +8 -0
- package/templates/skills/business-analyse/html/src/partials/decomp-dependencies.html +38 -0
- package/templates/skills/business-analyse/html/src/partials/decomp-modules.html +51 -0
- package/templates/skills/business-analyse/html/src/partials/handoff-summary.html +24 -0
- package/templates/skills/business-analyse/html/src/partials/module-spec-container.html +4 -0
- package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +17 -1
- package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +31 -5
- package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +100 -63
- package/templates/skills/business-analyse/html/src/scripts/06-render-mockups.js +372 -0
- package/templates/skills/business-analyse/html/src/scripts/10-comments.js +41 -13
- package/templates/skills/business-analyse/html/src/styles/09-mockups-html.css +136 -0
- package/templates/skills/business-analyse/patterns/suggestion-catalog.md +7 -5
- package/templates/skills/business-analyse/questionnaire/02-stakeholders-scope.md +142 -0
- package/templates/skills/business-analyse/questionnaire/03-data-ui.md +94 -0
- package/templates/skills/business-analyse/questionnaire/04-risks-metrics.md +150 -0
- package/templates/skills/business-analyse/questionnaire/05-cross-module.md +69 -0
- package/templates/skills/business-analyse/questionnaire.md +23 -280
- package/templates/skills/business-analyse/react/application-viewer.md +2 -2
- package/templates/skills/business-analyse/react/components.md +4 -4
- package/templates/skills/business-analyse/react/i18n-template.md +1 -1
- package/templates/skills/business-analyse/react/schema.md +14 -14
- package/templates/skills/business-analyse/references/acceptance-criteria.md +21 -21
- package/templates/skills/business-analyse/references/analysis-semantic-checks.md +3 -3
- package/templates/skills/business-analyse/references/compilation-structure-cards.md +1 -1
- package/templates/skills/business-analyse/references/consolidation-structural-checks.md +5 -5
- package/templates/skills/business-analyse/references/deploy-data-build.md +12 -11
- package/templates/skills/business-analyse/references/deploy-modes.md +10 -10
- package/templates/skills/business-analyse/references/detection-strategies.md +6 -6
- package/templates/skills/business-analyse/references/html-data-mapping.md +15 -15
- package/templates/skills/business-analyse/references/naming-conventions.md +4 -4
- package/templates/skills/business-analyse/references/review-data-mapping.md +29 -29
- package/templates/skills/business-analyse/references/robustness-checks.md +36 -36
- package/templates/skills/business-analyse/references/spec-auto-inference.md +2 -2
- package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
- package/templates/skills/business-analyse/references/ui-resource-cards.md +1 -1
- package/templates/skills/business-analyse/references/validation-checklist.md +3 -3
- package/templates/skills/business-analyse/references/wireframe-svg-style-guide.md +2 -2
- package/templates/skills/business-analyse/schemas/application-schema.json +8 -8
- package/templates/skills/business-analyse/schemas/feature-schema.json +3 -3
- package/templates/skills/business-analyse/schemas/index-schema.json +47 -0
- package/templates/skills/business-analyse/schemas/project-schema.json +6 -6
- package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +1 -1
- package/templates/skills/business-analyse/schemas/sections/handoff-schema.json +5 -3
- package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +4 -4
- package/templates/skills/business-analyse/schemas/sections/specification-schema.json +1 -1
- package/templates/skills/business-analyse/schemas/shared/common-defs.json +4 -4
- package/templates/skills/business-analyse/steps/step-00-init.md +68 -77
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +54 -180
- package/templates/skills/business-analyse/steps/step-02-structure.md +175 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +198 -0
- package/templates/skills/business-analyse/steps/step-04-consolidate.md +478 -0
- package/templates/skills/business-analyse/steps/step-05-deploy.md +220 -0
- package/templates/skills/business-analyse/steps/step-06-review.md +51 -69
- package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
- package/templates/skills/business-analyse/templates/tpl-handoff.md +20 -17
- package/templates/skills/business-analyse/templates/tpl-launch-displays.md +2 -2
- package/templates/skills/business-analyse/templates-react.md +2 -2
- package/templates/skills/derive-prd/SKILL.md +92 -0
- package/templates/skills/derive-prd/references/acceptance-criteria.md +169 -0
- package/templates/skills/derive-prd/references/entity-domain-mapping.md +115 -0
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-file-templates.md +131 -120
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-mappings.md +95 -95
- package/templates/skills/{business-analyse → derive-prd}/references/handoff-seeddata-generation.md +312 -312
- package/templates/skills/{business-analyse → derive-prd}/references/prd-generation.md +262 -263
- package/templates/skills/derive-prd/references/readiness-scoring.md +104 -0
- package/templates/skills/derive-prd/schemas/handoff-schema.json +95 -0
- package/templates/skills/derive-prd/steps/step-00-validate.md +130 -0
- package/templates/skills/derive-prd/steps/step-01-transform.md +206 -0
- package/templates/skills/derive-prd/steps/step-02-export.md +181 -0
- package/templates/skills/{business-analyse → derive-prd}/templates/tpl-progress.md +172 -172
- package/templates/skills/ralph-loop/SKILL.md +2 -1
- package/templates/skills/ralph-loop/references/init-resume-recovery.md +1 -1
- package/templates/skills/ralph-loop/steps/step-01-task.md +2 -2
- package/templates/skills/apex/references/agent-teams-protocol.md +0 -203
- package/templates/skills/business-analyse/_architecture.md +0 -124
- package/templates/skills/business-analyse/_elicitation.md +0 -206
- package/templates/skills/business-analyse/_module-loop.md +0 -115
- package/templates/skills/business-analyse/_rules.md +0 -142
- package/templates/skills/business-analyse/_suggestions.md +0 -34
- package/templates/skills/business-analyse/questionnaire/00-application.md +0 -160
- package/templates/skills/business-analyse/questionnaire/00b-project.md +0 -85
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +0 -189
- package/templates/skills/business-analyse/questionnaire/03-scope.md +0 -164
- package/templates/skills/business-analyse/questionnaire/04-data.md +0 -88
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +0 -58
- package/templates/skills/business-analyse/questionnaire/06-security.md +0 -68
- package/templates/skills/business-analyse/questionnaire/07-ui.md +0 -76
- package/templates/skills/business-analyse/questionnaire/08-performance.md +0 -42
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +0 -45
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +0 -58
- package/templates/skills/business-analyse/questionnaire/11-data-lifecycle.md +0 -59
- package/templates/skills/business-analyse/questionnaire/12-migration.md +0 -58
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +0 -69
- package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +0 -135
- package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +0 -136
- package/templates/skills/business-analyse/references/agent-module-prompt.md +0 -366
- package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +0 -557
- package/templates/skills/business-analyse/references/cache-warming-strategy.md +0 -566
- package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +0 -41
- package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +0 -74
- package/templates/skills/business-analyse/references/cadrage-pre-analysis.md +0 -115
- package/templates/skills/business-analyse/references/cadrage-shared-modules.md +0 -68
- package/templates/skills/business-analyse/references/cadrage-structure-cards.md +0 -85
- package/templates/skills/business-analyse/references/team-orchestration.md +0 -1093
- package/templates/skills/business-analyse/references/validate-incremental-html.md +0 -121
- package/templates/skills/business-analyse/steps/step-01b-applications.md +0 -419
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +0 -387
- package/templates/skills/business-analyse/steps/step-03a-data.md +0 -16
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +0 -486
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +0 -300
- package/templates/skills/business-analyse/steps/step-03b-ui.md +0 -405
- package/templates/skills/business-analyse/steps/step-03c-compile.md +0 -516
- package/templates/skills/business-analyse/steps/step-03d-validate.md +0 -691
- package/templates/skills/business-analyse/steps/step-04-consolidation.md +0 -17
- package/templates/skills/business-analyse/steps/step-04a-collect.md +0 -415
- package/templates/skills/business-analyse/steps/step-04b-analyze.md +0 -163
- package/templates/skills/business-analyse/steps/step-04c-decide.md +0 -186
- package/templates/skills/business-analyse/steps/step-05a-handoff.md +0 -937
- package/templates/skills/business-analyse/steps/step-05b-deploy.md +0 -522
- package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +0 -703
|
@@ -8,16 +8,17 @@ next_step: steps/step-04-examine.md
|
|
|
8
8
|
|
|
9
9
|
# Step 3: Execute
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
/apex ORCHESTRATES. It does not write SmartStack code directly.
|
|
12
12
|
All code goes through skills (/controller, /application, /ui-components, /efcore) or MCP tools.
|
|
13
13
|
|
|
14
14
|
## LOAD CONDITIONALLY
|
|
15
15
|
|
|
16
|
-
>
|
|
16
|
+
> CONTEXT REUSE: `smartstack-api.md` (loaded in step-01) and `smartstack-layers.md` (loaded in step-02) are already in context. Do not re-read them.
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
18
|
+
- Read `references/core-seed-data.md` — comprehensive seed data templates (needed for Layer 1, released after)
|
|
19
|
+
- Defer `references/smartstack-frontend.md` until Layer 3 — lazy loading, i18n, page structure, CSS variables, EntityLookup (sections 1-6)
|
|
20
|
+
- Defer `references/smartstack-frontend-compliance.md` until Layer 3 — documentation, form testing, compliance gates (sections 7-9)
|
|
21
|
+
- If NOT `{economy_mode}` AND a layer has multi-entity work: read `references/parallel-execution.md`
|
|
21
22
|
- If build failure during execution: read `references/error-classification.md` — error diagnosis categories A-F
|
|
22
23
|
|
|
23
24
|
---
|
|
@@ -29,7 +30,7 @@ All code goes through skills (/controller, /application, /ui-components, /efcore
|
|
|
29
30
|
This is a foundation-only execution (called by ralph-loop Phase 0). Execute ONLY:
|
|
30
31
|
- Layer 0: Domain entities + EF configs + Migration
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
Skip all other layers:
|
|
33
34
|
- Layer 1: Seed Data → SKIP
|
|
34
35
|
- Layer 2: Backend → SKIP
|
|
35
36
|
- Layer 3: Frontend → SKIP
|
|
@@ -41,7 +42,33 @@ After Layer 0 completes and builds successfully:
|
|
|
41
42
|
- End execution
|
|
42
43
|
|
|
43
44
|
**IF `{foundation_mode}` == false:**
|
|
44
|
-
Execute
|
|
45
|
+
Execute all layers (Layer 0 → Layer 1 → Layer 2 → Layer 3 → Layer 4).
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Context Recovery Protocol
|
|
50
|
+
|
|
51
|
+
> **Run this check BEFORE each layer** to survive context compression.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
BEFORE starting Layer N:
|
|
55
|
+
Verify these variables are still accessible:
|
|
56
|
+
{app_name}, {module_code}, {sections}, {entities}, {code_patterns}
|
|
57
|
+
|
|
58
|
+
IF any variable is missing or empty:
|
|
59
|
+
1. Read .claude/output/apex/{task_id}/state.json (if exists)
|
|
60
|
+
→ Restore: completed_layers, completed_entities, files_created
|
|
61
|
+
2. IF state.json missing:
|
|
62
|
+
→ Re-derive from filesystem:
|
|
63
|
+
- {app_name}: Glob("docs/business/*/") → first directory name
|
|
64
|
+
- {module_code}: Glob("src/**/Domain/Entities/*/") → target module directory
|
|
65
|
+
- {entities}: Glob("src/**/Domain/Entities/{module_code}/*.cs") → entity names
|
|
66
|
+
- {sections}: Glob("src/**/Seeding/Data/{module_code}/*NavigationSeedData.cs") → parse GetSectionEntries
|
|
67
|
+
3. IF Layer N-1 was already completed (check state.json or git log):
|
|
68
|
+
→ Skip to Layer N directly
|
|
69
|
+
|
|
70
|
+
Cost: ~5 tool calls. Only triggered if context was compressed.
|
|
71
|
+
```
|
|
45
72
|
|
|
46
73
|
---
|
|
47
74
|
|
|
@@ -64,46 +91,42 @@ For each entity to create/modify:
|
|
|
64
91
|
|
|
65
92
|
### Person Extension Detection
|
|
66
93
|
|
|
94
|
+
**If entity has personRoleConfig (mandatory or optional UserId link):**
|
|
95
|
+
See `references/person-extension-pattern.md` for full entity, EF config, service, DTO, and frontend patterns.
|
|
96
|
+
|
|
67
97
|
```
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
→ VERIFY: EF config has unique index on (TenantId, UserId)
|
|
74
|
-
→ VERIFY (mandatory): entity has ZERO person fields (FirstName, LastName, Email, PhoneNumber)
|
|
75
|
-
→ VERIFY (optional): entity has own person fields + computed Display* properties
|
|
98
|
+
1. scaffold_extension with options: { isPersonRole: true, userLinkMode: 'mandatory' | 'optional' }
|
|
99
|
+
2. Verify: EF config has unique index on (TenantId, UserId)
|
|
100
|
+
→ Mandatory variant: plain .IsUnique()
|
|
101
|
+
→ Optional variant: .IsUnique().HasFilter("[UserId] IS NOT NULL")
|
|
102
|
+
3. Verify all build checks pass before continuing
|
|
76
103
|
```
|
|
77
104
|
|
|
78
105
|
### EF Core Configurations
|
|
79
106
|
|
|
80
107
|
```
|
|
81
108
|
For each entity:
|
|
82
|
-
→
|
|
109
|
+
→ Create IEntityTypeConfiguration<T> manually per smartstack-api.md patterns
|
|
83
110
|
→ Verify: table name, relationships, indexes
|
|
84
111
|
→ Register DbSet in ExtensionsDbContext if new entity
|
|
85
112
|
```
|
|
86
113
|
|
|
87
|
-
### Migration
|
|
114
|
+
### Migration
|
|
88
115
|
|
|
89
|
-
>
|
|
90
|
-
> Root cause (test-apex-007): Migration was created once for 3 entities, then 4 more entities
|
|
91
|
-
> were added later without re-running migration → 4 entities had no database tables.
|
|
92
|
-
> **RULE:** Create/update migration AFTER ALL entities and EF configs are registered in DbContext.
|
|
93
|
-
> If entities are added incrementally, create a NEW migration for each batch.
|
|
116
|
+
> Migration must cover ALL entities. Root cause (test-apex-007): Migration was created once for 3 entities, then 4 more entities were added later without re-running → 4 entities had no tables. Create/update migration AFTER ALL entities and EF configs are registered in DbContext. If entities are added incrementally, create a new migration for each batch.
|
|
94
117
|
|
|
95
118
|
```
|
|
96
|
-
1. Verify
|
|
97
|
-
2. Verify
|
|
119
|
+
1. Verify all entities have been added as DbSet in ExtensionsDbContext
|
|
120
|
+
2. Verify all EF configurations are registered (ApplyConfigurationsFromAssembly or individual)
|
|
98
121
|
3. MCP suggest_migration → get standardized name
|
|
99
122
|
4. dotnet ef migrations add {Name} --project src/{Infra}.csproj --startup-project src/{Api}.csproj -o Persistence/Migrations
|
|
100
123
|
5. dotnet ef database update (if local DB)
|
|
101
|
-
6. dotnet build
|
|
102
|
-
7. Verify: dotnet ef migrations has-pending-model-changes →
|
|
124
|
+
6. dotnet build
|
|
125
|
+
7. Verify: dotnet ef migrations has-pending-model-changes → must report "No pending model changes"
|
|
103
126
|
```
|
|
104
127
|
|
|
105
|
-
|
|
106
|
-
|
|
128
|
+
If build fails after migration, fix EF configs before proceeding.
|
|
129
|
+
If `has-pending-model-changes` reports pending changes, entities are missing from the migration — create a new migration.
|
|
107
130
|
|
|
108
131
|
### Post-Layer 0 Build Gate
|
|
109
132
|
|
|
@@ -112,7 +135,7 @@ dotnet build
|
|
|
112
135
|
# Note: WSL bin\Debug cleanup handled by PostToolUse hook (wsl-dotnet-cleanup.sh)
|
|
113
136
|
```
|
|
114
137
|
|
|
115
|
-
|
|
138
|
+
Must pass before Layer 1. If NuGet error, run `dotnet restore` first. If file lock (MSB3021), use `--output /tmp/{project}_build`.
|
|
116
139
|
|
|
117
140
|
TaskUpdate(taskId: layer0_task_id, status: "completed",
|
|
118
141
|
metadata: { build_gate: "pass" })
|
|
@@ -133,21 +156,17 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
133
156
|
description: "Module: {module_code}. Current: step-03 (Execute), Layer 1",
|
|
134
157
|
activeForm: "Executing Layer 1")
|
|
135
158
|
|
|
136
|
-
>
|
|
137
|
-
> Without seed data, the module exists in code but is invisible to users.
|
|
138
|
-
> Reference: `references/core-seed-data.md` (loaded above) for complete C# templates.
|
|
159
|
+
> This layer is required. Seed data makes modules visible in the UI. Without it, the module exists in code but is invisible to users. Reference: `references/core-seed-data.md` (loaded above) for complete C# templates.
|
|
139
160
|
|
|
140
161
|
### Application-Level Seed Data (ONCE per application)
|
|
141
162
|
|
|
142
163
|
```
|
|
143
164
|
1. NavigationApplicationSeedData.cs
|
|
144
165
|
→ Application-level navigation entry (MUST be first)
|
|
145
|
-
→ Random GUID via Guid.NewGuid()
|
|
146
166
|
→ 4 language translations (fr, en, it, de)
|
|
147
167
|
|
|
148
168
|
2. ApplicationRolesSeedData.cs
|
|
149
169
|
→ 4 roles: admin, manager, contributor, viewer
|
|
150
|
-
→ Random GUIDs (Guid.NewGuid())
|
|
151
170
|
→ References NavigationApplicationSeedData.ApplicationId
|
|
152
171
|
```
|
|
153
172
|
|
|
@@ -155,8 +174,7 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
155
174
|
|
|
156
175
|
```
|
|
157
176
|
3. NavigationModuleSeedData.cs
|
|
158
|
-
→
|
|
159
|
-
→ GetModuleEntry() + GetTranslationEntries()
|
|
177
|
+
→ 4 languages (fr, en, it, de), GetModuleEntry() + GetTranslationEntries()
|
|
160
178
|
→ If sections defined: GetSectionEntries() + GetSectionTranslationEntries()
|
|
161
179
|
→ If resources defined: GetResourceEntries() + resource translations
|
|
162
180
|
→ Query actual parent from DB for FK (NOT deterministic GUID)
|
|
@@ -172,7 +190,7 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
172
190
|
|
|
173
191
|
6. RolesSeedData.cs
|
|
174
192
|
→ Admin=wildcard(*), Manager=CRU, Contributor=CR, Viewer=R
|
|
175
|
-
→ Code-based role mapping (
|
|
193
|
+
→ Code-based role mapping (not deterministic GUIDs for roles)
|
|
176
194
|
→ Look up roles by Code at runtime
|
|
177
195
|
```
|
|
178
196
|
|
|
@@ -194,7 +212,7 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
194
212
|
dotnet build
|
|
195
213
|
```
|
|
196
214
|
|
|
197
|
-
|
|
215
|
+
Must pass before Layer 2.
|
|
198
216
|
|
|
199
217
|
TaskUpdate(taskId: layer1_task_id, status: "completed",
|
|
200
218
|
metadata: { build_gate: "pass" })
|
|
@@ -205,6 +223,8 @@ TaskUpdate(taskId: layer1_task_id, status: "completed",
|
|
|
205
223
|
feat({module}): [seed] navigation, permissions, roles
|
|
206
224
|
```
|
|
207
225
|
|
|
226
|
+
> **Context release:** `references/core-seed-data.md` is no longer needed after Layer 1. Its templates have been consumed. Do not reference it in Layer 2+.
|
|
227
|
+
|
|
208
228
|
---
|
|
209
229
|
|
|
210
230
|
## Layer 2 — Backend (Services + Controllers)
|
|
@@ -224,9 +244,9 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
224
244
|
|
|
225
245
|
### Backend Tasks (sequential or parallel within layer)
|
|
226
246
|
|
|
227
|
-
-
|
|
228
|
-
-
|
|
229
|
-
-
|
|
247
|
+
- Services/DTOs: MCP scaffold_extension
|
|
248
|
+
- Controllers: use /controller skill for complex, MCP scaffold_extension for simple
|
|
249
|
+
- Important: All GetAll endpoints must support `?search=` query parameter (enables EntityLookup on frontend)
|
|
230
250
|
|
|
231
251
|
### Skill Delegation
|
|
232
252
|
|
|
@@ -239,40 +259,36 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
239
259
|
| /notification | In-app or email notifications | trigger, recipients, template |
|
|
240
260
|
| /workflow | Automated workflows | trigger, steps, conditions |
|
|
241
261
|
|
|
242
|
-
### If NOT economy_mode AND multiple entities:
|
|
262
|
+
### If NOT economy_mode AND multiple entities: Parallel Agents (within layer)
|
|
243
263
|
|
|
244
|
-
> **Protocol:** See `references/
|
|
264
|
+
> **Protocol:** See `references/parallel-execution.md`
|
|
245
265
|
|
|
246
266
|
```
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
267
|
+
IF NOT economy_mode AND entities.length > 1:
|
|
268
|
+
For each entity, launch in parallel (single message):
|
|
269
|
+
Agent(subagent_type='Snipper', model='opus',
|
|
270
|
+
prompt='Execute Layer 2 backend for {EntityName}:
|
|
271
|
+
- Application service/DTO: MCP scaffold_extension
|
|
272
|
+
- Controller: /controller skill or MCP scaffold_extension
|
|
273
|
+
- IMPORTANT: GetAll endpoint MUST support ?search= parameter
|
|
274
|
+
- Validators: FluentValidation + DI registration
|
|
275
|
+
- Your task ID is {task_id}. Call TaskUpdate(status: "in_progress") before starting.
|
|
276
|
+
- Call TaskUpdate(status: "completed", metadata: { files_created: [...] }) when done.')
|
|
277
|
+
# All agents launched in parallel
|
|
257
278
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Wait for all teammates to report completion.
|
|
262
|
-
shutdown_request → shutdown_response → TeamDelete("apex-layer2")
|
|
279
|
+
ELSE:
|
|
280
|
+
# Agent principal handles all entities sequentially
|
|
263
281
|
```
|
|
264
282
|
|
|
265
|
-
###
|
|
283
|
+
### Parallel Agents + TaskCreate Integration
|
|
266
284
|
|
|
267
|
-
When
|
|
268
|
-
- Each
|
|
269
|
-
-
|
|
270
|
-
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
285
|
+
When launching agents for multi-entity layers:
|
|
286
|
+
- Each agent receives its task ID and metadata context in the prompt
|
|
287
|
+
- Agent must call TaskUpdate(status: "in_progress") before starting
|
|
288
|
+
- Agent must call TaskUpdate(status: "completed", metadata: { files_created: [...] }) when done
|
|
289
|
+
- Agent principal monitors via TaskList() after all agents complete
|
|
290
|
+
- Agent principal updates activeForm after each entity completion:
|
|
273
291
|
`TaskUpdate(taskId: layer2_task_id, activeForm: "Building {EntityName} backend (2/5 entities)")`
|
|
274
|
-
- Lead updates metadata after each MCP scaffold:
|
|
275
|
-
`TaskUpdate(taskId: layer_task_id, metadata: { files_created: [...previous, "new_file.cs"] })`
|
|
276
292
|
|
|
277
293
|
### Post-Layer 2 Build Gate
|
|
278
294
|
|
|
@@ -280,7 +296,7 @@ When spawning teammates for multi-entity layers:
|
|
|
280
296
|
dotnet build
|
|
281
297
|
```
|
|
282
298
|
|
|
283
|
-
|
|
299
|
+
Must pass before backend tests.
|
|
284
300
|
|
|
285
301
|
TaskUpdate(taskId: layer2_task_id, status: "completed",
|
|
286
302
|
metadata: { build_gate: "pass" })
|
|
@@ -319,10 +335,17 @@ feat({module}): [app+api] {short description}
|
|
|
319
335
|
test({module}): backend unit and integration tests
|
|
320
336
|
```
|
|
321
337
|
|
|
338
|
+
> **Context release:** `references/smartstack-api.md` entity patterns and `references/smartstack-layers.md` Layer 2 rules have been consumed. Layer 3 only needs their frontend sections (already covered by `smartstack-frontend.md`).
|
|
339
|
+
|
|
322
340
|
---
|
|
323
341
|
|
|
324
342
|
## Layer 3 — Frontend (Pages + I18n + Documentation)
|
|
325
343
|
|
|
344
|
+
### Load Frontend References (deferred from top of step)
|
|
345
|
+
|
|
346
|
+
- Read `references/smartstack-frontend.md` now — lazy loading, i18n, page structure, CSS variables, EntityLookup (sections 1-6)
|
|
347
|
+
- Read `references/smartstack-frontend-compliance.md` now — documentation, form testing, compliance gates (sections 7-9)
|
|
348
|
+
|
|
326
349
|
### Task Progress
|
|
327
350
|
TaskUpdate(taskId: layer3_task_id, status: "in_progress")
|
|
328
351
|
TaskUpdate(taskId: progress_tracker_id,
|
|
@@ -334,7 +357,7 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
334
357
|
> - Route scaffolding (MCP scaffold_routes) — section 1 + 3b
|
|
335
358
|
> - Page types (ListPage, DetailPage, CreatePage, EditPage) — section 3
|
|
336
359
|
> - FK field handling (EntityLookup component) — section 6
|
|
337
|
-
> - Form structure (
|
|
360
|
+
> - Form structure (no modals — all full pages) — section 3b
|
|
338
361
|
> - Detail page tabs (local state only) — section 3 "Tab Behavior Rules"
|
|
339
362
|
> - Testing patterns (co-located form tests) — section 8
|
|
340
363
|
> - Section-level routes and permissions — section 3b
|
|
@@ -344,50 +367,56 @@ TaskUpdate(taskId: progress_tracker_id,
|
|
|
344
367
|
### Frontend Tasks (sequential or parallel within layer)
|
|
345
368
|
|
|
346
369
|
For each module:
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
370
|
+
- API client: MCP scaffold_api_client
|
|
371
|
+
- Routes: MCP scaffold_routes (outputFormat: 'applicationRoutes') → generates lazy imports + Suspense
|
|
372
|
+
- Wire Routes to App.tsx: After scaffold_routes, routes must be wired into App.tsx:
|
|
350
373
|
→ Read App.tsx and detect the routing pattern
|
|
351
|
-
→
|
|
352
|
-
→
|
|
353
|
-
→
|
|
354
|
-
→
|
|
374
|
+
→ Pattern A (`applicationRoutes: ApplicationRouteExtensions`): add routes to `applicationRoutes['{application_kebab}'][]` with RELATIVE paths
|
|
375
|
+
→ Pattern B (JSX `<Route>`): nest routes inside `<Route path="/{application}" element={<AppLayout />}>` + duplicate in tenant block
|
|
376
|
+
→ Do not add business routes to `clientRoutes[]` — it is only for non-app routes (`/about`, `/pricing`)
|
|
377
|
+
→ All business applications use `<AppLayout />` as layout wrapper
|
|
355
378
|
→ See `references/frontend-route-wiring-app-tsx.md` for full Pattern A/B detection and examples
|
|
356
379
|
→ Verify: `mcp__smartstack__validate_frontend_routes (scope: 'routes')`
|
|
357
|
-
-
|
|
380
|
+
- Pages: use /ui-components skill — follow smartstack-frontend.md patterns:
|
|
358
381
|
→ React.lazy() for all page imports (named export wrapping)
|
|
359
382
|
→ `<Suspense fallback={<PageLoader />}>` around all lazy components
|
|
360
383
|
→ Page structure: hooks → useEffect(load) → loading → error → content
|
|
361
384
|
→ CSS variables only: bg-[var(--bg-card)], text-[var(--text-primary)]
|
|
362
|
-
→ DataTable/EntityCard (
|
|
385
|
+
→ DataTable/EntityCard (not raw HTML `<table>`)
|
|
363
386
|
→ If entity has FK Guid fields: generate EntityLookup component in @/components/ui/EntityLookup (see smartstack-frontend.md section 6)
|
|
364
387
|
→ Dashboard pages: generate StatCard + ChartCard locally (see ui-components patterns/dashboard-chart.md)
|
|
365
|
-
-
|
|
388
|
+
- Form pages: Create/Edit forms are full pages with own routes:
|
|
366
389
|
→ EntityCreatePage.tsx with route /{module}/create
|
|
367
390
|
→ EntityEditPage.tsx with route /{module}/:id/edit
|
|
368
|
-
→
|
|
391
|
+
→ Zero modals/popups/drawers/dialogs for forms
|
|
369
392
|
→ Back button with navigate(-1) on every form page
|
|
370
393
|
→ See smartstack-frontend.md section 3b for templates
|
|
371
|
-
-
|
|
372
|
-
→ Tab click handler: setActiveTab(tabKey)
|
|
394
|
+
- Tabs on detail pages: Tabs must switch content locally:
|
|
395
|
+
→ Tab click handler: setActiveTab(tabKey) only — do not navigate() to another page
|
|
373
396
|
→ Tab content: render inline with {activeTab === 'tabKey' && <TabContent />}
|
|
374
397
|
→ Sub-resource data: fetch via API filtered by parent ID, display in tab panel
|
|
375
|
-
→
|
|
398
|
+
→ Do not use navigate('../leaves?employee=${id}') in tab handler
|
|
376
399
|
→ See smartstack-frontend.md section 3 'Tab Behavior Rules'
|
|
377
|
-
-
|
|
378
|
-
→
|
|
379
|
-
→
|
|
380
|
-
→
|
|
400
|
+
- FK fields: Foreign key Guid fields (e.g., EmployeeId) must use EntityLookup:
|
|
401
|
+
→ Do not render FK fields as `<input>` — users cannot type GUIDs
|
|
402
|
+
→ Do not render FK fields as `<select>` — even with API-loaded options, `<select>` is not acceptable
|
|
403
|
+
→ Only use `<EntityLookup />` from @/components/ui/EntityLookup for searchable selection
|
|
381
404
|
→ Each FK field needs: apiEndpoint, mapOption (display name), search support on backend
|
|
382
|
-
→
|
|
405
|
+
→ Do not use `<select value={formData.departmentId}>`, `<option value={dept.id}>`, `e.target.value` for FK fields
|
|
383
406
|
→ See smartstack-frontend.md section 6 for the full EntityLookup pattern
|
|
384
|
-
-
|
|
407
|
+
- I18n: Generate 4 JSON files per module namespace (fr, en, it, de)
|
|
385
408
|
→ Follow JSON template from smartstack-frontend.md
|
|
386
409
|
→ Keys: actions, labels, errors, validation, columns, form, messages, empty
|
|
387
|
-
→
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
410
|
+
→ All t() calls must use namespace prefix + fallback: t('ns:key', 'Default text')
|
|
411
|
+
→ **Register namespace in i18n config** (critical — POST-CHECK C39 catches this, but fix it now):
|
|
412
|
+
1. Find i18n config: `Glob("src/**/i18n/config.ts")` or `index.ts` or `i18n.ts`
|
|
413
|
+
2. Read the config → find the resources/ns registration pattern
|
|
414
|
+
3. Add the new namespace import + registration for all 4 languages
|
|
415
|
+
4. If config uses dynamic imports: add namespace to the `ns` array
|
|
416
|
+
5. Verify: `grep -q "{module_namespace}" src/**/i18n/config.ts` → must match
|
|
417
|
+
- Permissions: Call MCP generate_permissions for the module permission root (2 segments: {app}.{module}),
|
|
418
|
+
then also call MCP generate_permissions for each section (3 segments: {app}.{module}.{section}).
|
|
419
|
+
- Section routes: Add section child routes to the module's children array.
|
|
391
420
|
Wire PermissionGuard for section routes with section-level permissions.
|
|
392
421
|
- MUST use src/pages/{App}/{Module}/ hierarchy (NOT flat)
|
|
393
422
|
|
|
@@ -411,63 +440,55 @@ This generates:
|
|
|
411
440
|
- Import: `import { DocToggleButton } from '@/components/docs/DocToggleButton';`
|
|
412
441
|
- Placement: inside the header actions area (see `smartstack-frontend.md` section 7)
|
|
413
442
|
|
|
414
|
-
### If NOT economy_mode AND multiple entities:
|
|
415
|
-
|
|
416
|
-
> **Protocol:** See `references/
|
|
417
|
-
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
When spawning teammates for multi-entity layers:
|
|
452
|
-
- Each teammate receives its task ID and metadata context in the prompt
|
|
453
|
-
- Teammate MUST call TaskUpdate(status: "in_progress") before starting
|
|
454
|
-
- Teammate MUST call TaskUpdate(status: "completed", metadata: { files_created: [...] }) after SendMessage("ENTITY_COMPLETE")
|
|
455
|
-
- Lead monitors via TaskList() between teammate completions
|
|
456
|
-
- Lead updates activeForm after each entity completion:
|
|
443
|
+
### If NOT economy_mode AND multiple entities: Parallel Agents (within layer)
|
|
444
|
+
|
|
445
|
+
> **Protocol:** See `references/parallel-execution.md`
|
|
446
|
+
|
|
447
|
+
```
|
|
448
|
+
IF NOT economy_mode AND entities.length > 1:
|
|
449
|
+
For each entity, launch in parallel (single message):
|
|
450
|
+
Agent(subagent_type='Snipper', model='opus',
|
|
451
|
+
prompt='Execute Layer 3 frontend for {EntityName}:
|
|
452
|
+
**MANDATORY: Read references/smartstack-frontend.md FIRST**
|
|
453
|
+
- API client: MCP scaffold_api_client
|
|
454
|
+
- Routes: MCP scaffold_routes (outputFormat: "applicationRoutes")
|
|
455
|
+
- Wire Routes to App.tsx (BLOCKING): detect Pattern A/B, wire accordingly
|
|
456
|
+
→ See references/frontend-route-wiring-app-tsx.md for full patterns
|
|
457
|
+
→ Verify: mcp__smartstack__validate_frontend_routes (scope: "routes")
|
|
458
|
+
- Pages: /ui-components skill (ALL 4 types: List, Detail, Create, Edit)
|
|
459
|
+
- I18n: 4 JSON files (fr, en, it, de) + REGISTER namespace in i18n config
|
|
460
|
+
- FORM PAGES: Full pages with own routes (no modals)
|
|
461
|
+
- FK FIELDS: EntityLookup for all FK Guid fields
|
|
462
|
+
- TABS: Local state only (NEVER navigate())
|
|
463
|
+
- FORM TESTS: Co-located .test.tsx for Create and Edit pages
|
|
464
|
+
- Your task ID is {task_id}. Call TaskUpdate(status: "in_progress") before starting.
|
|
465
|
+
- Call TaskUpdate(status: "completed", metadata: { files_created: [...] }) when done.')
|
|
466
|
+
# All agents launched in parallel
|
|
467
|
+
|
|
468
|
+
ELSE:
|
|
469
|
+
# Agent principal handles all entities sequentially
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Parallel Agents + TaskCreate Integration
|
|
473
|
+
|
|
474
|
+
When launching agents for multi-entity layers:
|
|
475
|
+
- Each agent receives its task ID and metadata context in the prompt
|
|
476
|
+
- Agent must call TaskUpdate(status: "in_progress") before starting
|
|
477
|
+
- Agent must call TaskUpdate(status: "completed", metadata: { files_created: [...] }) when done
|
|
478
|
+
- Agent principal monitors via TaskList() after all agents complete
|
|
479
|
+
- Agent principal updates activeForm after each entity completion:
|
|
457
480
|
`TaskUpdate(taskId: layer3_task_id, activeForm: "Building {EntityName} frontend (2/5 entities)")`
|
|
458
|
-
- Lead updates metadata after each MCP scaffold:
|
|
459
|
-
`TaskUpdate(taskId: layer_task_id, metadata: { files_created: [...previous, "NewPage.tsx"] })`
|
|
460
481
|
|
|
461
|
-
###
|
|
482
|
+
### Frontend Compliance Gate
|
|
462
483
|
|
|
463
|
-
>
|
|
484
|
+
> See `references/smartstack-frontend.md` section 9 "Compliance Gates" for all 5 required checks:
|
|
464
485
|
> 1. CSS Variables (theme system)
|
|
465
|
-
> 2. Forms as Pages (
|
|
486
|
+
> 2. Forms as Pages (zero modals/drawers/slide-overs)
|
|
466
487
|
> 3. I18n File Structure (4 languages, separate JSON files)
|
|
467
488
|
> 4. Lazy Loading (React.lazy() — no static imports)
|
|
468
489
|
> 5. useTranslation in Pages (all text translated)
|
|
469
490
|
|
|
470
|
-
|
|
491
|
+
Do not commit frontend changes until all 5 gates pass.
|
|
471
492
|
|
|
472
493
|
When delegating to `/ui-components` skill, include explicit instructions:
|
|
473
494
|
- "CSS: Use CSS variables ONLY — `bg-[var(--bg-card)]`, `text-[var(--text-primary)]`."
|
|
@@ -510,7 +531,7 @@ When delegating to `/ui-components` skill, include explicit instructions:
|
|
|
510
531
|
npm run typecheck
|
|
511
532
|
```
|
|
512
533
|
|
|
513
|
-
|
|
534
|
+
Must pass before commit.
|
|
514
535
|
|
|
515
536
|
TaskUpdate(taskId: layer3_task_id, status: "completed",
|
|
516
537
|
metadata: { build_gate: "pass" })
|
|
@@ -595,6 +616,40 @@ Layer 4: feat({module}): [devdata] test data for development # if applicable
|
|
|
595
616
|
|
|
596
617
|
---
|
|
597
618
|
|
|
619
|
+
## State Auto-Save (after each layer)
|
|
620
|
+
|
|
621
|
+
> **Automatic** — not dependent on `-s` flag. Enables reliable resume after context loss.
|
|
622
|
+
|
|
623
|
+
After each layer's build gate passes, write state to `.claude/output/apex/{task_id}/state.json`:
|
|
624
|
+
|
|
625
|
+
```json
|
|
626
|
+
{
|
|
627
|
+
"step": 3,
|
|
628
|
+
"layer": 2,
|
|
629
|
+
"completed_layers": [0, 1, 2],
|
|
630
|
+
"completed_entities": ["Employee", "Department"],
|
|
631
|
+
"files_created": ["Employee.cs", "EmployeeConfiguration.cs", "..."],
|
|
632
|
+
"build_gates": { "layer0": "pass", "layer1": "pass", "layer2": "pass" },
|
|
633
|
+
"commits": ["abc1234", "def5678", "ghi9012"],
|
|
634
|
+
"timestamp": "2026-03-06T14:30:00Z"
|
|
635
|
+
}
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
```
|
|
639
|
+
IF .claude/output/apex/{task_id}/ does not exist:
|
|
640
|
+
Generate {task_id} from timestamp (e.g., "20260306-143000")
|
|
641
|
+
Create directory
|
|
642
|
+
|
|
643
|
+
After EACH layer build gate passes:
|
|
644
|
+
Read existing state.json (or create new)
|
|
645
|
+
Update: layer, completed_layers, completed_entities, files_created, build_gates, commits
|
|
646
|
+
Write back to state.json
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
This file is consumed by resume mode (`-r`) to skip completed layers instead of re-deriving from git.
|
|
650
|
+
|
|
651
|
+
---
|
|
652
|
+
|
|
598
653
|
## Save Output (if save_mode)
|
|
599
654
|
|
|
600
655
|
Write to `{output_dir}/03-execute.md` with execution log per layer.
|