@atlashub/smartstack-cli 3.37.0 → 3.38.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 +201 -256
- 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/gitflow/merge.md +0 -4
- package/templates/agents/gitflow/pr.md +0 -4
- package/templates/agents/gitflow/start.md +30 -5
- 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 -57
- package/templates/skills/apex/references/examine-build-validation.md +87 -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 +17 -17
- 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 +47 -249
- 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 +2 -0
- package/templates/skills/application/SKILL.md +6 -7
- 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 +120 -0
- package/templates/skills/application/references/migration-checklist-troubleshooting.md +100 -0
- package/templates/skills/application/references/nav-fallback-procedure.md +5 -6
- 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 +11 -141
- package/templates/skills/application/steps/step-01-navigation.md +3 -3
- package/templates/skills/application/steps/step-02-permissions.md +4 -4
- package/templates/skills/application/steps/step-03-roles.md +18 -175
- package/templates/skills/application/steps/step-03b-provider.md +1 -2
- package/templates/skills/application/steps/step-04-backend.md +19 -110
- package/templates/skills/application/steps/step-05-frontend.md +17 -143
- 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 +48 -48
- 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 +11 -11
- 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-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/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-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 +1 -1
- package/templates/skills/gitflow/_shared.md +23 -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 +51 -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 +71 -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 +21 -73
- package/templates/skills/review-code/references/owasp-api-top10.md +5 -5
- package/templates/skills/review-code/references/smartstack-conventions.md +11 -11
- 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 +5 -2
- 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,231 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Generate - Documentation Content
|
|
3
|
+
description: Generate documentation TSX, i18n files, and data files based on type
|
|
4
|
+
next_step: step-03-validate.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## STEP 02: Generate — Documentation Content
|
|
8
|
+
|
|
9
|
+
### Purpose
|
|
10
|
+
|
|
11
|
+
Generate the complete documentation structure based on type (user/developer/database/testing/update) using data collected in step-01.
|
|
12
|
+
|
|
13
|
+
### Generation By Type
|
|
14
|
+
|
|
15
|
+
#### For `user` Type: Standalone Mock UI Page
|
|
16
|
+
|
|
17
|
+
**IMPORTANT:** Generate a **standalone TSX page** with **annotated Mock UI** components that faithfully reproduce the real application interface. Each Mock UI section MUST be followed by `Annotation` components explaining each visual element. **DO NOT use DocRenderer or doc-data.ts for user type.**
|
|
18
|
+
|
|
19
|
+
**Output:** Standalone React TSX component (~400-600 lines)
|
|
20
|
+
|
|
21
|
+
**Structure — 9 Sections:**
|
|
22
|
+
|
|
23
|
+
1. **Section 1: Business Value** — Problem + solution
|
|
24
|
+
2. **Section 2: Access** — Navigation breadcrumb + URL
|
|
25
|
+
3. **Section 3: Interface Overview** — Annotated Mock UI (faithful to real page)
|
|
26
|
+
4. **Section 4: Create Form** — Annotated Mock UI (faithful to real form)
|
|
27
|
+
5. **Section 5: Detail View** — Annotated Mock UI (faithful to real detail)
|
|
28
|
+
6. **Section 6: Use Cases** — 2-3 personas
|
|
29
|
+
7. **Section 7: Features** — 5 features with examples
|
|
30
|
+
8. **Section 8: FAQ** — 5 non-technical questions
|
|
31
|
+
9. **Section 9: Technical Reference** — Collapsible: business rules + API endpoints
|
|
32
|
+
|
|
33
|
+
> **REMOVED:** "Benefits" and "Before/After" sections are NOT included. This is user documentation, not a sales pitch.
|
|
34
|
+
|
|
35
|
+
**Files to Generate:**
|
|
36
|
+
|
|
37
|
+
- `docs/business/{application}/{module}/index.tsx` (main page)
|
|
38
|
+
- `docs/business/{application}/{module}/i18n/fr.json` (French)
|
|
39
|
+
- `docs/business/{application}/{module}/i18n/en.json` (English)
|
|
40
|
+
- `docs/business/{application}/{module}/i18n/de.json` (German)
|
|
41
|
+
- `docs/business/{application}/{module}/i18n/it.json` (Italian)
|
|
42
|
+
|
|
43
|
+
**i18n Format:** FLAT JSON (no root key) for standalone pages
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"title": "Module Title",
|
|
48
|
+
"subtitle": "...",
|
|
49
|
+
"sections": { ... }
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### For `developer|database|testing` Types: Data-Driven with DocRenderer
|
|
54
|
+
|
|
55
|
+
**Files to Generate:**
|
|
56
|
+
|
|
57
|
+
- `docs/developer/{category}/{tool}Page.tsx` (wrapper)
|
|
58
|
+
- `docs/developer/{category}/doc-data.ts` (data, ~50 lines)
|
|
59
|
+
- `docs/developer/{category}/i18n/fr.json` (French)
|
|
60
|
+
- `docs/developer/{category}/i18n/en.json` (English)
|
|
61
|
+
- `docs/developer/{category}/i18n/de.json` (German)
|
|
62
|
+
- `docs/developer/{category}/i18n/it.json` (Italian)
|
|
63
|
+
|
|
64
|
+
**Workflow:**
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
1. Read source data (feature.json, code patterns)
|
|
68
|
+
2. Generate doc-data.ts (data file, ~50 lines)
|
|
69
|
+
3. Generate index.tsx (page wrapper, ~10 lines) with i18nNamespace prop
|
|
70
|
+
4. Generate i18n files in ALL 4 languages (FR, EN, DE, IT) — with root key for DocRenderer
|
|
71
|
+
5. Update docs-manifest.json
|
|
72
|
+
6. Update App.tsx routing and parent indexes
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**index.tsx Format for DocRenderer:**
|
|
76
|
+
|
|
77
|
+
```tsx
|
|
78
|
+
import { DocRenderer } from '@/components/docs';
|
|
79
|
+
import { docData } from './doc-data';
|
|
80
|
+
|
|
81
|
+
export default function {Tool}DocPage() {
|
|
82
|
+
return (
|
|
83
|
+
<DocRenderer
|
|
84
|
+
data={docData}
|
|
85
|
+
backPath="/docs/developer"
|
|
86
|
+
backLabel="nav.backToDeveloper"
|
|
87
|
+
i18nNamespace="docsDeveloper{Tool}"
|
|
88
|
+
/>
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**i18n Format:** Nested JSON with root key matching namespace
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"docsDeveloper{Tool}": {
|
|
98
|
+
"title": "Tool Title",
|
|
99
|
+
"subtitle": "...",
|
|
100
|
+
"sections": { ... }
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
#### For `update` Type
|
|
106
|
+
|
|
107
|
+
Re-generate files using the same workflow as original type, but:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
1. Read real page TSX → update Mock UI if interface changed
|
|
111
|
+
2. Read controller → update API endpoints and business rules
|
|
112
|
+
3. Update i18n files in ALL 4 languages (FR, EN, DE, IT)
|
|
113
|
+
4. Update docs-manifest.json timestamps (refreshed_at)
|
|
114
|
+
5. Do NOT regenerate route registration (already exists)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Extraction Scripts Reference
|
|
118
|
+
|
|
119
|
+
#### extract-api-endpoints.ts
|
|
120
|
+
|
|
121
|
+
**Purpose:** Extract all API endpoints from SmartStack controllers
|
|
122
|
+
|
|
123
|
+
**Input:**
|
|
124
|
+
- `--module {module}` - Module name (e.g., users, tenants)
|
|
125
|
+
- `--app-path {path}` - Path to SmartStack.app
|
|
126
|
+
|
|
127
|
+
**What it extracts:**
|
|
128
|
+
- Controller file path (e.g., `UsersController.cs`)
|
|
129
|
+
- HTTP method (`[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpDelete]`, `[HttpPatch]`)
|
|
130
|
+
- Route suffix (e.g., `{id:guid}`, `activate`)
|
|
131
|
+
- Base path from `[NavRoute("administration.users")]`
|
|
132
|
+
- Permission from `[RequirePermission(Permissions.Admin.Users.View)]`
|
|
133
|
+
- Handler method name
|
|
134
|
+
|
|
135
|
+
**Output:** JSON array
|
|
136
|
+
```json
|
|
137
|
+
[
|
|
138
|
+
{
|
|
139
|
+
"method": "GET",
|
|
140
|
+
"path": "/api/administration/users",
|
|
141
|
+
"handler": "GetUsers",
|
|
142
|
+
"permission": "administration.users.read"
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### extract-business-rules.ts
|
|
148
|
+
|
|
149
|
+
**Purpose:** Extract business rules from Domain entities and unit tests
|
|
150
|
+
|
|
151
|
+
**Input:**
|
|
152
|
+
- `--module {module}` - Module name (e.g., users, tenants)
|
|
153
|
+
- `--app-path {path}` - Path to SmartStack.app
|
|
154
|
+
|
|
155
|
+
**Phase 1: Domain Entity Extraction**
|
|
156
|
+
- Scans Domain entity (e.g., `User.cs`)
|
|
157
|
+
- Looks for guard clauses: `if (...) throw new DomainException("...")`
|
|
158
|
+
- Looks for validation in Create/Update methods
|
|
159
|
+
- Extracts exception messages and context
|
|
160
|
+
|
|
161
|
+
**Phase 2: Unit Tests Extraction**
|
|
162
|
+
- Scans unit test file (e.g., `UserTests.cs`)
|
|
163
|
+
- Looks for test methods with `[Fact]` attribute
|
|
164
|
+
- Extracts test names and scenarios (edge cases)
|
|
165
|
+
- Maps to business rule statements
|
|
166
|
+
|
|
167
|
+
**Output:** JSON array
|
|
168
|
+
```json
|
|
169
|
+
[
|
|
170
|
+
{
|
|
171
|
+
"id": "BR-001",
|
|
172
|
+
"name": "Email requis",
|
|
173
|
+
"category": "Validation",
|
|
174
|
+
"statement": "Un utilisateur doit avoir une adresse email valide et non vide"
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
#### generate-doc-with-mock-ui.ts
|
|
180
|
+
|
|
181
|
+
**Purpose:** Main generator - creates complete documentation TSX with Mock UI
|
|
182
|
+
|
|
183
|
+
**Input:**
|
|
184
|
+
- `--module {module}` - Module name (e.g., users)
|
|
185
|
+
- `--application {application}` - Application (e.g., administration)
|
|
186
|
+
- `--app-path {path}` - Path to SmartStack.app
|
|
187
|
+
|
|
188
|
+
**Workflow:**
|
|
189
|
+
1. Find Domain entity file (users → User.cs via singularize)
|
|
190
|
+
2. Extract entity properties (name, type, nullable, required)
|
|
191
|
+
3. Call `extract-api-endpoints.ts`
|
|
192
|
+
4. Call `extract-business-rules.ts`
|
|
193
|
+
5. Generate mock data (5 sample records with realistic values)
|
|
194
|
+
6. Generate KPI stats (Total, Active/Inactive, Status breakdown)
|
|
195
|
+
7. Generate table UI (smart column selection - 6 most relevant)
|
|
196
|
+
8. Generate form UI (intelligent field types based on property)
|
|
197
|
+
9. Output complete TSX file to stdout
|
|
198
|
+
|
|
199
|
+
**Smart Features:**
|
|
200
|
+
- **Singularize**: users → User.cs, tenants → Tenant.cs
|
|
201
|
+
- **Property filtering**: Excludes hash, token, *Id, normalized, internal
|
|
202
|
+
- **Priority selection**: name/title > email > status > date
|
|
203
|
+
- **Field type detection**: email → email input, bool → checkbox
|
|
204
|
+
- **Mock value generation**: Realistic emails, names, dates, GUIDs
|
|
205
|
+
|
|
206
|
+
**Output:** Complete React TSX component (400-500 lines)
|
|
207
|
+
|
|
208
|
+
### Absolute Rules
|
|
209
|
+
|
|
210
|
+
1. **NEVER** hardcoded text → `useTranslation('namespace')`
|
|
211
|
+
2. **NEVER** ASCII art → React/HTML components for ERD
|
|
212
|
+
3. **ALWAYS** read the REAL page TSX before generating Mock UI
|
|
213
|
+
4. **ALWAYS** read the controller to extract real API endpoints
|
|
214
|
+
5. **ALWAYS** annotate every Mock UI section with `Annotation` components
|
|
215
|
+
6. **ALWAYS** generate i18n in ALL 4 languages (FR, EN, DE, IT)
|
|
216
|
+
7. **ALWAYS** use FLAT JSON (no root key) for standalone `user` type pages
|
|
217
|
+
8. **ALWAYS** use nested JSON with root key for DocRenderer pages
|
|
218
|
+
|
|
219
|
+
### Success Metrics
|
|
220
|
+
|
|
221
|
+
- [x] TSX file generated with correct structure
|
|
222
|
+
- [x] Mock UI faithfully reproduces real interface
|
|
223
|
+
- [x] Every Mock UI section annotated with `Annotation` components
|
|
224
|
+
- [x] i18n files created in ALL 4 languages (FR, EN, DE, IT)
|
|
225
|
+
- [x] JSON format correct (FLAT for user, nested for others)
|
|
226
|
+
- [x] All hardcoded text uses `useTranslation()`
|
|
227
|
+
- [x] No "Benefices" or "Avant/Apres" sections present
|
|
228
|
+
|
|
229
|
+
### Next Step
|
|
230
|
+
|
|
231
|
+
→ **step-03-validate.md** — Validate completeness and integrate into project.
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Validate - Completeness and Integration
|
|
3
|
+
description: Validate documentation completeness, accuracy, and integrate into SmartStack app
|
|
4
|
+
next_step: null
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## STEP 03: Validate — Completeness and Integration
|
|
8
|
+
|
|
9
|
+
### Purpose
|
|
10
|
+
|
|
11
|
+
Validate that generated documentation is complete and accurate, then integrate into the SmartStack app with proper routing and i18n configuration.
|
|
12
|
+
|
|
13
|
+
### Validation Checklist
|
|
14
|
+
|
|
15
|
+
#### All Types
|
|
16
|
+
|
|
17
|
+
- [ ] Documentation page renders correctly in React app
|
|
18
|
+
- [ ] i18n files created in ALL 4 languages (FR, EN, DE, IT)
|
|
19
|
+
- [ ] Files saved to correct directory paths
|
|
20
|
+
- [ ] docs-manifest.json updated with new entry
|
|
21
|
+
- [ ] NO "Benefices" or "Avant/Apres" sections present
|
|
22
|
+
|
|
23
|
+
#### For `user` Type Only
|
|
24
|
+
|
|
25
|
+
- [ ] Mock UI faithfully reproduces the real page interface (not generic KPI/table)
|
|
26
|
+
- [ ] Every Mock UI section has `Annotation` components explaining each visual element
|
|
27
|
+
- [ ] i18n JSON is FLAT (no root key) — `t('title')` resolves directly
|
|
28
|
+
- [ ] Route registered in App.tsx
|
|
29
|
+
- [ ] Module appears in UserIndexPage.tsx (if applicable)
|
|
30
|
+
- [ ] DocPanelContext.tsx mapping updated for all module routes
|
|
31
|
+
- [ ] i18n/config.ts updated with new namespace
|
|
32
|
+
- [ ] BookOpen edge button opens correct doc for the module's routes
|
|
33
|
+
|
|
34
|
+
#### For `developer|database|testing` Types
|
|
35
|
+
|
|
36
|
+
- [ ] i18n JSON uses root key matching namespace
|
|
37
|
+
- [ ] DocRenderer wrapper (index.tsx) passes correct `i18nNamespace` prop
|
|
38
|
+
- [ ] doc-data.ts contains structured data (~50 lines)
|
|
39
|
+
- [ ] Route registered in App.tsx and parent indexes
|
|
40
|
+
|
|
41
|
+
#### For `update` Type
|
|
42
|
+
|
|
43
|
+
- [ ] Mock UI updates reflect current interface
|
|
44
|
+
- [ ] API endpoints verified against current controller
|
|
45
|
+
- [ ] Business rules updated with any new validation rules
|
|
46
|
+
- [ ] docs-manifest.json timestamps refreshed
|
|
47
|
+
- [ ] All 4 language files updated
|
|
48
|
+
|
|
49
|
+
### Integration Steps
|
|
50
|
+
|
|
51
|
+
#### UserIndexPage Integration (TYPE: user only)
|
|
52
|
+
|
|
53
|
+
**MANDATORY** for `user` modules: Add the module to the navigation hierarchy.
|
|
54
|
+
|
|
55
|
+
| File | Modification |
|
|
56
|
+
|------|--------------|
|
|
57
|
+
| `UserIndexPage.tsx` | Add icon + entry in `modules[]` of parent application |
|
|
58
|
+
| `fr/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
59
|
+
| `en/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
60
|
+
|
|
61
|
+
**Parent applications:**
|
|
62
|
+
- `Administration`: admin modules (users, roles, ai, entra...)
|
|
63
|
+
- `Support`: support modules (tickets, sla, templates...)
|
|
64
|
+
- `MySpace`: personal modules (profile, preferences...)
|
|
65
|
+
|
|
66
|
+
**Verification:** The module should appear on `/docs/user` under its application.
|
|
67
|
+
|
|
68
|
+
#### DocPanelContext Integration (TYPE: user only)
|
|
69
|
+
|
|
70
|
+
**MANDATORY** for `user` modules: Update the contextual documentation panel mapping.
|
|
71
|
+
|
|
72
|
+
**File to update:** `web/smartstack-web/src/contexts/DocPanelContext.tsx`
|
|
73
|
+
|
|
74
|
+
**What to add:** For each module, add entries in the `docMapping` object for ALL the module's routes:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const docMapping: Record<string, string> = {
|
|
78
|
+
// Administration > {Module}
|
|
79
|
+
'{module}': '/docs/business/administration/{module}',
|
|
80
|
+
'{module}/list': '/docs/business/administration/{module}',
|
|
81
|
+
'{module}/create': '/docs/business/administration/{module}',
|
|
82
|
+
'{module}/dashboard': '/docs/business/administration/{module}',
|
|
83
|
+
// ... add ALL sub-routes that exist for the module
|
|
84
|
+
};
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Also update `appDocMapping`** if the module is the "default" for its application:
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
const appDocMapping: Record<string, string> = {
|
|
91
|
+
'administration': '/docs/business/administration/users', // default for admin
|
|
92
|
+
};
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**Key resolution logic:** The `getDocUrlForPath()` function extracts segments from the pathname:
|
|
96
|
+
- `/administration/users/list` → tries `users/list`, then `users`
|
|
97
|
+
- `/support/tickets/123` → tries `tickets/123`, then `tickets`
|
|
98
|
+
|
|
99
|
+
#### App.tsx Routing
|
|
100
|
+
|
|
101
|
+
**For `user` type:** Add dynamic import and route:
|
|
102
|
+
|
|
103
|
+
```tsx
|
|
104
|
+
const {Module}DocPage = lazy(() =>
|
|
105
|
+
import('@/pages/docs/business/{application}/{module}')
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// In routes array:
|
|
109
|
+
{
|
|
110
|
+
path: '/docs/business/{application}/{module}',
|
|
111
|
+
element: <Suspense><{Module}DocPage /></Suspense>
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**For `developer|database|testing` types:** Add to appropriate category:
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
const {Tool}DocPage = lazy(() =>
|
|
119
|
+
import('@/pages/docs/developer/{category}/{tool}')
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// In routes array:
|
|
123
|
+
{
|
|
124
|
+
path: '/docs/developer/{category}/{tool}',
|
|
125
|
+
element: <Suspense><{Tool}DocPage /></Suspense>
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### i18n Config Update
|
|
130
|
+
|
|
131
|
+
**File:** `web/smartstack-web/src/i18n/config.ts`
|
|
132
|
+
|
|
133
|
+
Add the new namespace to `loadLanguageResources`:
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
// 1. Add to destructured imports
|
|
137
|
+
const {
|
|
138
|
+
docsAdministrationUsers,
|
|
139
|
+
docsAdministrationPermissions,
|
|
140
|
+
docsAdministrationNewModule, // NEW
|
|
141
|
+
// ...
|
|
142
|
+
} = resources;
|
|
143
|
+
|
|
144
|
+
// 2. Add dynamic import with fallback
|
|
145
|
+
const docsAdministrationNewModule = await import(
|
|
146
|
+
'@i18n/docs-administration-new-module.json'
|
|
147
|
+
).catch(() => ({ default: {} }));
|
|
148
|
+
|
|
149
|
+
// 3. Add to return object
|
|
150
|
+
return {
|
|
151
|
+
// ...
|
|
152
|
+
docsAdministrationNewModule,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
// 4. Add to ns array in i18n.init()
|
|
156
|
+
ns: [
|
|
157
|
+
'common',
|
|
158
|
+
'nav',
|
|
159
|
+
'docsAdministrationUsers',
|
|
160
|
+
'docsAdministrationPermissions',
|
|
161
|
+
'docsAdministrationNewModule', // NEW
|
|
162
|
+
// ...
|
|
163
|
+
]
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
#### docs-manifest.json Update
|
|
167
|
+
|
|
168
|
+
Add or update entry with metadata:
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{
|
|
172
|
+
"id": "{module}",
|
|
173
|
+
"type": "user",
|
|
174
|
+
"title": "Module Title",
|
|
175
|
+
"application": "administration",
|
|
176
|
+
"path": "/docs/business/administration/{module}",
|
|
177
|
+
"created_at": "2026-02-17T10:30:00Z",
|
|
178
|
+
"refreshed_at": "2026-02-17T10:30:00Z",
|
|
179
|
+
"i18n_namespace": "docsAdministration{Module}",
|
|
180
|
+
"routes": [
|
|
181
|
+
"{module}",
|
|
182
|
+
"{module}/list",
|
|
183
|
+
"{module}/create"
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Data Sources Reference
|
|
189
|
+
|
|
190
|
+
| Data | Source |
|
|
191
|
+
|------|--------|
|
|
192
|
+
| DB schemas | `src/SmartStack.Infrastructure/Persistence/Configurations/` |
|
|
193
|
+
| Tables | `ApplicationDbContextModelSnapshot.cs` |
|
|
194
|
+
| Existing documentation | `web/smartstack-web/src/pages/docs/` |
|
|
195
|
+
| Testing tools | WebSearch (current versions) |
|
|
196
|
+
| Real UI pages | `web/smartstack-web/src/pages/{Application}/` |
|
|
197
|
+
| Controllers | `src/SmartStack.Api/Controllers/` |
|
|
198
|
+
| Domain entities | `src/SmartStack.Domain/Entities/` |
|
|
199
|
+
| Permissions | `src/SmartStack.Domain/Authorization/Permissions.cs` |
|
|
200
|
+
|
|
201
|
+
### Associated Files Reference
|
|
202
|
+
|
|
203
|
+
- **React Templates:** `templates.md`
|
|
204
|
+
- **Data Schema:** `data-schema.md`
|
|
205
|
+
- **DocRenderer:** `web/smartstack-web/src/components/docs/DocRenderer.tsx`
|
|
206
|
+
- **Types:** `web/smartstack-web/src/components/docs/types.ts`
|
|
207
|
+
- **DocPanelContext:** `web/smartstack-web/src/contexts/DocPanelContext.tsx`
|
|
208
|
+
- **DocEdgeButton:** `web/smartstack-web/src/components/ui/DocEdgeButton.tsx`
|
|
209
|
+
- **DocPanel:** `web/smartstack-web/src/components/ui/DocPanel.tsx`
|
|
210
|
+
- **i18n Config:** `web/smartstack-web/src/i18n/config.ts`
|
|
211
|
+
- **Manifest Schema:** `_resources/docs-manifest-schema.md`
|
|
212
|
+
- **Complete Command:** `.claude/commands/documentation-module.md`
|
|
213
|
+
|
|
214
|
+
### Success Metrics
|
|
215
|
+
|
|
216
|
+
- [x] Documentation page renders correctly in React app
|
|
217
|
+
- [x] Mock UI faithfully reproduces the real page interface (user type)
|
|
218
|
+
- [x] Every Mock UI section has `Annotation` components (user type)
|
|
219
|
+
- [x] i18n files created in ALL 4 languages (FR, EN, DE, IT) with correct format
|
|
220
|
+
- [x] Route registered in App.tsx
|
|
221
|
+
- [x] docs-manifest.json updated
|
|
222
|
+
- [x] i18n/config.ts updated with new namespace
|
|
223
|
+
- [x] Module appears in UserIndexPage (if type = user)
|
|
224
|
+
- [x] DocPanelContext.tsx mapping updated (if type = user)
|
|
225
|
+
- [x] BookOpen edge button opens correct doc for the module's routes
|
|
226
|
+
- [x] NO "Benefices" or "Avant/Apres" sections present
|
|
227
|
+
- [x] All tests pass and app builds successfully
|
|
228
|
+
|
|
229
|
+
### Completion
|
|
230
|
+
|
|
231
|
+
**Documentation workflow complete.** The generated documentation is now:
|
|
232
|
+
- Fully integrated into SmartStack app
|
|
233
|
+
- Accessible via routing system
|
|
234
|
+
- Accessible via DocPanel contextual button
|
|
235
|
+
- Internationalized in FR, EN, DE, IT
|
|
236
|
+
- Listed in docs-manifest.json for discovery
|
|
237
|
+
|
|
238
|
+
**Next:** Monitor for feedback on documentation accuracy and completeness. Use step-03 validation checklist for future updates.
|