@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,169 @@
1
+ ---
2
+ name: step-01-analyze
3
+ description: Explore existing code to understand what exists — do NOT plan yet
4
+ model: opus
5
+ prev_step: steps/step-00-init.md
6
+ next_step: steps/step-02-plan.md
7
+ ---
8
+
9
+ # Step 1: Analyze
10
+
11
+ **Goal:** Understand what EXISTS in the codebase. Pure exploration, NO planning.
12
+
13
+ ## LOAD CONDITIONALLY
14
+
15
+ - If NOT `{economy_mode}`: read `references/agent-teams-protocol.md`
16
+
17
+ ---
18
+
19
+ ## 1. Context Sources
20
+
21
+ Read available context (in order of priority):
22
+
23
+ **A. PRD (if exists):**
24
+ ```
25
+ Read {prd_path} → extract:
26
+ - filesToCreate (7 categories)
27
+ - brToCodeMapping
28
+ - permissionMatrix
29
+ - acceptance criteria
30
+ ```
31
+
32
+ **B. Feature.json (if exists):**
33
+ ```
34
+ Read {feature_path} → extract:
35
+ - Module structure (sections, resources)
36
+ - Business rules
37
+ - Entity definitions
38
+ - Permission structure
39
+ ```
40
+
41
+ **C. Task description only:**
42
+ If neither PRD nor feature.json exists, rely on task description and code exploration.
43
+
44
+ ---
45
+
46
+ ## 2. Code Exploration
47
+
48
+ ### If economy_mode: Direct Tools
49
+
50
+ Use Glob, Grep, Read, and MCP tools directly:
51
+
52
+ ```
53
+ Backend:
54
+ - Glob("**/Domain/Entities/**/{module_code}/**/*.cs")
55
+ - Glob("**/Infrastructure/Persistence/Configurations/**/{module_code}/**/*.cs")
56
+ - Glob("**/Application/Services/**/{module_code}/**/*.cs")
57
+ - Glob("**/Api/Controllers/**/*{module_code}*Controller.cs")
58
+ - Glob("**/Infrastructure/Persistence/Seeding/Data/{module_code}/**/*.cs")
59
+
60
+ Frontend:
61
+ - Glob("src/pages/**/{module_code}/**/*.tsx")
62
+ - Glob("src/components/**/{module_code}/**/*.tsx")
63
+
64
+ MCP:
65
+ - mcp__smartstack__api_docs → existing API surface
66
+ - mcp__smartstack__analyze_extension_points → React extension points
67
+ ```
68
+
69
+ ### If NOT economy_mode: Agent Teams
70
+
71
+ > **Protocol:** See `references/agent-teams-protocol.md`
72
+
73
+ ```
74
+ TeamCreate("apex-analyze", description: "Scan SmartStack project for existing code")
75
+
76
+ Spawn 3 teammates (Sonnet, read-only tools: Glob, Grep, Read):
77
+
78
+ 1. scan-backend:
79
+ "Scan backend code for module {module_code} in app {app_name}.
80
+ Find: entities, EF configs, services, DTOs, validators, controllers.
81
+ Report: file paths, class names, key patterns found.
82
+ Folders: Domain/, Infrastructure/, Application/, Api/"
83
+
84
+ 2. scan-frontend:
85
+ "Scan frontend code for module {module_code} in app {app_name}.
86
+ Find: pages, components, hooks, i18n files, route definitions.
87
+ Report: file paths, component names, route patterns.
88
+ Folders: src/pages/, src/components/, src/locales/"
89
+
90
+ 3. scan-context:
91
+ "Read context artifacts for module {module_code} in app {app_name}.
92
+ Read: .ralph/prd-{module_code}.json, docs/business/**/feature.json.
93
+ Report: sections, entities, business rules, permissions, acceptance criteria."
94
+
95
+ Wait for all 3 teammates to report via SendMessage (DM to lead).
96
+ Aggregate results.
97
+
98
+ Shutdown teammates → TeamDelete("apex-analyze")
99
+ ```
100
+
101
+ ---
102
+
103
+ ## 3. Seed Data Inventory
104
+
105
+ Check existing seed data:
106
+
107
+ ```
108
+ Glob("**/Seeding/Data/{module_code}/*SeedData.cs")
109
+ Glob("**/Seeding/*SeedDataProvider.cs")
110
+ ```
111
+
112
+ Identify:
113
+ - NavigationModuleSeedData: exists? complete?
114
+ - PermissionsSeedData: exists? complete?
115
+ - RolesSeedData: exists? complete?
116
+ - SeedConstants: exists?
117
+ - IClientSeedDataProvider: exists? registered in DI?
118
+
119
+ ---
120
+
121
+ ## 4. Gap Analysis
122
+
123
+ Compare what EXISTS vs what the TASK REQUIRES:
124
+
125
+ ```
126
+ For each element in the task description:
127
+ - EXISTS and COMPLETE → mark as "skip"
128
+ - EXISTS but INCOMPLETE → mark as "modify"
129
+ - DOES NOT EXIST → mark as "create"
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 5. Analysis Summary
135
+
136
+ ```
137
+ **APEX SmartStack - Analysis Complete**
138
+
139
+ **Existing Code:**
140
+ - Entities: {list with paths}
141
+ - EF Configs: {list with paths}
142
+ - Services: {list with paths}
143
+ - Controllers: {list with paths}
144
+ - Frontend pages: {list with paths}
145
+ - Seed data: {status per type}
146
+ - Tests: {list with paths}
147
+
148
+ **Required Changes:**
149
+ - Create: {list of new files/elements}
150
+ - Modify: {list of files to change}
151
+ - Skip: {list of existing complete elements}
152
+
153
+ **Acceptance Criteria:** (inferred from PRD/feature/task)
154
+ - AC1: {criterion}
155
+ - AC2: {criterion}
156
+ ...
157
+ ```
158
+
159
+ ---
160
+
161
+ ## 6. Save Output (if save_mode)
162
+
163
+ Write to `{output_dir}/01-analyze.md` with analysis results.
164
+
165
+ ---
166
+
167
+ ## NEXT STEP
168
+
169
+ Load `steps/step-02-plan.md`
@@ -0,0 +1,160 @@
1
+ ---
2
+ name: step-02-plan
3
+ description: Create layer-by-layer execution plan with skill/MCP mapping per file
4
+ model: opus
5
+ prev_step: steps/step-01-analyze.md
6
+ next_step: steps/step-03-execute.md
7
+ ---
8
+
9
+ # Step 2: Plan
10
+
11
+ **Goal:** Create a precise, file-by-file plan. Each file mapped to a SKILL or MCP tool.
12
+
13
+ ## LOAD CONDITIONALLY
14
+
15
+ Read `references/smartstack-layers.md` for layer execution rules and skill/MCP mapping.
16
+
17
+ ---
18
+
19
+ ## 1. Map Changes to Layers
20
+
21
+ For each element identified in step-01 (create or modify), assign to a SmartStack layer:
22
+
23
+ | Layer | Category | Order |
24
+ |-------|----------|-------|
25
+ | 0 | Domain (entities, enums, exceptions) | Sequential |
26
+ | 0 | Infrastructure - EF Configs | Sequential |
27
+ | 0 | Infrastructure - Migration (BLOCKING) | Sequential |
28
+ | 1 | Application (services, DTOs, validators) | Parallel |
29
+ | 1 | API (controllers) | Parallel |
30
+ | 1 | Infrastructure - Seed Data | Parallel |
31
+ | 2 | Frontend (pages, components) | Parallel |
32
+ | 2 | I18n (translations) | Parallel |
33
+ | 3 | Tests | Sequential |
34
+
35
+ ---
36
+
37
+ ## 2. Assign Skill/MCP per File
38
+
39
+ For EACH file in the plan, specify HOW it will be created/modified:
40
+
41
+ ```markdown
42
+ ### Layer 0 — Domain + Infrastructure (sequential)
43
+
44
+ | # | File | Action | Tool |
45
+ |---|------|--------|------|
46
+ | 1 | Domain/Entities/.../MyEntity.cs | create | MCP scaffold_extension |
47
+ | 2 | Infrastructure/.../MyEntityConfiguration.cs | create | MCP scaffold_extension |
48
+ | 3 | Migration | create | MCP suggest_migration + dotnet ef |
49
+
50
+ ### Layer 1 — Application + API (parallel)
51
+
52
+ | # | File | Action | Tool |
53
+ |---|------|--------|------|
54
+ | 4 | Application/Services/.../MyService.cs | create | MCP scaffold_extension |
55
+ | 5 | Application/DTOs/.../MyDto.cs | create | MCP scaffold_extension |
56
+ | 6 | Api/Controllers/.../MyController.cs | create | /controller skill |
57
+ | 7 | Seeding/Data/.../NavigationModuleSeedData.cs | create | MCP generate_permissions |
58
+ | 8 | Seeding/Data/.../PermissionsSeedData.cs | create | MCP generate_permissions |
59
+ | 9 | Seeding/Data/.../RolesSeedData.cs | create | ref smartstack-layers.md |
60
+
61
+ ### Layer 2 — Frontend + I18n (parallel)
62
+
63
+ | # | File | Action | Tool |
64
+ |---|------|--------|------|
65
+ | 10 | src/pages/{Ctx}/{App}/{Mod}/ListPage.tsx | create | /ui-components skill |
66
+ | 11 | src/services/api/{module}Api.ts | create | MCP scaffold_api_client |
67
+ | 12 | src/routes/{module}.tsx | create | MCP scaffold_routes |
68
+ | 13 | src/locales/fr/{module}.json | create | manual (4 languages) |
69
+
70
+ ### Layer 3 — Tests (sequential, if -t)
71
+
72
+ | # | File | Action | Tool |
73
+ |---|------|--------|------|
74
+ | 14 | tests/.../MyEntityTests.cs | create | MCP scaffold_tests |
75
+ | 15 | tests/.../MyServiceTests.cs | create | MCP scaffold_tests |
76
+ ```
77
+
78
+ ---
79
+
80
+ ## 3. Identify Parallelization (Agent Teams)
81
+
82
+ If NOT economy_mode AND Layer 1 has both backend and frontend work:
83
+
84
+ ```
85
+ Layer 0: SEQUENTIAL (agent principal)
86
+ → domain + infra + migration
87
+ → dotnet build --no-restore (BLOCKING)
88
+
89
+ Layer 1: PARALLEL (Agent Teams)
90
+ → exec-backend: application + api + seed data
91
+ → exec-frontend: frontend + i18n
92
+
93
+ Layer 2: SEQUENTIAL (agent principal)
94
+ → final validation + tests
95
+ ```
96
+
97
+ If economy_mode: ALL layers sequential, agent principal only.
98
+
99
+ ---
100
+
101
+ ## 4. Dependency Validation
102
+
103
+ Verify the plan respects dependencies:
104
+
105
+ ```
106
+ - Migration AFTER EF configs (always)
107
+ - Application services AFTER domain entities (always)
108
+ - Controllers AFTER application services (always)
109
+ - Frontend AFTER API controllers (API contract needed)
110
+ - Seed data AFTER navigation module exists
111
+ - Tests AFTER all code layers complete
112
+ - Build check between Layer 0 and Layer 1 (BLOCKING)
113
+ ```
114
+
115
+ ---
116
+
117
+ ## 5. Estimated Commits
118
+
119
+ ```
120
+ feat({module}): [domain+infra] {description}
121
+ feat({module}): [app+api] {description}
122
+ feat({module}): [frontend] {description}
123
+ feat({module}): [seed] {description}
124
+ feat({module}): [tests] {description} # if -t
125
+ ```
126
+
127
+ ---
128
+
129
+ ## 6. User Checkpoint (if NOT auto_mode)
130
+
131
+ Present the plan and ask for validation:
132
+
133
+ ```yaml
134
+ questions:
135
+ - header: "Plan"
136
+ question: "Does this execution plan look correct?"
137
+ options:
138
+ - label: "Approve and execute (Recommended)"
139
+ description: "Proceed with the plan as described"
140
+ - label: "Modify plan"
141
+ description: "I want to adjust some items"
142
+ - label: "Cancel"
143
+ description: "Abort the workflow"
144
+ multiSelect: false
145
+ ```
146
+
147
+ If "Modify plan": ask what to change, update plan, re-present.
148
+ If "Cancel": abort workflow.
149
+
150
+ ---
151
+
152
+ ## 7. Save Output (if save_mode)
153
+
154
+ Write to `{output_dir}/02-plan.md` with the complete plan.
155
+
156
+ ---
157
+
158
+ ## NEXT STEP
159
+
160
+ Load `steps/step-03-execute.md`
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: step-03-execute
3
+ description: Orchestrate code creation via existing skills and MCP tools
4
+ model: opus
5
+ prev_step: steps/step-02-plan.md
6
+ next_step: steps/step-04-validate.md
7
+ ---
8
+
9
+ # Step 3: Execute
10
+
11
+ **CRITICAL PRINCIPLE: /apex ORCHESTRATES. It NEVER writes SmartStack code directly.**
12
+ All code goes through skills (/controller, /application, /ui-components, /efcore) or MCP tools.
13
+
14
+ ## LOAD CONDITIONALLY
15
+
16
+ - Read `references/smartstack-layers.md` for execution rules per layer
17
+ - If NOT `{economy_mode}` AND Layer 1 has parallel work: read `references/agent-teams-protocol.md`
18
+
19
+ ---
20
+
21
+ ## Layer 0 — Domain + Infrastructure (sequential, agent principal)
22
+
23
+ ### Domain Entities
24
+
25
+ ```
26
+ For each entity to create/modify:
27
+ → MCP scaffold_extension (type: "entity", target: entity_name)
28
+ → Verify: inherits AuditableEntity, has IHasData if multi-tenant
29
+ ```
30
+
31
+ ### EF Core Configurations
32
+
33
+ ```
34
+ For each entity:
35
+ → MCP scaffold_extension (type: "configuration", target: entity_name)
36
+ → Verify: table name, relationships, indexes
37
+ → Register DbSet in ExtensionsDbContext if new entity
38
+ ```
39
+
40
+ ### Migration (BLOCKING)
41
+
42
+ ```
43
+ 1. MCP suggest_migration → get standardized name
44
+ 2. dotnet ef migrations add {Name} --project src/{Infra}.csproj --startup-project src/{Api}.csproj -o Persistence/Migrations
45
+ 3. dotnet ef database update (if local DB)
46
+ 4. dotnet build --no-restore → MUST PASS
47
+ ```
48
+
49
+ **BLOCKING:** If build fails after migration, fix EF configs before proceeding.
50
+
51
+ ### Post-Layer 0 Build Gate
52
+
53
+ ```bash
54
+ dotnet build --no-restore
55
+ ```
56
+
57
+ **MUST PASS before Layer 1. If failure, fix and retry.**
58
+
59
+ ---
60
+
61
+ ## Layer 1 — Application + API + Seed Data
62
+
63
+ ### If economy_mode: Sequential execution
64
+
65
+ Execute each item from the plan sequentially using skills and MCP.
66
+
67
+ ### If NOT economy_mode: Agent Teams (parallel)
68
+
69
+ > **Protocol:** See `references/agent-teams-protocol.md`
70
+
71
+ ```
72
+ TeamCreate("apex-exec", description: "Execute Layer 1 in parallel")
73
+
74
+ Spawn 2 teammates (Opus, full tools):
75
+
76
+ 1. exec-backend (team_name: "apex-exec", name: "exec-backend"):
77
+ "Execute these Layer 1 backend tasks for module {module_code}:
78
+ {list of application + api + seed data tasks from plan}
79
+
80
+ For each task:
81
+ - Application services/DTOs: MCP scaffold_extension
82
+ - Controllers: use /controller skill for complex, MCP scaffold_extension for simple
83
+ - Seed data: MCP generate_permissions, then follow smartstack-layers.md templates
84
+
85
+ After ALL tasks done:
86
+ SendMessage(type:'message', recipient:'team-lead', content:'BACKEND_COMPLETE', summary:'Backend layer done')"
87
+
88
+ 2. exec-frontend (team_name: "apex-exec", name: "exec-frontend"):
89
+ "Execute these Layer 1 frontend tasks for module {module_code}:
90
+ {list of frontend + i18n tasks from plan}
91
+
92
+ For each task:
93
+ - API client: MCP scaffold_api_client
94
+ - Routes: MCP scaffold_routes
95
+ - Pages: use /ui-components skill
96
+ - I18n: 4 languages (fr, en, it, de)
97
+ - MUST use src/pages/{Context}/{App}/{Module}/ hierarchy (NOT flat)
98
+
99
+ After ALL tasks done:
100
+ SendMessage(type:'message', recipient:'team-lead', content:'FRONTEND_COMPLETE', summary:'Frontend layer done')"
101
+
102
+ Wait for both teammates to report completion.
103
+
104
+ Build verification:
105
+ dotnet build --no-restore (backend)
106
+ npm run typecheck (frontend, if applicable)
107
+
108
+ shutdown_request → shutdown_response → TeamDelete("apex-exec")
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Layer 1 — Skill Delegation
114
+
115
+ | Skill | When | Context to provide |
116
+ |-------|------|--------------------|
117
+ | /controller | Custom routes, complex auth, file upload | entity, CRUD actions, permissions, routes |
118
+ | /application | Full context/app/module from scratch | context, app, module names |
119
+ | /ui-components | Complex pages (tables, grids, dashboards) | entity, fields, page type |
120
+ | /efcore | Complex EF configs, inheritance | relationships, indexes |
121
+ | /notification | In-app or email notifications | trigger, recipients, template |
122
+ | /workflow | Automated workflows | trigger, steps, conditions |
123
+
124
+ ---
125
+
126
+ ## Layer 2 — Final Seed Data + Validation (sequential)
127
+
128
+ After Layer 1 completes:
129
+
130
+ ```
131
+ 1. Verify seed data completeness:
132
+ - NavigationModuleSeedData.cs with 4 languages
133
+ - PermissionsSeedData.cs with deterministic GUIDs
134
+ - RolesSeedData.cs with context-based role mapping
135
+ - IClientSeedDataProvider updated
136
+ - DI registration added
137
+
138
+ 2. Build gate:
139
+ dotnet build --no-restore → MUST PASS
140
+ npm run typecheck → MUST PASS (if frontend)
141
+ ```
142
+
143
+ ---
144
+
145
+ ## Commits Per Layer
146
+
147
+ After each layer completes and builds pass:
148
+
149
+ ```
150
+ Layer 0: feat({module}): [domain+infra] {short description}
151
+ Layer 1: feat({module}): [app+api] {short description}
152
+ Layer 1: feat({module}): [frontend] {short description} # if applicable
153
+ Layer 2: feat({module}): [seed] {short description} # if applicable
154
+ ```
155
+
156
+ ---
157
+
158
+ ## Save Output (if save_mode)
159
+
160
+ Write to `{output_dir}/03-execute.md` with execution log per layer.
161
+
162
+ ---
163
+
164
+ ## NEXT STEP
165
+
166
+ Load `steps/step-04-validate.md`
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: step-04-validate
3
+ description: MCP validation, build verification, seed data check, acceptance criteria
4
+ model: opus
5
+ prev_step: steps/step-03-execute.md
6
+ next_step: steps/step-05-examine.md
7
+ ---
8
+
9
+ # Step 4: Validate
10
+
11
+ **Goal:** Verify everything works. MCP conventions, build, seed data, acceptance criteria.
12
+
13
+ ---
14
+
15
+ ## 1. MCP Convention Validation
16
+
17
+ ```
18
+ Call: mcp__smartstack__validate_conventions
19
+
20
+ Expected: 0 errors
21
+ If errors found:
22
+ → Fix each error (use appropriate skill/MCP)
23
+ → Re-validate until 0 errors
24
+ ```
25
+
26
+ ---
27
+
28
+ ## 2. EF Core Migration Check (if needs_migration)
29
+
30
+ ```
31
+ Call: mcp__smartstack__check_migrations
32
+
33
+ Verify:
34
+ - Migration exists and is applied
35
+ - No pending model changes
36
+ - ModelSnapshot matches
37
+ ```
38
+
39
+ ---
40
+
41
+ ## 3. Frontend Route Validation (if frontend modified)
42
+
43
+ ```
44
+ Call: mcp__smartstack__validate_frontend_routes
45
+
46
+ Verify:
47
+ - Routes nested inside correct Layout wrapper
48
+ - Route paths match controller patterns
49
+ - No orphan routes
50
+ ```
51
+
52
+ ---
53
+
54
+ ## 4. Build Verification
55
+
56
+ ```bash
57
+ # Backend
58
+ dotnet clean && dotnet restore && dotnet build
59
+
60
+ # Frontend (if applicable)
61
+ npm run typecheck
62
+ ```
63
+
64
+ **BLOCKING:** Both must pass. If failure, fix and retry.
65
+
66
+ ---
67
+
68
+ ## 5. Seed Data Completeness Check (if needs_seed_data)
69
+
70
+ | File | Checks |
71
+ |------|--------|
72
+ | NavigationModuleSeedData | Deterministic GUIDs (SHA256), 4 languages, GetModuleEntry + GetTranslationEntries |
73
+ | PermissionsSeedData | MCP generate_permissions used, paths match Permissions.cs, wildcard + CRUD |
74
+ | RolesSeedData | Admin=wildcard, Manager=CRU, Contributor=CR, Viewer=R |
75
+ | IClientSeedDataProvider | 3 Seed methods, idempotent, factory methods, SaveChanges per group |
76
+ | DI Registration | `services.AddScoped<IClientSeedDataProvider, {App}SeedDataProvider>()` |
77
+
78
+ ---
79
+
80
+ ## 6. Acceptance Criteria POST-CHECK
81
+
82
+ For each AC inferred in step-01:
83
+
84
+ ```
85
+ AC1: {criterion} → PASS / FAIL (evidence: {file:line or test})
86
+ AC2: {criterion} → PASS / FAIL (evidence: {file:line or test})
87
+ ...
88
+ ```
89
+
90
+ **All ACs must PASS. If any FAIL, go back to step-03 to fix.**
91
+
92
+ ---
93
+
94
+ ## 7. Validation Summary
95
+
96
+ ```
97
+ **APEX SmartStack - Validation Complete**
98
+
99
+ | Check | Status |
100
+ |-------|--------|
101
+ | MCP validate_conventions | PASS (0 errors) |
102
+ | EF Core migrations | PASS / N/A |
103
+ | Frontend routes | PASS / N/A |
104
+ | dotnet build | PASS |
105
+ | npm typecheck | PASS / N/A |
106
+ | Seed data | PASS / N/A |
107
+ | Acceptance criteria | {X}/{Y} PASS |
108
+ ```
109
+
110
+ ---
111
+
112
+ ## 8. Save Output (if save_mode)
113
+
114
+ Write to `{output_dir}/04-validate.md` with validation results.
115
+
116
+ ---
117
+
118
+ ## 9. Route to Next Step
119
+
120
+ ```
121
+ IF examine_mode = true:
122
+ → Load steps/step-05-examine.md
123
+
124
+ ELSE IF test_mode = true:
125
+ → Load steps/step-07-tests.md
126
+
127
+ ELSE IF pr_mode = true:
128
+ → Create PR and show final summary
129
+
130
+ ELSE:
131
+ → Show final summary and exit
132
+ ```
133
+
134
+ ---
135
+
136
+ ## FINAL SUMMARY (if no more steps)
137
+
138
+ Display: task, context, files created/modified, validation status, commits count, next steps (git diff, dotnet test, deploy).