@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
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Test Generation: Coverage Requirements & Categories
|
|
2
|
+
|
|
3
|
+
> Referenced from `steps/step-07-tests.md` — Test coverage minimums and category definitions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Minimum Test Coverage Per Category
|
|
8
|
+
|
|
9
|
+
| Category | Minimum Tests | Focus Areas |
|
|
10
|
+
|----------|---------------|------------|
|
|
11
|
+
| Controller (mock) | 10 | CRUD routing, auth/tenant handling, error responses |
|
|
12
|
+
| Controller (real integration) | 8 | CRUD with actual DB persistence, tenant isolation, 404/409 cases |
|
|
13
|
+
| Service | 8 | Business logic, CRUD, error handling, edge cases |
|
|
14
|
+
| Entity | 5 | Factory method, property updates, validation, soft delete |
|
|
15
|
+
| Validator | 8 | Code validation, name validation, security rules |
|
|
16
|
+
| Repository | 8 | CRUD, tenant filtering, pagination, indexes |
|
|
17
|
+
| Security | 10 | Auth bypass attempts, injection attacks, header validation |
|
|
18
|
+
|
|
19
|
+
**Total minimum:** ~67 tests per entity
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Real Integration Test Coverage
|
|
24
|
+
|
|
25
|
+
Integration tests (with actual DB):
|
|
26
|
+
- GET all → 200 with list
|
|
27
|
+
- GET by ID → 200 when exists, 404 when not
|
|
28
|
+
- POST → 201/200 when valid, persist to DB, read back to verify
|
|
29
|
+
- POST → 400 when invalid data
|
|
30
|
+
- POST → 409 when duplicate code
|
|
31
|
+
- PUT → 200 when valid, persist changes, read back to verify
|
|
32
|
+
- PUT → 404 when not exists
|
|
33
|
+
- DELETE → 204 when exists
|
|
34
|
+
- DELETE → 404 when not exists
|
|
35
|
+
- Tenant isolation → create in tenant A, invisible in tenant B (REAL DB)
|
|
36
|
+
- Authorization → 401 when not authenticated
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Test Naming Convention (BLOCKING)
|
|
41
|
+
|
|
42
|
+
All test methods MUST follow: `{Method}_When{Condition}_Should{Result}`
|
|
43
|
+
|
|
44
|
+
**FORBIDDEN patterns:**
|
|
45
|
+
- `Test1`, `Test2`, `TestMethod`, `MyTest`
|
|
46
|
+
- `Should_Return_OK`, `test_get_all`
|
|
47
|
+
|
|
48
|
+
**REQUIRED pattern:**
|
|
49
|
+
```csharp
|
|
50
|
+
GetAll_WhenCalled_ShouldReturn200WithList
|
|
51
|
+
Create_WhenDuplicateCode_ShouldThrowException
|
|
52
|
+
Delete_WhenNotAuthenticated_ShouldReturn401
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Test Structure (BLOCKING)
|
|
58
|
+
|
|
59
|
+
All tests MUST follow Arrange-Act-Assert:
|
|
60
|
+
|
|
61
|
+
```csharp
|
|
62
|
+
// CORRECT
|
|
63
|
+
[Fact]
|
|
64
|
+
public async Task GetById_WhenExists_ShouldReturn200()
|
|
65
|
+
{
|
|
66
|
+
// Arrange
|
|
67
|
+
var id = Guid.NewGuid();
|
|
68
|
+
// ... setup
|
|
69
|
+
|
|
70
|
+
// Act
|
|
71
|
+
var response = await _client.GetAsync($"/api/{entityCode}/{id}");
|
|
72
|
+
|
|
73
|
+
// Assert
|
|
74
|
+
response.StatusCode.Should().Be(HttpStatusCode.OK);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// FORBIDDEN - No structure
|
|
78
|
+
[Fact]
|
|
79
|
+
public void TestGetById()
|
|
80
|
+
{
|
|
81
|
+
var response = _client.GetAsync("/api/product/1");
|
|
82
|
+
Assert.Equal(200, response.StatusCode);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Dependencies Check (BLOCKING)
|
|
89
|
+
|
|
90
|
+
Verify test project uses:
|
|
91
|
+
- `FluentAssertions` (NOT `Assert.Equal`)
|
|
92
|
+
- `Moq` (NOT manual fakes)
|
|
93
|
+
- `xunit` (NOT NUnit or MSTest)
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Test Categories
|
|
98
|
+
|
|
99
|
+
### 1. Controller Mock Tests
|
|
100
|
+
|
|
101
|
+
Unit tests with mocked dependencies:
|
|
102
|
+
- Routing validation
|
|
103
|
+
- Authentication/Authorization
|
|
104
|
+
- Error response formatting
|
|
105
|
+
- Input validation
|
|
106
|
+
|
|
107
|
+
```csharp
|
|
108
|
+
[Fact]
|
|
109
|
+
public async Task GetAll_WhenCalled_ShouldReturn200WithList()
|
|
110
|
+
{
|
|
111
|
+
// Mock service
|
|
112
|
+
_mockService.Setup(s => s.GetAllAsync(It.IsAny<CancellationToken>()))
|
|
113
|
+
.ReturnsAsync(new List<ProductDto>());
|
|
114
|
+
|
|
115
|
+
// Act & Assert
|
|
116
|
+
...
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 2. Controller Integration Tests
|
|
121
|
+
|
|
122
|
+
REAL tests with actual DB (via WebApplicationFactory):
|
|
123
|
+
- Full HTTP flow
|
|
124
|
+
- Database persistence
|
|
125
|
+
- Tenant isolation
|
|
126
|
+
- Query validation
|
|
127
|
+
|
|
128
|
+
### 3. Service Tests
|
|
129
|
+
|
|
130
|
+
Unit tests for business logic:
|
|
131
|
+
- CRUD operations
|
|
132
|
+
- Error handling
|
|
133
|
+
- Validation logic
|
|
134
|
+
|
|
135
|
+
### 4. Entity Tests
|
|
136
|
+
|
|
137
|
+
Domain model tests:
|
|
138
|
+
- Factory methods
|
|
139
|
+
- Property validation
|
|
140
|
+
- State transitions
|
|
141
|
+
- Soft delete
|
|
142
|
+
|
|
143
|
+
### 5. Validator Tests
|
|
144
|
+
|
|
145
|
+
Input validation:
|
|
146
|
+
- Code format validation
|
|
147
|
+
- Name constraints
|
|
148
|
+
- Security rules (XSS, SQL injection detection)
|
|
149
|
+
|
|
150
|
+
### 6. Repository Tests
|
|
151
|
+
|
|
152
|
+
Data access tests:
|
|
153
|
+
- Query correctness
|
|
154
|
+
- Tenant filtering
|
|
155
|
+
- Pagination
|
|
156
|
+
- Indexes
|
|
157
|
+
|
|
158
|
+
### 7. Security Tests
|
|
159
|
+
|
|
160
|
+
OWASP coverage:
|
|
161
|
+
- Authentication bypass attempts
|
|
162
|
+
- Authorization bypass attempts
|
|
163
|
+
- SQL injection attempts
|
|
164
|
+
- XSS payload handling
|
|
165
|
+
- CSRF token validation
|
|
166
|
+
- Tenant isolation breach attempts
|
|
167
|
+
- Header injection attempts
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## Build & Run Checks (BLOCKING)
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Build
|
|
175
|
+
dotnet build tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj
|
|
176
|
+
|
|
177
|
+
# Run
|
|
178
|
+
dotnet test tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj --no-build --verbosity normal
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**ALL tests MUST pass.** If tests fail:
|
|
182
|
+
1. Read the failure output carefully
|
|
183
|
+
2. Fix the failing tests or the code they test
|
|
184
|
+
3. Re-run until all tests pass
|
|
185
|
+
4. Do NOT proceed to the next step until all tests are green
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## Frontend Test Categories
|
|
190
|
+
|
|
191
|
+
| File | Category | Focus |
|
|
192
|
+
|------|----------|-------|
|
|
193
|
+
| `{EntityName}Page.test.tsx` | Page | Loading, error, render with data |
|
|
194
|
+
| `{EntityName}ListView.test.tsx` | List | Pagination, filtering, view toggle |
|
|
195
|
+
| `{EntityName}DetailPage.test.tsx` | Detail | Tab switching, back navigation |
|
|
196
|
+
| `use{EntityName}Preferences.test.ts` | Hooks | State persistence, local storage |
|
|
197
|
+
| `{entityName}Api.test.ts` | API Client | MSW mocking, HTTP methods |
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Validation Checklist
|
|
202
|
+
|
|
203
|
+
- [ ] All test methods follow `{Method}_When{Condition}_Should{Result}` naming
|
|
204
|
+
- [ ] All tests use Arrange-Act-Assert structure
|
|
205
|
+
- [ ] FluentAssertions used throughout (not Assert.Equal)
|
|
206
|
+
- [ ] Moq used for mock-based tests only
|
|
207
|
+
- [ ] Minimum test count met per category
|
|
208
|
+
- [ ] Real integration tests verify DB persistence
|
|
209
|
+
- [ ] Security tests cover OWASP top 10 issues
|
|
210
|
+
- [ ] Backend tests build successfully
|
|
211
|
+
- [ ] **ALL backend tests pass**
|
|
212
|
+
- [ ] Frontend tests build successfully
|
|
213
|
+
- [ ] **ALL frontend tests pass**
|
|
@@ -53,9 +53,9 @@ Args:
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
This generates:
|
|
56
|
-
- `src/pages/{
|
|
57
|
-
- `src/pages/{
|
|
58
|
-
- `src/pages/{
|
|
56
|
+
- `src/pages/{application}/__tests__/{EntityName}Page.test.tsx` - Page rendering, loading, error states
|
|
57
|
+
- `src/pages/{application}/__tests__/{EntityName}ListView.test.tsx` - List display, pagination, view toggle
|
|
58
|
+
- `src/pages/{application}/__tests__/{EntityName}DetailPage.test.tsx` - Detail view, tabs, back navigation
|
|
59
59
|
- `src/hooks/__tests__/use{EntityName}Preferences.test.ts` - Preference get/set
|
|
60
60
|
- `src/services/api/__tests__/{entityName}Api.test.ts` - API client calls with MSW
|
|
61
61
|
|
|
@@ -1,260 +1,130 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: step-00-init
|
|
3
|
-
description: Initialize application/module creation - parse parameters and validate context
|
|
4
|
-
next_step: steps/step-01-navigation.md
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Step 0: Initialization
|
|
8
|
-
|
|
9
|
-
## MANDATORY EXECUTION RULES
|
|
10
|
-
|
|
11
|
-
- NEVER skip parameter validation
|
|
12
|
-
- ALWAYS detect the navigation level from user request
|
|
13
|
-
- ALWAYS validate MCP availability before proceeding
|
|
14
|
-
- YOU ARE AN INITIALIZER, not an executor
|
|
15
|
-
- FORBIDDEN to call MCP tools until init is complete
|
|
16
|
-
|
|
17
|
-
## YOUR TASK
|
|
18
|
-
|
|
19
|
-
Initialize the application/module creation by parsing parameters, detecting level, and validating the SmartStack context.
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## EXECUTION SEQUENCE
|
|
24
|
-
|
|
25
|
-
### 1.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
| `specification.useCases[]` | step-04 (backend) | API endpoint definitions beyond basic CRUD |
|
|
132
|
-
| `specification.permissionMatrix` | step-02 (permissions) | Custom permission paths and role assignments |
|
|
133
|
-
| `specification.apiEndpoints[]` | step-04 (backend) | Exact HTTP methods, routes, DTOs |
|
|
134
|
-
| `specification.navigation` | step-01 (navigation) | Navigation hierarchy with labels and icons |
|
|
135
|
-
| `specification.i18nKeys` | step-05 (frontend) | Pre-defined translation keys |
|
|
136
|
-
| `specification.validations[]` | step-04 (backend) | Field-level validation rules |
|
|
137
|
-
| `specification.uiWireframes[]` | step-05 (frontend) | UI layout guidance |
|
|
138
|
-
| `specification.seedDataCore` | step-01, step-02, step-03 | Pre-computed seeds |
|
|
139
|
-
| `analysis.businessRules[]` | step-04, step-07 | Business rules for service logic and tests |
|
|
140
|
-
| `specification.lifeCycles[]` | step-04 (backend) | Entity state machines |
|
|
141
|
-
| `specification.dashboards` | step-05 (frontend) | Dashboard KPIs and chart specs |
|
|
142
|
-
| `documentation` | step-08 | userDocRequired / techDocRequired flags |
|
|
143
|
-
|
|
144
|
-
Store:
|
|
145
|
-
```
|
|
146
|
-
{feature_json_path} = "path/to/feature.json" or null
|
|
147
|
-
{has_feature_context} = true or false
|
|
148
|
-
{feature_data} = parsed feature.json object (if found)
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
**If NOT found or status not in ["handed-off", "consolidated"]:**
|
|
152
|
-
|
|
153
|
-
```
|
|
154
|
-
{has_feature_context} = false
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Continue normally. All subsequent steps use their standard generation logic (generic CRUD).
|
|
158
|
-
|
|
159
|
-
> **When `{has_feature_context} = true`**, subsequent steps SHOULD use the feature.json data
|
|
160
|
-
> to generate more accurate code: entities with correct attributes and relationships, custom
|
|
161
|
-
> permissions beyond basic CRUD, specific API routes, validation rules, and business logic
|
|
162
|
-
> in services. This reduces post-generation manual corrections significantly.
|
|
163
|
-
|
|
164
|
-
### 5. Build Full Path
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
{full_path} = {parentPath}.{code} (if parentPath exists)
|
|
168
|
-
{full_path} = {code} (if context level)
|
|
169
|
-
|
|
170
|
-
Example:
|
|
171
|
-
level: module
|
|
172
|
-
parentPath: erp.sales
|
|
173
|
-
code: products
|
|
174
|
-
→ full_path: erp.sales.products
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### 6. Infer Descriptions (if not provided)
|
|
178
|
-
|
|
179
|
-
```yaml
|
|
180
|
-
descriptions:
|
|
181
|
-
fr: "Gestion de {labels.fr}"
|
|
182
|
-
en: "{labels.en} management"
|
|
183
|
-
it: "Gestione di {labels.it}"
|
|
184
|
-
de: "Verwaltung von {labels.de}"
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### 7. Show Summary
|
|
188
|
-
|
|
189
|
-
```
|
|
190
|
-
## Application Skill: {level} - {code}
|
|
191
|
-
|
|
192
|
-
| Parameter | Value |
|
|
193
|
-
|-----------|-------|
|
|
194
|
-
| Level | {level} |
|
|
195
|
-
| Code | {code} |
|
|
196
|
-
| Full Path | {full_path} |
|
|
197
|
-
| Parent | {parentPath} |
|
|
198
|
-
| Icon | {icon} |
|
|
199
|
-
| Display Order | {displayOrder} |
|
|
200
|
-
| Project Type | {project_type} |
|
|
201
|
-
| Seeding Strategy | {seeding_strategy} |
|
|
202
|
-
| Feature.json | {has_feature_context ? feature_json_path : "Not found (standard generation)"} |
|
|
203
|
-
|
|
204
|
-
### Labels
|
|
205
|
-
| Language | Label |
|
|
206
|
-
|----------|-------|
|
|
207
|
-
| FR | {labels.fr} |
|
|
208
|
-
| EN | {labels.en} |
|
|
209
|
-
| IT | {labels.it} |
|
|
210
|
-
| DE | {labels.de} |
|
|
211
|
-
|
|
212
|
-
→ Proceeding to navigation generation...
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
---
|
|
216
|
-
|
|
217
|
-
## STATE VARIABLES TO PERSIST
|
|
218
|
-
|
|
219
|
-
| Variable | Description |
|
|
220
|
-
|----------|-------------|
|
|
221
|
-
| `{level}` | context, application, module, or section |
|
|
222
|
-
| `{code}` | kebab-case identifier |
|
|
223
|
-
| `{full_path}` | Complete navigation path |
|
|
224
|
-
| `{parent_path}` | Parent path (null for context) |
|
|
225
|
-
| `{labels}` | Object with fr, en, it, de |
|
|
226
|
-
| `{descriptions}` | Object with fr, en, it, de |
|
|
227
|
-
| `{icon}` | Lucide icon name |
|
|
228
|
-
| `{display_order}` | Numeric display order |
|
|
229
|
-
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
230
|
-
| `{project_type}` | "core" or "client" (from .smartstack/config.json) |
|
|
231
|
-
| `{db_context}` | "core" or "extensions" (from .smartstack/config.json) |
|
|
232
|
-
| `{seeding_strategy}` | "hasdata" (core) or "provider" (client) |
|
|
233
|
-
| `{feature_json_path}` | Path to feature.json (null if not found) |
|
|
234
|
-
| `{has_feature_context}` | Boolean - whether BA context is available |
|
|
235
|
-
| `{feature_data}` | Parsed feature.json object (null if not found) |
|
|
236
|
-
|
|
237
|
-
---
|
|
238
|
-
|
|
239
|
-
## SUCCESS METRICS
|
|
240
|
-
|
|
241
|
-
- Level correctly detected
|
|
242
|
-
- All required parameters extracted
|
|
243
|
-
- MCP availability verified
|
|
244
|
-
- Project type and seeding strategy detected
|
|
245
|
-
- Feature.json detected if available (enrichment context loaded)
|
|
246
|
-
- Full path computed correctly
|
|
247
|
-
- Summary displayed
|
|
248
|
-
- Proceeded to step-01-navigation.md
|
|
249
|
-
|
|
250
|
-
## FAILURE MODES
|
|
251
|
-
|
|
252
|
-
- Missing required parameters (ask user)
|
|
253
|
-
- Invalid level detection (clarify with user)
|
|
254
|
-
- MCP not available (STOP - display install instructions)
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## NEXT STEP
|
|
259
|
-
|
|
260
|
-
After showing initialization summary, proceed to `./step-01-navigation.md`
|
|
1
|
+
---
|
|
2
|
+
name: step-00-init
|
|
3
|
+
description: Initialize application/module creation - parse parameters and validate context
|
|
4
|
+
next_step: steps/step-01-navigation.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Step 0: Initialization
|
|
8
|
+
|
|
9
|
+
## MANDATORY EXECUTION RULES
|
|
10
|
+
|
|
11
|
+
- NEVER skip parameter validation
|
|
12
|
+
- ALWAYS detect the navigation level from user request
|
|
13
|
+
- ALWAYS validate MCP availability before proceeding
|
|
14
|
+
- YOU ARE AN INITIALIZER, not an executor
|
|
15
|
+
- FORBIDDEN to call MCP tools until init is complete
|
|
16
|
+
|
|
17
|
+
## YOUR TASK
|
|
18
|
+
|
|
19
|
+
Initialize the application/module creation by parsing parameters, detecting level, and validating the SmartStack context.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## EXECUTION SEQUENCE
|
|
24
|
+
|
|
25
|
+
### 1-4. Parameter Detection & Project Analysis
|
|
26
|
+
|
|
27
|
+
See [references/init-parameter-detection.md](../references/init-parameter-detection.md) for:
|
|
28
|
+
- Navigation level detection (application/module/section/resource)
|
|
29
|
+
- Parameter extraction (code, labels, icon, displayOrder)
|
|
30
|
+
- Project type & seeding strategy detection
|
|
31
|
+
- Feature.json context enrichment (optional)
|
|
32
|
+
- MCP prerequisite validation (BLOCKING)
|
|
33
|
+
|
|
34
|
+
### 5. Build Full Path
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
{full_path} = {parentPath}.{code} (if parentPath exists)
|
|
38
|
+
{full_path} = {code} (if application level)
|
|
39
|
+
|
|
40
|
+
Example:
|
|
41
|
+
level: module
|
|
42
|
+
parentPath: sales
|
|
43
|
+
code: products
|
|
44
|
+
→ full_path: sales.products
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 6. Infer Descriptions (if not provided)
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
descriptions:
|
|
51
|
+
fr: "Gestion de {labels.fr}"
|
|
52
|
+
en: "{labels.en} management"
|
|
53
|
+
it: "Gestione di {labels.it}"
|
|
54
|
+
de: "Verwaltung von {labels.de}"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### 7. Show Summary
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
## Application Skill: {level} - {code}
|
|
61
|
+
|
|
62
|
+
| Parameter | Value |
|
|
63
|
+
|-----------|-------|
|
|
64
|
+
| Level | {level} |
|
|
65
|
+
| Code | {code} |
|
|
66
|
+
| Full Path | {full_path} |
|
|
67
|
+
| Parent | {parentPath} |
|
|
68
|
+
| Icon | {icon} |
|
|
69
|
+
| Display Order | {displayOrder} |
|
|
70
|
+
| Project Type | {project_type} |
|
|
71
|
+
| Seeding Strategy | {seeding_strategy} |
|
|
72
|
+
| Feature.json | {has_feature_context ? feature_json_path : "Not found (standard generation)"} |
|
|
73
|
+
|
|
74
|
+
### Labels
|
|
75
|
+
| Language | Label |
|
|
76
|
+
|----------|-------|
|
|
77
|
+
| FR | {labels.fr} |
|
|
78
|
+
| EN | {labels.en} |
|
|
79
|
+
| IT | {labels.it} |
|
|
80
|
+
| DE | {labels.de} |
|
|
81
|
+
|
|
82
|
+
→ Proceeding to navigation generation...
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## STATE VARIABLES TO PERSIST
|
|
88
|
+
|
|
89
|
+
| Variable | Description |
|
|
90
|
+
|----------|-------------|
|
|
91
|
+
| `{level}` | application, module, section, or resource |
|
|
92
|
+
| `{code}` | kebab-case identifier |
|
|
93
|
+
| `{full_path}` | Complete navigation path |
|
|
94
|
+
| `{parent_path}` | Parent path (null for context) |
|
|
95
|
+
| `{labels}` | Object with fr, en, it, de |
|
|
96
|
+
| `{descriptions}` | Object with fr, en, it, de |
|
|
97
|
+
| `{icon}` | Lucide icon name |
|
|
98
|
+
| `{display_order}` | Numeric display order |
|
|
99
|
+
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
100
|
+
| `{project_type}` | "core" or "client" (from .smartstack/config.json) |
|
|
101
|
+
| `{db_context}` | "core" or "extensions" (from .smartstack/config.json) |
|
|
102
|
+
| `{seeding_strategy}` | "hasdata" (core) or "provider" (client) |
|
|
103
|
+
| `{feature_json_path}` | Path to feature.json (null if not found) |
|
|
104
|
+
| `{has_feature_context}` | Boolean - whether BA context is available |
|
|
105
|
+
| `{feature_data}` | Parsed feature.json object (null if not found) |
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## SUCCESS METRICS
|
|
110
|
+
|
|
111
|
+
- Level correctly detected
|
|
112
|
+
- All required parameters extracted
|
|
113
|
+
- MCP availability verified
|
|
114
|
+
- Project type and seeding strategy detected
|
|
115
|
+
- Feature.json detected if available (enrichment context loaded)
|
|
116
|
+
- Full path computed correctly
|
|
117
|
+
- Summary displayed
|
|
118
|
+
- Proceeded to step-01-navigation.md
|
|
119
|
+
|
|
120
|
+
## FAILURE MODES
|
|
121
|
+
|
|
122
|
+
- Missing required parameters (ask user)
|
|
123
|
+
- Invalid level detection (clarify with user)
|
|
124
|
+
- MCP not available (STOP - display install instructions)
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## NEXT STEP
|
|
129
|
+
|
|
130
|
+
After showing initialization summary, proceed to `./step-01-navigation.md`
|