@atlashub/smartstack-cli 3.37.0 → 3.39.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/dist/index.js +16 -24
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +235 -265
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +1 -1
- package/scripts/extract-api-endpoints.ts +5 -5
- package/scripts/generate-doc-with-mock-ui.ts +10 -17
- package/templates/agents/ba-reader.md +9 -9
- package/templates/agents/ba-writer.md +12 -15
- package/templates/agents/code-reviewer.md +1 -1
- package/templates/agents/docs-context-reader.md +1 -1
- package/templates/agents/efcore/scan.md +3 -1
- package/templates/agents/gitflow/commit.md +74 -0
- package/templates/agents/gitflow/finish.md +5 -2
- package/templates/agents/gitflow/init-clone.md +3 -3
- package/templates/agents/gitflow/init-validate.md +3 -2
- package/templates/agents/gitflow/merge.md +5 -4
- package/templates/agents/gitflow/pr.md +5 -4
- package/templates/agents/gitflow/start.md +37 -5
- package/templates/hooks/hooks.json +11 -0
- package/templates/hooks/wsl-dotnet-cleanup.sh +24 -0
- package/templates/mcp-scaffolding/frontend/nav-routes.ts.hbs +20 -20
- package/templates/mcp-scaffolding/frontend/routes.tsx.hbs +16 -24
- package/templates/mcp-scaffolding/migrations/seed-roles.cs.hbs +2 -2
- package/templates/skills/_resources/mcp-validate-documentation-spec.md +3 -3
- package/templates/skills/_shared.md +15 -17
- package/templates/skills/ai-prompt/SKILL.md +1 -1
- package/templates/skills/ai-prompt/steps/step-00-init.md +47 -0
- package/templates/skills/apex/SKILL.md +3 -4
- package/templates/skills/apex/_shared.md +10 -20
- package/templates/skills/apex/references/analysis-methods.md +141 -0
- package/templates/skills/apex/references/challenge-questions.md +1 -21
- package/templates/skills/apex/references/core-seed-data.md +35 -58
- package/templates/skills/apex/references/examine-build-validation.md +82 -0
- package/templates/skills/apex/references/execution-frontend-gates.md +177 -0
- package/templates/skills/apex/references/execution-frontend-patterns.md +105 -0
- package/templates/skills/apex/references/execution-layer1-rules.md +96 -0
- package/templates/skills/apex/references/initialization-challenge-flow.md +110 -0
- package/templates/skills/apex/references/planning-layer-mapping.md +151 -0
- package/templates/skills/apex/references/post-checks.md +145 -40
- package/templates/skills/apex/references/smartstack-api.md +35 -51
- package/templates/skills/apex/references/smartstack-frontend.md +18 -18
- package/templates/skills/apex/references/smartstack-layers.md +38 -62
- package/templates/skills/apex/steps/step-00-init.md +14 -26
- package/templates/skills/apex/steps/step-01-analyze.md +10 -143
- package/templates/skills/apex/steps/step-02-plan.md +10 -92
- package/templates/skills/apex/steps/step-03-execute.md +45 -252
- package/templates/skills/apex/steps/step-04-examine.md +14 -78
- package/templates/skills/apex/steps/step-05-deep-review.md +2 -2
- package/templates/skills/apex/steps/step-08-run-tests.md +1 -0
- package/templates/skills/application/SKILL.md +241 -242
- package/templates/skills/application/references/backend-controller-hierarchy.md +16 -16
- package/templates/skills/application/references/backend-seeding-and-dto-output.md +83 -0
- package/templates/skills/application/references/backend-table-prefix-mapping.md +79 -0
- package/templates/skills/application/references/backend-verification.md +1 -1
- package/templates/skills/application/references/frontend-i18n-and-output.md +67 -0
- package/templates/skills/application/references/frontend-route-naming.md +117 -0
- package/templates/skills/application/references/frontend-route-wiring-app-tsx.md +107 -0
- package/templates/skills/application/references/frontend-verification.md +12 -12
- package/templates/skills/application/references/init-parameter-detection.md +121 -0
- package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
- package/templates/skills/application/references/nav-fallback-procedure.md +199 -200
- package/templates/skills/application/references/provider-template.md +2 -6
- package/templates/skills/application/references/roles-client-project-handling.md +55 -0
- package/templates/skills/application/references/roles-fallback-procedure.md +149 -0
- package/templates/skills/application/references/test-coverage-requirements.md +213 -0
- package/templates/skills/application/references/test-frontend.md +3 -3
- package/templates/skills/application/steps/step-00-init.md +130 -260
- package/templates/skills/application/steps/step-01-navigation.md +170 -170
- package/templates/skills/application/steps/step-02-permissions.md +196 -196
- package/templates/skills/application/steps/step-03-roles.md +182 -339
- package/templates/skills/application/steps/step-03b-provider.md +133 -134
- package/templates/skills/application/steps/step-04-backend.md +174 -265
- package/templates/skills/application/steps/step-05-frontend.md +18 -144
- package/templates/skills/application/steps/step-06-migration.md +12 -60
- package/templates/skills/application/steps/step-07-tests.md +9 -76
- package/templates/skills/application/templates-backend.md +29 -27
- package/templates/skills/application/templates-frontend.md +49 -49
- package/templates/skills/application/templates-seed.md +57 -131
- package/templates/skills/business-analyse/SKILL.md +27 -30
- package/templates/skills/business-analyse/_architecture.md +6 -6
- package/templates/skills/business-analyse/_shared.md +60 -88
- package/templates/skills/business-analyse/questionnaire/04-data.md +3 -3
- package/templates/skills/business-analyse/questionnaire/06-security.md +1 -1
- package/templates/skills/business-analyse/questionnaire/13-cross-module.md +1 -1
- package/templates/skills/business-analyse/react/application-viewer.md +12 -12
- package/templates/skills/business-analyse/react/components.md +8 -12
- package/templates/skills/business-analyse/react/schema.md +836 -836
- package/templates/skills/business-analyse/references/agent-module-prompt.md +2 -3
- package/templates/skills/business-analyse/references/analysis-semantic-checks.md +190 -0
- package/templates/skills/business-analyse/references/cache-warming-strategy.md +2 -2
- package/templates/skills/business-analyse/references/cadrage-challenge-patterns.md +41 -0
- package/templates/skills/business-analyse/references/cadrage-coverage-matrix.md +74 -0
- package/templates/skills/business-analyse/references/cadrage-shared-modules.md +69 -0
- package/templates/skills/business-analyse/references/cadrage-structure-cards.md +1 -1
- package/templates/skills/business-analyse/references/compilation-structure-cards.md +297 -0
- package/templates/skills/business-analyse/references/consolidation-structural-checks.md +2 -2
- package/templates/skills/business-analyse/references/deploy-modes.md +5 -5
- package/templates/skills/business-analyse/references/detection-strategies.md +7 -7
- package/templates/skills/business-analyse/references/handoff-file-templates.md +14 -22
- package/templates/skills/business-analyse/references/handoff-mappings.md +4 -4
- package/templates/skills/business-analyse/references/handoff-seeddata-generation.md +312 -0
- package/templates/skills/business-analyse/references/init-schema-deployment.md +3 -3
- package/templates/skills/business-analyse/references/naming-conventions.md +22 -24
- package/templates/skills/business-analyse/references/prd-generation.md +2 -2
- package/templates/skills/business-analyse/references/review-data-mapping.md +2 -2
- package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
- package/templates/skills/business-analyse/references/spec-auto-inference.md +3 -3
- package/templates/skills/business-analyse/references/team-orchestration.md +49 -6
- package/templates/skills/business-analyse/references/ui-dashboard-spec.md +1 -1
- package/templates/skills/business-analyse/references/ui-resource-cards.md +18 -18
- package/templates/skills/business-analyse/references/validate-incremental-html.md +2 -2
- package/templates/skills/business-analyse/references/validation-checklist.md +2 -2
- package/templates/skills/business-analyse/schemas/application-schema.json +4 -5
- package/templates/skills/business-analyse/schemas/project-schema.json +1 -6
- package/templates/skills/business-analyse/schemas/sections/metadata-schema.json +2 -3
- package/templates/skills/business-analyse/schemas/sections/specification-schema.json +4 -4
- package/templates/skills/business-analyse/steps/step-00-init.md +8 -17
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +35 -198
- package/templates/skills/business-analyse/steps/step-01b-applications.md +16 -20
- package/templates/skills/business-analyse/steps/step-02-decomposition.md +1 -1
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +4 -4
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +1 -1
- package/templates/skills/business-analyse/steps/step-03b-ui.md +4 -4
- package/templates/skills/business-analyse/steps/step-03c-compile.md +66 -140
- package/templates/skills/business-analyse/steps/step-03d-validate.md +2 -2
- package/templates/skills/business-analyse/steps/step-04a-collect.md +2 -2
- package/templates/skills/business-analyse/steps/step-04b-analyze.md +42 -160
- package/templates/skills/business-analyse/steps/step-04c-decide.md +1 -1
- package/templates/skills/business-analyse/steps/step-05a-handoff.md +74 -104
- package/templates/skills/business-analyse/steps/step-05b-deploy.md +13 -11
- package/templates/skills/business-analyse/steps/step-06-review.md +3 -3
- package/templates/skills/business-analyse/templates/tpl-frd.md +13 -13
- package/templates/skills/business-analyse/templates/tpl-handoff.md +12 -12
- package/templates/skills/business-analyse/templates/tpl-progress.md +1 -1
- package/templates/skills/business-analyse/templates-frd.md +25 -25
- package/templates/skills/business-analyse/templates-react.md +15 -21
- package/templates/skills/controller/SKILL.md +1 -1
- package/templates/skills/controller/postman-templates.md +1 -1
- package/templates/skills/controller/references/controller-code-templates.md +2 -2
- package/templates/skills/controller/references/mcp-scaffold-workflow.md +209 -0
- package/templates/skills/controller/references/permission-sync-templates.md +13 -16
- package/templates/skills/controller/steps/step-00-init.md +11 -11
- package/templates/skills/controller/steps/step-03-generate.md +64 -103
- package/templates/skills/controller/templates.md +67 -71
- package/templates/skills/debug/SKILL.md +13 -218
- package/templates/skills/debug/steps/step-00-init.md +57 -0
- package/templates/skills/debug/steps/step-01-analyze.md +219 -0
- package/templates/skills/debug/steps/step-02-resolve.md +85 -0
- package/templates/skills/documentation/SKILL.md +49 -345
- package/templates/skills/documentation/data-schema.md +11 -8
- package/templates/skills/documentation/steps/step-00-init.md +70 -0
- package/templates/skills/documentation/steps/step-01-scan.md +113 -0
- package/templates/skills/documentation/steps/step-02-generate.md +231 -0
- package/templates/skills/documentation/steps/step-03-validate.md +238 -0
- package/templates/skills/documentation/templates.md +480 -322
- package/templates/skills/efcore/SKILL.md +1 -1
- package/templates/skills/efcore/references/both-contexts.md +32 -0
- package/templates/skills/efcore/references/database-operations.md +67 -0
- package/templates/skills/efcore/references/destructive-operations.md +38 -0
- package/templates/skills/efcore/references/reset-operations.md +81 -0
- package/templates/skills/efcore/references/seed-methods.md +86 -0
- package/templates/skills/efcore/references/shared-init-functions.md +250 -0
- package/templates/skills/efcore/references/sql-objects-injection.md +61 -0
- package/templates/skills/efcore/references/troubleshooting.md +81 -0
- package/templates/skills/efcore/steps/db/step-deploy.md +1 -32
- package/templates/skills/efcore/steps/db/step-reset.md +7 -103
- package/templates/skills/efcore/steps/db/step-seed.md +10 -132
- package/templates/skills/efcore/steps/db/step-status.md +5 -44
- package/templates/skills/efcore/steps/migration/step-02-create.md +1 -14
- package/templates/skills/efcore/steps/migration/step-03-validate.md +8 -62
- package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +1 -57
- package/templates/skills/efcore/steps/shared/step-00-init.md +11 -254
- package/templates/skills/efcore/steps/squash/step-03-create.md +1 -58
- package/templates/skills/feature-full/SKILL.md +1 -1
- package/templates/skills/feature-full/steps/step-00-init.md +57 -0
- package/templates/skills/feature-full/steps/step-01-implementation.md +1 -1
- package/templates/skills/gitflow/SKILL.md +28 -5
- package/templates/skills/gitflow/_shared.md +109 -12
- package/templates/skills/gitflow/phases/abort.md +4 -0
- package/templates/skills/gitflow/phases/cleanup.md +4 -0
- package/templates/skills/gitflow/references/commit-message-generation.md +58 -0
- package/templates/skills/gitflow/references/commit-migration-validation.md +49 -0
- package/templates/skills/gitflow/references/finish-cleanup.md +55 -0
- package/templates/skills/gitflow/references/finish-version-bumping.md +45 -0
- package/templates/skills/gitflow/references/init-environment-detection.md +41 -0
- package/templates/skills/gitflow/references/init-questions.md +185 -0
- package/templates/skills/gitflow/references/init-structure-creation.md +75 -0
- package/templates/skills/gitflow/references/init-version-detection.md +21 -0
- package/templates/skills/gitflow/references/init-workspace-detection.md +43 -0
- package/templates/skills/gitflow/references/merge-ci-status.md +36 -0
- package/templates/skills/gitflow/references/merge-execution.md +62 -0
- package/templates/skills/gitflow/references/merge-pr-context.md +76 -0
- package/templates/skills/gitflow/references/pr-build-checks.md +60 -0
- package/templates/skills/gitflow/references/pr-generation.md +58 -0
- package/templates/skills/gitflow/references/start-branch-normalization.md +28 -0
- package/templates/skills/gitflow/references/start-worktree-creation.md +50 -0
- package/templates/skills/gitflow/references/sync-push-verify.md +44 -0
- package/templates/skills/gitflow/references/sync-rebase-conflicts.md +38 -0
- package/templates/skills/gitflow/steps/step-commit.md +12 -91
- package/templates/skills/gitflow/steps/step-finish.md +15 -159
- package/templates/skills/gitflow/steps/step-init.md +24 -326
- package/templates/skills/gitflow/steps/step-merge.md +17 -176
- package/templates/skills/gitflow/steps/step-pr.md +10 -116
- package/templates/skills/gitflow/steps/step-start.md +16 -109
- package/templates/skills/gitflow/steps/step-sync.md +6 -69
- package/templates/skills/ralph-loop/SKILL.md +6 -0
- package/templates/skills/ralph-loop/references/category-completeness.md +185 -0
- package/templates/skills/ralph-loop/references/compact-loop.md +1 -1
- package/templates/skills/ralph-loop/references/init-resume-recovery.md +127 -0
- package/templates/skills/ralph-loop/references/module-transition.md +151 -0
- package/templates/skills/ralph-loop/references/multi-module-queue.md +171 -0
- package/templates/skills/ralph-loop/references/parallel-execution.md +246 -0
- package/templates/skills/ralph-loop/references/task-transform-legacy.md +6 -9
- package/templates/skills/ralph-loop/references/team-orchestration.md +45 -3
- package/templates/skills/ralph-loop/steps/step-00-init.md +36 -109
- package/templates/skills/ralph-loop/steps/step-01-task.md +15 -163
- package/templates/skills/ralph-loop/steps/step-02-execute.md +8 -154
- package/templates/skills/ralph-loop/steps/step-04-check.md +20 -73
- package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
- package/templates/skills/review-code/references/smartstack-conventions.md +568 -568
- package/templates/skills/validate-feature/references/api-smoke-tests.md +140 -0
- package/templates/skills/validate-feature/references/db-validation-checks.md +180 -0
- package/templates/skills/validate-feature/steps/step-01-compile.md +1 -3
- package/templates/skills/validate-feature/steps/step-04-api-smoke.md +34 -145
- package/templates/skills/validate-feature/steps/step-05-db-validation.md +74 -260
- package/templates/skills/workflow/SKILL.md +1 -1
- package/templates/skills/workflow/steps/step-00-init.md +57 -0
|
@@ -1,265 +1,174 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-04-backend
|
|
3
|
-
description: Generate backend code using MCP scaffold_extension
|
|
4
|
-
prev_step: steps/step-03-roles.md
|
|
5
|
-
next_step: steps/step-05-frontend.md
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Step 4: Backend Generation
|
|
9
|
-
|
|
10
|
-
## MANDATORY EXECUTION RULES
|
|
11
|
-
|
|
12
|
-
- ALWAYS use MCP `scaffold_extension` tool - NEVER use templates
|
|
13
|
-
- ALWAYS generate Entity + Service + Controller as a unit
|
|
14
|
-
- NEVER skip controller generation - API is required
|
|
15
|
-
- YOU ARE AN ORCHESTRATOR calling MCP, not a generator
|
|
16
|
-
- **NEVER use Write on appsettings*.json** - ALWAYS use Edit (see _resources/config-safety.md)
|
|
17
|
-
- **Replace secret VALUES with `<CONFIGURE_HERE>`** - NEVER delete keys or sections
|
|
18
|
-
|
|
19
|
-
## YOUR TASK
|
|
20
|
-
|
|
21
|
-
Call the SmartStack MCP `scaffold_extension` tool with type "feature" to generate:
|
|
22
|
-
1. Domain Entity with EF Configuration
|
|
23
|
-
2. Application Service (Interface + Implementation)
|
|
24
|
-
3. API Controller with NavRoute attribute
|
|
25
|
-
4. DTOs (Response, Create, Update)
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## AVAILABLE STATE
|
|
30
|
-
|
|
31
|
-
From previous steps:
|
|
32
|
-
|
|
33
|
-
| Variable | Description |
|
|
34
|
-
|----------|-------------|
|
|
35
|
-
| `{level}` |
|
|
36
|
-
| `{code}` | kebab-case identifier |
|
|
37
|
-
| `{full_path}` | Complete navigation path (navRoute) |
|
|
38
|
-
| `{labels}` | Object with fr, en, it, de |
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## EXECUTION SEQUENCE
|
|
43
|
-
|
|
44
|
-
### 1. Derive Entity Name
|
|
45
|
-
|
|
46
|
-
Convert `{code}` to PascalCase for entity name:
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
code: "products" → entityName: "Product"
|
|
50
|
-
code: "order-items" → entityName: "OrderItem"
|
|
51
|
-
code: "user-profiles" → entityName: "UserProfile"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 2. Determine Table Prefix and Controller Folder
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
-
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
###
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
```markdown
|
|
176
|
-
> Skipping entity seed data. You can generate it later using the SeedData provider pattern
|
|
177
|
-
> documented in templates-seed.md.
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### 7. Store Entity Info
|
|
181
|
-
|
|
182
|
-
Store entity information for frontend generation:
|
|
183
|
-
|
|
184
|
-
```
|
|
185
|
-
{entity_name} = "{EntityName}"
|
|
186
|
-
{entity_code} = "{code}"
|
|
187
|
-
{api_route} = "/api/{code}"
|
|
188
|
-
{has_seed_data} = true/false // Whether SeedData provider was generated
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
## CONTROLLER NAVROUTE AND FOLDER HIERARCHY
|
|
194
|
-
|
|
195
|
-
See [references/backend-controller-hierarchy.md](../references/backend-controller-hierarchy.md) for the complete reference:
|
|
196
|
-
- Controller file organization (Admin/Business/Support/User folders)
|
|
197
|
-
- Context-to-folder mapping table
|
|
198
|
-
- NavRoute attribute C# template with RequirePermission
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
## MCP RESPONSE HANDLING
|
|
203
|
-
|
|
204
|
-
### Success Case
|
|
205
|
-
|
|
206
|
-
If MCP returns successfully:
|
|
207
|
-
- Display all generated files
|
|
208
|
-
- Show DbSet and DI registration instructions
|
|
209
|
-
- Ask about entity seeding (section 6)
|
|
210
|
-
- Store entity info for frontend
|
|
211
|
-
- Proceed to step-05-frontend.md
|
|
212
|
-
|
|
213
|
-
### Error Case
|
|
214
|
-
|
|
215
|
-
If MCP call fails:
|
|
216
|
-
- Display error message
|
|
217
|
-
- Suggest checking entity name format
|
|
218
|
-
- Do NOT proceed automatically
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## POST-GENERATION VERIFICATION (MANDATORY)
|
|
223
|
-
|
|
224
|
-
**Before proceeding to step-05, run ALL checks.**
|
|
225
|
-
|
|
226
|
-
See [references/backend-verification.md](../references/backend-verification.md) for the complete verification checklist:
|
|
227
|
-
|
|
228
|
-
| Check | Type | What |
|
|
229
|
-
|-------|------|------|
|
|
230
|
-
| 1. Backend Build | BLOCKING | `dotnet build --no-restore` must succeed |
|
|
231
|
-
| 2. DbSet Registration | BLOCKING | `DbSet<{EntityName}>` in DbContext |
|
|
232
|
-
| 3. DI Registration | BLOCKING | `I{EntityName}Service` in DependencyInjection.cs |
|
|
233
|
-
| 4. RequirePermission | BLOCKING | All HTTP actions have `[RequirePermission]` |
|
|
234
|
-
| 5. Entity Configuration | BLOCKING | Table prefix, HasKey, HasIndex |
|
|
235
|
-
| 5b. Seeding Infrastructure | BLOCKING (first entity) | SeedConstants + DevDataSeeder + DI |
|
|
236
|
-
| 5c. SqlObjects Directory | BLOCKING (first entity) | SqlObjectHelper + Functions/ + .csproj EmbeddedResource |
|
|
237
|
-
| 6. Convention Validation | RECOMMENDED | `mcp__smartstack__validate_conventions` |
|
|
238
|
-
|
|
239
|
-
IF any BLOCKING check fails: Fix before proceeding to step-05.
|
|
240
|
-
|
|
241
|
-
---
|
|
242
|
-
|
|
243
|
-
## SUCCESS METRICS
|
|
244
|
-
|
|
245
|
-
- MCP scaffold_extension called successfully
|
|
246
|
-
- Entity, Service, Controller generated
|
|
247
|
-
- DTOs generated
|
|
248
|
-
- NavRoute attribute included
|
|
249
|
-
- Entity seeding offered to user (SeedData.cs + DevDataSeeder if accepted)
|
|
250
|
-
- Entity info stored for frontend
|
|
251
|
-
- Post-generation verification passed (all 7 checks: 5 original + 5b Seeding + 5c SqlObjects)
|
|
252
|
-
- Proceeded to step-05-frontend.md
|
|
253
|
-
|
|
254
|
-
## FAILURE MODES
|
|
255
|
-
|
|
256
|
-
- MCP call failed (display error, stop)
|
|
257
|
-
- Invalid entity name (must be PascalCase)
|
|
258
|
-
- Invalid navRoute format
|
|
259
|
-
|
|
260
|
-
---
|
|
261
|
-
|
|
262
|
-
## NEXT STEP
|
|
263
|
-
|
|
264
|
-
After backend code is generated and entity seeding is handled,
|
|
265
|
-
proceed to `./step-05-frontend.md`
|
|
1
|
+
---
|
|
2
|
+
name: step-04-backend
|
|
3
|
+
description: Generate backend code using MCP scaffold_extension
|
|
4
|
+
prev_step: steps/step-03-roles.md
|
|
5
|
+
next_step: steps/step-05-frontend.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Step 4: Backend Generation
|
|
9
|
+
|
|
10
|
+
## MANDATORY EXECUTION RULES
|
|
11
|
+
|
|
12
|
+
- ALWAYS use MCP `scaffold_extension` tool - NEVER use templates
|
|
13
|
+
- ALWAYS generate Entity + Service + Controller as a unit
|
|
14
|
+
- NEVER skip controller generation - API is required
|
|
15
|
+
- YOU ARE AN ORCHESTRATOR calling MCP, not a generator
|
|
16
|
+
- **NEVER use Write on appsettings*.json** - ALWAYS use Edit (see _resources/config-safety.md)
|
|
17
|
+
- **Replace secret VALUES with `<CONFIGURE_HERE>`** - NEVER delete keys or sections
|
|
18
|
+
|
|
19
|
+
## YOUR TASK
|
|
20
|
+
|
|
21
|
+
Call the SmartStack MCP `scaffold_extension` tool with type "feature" to generate:
|
|
22
|
+
1. Domain Entity with EF Configuration
|
|
23
|
+
2. Application Service (Interface + Implementation)
|
|
24
|
+
3. API Controller with NavRoute attribute
|
|
25
|
+
4. DTOs (Response, Create, Update)
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## AVAILABLE STATE
|
|
30
|
+
|
|
31
|
+
From previous steps:
|
|
32
|
+
|
|
33
|
+
| Variable | Description |
|
|
34
|
+
|----------|-------------|
|
|
35
|
+
| `{level}` | application, module, section, or resource |
|
|
36
|
+
| `{code}` | kebab-case identifier |
|
|
37
|
+
| `{full_path}` | Complete navigation path (navRoute) |
|
|
38
|
+
| `{labels}` | Object with fr, en, it, de |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## EXECUTION SEQUENCE
|
|
43
|
+
|
|
44
|
+
### 1. Derive Entity Name
|
|
45
|
+
|
|
46
|
+
Convert `{code}` to PascalCase for entity name:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
code: "products" → entityName: "Product"
|
|
50
|
+
code: "order-items" → entityName: "OrderItem"
|
|
51
|
+
code: "user-profiles" → entityName: "UserProfile"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. Determine Table Prefix and Controller Folder
|
|
55
|
+
|
|
56
|
+
See [references/backend-table-prefix-mapping.md](../references/backend-table-prefix-mapping.md) for:
|
|
57
|
+
- Table prefix priority (feature.json vs. fallback)
|
|
58
|
+
- Application-to-prefix mapping table
|
|
59
|
+
- Feature.json detection and extraction
|
|
60
|
+
- Controller folder organization
|
|
61
|
+
- Store `{controller_folder}` from the mapping
|
|
62
|
+
|
|
63
|
+
### 3. Call MCP scaffold_extension
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
Tool: mcp__smartstack__scaffold_extension
|
|
67
|
+
Args:
|
|
68
|
+
type: "feature"
|
|
69
|
+
name: "{entityName}" # PascalCase
|
|
70
|
+
options:
|
|
71
|
+
navRoute: "{full_path}"
|
|
72
|
+
tablePrefix: "{prefix}"
|
|
73
|
+
schema: "core"
|
|
74
|
+
withDtos: true
|
|
75
|
+
withValidation: true
|
|
76
|
+
withRepository: false # Use service pattern
|
|
77
|
+
skipComponent: true # Frontend in next step
|
|
78
|
+
dryRun: false
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 4. Parse MCP Response
|
|
82
|
+
|
|
83
|
+
The tool generates (paths organized by navRoute hierarchy `{application}.{module}`):
|
|
84
|
+
- `Domain/{Application}/{Module}/{EntityName}.cs` - Entity with BaseEntity
|
|
85
|
+
- `Infrastructure/Persistence/Configurations/{Application}/{Module}/{EntityName}Configuration.cs` - EF Config
|
|
86
|
+
- `Application/Common/Interfaces/I{EntityName}Service.cs` - Service Interface
|
|
87
|
+
- `Infrastructure/Services/{Application}/{Module}/{EntityName}Service.cs` - Service Implementation
|
|
88
|
+
- `Api/Controllers/{controller_folder}/{Application}/{EntityName}Controller.cs` - REST Controller
|
|
89
|
+
- `Application/{Application}/{Module}/DTOs/{EntityName}ResponseDto.cs` - Response DTO
|
|
90
|
+
- `Application/{Application}/{Module}/DTOs/Create{EntityName}Dto.cs` - Create request
|
|
91
|
+
- `Application/{Application}/{Module}/DTOs/Update{EntityName}Dto.cs` - Update request
|
|
92
|
+
|
|
93
|
+
### 5-7. Present Output, Entity Seeding & Store Info
|
|
94
|
+
|
|
95
|
+
See [references/backend-seeding-and-dto-output.md](../references/backend-seeding-and-dto-output.md) for:
|
|
96
|
+
- Output formatting by layer (Domain, Infrastructure, Application, API)
|
|
97
|
+
- Entity seeding questions and responses
|
|
98
|
+
- Entity info storage for frontend generation
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## CONTROLLER NAVROUTE AND FOLDER HIERARCHY
|
|
103
|
+
|
|
104
|
+
See [references/backend-controller-hierarchy.md](../references/backend-controller-hierarchy.md) for the complete reference:
|
|
105
|
+
- Controller file organization (Admin/Business/Support/User folders)
|
|
106
|
+
- Context-to-folder mapping table
|
|
107
|
+
- NavRoute attribute C# template with RequirePermission
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## MCP RESPONSE HANDLING
|
|
112
|
+
|
|
113
|
+
### Success Case
|
|
114
|
+
|
|
115
|
+
If MCP returns successfully:
|
|
116
|
+
- Display all generated files
|
|
117
|
+
- Show DbSet and DI registration instructions
|
|
118
|
+
- Ask about entity seeding (section 6)
|
|
119
|
+
- Store entity info for frontend
|
|
120
|
+
- Proceed to step-05-frontend.md
|
|
121
|
+
|
|
122
|
+
### Error Case
|
|
123
|
+
|
|
124
|
+
If MCP call fails:
|
|
125
|
+
- Display error message
|
|
126
|
+
- Suggest checking entity name format
|
|
127
|
+
- Do NOT proceed automatically
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## POST-GENERATION VERIFICATION (MANDATORY)
|
|
132
|
+
|
|
133
|
+
**Before proceeding to step-05, run ALL checks.**
|
|
134
|
+
|
|
135
|
+
See [references/backend-verification.md](../references/backend-verification.md) for the complete verification checklist:
|
|
136
|
+
|
|
137
|
+
| Check | Type | What |
|
|
138
|
+
|-------|------|------|
|
|
139
|
+
| 1. Backend Build | BLOCKING | `dotnet build --no-restore` must succeed |
|
|
140
|
+
| 2. DbSet Registration | BLOCKING | `DbSet<{EntityName}>` in DbContext |
|
|
141
|
+
| 3. DI Registration | BLOCKING | `I{EntityName}Service` in DependencyInjection.cs |
|
|
142
|
+
| 4. RequirePermission | BLOCKING | All HTTP actions have `[RequirePermission]` |
|
|
143
|
+
| 5. Entity Configuration | BLOCKING | Table prefix, HasKey, HasIndex |
|
|
144
|
+
| 5b. Seeding Infrastructure | BLOCKING (first entity) | SeedConstants + DevDataSeeder + DI |
|
|
145
|
+
| 5c. SqlObjects Directory | BLOCKING (first entity) | SqlObjectHelper + Functions/ + .csproj EmbeddedResource |
|
|
146
|
+
| 6. Convention Validation | RECOMMENDED | `mcp__smartstack__validate_conventions` |
|
|
147
|
+
|
|
148
|
+
IF any BLOCKING check fails: Fix before proceeding to step-05.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## SUCCESS METRICS
|
|
153
|
+
|
|
154
|
+
- MCP scaffold_extension called successfully
|
|
155
|
+
- Entity, Service, Controller generated
|
|
156
|
+
- DTOs generated
|
|
157
|
+
- NavRoute attribute included
|
|
158
|
+
- Entity seeding offered to user (SeedData.cs + DevDataSeeder if accepted)
|
|
159
|
+
- Entity info stored for frontend
|
|
160
|
+
- Post-generation verification passed (all 7 checks: 5 original + 5b Seeding + 5c SqlObjects)
|
|
161
|
+
- Proceeded to step-05-frontend.md
|
|
162
|
+
|
|
163
|
+
## FAILURE MODES
|
|
164
|
+
|
|
165
|
+
- MCP call failed (display error, stop)
|
|
166
|
+
- Invalid entity name (must be PascalCase)
|
|
167
|
+
- Invalid navRoute format
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## NEXT STEP
|
|
172
|
+
|
|
173
|
+
After backend code is generated and entity seeding is handled,
|
|
174
|
+
proceed to `./step-05-frontend.md`
|
|
@@ -42,15 +42,11 @@ From previous steps:
|
|
|
42
42
|
|
|
43
43
|
## ROUTE NAMING RULE
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
> - **FORBIDDEN:** `humanresources`, `timemanagement` (concatenated words without hyphens)
|
|
51
|
-
> - **REQUIRED:** `human-resources`, `time-management` (proper kebab-case)
|
|
52
|
-
>
|
|
53
|
-
> Route paths MUST match the navigation seed data routes (which use `ToKebabCase()`).
|
|
45
|
+
See [references/frontend-route-naming.md](../references/frontend-route-naming.md) for:
|
|
46
|
+
- Kebab-case transformation rules
|
|
47
|
+
- Forbidden patterns (concatenated words)
|
|
48
|
+
- Required patterns (hyphens in multi-word segments)
|
|
49
|
+
- Verification against navigation seed data
|
|
54
50
|
|
|
55
51
|
---
|
|
56
52
|
|
|
@@ -65,7 +61,7 @@ Args:
|
|
|
65
61
|
name: "{entity_name}"
|
|
66
62
|
options:
|
|
67
63
|
navRoute: "{full_path}"
|
|
68
|
-
outputPath: "web/src/pages/{
|
|
64
|
+
outputPath: "web/src/pages/{application}/{module}"
|
|
69
65
|
dryRun: false
|
|
70
66
|
```
|
|
71
67
|
|
|
@@ -116,152 +112,30 @@ This generates:
|
|
|
116
112
|
|
|
117
113
|
### 4. Wire Routes to App.tsx (BLOCKING)
|
|
118
114
|
|
|
119
|
-
|
|
115
|
+
See [references/frontend-route-wiring-app-tsx.md](../references/frontend-route-wiring-app-tsx.md) for:
|
|
116
|
+
- Step 4a: Import page components
|
|
117
|
+
- Step 4b: Detect App.tsx routing pattern (Pattern A vs Pattern B)
|
|
118
|
+
- Step 4c: Application-to-Layout mapping table
|
|
119
|
+
- Step 4d: Route wiring verification
|
|
120
|
+
- Forbidden patterns (absolute paths, outside Layout, createBrowserRouter)
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
### 5-6. Verify i18n & Present Output
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
// Or lazy-loaded:
|
|
128
|
-
const {EntityName}Page = lazy(() => import('@/pages/{Context}/{Application}/{Module}/{EntityName}Page'));
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
**Step 4b:** Detect the App.tsx routing pattern:
|
|
132
|
-
|
|
133
|
-
Read App.tsx and detect which pattern is used:
|
|
134
|
-
|
|
135
|
-
**Pattern A** — If App.tsx contains `contextRoutes: ContextRouteExtensions`:
|
|
136
|
-
→ Add routes to `contextRoutes.{context}[]` with **RELATIVE** paths (no leading `/`)
|
|
137
|
-
|
|
138
|
-
```tsx
|
|
139
|
-
const contextRoutes: ContextRouteExtensions = {
|
|
140
|
-
business: [
|
|
141
|
-
// existing routes...
|
|
142
|
-
{ path: '{application_kebab}/{module_kebab}', element: <{EntityName}ListPage /> },
|
|
143
|
-
{ path: '{application_kebab}/{module_kebab}/new', element: <Create{EntityName}Page /> },
|
|
144
|
-
{ path: '{application_kebab}/{module_kebab}/:id', element: <{EntityName}DetailPage /> },
|
|
145
|
-
{ path: '{application_kebab}/{module_kebab}/:id/edit', element: <Create{EntityName}Page /> },
|
|
146
|
-
],
|
|
147
|
-
};
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Routes are automatically injected into BOTH standard (`/business/...`) and tenant-prefixed (`/t/:slug/business/...`) route trees by `mergeRoutes()`. No manual duplication needed.
|
|
151
|
-
|
|
152
|
-
**Pattern B** — If App.tsx contains `<Route path="/{context}" element={<{Layout} />}>` (JSX Routes):
|
|
153
|
-
→ Insert `<Route>` children inside the Layout wrapper (see below)
|
|
154
|
-
|
|
155
|
-
```tsx
|
|
156
|
-
<Route path="/business" element={<BusinessLayout />}>
|
|
157
|
-
{/* ... existing routes ... */}
|
|
158
|
-
<Route path="{application_kebab}/{module_kebab}" element={<{EntityName}Page />} />
|
|
159
|
-
</Route>
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
ALSO add the same routes inside the tenant-prefixed block:
|
|
163
|
-
Find `<Route path="/t/:slug">` and add the **same route entries** there.
|
|
164
|
-
|
|
165
|
-
**Step 4c:** Context-to-Layout mapping:
|
|
166
|
-
|
|
167
|
-
| Context | Layout Component | Route path |
|
|
168
|
-
|---------|------------------|------------|
|
|
169
|
-
| `platform.*` | `AdminLayout` | `/platform` |
|
|
170
|
-
| `business.*` | `BusinessLayout` | `/business` |
|
|
171
|
-
| `personal.*` | `UserLayout` | `/personal/myspace` |
|
|
172
|
-
|
|
173
|
-
**Step 4d:** Verify wiring:
|
|
174
|
-
|
|
175
|
-
```
|
|
176
|
-
Tool: mcp__smartstack__validate_frontend_routes
|
|
177
|
-
Args:
|
|
178
|
-
scope: "routes"
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
If `appWiring.issues` is not empty, fix the wiring before proceeding.
|
|
182
|
-
|
|
183
|
-
**FORBIDDEN (both patterns):**
|
|
184
|
-
- Adding business/platform/personal routes to `clientRoutes[]` with absolute paths — `clientRoutes` is ONLY for routes outside SmartStack contexts (e.g., `/about`, `/pricing`)
|
|
185
|
-
- Adding routes OUTSIDE the Layout wrapper (shell will not render)
|
|
186
|
-
- Using `createBrowserRouter` (SmartStack uses `useRoutes()` + `mergeRoutes()`)
|
|
187
|
-
|
|
188
|
-
### 5. Verify i18n Files
|
|
189
|
-
|
|
190
|
-
> **Note:** i18n files are now auto-generated by `type: "page"` scaffold (step 1).
|
|
191
|
-
> Verify the 4 language files were created and customize the `title`/`subtitle` with the proper labels.
|
|
192
|
-
|
|
193
|
-
If the generated translations need customization (e.g., replacing generic title with `{labels.fr}`):
|
|
194
|
-
- `i18n/locales/fr/{entityCode}.json` → set `"title": "{labels.fr}"`
|
|
195
|
-
- `i18n/locales/en/{entityCode}.json` → set `"title": "{labels.en}"`
|
|
196
|
-
- `i18n/locales/it/{entityCode}.json` → set `"title": "{labels.it}"`
|
|
197
|
-
- `i18n/locales/de/{entityCode}.json` → set `"title": "{labels.de}"`
|
|
198
|
-
|
|
199
|
-
### 6. Present Output to User
|
|
200
|
-
|
|
201
|
-
```markdown
|
|
202
|
-
## Frontend Code Generated
|
|
203
|
-
|
|
204
|
-
### Pages
|
|
205
|
-
- `pages/{context}/{application}/{module}/{EntityName}Page.tsx`
|
|
206
|
-
- `pages/{context}/{application}/{module}/{EntityName}ListView.tsx`
|
|
207
|
-
|
|
208
|
-
### Components
|
|
209
|
-
- `components/{context}/{module}/{EntityName}.tsx`
|
|
210
|
-
- `hooks/use{EntityName}.ts`
|
|
211
|
-
|
|
212
|
-
### API Client
|
|
213
|
-
- `services/api/{entityCode}Api.ts`
|
|
214
|
-
- `types/{entityName}.types.ts`
|
|
215
|
-
|
|
216
|
-
### Routes
|
|
217
|
-
- Updated `navRoutes.generated.ts`
|
|
218
|
-
- Generated `clientRoutes.generated.tsx`
|
|
219
|
-
- Wired routes in `App.tsx` (standard + tenant blocks)
|
|
220
|
-
|
|
221
|
-
### i18n
|
|
222
|
-
- `locales/fr/{entityCode}.json`
|
|
223
|
-
- `locales/en/{entityCode}.json`
|
|
224
|
-
- `locales/it/{entityCode}.json`
|
|
225
|
-
- `locales/de/{entityCode}.json`
|
|
226
|
-
|
|
227
|
-
### Route Configuration
|
|
228
|
-
```tsx
|
|
229
|
-
// In routes.tsx - NESTED routes (not flat!)
|
|
230
|
-
<Route path="{application_kebab}">
|
|
231
|
-
<Route index element={<Navigate to="{module_kebab}" replace />} />
|
|
232
|
-
<Route path="{module_kebab}" element={<{EntityName}Page />} />
|
|
233
|
-
</Route>
|
|
234
|
-
```
|
|
235
|
-
```
|
|
124
|
+
See [references/frontend-i18n-and-output.md](../references/frontend-i18n-and-output.md) for:
|
|
125
|
+
- i18n structure (4 language files)
|
|
126
|
+
- Customization of labels from feature context
|
|
127
|
+
- Output formatting by category (Pages, Components, API Client, Routes, i18n)
|
|
236
128
|
|
|
237
129
|
---
|
|
238
130
|
|
|
239
131
|
## ROUTING RULES
|
|
240
132
|
|
|
241
133
|
See [references/frontend-verification.md](../references/frontend-verification.md) for detailed routing rules with code examples:
|
|
242
|
-
- **Rule 1:** Routes MUST be inside
|
|
134
|
+
- **Rule 1:** Routes MUST be inside the AppLayout wrapper
|
|
243
135
|
- **Rule 2:** Use NESTED routes (not flat) — flat routes bypass layout and break the shell
|
|
244
136
|
|
|
245
137
|
---
|
|
246
138
|
|
|
247
|
-
## I18N STRUCTURE
|
|
248
|
-
|
|
249
|
-
All i18n files must follow this structure:
|
|
250
|
-
|
|
251
|
-
```
|
|
252
|
-
locales/
|
|
253
|
-
├── fr/
|
|
254
|
-
│ └── {entityCode}.json
|
|
255
|
-
├── en/
|
|
256
|
-
│ └── {entityCode}.json
|
|
257
|
-
├── it/
|
|
258
|
-
│ └── {entityCode}.json
|
|
259
|
-
└── de/
|
|
260
|
-
└── {entityCode}.json
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
---
|
|
264
|
-
|
|
265
139
|
## POST-GENERATION VERIFICATION (MANDATORY)
|
|
266
140
|
|
|
267
141
|
**Before proceeding to step-06, run all 7 checks on generated frontend files.**
|