@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
|
@@ -40,7 +40,7 @@ Claude automatically invokes this skill when it detects:
|
|
|
40
40
|
|
|
41
41
|
| Type | Description | Output |
|
|
42
42
|
|------|-------------|--------|
|
|
43
|
-
| `user` | User module (
|
|
43
|
+
| `user` | User module (Mock UI) | `docs/business/{application}/{module}/index.tsx` (standalone TSX with Mock UI) |
|
|
44
44
|
| `developer` | Development tool guide | `docs/developer/tools/{Tool}Page.tsx` |
|
|
45
45
|
| `database` | Schema with ERD diagram | `docs/developer/database/{Schema}SchemaPage.tsx` |
|
|
46
46
|
| `testing` | Testing tool | `docs/developer/testing/{Tool}TestingPage.tsx` |
|
|
@@ -58,371 +58,75 @@ Claude automatically invokes this skill when it detects:
|
|
|
58
58
|
</parameters>
|
|
59
59
|
|
|
60
60
|
<workflow>
|
|
61
|
-
##
|
|
61
|
+
## WORKFLOW EXECUTION SEQUENCE
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
The documentation skill executes in 4 progressive steps, each loaded on-demand:
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
1. **[Step 00: Init](steps/step-00-init.md)** — Detect documentation type and gather context
|
|
66
|
+
2. **[Step 01: Scan](steps/step-01-scan.md)** — Scan source code and extract data
|
|
67
|
+
3. **[Step 02: Generate](steps/step-02-generate.md)** — Generate documentation content
|
|
68
|
+
4. **[Step 03: Validate](steps/step-03-validate.md)** — Validate and integrate into SmartStack
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|------|--------|
|
|
69
|
-
| Functional module (SLA, Tickets, Users) | `user` |
|
|
70
|
-
| Dev tool (Docker, Postman, VS Code) | `developer` |
|
|
71
|
-
| Tables, schema, database | `database` |
|
|
72
|
-
| Tests (security, load, E2E) | `testing` |
|
|
70
|
+
### Quick Reference
|
|
73
71
|
|
|
74
|
-
|
|
72
|
+
| Type | Key Actions |
|
|
73
|
+
|------|-----------|
|
|
74
|
+
| `user` | Read real page TSX → Extract API/BR → Generate standalone annotated Mock UI TSX → Generate i18n (4 lang, FLAT) → Register routes/DocPanel |
|
|
75
|
+
| `developer\|database\|testing` | Extract tool data → Generate doc-data.ts → Generate DocRenderer wrapper → Generate i18n (4 lang, nested) → Register routes |
|
|
76
|
+
| `update` | Re-read real page TSX → Refresh API endpoints and business rules → Update i18n files (4 lang) → Update docs-manifest.json timestamps |
|
|
75
77
|
|
|
76
|
-
|
|
77
|
-
- Module: `sla`, `tickets`, `users`, `permissions`
|
|
78
|
-
- Tool: `docker`, `postman`, `playwright`, `maildev`
|
|
79
|
-
- Schema: `support`, `auth`, `nav`, `usr`
|
|
80
|
-
- Test: `security`, `load`, `e2e`
|
|
81
|
-
|
|
82
|
-
### STEP 3: EXECUTION
|
|
83
|
-
|
|
84
|
-
**For NEW documentation (type = user) - AUTOMATIC MOCK UI GENERATION:**
|
|
85
|
-
|
|
86
|
-
Use the automated generator script that creates complete documentation with Mock UI components:
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
npx tsx scripts/generate-doc-with-mock-ui.ts \
|
|
90
|
-
--module {module} \
|
|
91
|
-
--context {context} \
|
|
92
|
-
--application {application} \
|
|
93
|
-
--app-path "D:/01 - projets/SmartStack.app/02-Develop"
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
**What it does automatically:**
|
|
97
|
-
|
|
98
|
-
1. **Find & Extract Entity** (e.g., users → User.cs)
|
|
99
|
-
- Locates Domain entity file
|
|
100
|
-
- Extracts all properties with types
|
|
101
|
-
|
|
102
|
-
2. **Extract API Endpoints** (via `extract-api-endpoints.ts`)
|
|
103
|
-
- Scans controller for all endpoints
|
|
104
|
-
- Parses `[HttpGet]`, `[HttpPost]`, `[NavRoute]`, `[RequirePermission]`
|
|
105
|
-
- Resolves permission constants
|
|
106
|
-
- Output: JSON array of endpoints with method, path, handler, permission
|
|
107
|
-
|
|
108
|
-
3. **Extract Business Rules** (via `extract-business-rules.ts`)
|
|
109
|
-
- Scans Domain entity for guard clauses and DomainExceptions
|
|
110
|
-
- Scans unit tests for edge case scenarios
|
|
111
|
-
- Auto-assigns BR-XXX IDs and categorizes rules
|
|
112
|
-
- Output: JSON array of business rules with id, name, category, statement
|
|
113
|
-
|
|
114
|
-
4. **Generate Mock UI Components**
|
|
115
|
-
- **KPIs**: Automatic stats based on entity properties
|
|
116
|
-
- Total count
|
|
117
|
-
- Active/Inactive (if IsActive property)
|
|
118
|
-
- Status breakdown (if Status property)
|
|
119
|
-
- Time-based stats (if DateTime property)
|
|
120
|
-
- **Table**: Smart column selection (6 most relevant properties)
|
|
121
|
-
- Filters out: Hash, Token, *Id (FK), normalized, internal fields
|
|
122
|
-
- Prioritizes: name/title → email → status → date
|
|
123
|
-
- **Form**: Create form with intelligent field types
|
|
124
|
-
- Email → type="email" with placeholder
|
|
125
|
-
- Bool → checkbox
|
|
126
|
-
- DateTime → type="date"
|
|
127
|
-
- Description/Notes → textarea
|
|
128
|
-
- Default → type="text"
|
|
129
|
-
|
|
130
|
-
5. **Generate Complete TSX File**
|
|
131
|
-
- Full React component with breadcrumb, sections, mock data
|
|
132
|
-
- Section 1: Introduction
|
|
133
|
-
- Section 2: Access (navigation path + URL)
|
|
134
|
-
- Section 3: Interface Overview (KPIs + Table Mock UI)
|
|
135
|
-
- Section 4: Create Form (generated form fields)
|
|
136
|
-
- Section 5: API Reference (endpoints table)
|
|
137
|
-
|
|
138
|
-
6. **Manual Steps (Post-Generation)**
|
|
139
|
-
- Save generated TSX to `docs/business/{context}/{application}/{module}/index.tsx`
|
|
140
|
-
- Update docs-manifest.json
|
|
141
|
-
- Update App.tsx routing
|
|
142
|
-
- Update DocPanelContext.tsx mapping
|
|
143
|
-
- Generate i18n FR file (if needed)
|
|
144
|
-
|
|
145
|
-
**For NEW documentation (type = developer|database|testing):**
|
|
146
|
-
|
|
147
|
-
Follow the data-driven workflow from [templates.md](templates.md):
|
|
148
|
-
|
|
149
|
-
```
|
|
150
|
-
1. Read source data (feature.json, code patterns)
|
|
151
|
-
2. Generate doc-data.ts (data file, ~50 lines)
|
|
152
|
-
3. Generate index.tsx (page wrapper, ~10 lines) with i18nNamespace prop
|
|
153
|
-
4. Generate i18n FR file (source language only)
|
|
154
|
-
5. Update docs-manifest.json
|
|
155
|
-
6. Update App.tsx routing and parent indexes
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**For UPDATE documentation (type = update):**
|
|
159
|
-
|
|
160
|
-
Re-run the generator script to refresh automatically extracted data:
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
1. Run generate-doc-with-mock-ui.ts → regenerates with latest API/rules
|
|
164
|
-
2. Update i18n FR file if labels changed
|
|
165
|
-
3. Update docs-manifest.json timestamps
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
> **i18n simplifié:** Seul FR (source) est généré. EN/IT/DE sont déférés à un pipeline de traduction séparé.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## EXTRACTION SCRIPTS REFERENCE
|
|
173
|
-
|
|
174
|
-
### extract-api-endpoints.ts
|
|
175
|
-
|
|
176
|
-
**Purpose:** Extract all API endpoints from SmartStack controllers
|
|
177
|
-
|
|
178
|
-
**Input:**
|
|
179
|
-
- `--module {module}` - Module name (e.g., users, tenants)
|
|
180
|
-
- `--app-path {path}` - Path to SmartStack.app
|
|
181
|
-
|
|
182
|
-
**What it extracts:**
|
|
183
|
-
- Controller file path (e.g., `UsersController.cs`)
|
|
184
|
-
- HTTP method (`[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpDelete]`, `[HttpPatch]`)
|
|
185
|
-
- Route suffix (e.g., `{id:guid}`, `activate`)
|
|
186
|
-
- Base path from `[NavRoute("platform.administration.users")]`
|
|
187
|
-
- Permission from `[RequirePermission(Permissions.Admin.Users.View)]`
|
|
188
|
-
- Handler method name
|
|
189
|
-
|
|
190
|
-
**Output:** JSON array
|
|
191
|
-
```json
|
|
192
|
-
[
|
|
193
|
-
{
|
|
194
|
-
"method": "GET",
|
|
195
|
-
"path": "/api/platform/administration/users",
|
|
196
|
-
"handler": "GetUsers",
|
|
197
|
-
"permission": "platform.administration.users.read"
|
|
198
|
-
}
|
|
199
|
-
]
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Permission resolution:**
|
|
203
|
-
- Loads `Permissions.cs` constants
|
|
204
|
-
- Maps `Permissions.Admin.Users.View` → `"platform.administration.users.read"`
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
### extract-business-rules.ts
|
|
209
|
-
|
|
210
|
-
**Purpose:** Extract business rules from Domain entities and unit tests
|
|
211
|
-
|
|
212
|
-
**Input:**
|
|
213
|
-
- `--module {module}` - Module name (e.g., users, tenants)
|
|
214
|
-
- `--app-path {path}` - Path to SmartStack.app
|
|
215
|
-
|
|
216
|
-
**Phase 1: Domain Entity Extraction**
|
|
217
|
-
- Scans Domain entity (e.g., `User.cs`)
|
|
218
|
-
- Looks for guard clauses: `if (...) throw new DomainException("...")`
|
|
219
|
-
- Looks for validation in Create/Update methods
|
|
220
|
-
- Extracts exception messages and context
|
|
221
|
-
|
|
222
|
-
**Phase 2: Unit Tests Extraction**
|
|
223
|
-
- Scans unit test file (e.g., `UserTests.cs`)
|
|
224
|
-
- Looks for test methods with `[Fact]` attribute
|
|
225
|
-
- Extracts test names and scenarios (edge cases)
|
|
226
|
-
- Maps to business rule statements
|
|
227
|
-
|
|
228
|
-
**Output:** JSON array
|
|
229
|
-
```json
|
|
230
|
-
[
|
|
231
|
-
{
|
|
232
|
-
"id": "BR-001",
|
|
233
|
-
"name": "Email requis",
|
|
234
|
-
"category": "Validation",
|
|
235
|
-
"statement": "Un utilisateur doit avoir une adresse email valide et non vide"
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
**Auto-categorization:**
|
|
241
|
-
- Validation: Required fields, format checks
|
|
242
|
-
- Security: Password rules, access control
|
|
243
|
-
- Business Logic: State transitions, calculations
|
|
244
|
-
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
### generate-doc-with-mock-ui.ts
|
|
248
|
-
|
|
249
|
-
**Purpose:** Main generator - creates complete documentation TSX with Mock UI
|
|
250
|
-
|
|
251
|
-
**Input:**
|
|
252
|
-
- `--module {module}` - Module name (e.g., users)
|
|
253
|
-
- `--context {context}` - Context (e.g., platform)
|
|
254
|
-
- `--application {application}` - Application (e.g., administration)
|
|
255
|
-
- `--app-path {path}` - Path to SmartStack.app
|
|
78
|
+
</workflow>
|
|
256
79
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
2. Extract entity properties (name, type, nullable, required)
|
|
260
|
-
3. Call `extract-api-endpoints.ts`
|
|
261
|
-
4. Call `extract-business-rules.ts`
|
|
262
|
-
5. Generate mock data (5 sample records with realistic values)
|
|
263
|
-
6. Generate KPI stats (Total, Active/Inactive, Status breakdown)
|
|
264
|
-
7. Generate table UI (smart column selection - 6 most relevant)
|
|
265
|
-
8. Generate form UI (intelligent field types based on property)
|
|
266
|
-
9. Output complete TSX file to stdout
|
|
80
|
+
<entry_point>
|
|
81
|
+
## SKILL ENTRY POINT
|
|
267
82
|
|
|
268
|
-
**
|
|
269
|
-
- **Singularize**: users → User.cs, tenants → Tenant.cs
|
|
270
|
-
- **Property filtering**: Excludes hash, token, *Id, normalized, internal
|
|
271
|
-
- **Priority selection**: name/title > email > status > date
|
|
272
|
-
- **Field type detection**: email → email input, bool → checkbox
|
|
273
|
-
- **Mock value generation**: Realistic emails, names, dates, GUIDs
|
|
83
|
+
**Start with:** [steps/step-00-init.md](steps/step-00-init.md)
|
|
274
84
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
85
|
+
All execution flows through this progressive loading architecture. Each step file contains:
|
|
86
|
+
- Clear execution sequence
|
|
87
|
+
- Success metrics
|
|
88
|
+
- Next step reference
|
|
89
|
+
</entry_point>
|
|
278
90
|
|
|
279
91
|
<execution_rules>
|
|
280
92
|
## ABSOLUTE RULES
|
|
281
93
|
|
|
282
|
-
1. **NEVER** hardcoded text → `useTranslation('
|
|
94
|
+
1. **NEVER** hardcoded text → `useTranslation('namespace')`
|
|
283
95
|
2. **NEVER** ASCII art → React/HTML components for ERD
|
|
284
|
-
3. **ALWAYS** read
|
|
285
|
-
4. **ALWAYS**
|
|
286
|
-
5. **ALWAYS**
|
|
287
|
-
6. **ALWAYS**
|
|
288
|
-
7. **ALWAYS**
|
|
289
|
-
8. **ALWAYS**
|
|
96
|
+
3. **ALWAYS** read the REAL page TSX before generating Mock UI
|
|
97
|
+
4. **ALWAYS** read the controller to extract real API endpoints
|
|
98
|
+
5. **ALWAYS** annotate every Mock UI section with `Annotation` components
|
|
99
|
+
6. **ALWAYS** generate i18n in ALL 4 languages (FR, EN, DE, IT)
|
|
100
|
+
7. **ALWAYS** use FLAT JSON (no root key) for standalone `user` type pages
|
|
101
|
+
8. **ALWAYS** update App.tsx, docs-manifest.json, i18n/config.ts
|
|
102
|
+
9. **ALWAYS** add module in `UserIndexPage.tsx` (IF type == `user`)
|
|
103
|
+
10. **ALWAYS** update `DocPanelContext.tsx` mapping (IF type == `user`)
|
|
104
|
+
11. **For `user` type:** Generate a standalone annotated Mock UI TSX page. **DO NOT use DocRenderer.**
|
|
105
|
+
12. **For `developer|database|testing` types:** Use DocRenderer with `doc-data.ts` + `index.tsx` wrapper, pass `i18nNamespace` prop.
|
|
106
|
+
13. **NEVER** include "Benefices" or "Avant/Apres" sections — this is documentation, not sales.
|
|
290
107
|
</execution_rules>
|
|
291
108
|
|
|
292
|
-
|
|
109
|
+
<step_files>
|
|
110
|
+
## Step Files
|
|
111
|
+
|
|
112
|
+
| Step | File | Purpose |
|
|
113
|
+
|------|------|---------|
|
|
114
|
+
| 00 | [steps/step-00-init.md](steps/step-00-init.md) | Detect documentation type and gather context |
|
|
115
|
+
| 01 | [steps/step-01-scan.md](steps/step-01-scan.md) | Scan source code and extract data |
|
|
116
|
+
| 02 | [steps/step-02-generate.md](steps/step-02-generate.md) | Generate documentation content |
|
|
117
|
+
| 03 | [steps/step-03-validate.md](steps/step-03-validate.md) | Validate and integrate into SmartStack |
|
|
118
|
+
</step_files>
|
|
293
119
|
|
|
294
120
|
<success_criteria>
|
|
295
121
|
- Documentation page renders correctly in React app
|
|
296
|
-
-
|
|
122
|
+
- Mock UI faithfully reproduces the real page interface (not generic KPI/table)
|
|
123
|
+
- Every Mock UI section has `Annotation` components explaining each visual element
|
|
124
|
+
- i18n files created in ALL 4 languages (FR, EN, DE, IT) with correct JSON format
|
|
297
125
|
- Route registered in App.tsx
|
|
298
126
|
- docs-manifest.json updated
|
|
127
|
+
- i18n/config.ts updated with new namespace
|
|
299
128
|
- Module appears in UserIndexPage (if type = user)
|
|
300
129
|
- DocPanelContext.tsx mapping updated (if type = user)
|
|
301
130
|
- BookOpen edge button opens correct doc for the module's routes
|
|
131
|
+
- NO "Benefices" or "Avant/Apres" sections present
|
|
302
132
|
</success_criteria>
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
## UserIndexPage Integration (TYPE: user)
|
|
307
|
-
|
|
308
|
-
**MANDATORY** for `user` modules: Add the module to the navigation hierarchy.
|
|
309
|
-
|
|
310
|
-
| File | Modification |
|
|
311
|
-
|------|--------------|
|
|
312
|
-
| `UserIndexPage.tsx` | Add icon + entry in `modules[]` of parent application |
|
|
313
|
-
| `fr/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
314
|
-
| `en/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
315
|
-
|
|
316
|
-
**Parent applications:**
|
|
317
|
-
- `Platform > Administration`: admin modules (users, roles, ai, entra...)
|
|
318
|
-
- `Platform > Support`: support modules (tickets, sla, templates...)
|
|
319
|
-
- `Personal > MySpace`: personal modules (profile, preferences...)
|
|
320
|
-
|
|
321
|
-
**Verification:** The module should appear on `/docs/user` under its application.
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
## DocPanelContext Integration (TYPE: user)
|
|
326
|
-
|
|
327
|
-
**MANDATORY** for `user` modules: Update the contextual documentation panel mapping.
|
|
328
|
-
|
|
329
|
-
### How it works
|
|
330
|
-
|
|
331
|
-
When a user clicks the BookOpen icon (edge button) on any application page, the `DocPanelContext` resolves the current route to the matching documentation URL and opens it in an iframe panel.
|
|
332
|
-
|
|
333
|
-
### File to update
|
|
334
|
-
|
|
335
|
-
`web/smartstack-web/src/contexts/DocPanelContext.tsx`
|
|
336
|
-
|
|
337
|
-
### What to add
|
|
338
|
-
|
|
339
|
-
For each module, add entries in the `docMapping` object for ALL the module's routes:
|
|
340
|
-
|
|
341
|
-
```typescript
|
|
342
|
-
const docMapping: Record<string, string> = {
|
|
343
|
-
// Platform > Administration > {Module}
|
|
344
|
-
'{module}': '/docs/business/platform/administration/{module}',
|
|
345
|
-
'{module}/list': '/docs/business/platform/administration/{module}',
|
|
346
|
-
'{module}/create': '/docs/business/platform/administration/{module}',
|
|
347
|
-
'{module}/dashboard': '/docs/business/platform/administration/{module}',
|
|
348
|
-
// ... add ALL sub-routes that exist for the module
|
|
349
|
-
};
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
### Key resolution logic
|
|
353
|
-
|
|
354
|
-
The `getDocUrlForPath()` function extracts segments from the pathname:
|
|
355
|
-
- `/platform/administration/users/list` → tries `users/list`, then `users`
|
|
356
|
-
- `/platform/support/tickets/123` → tries `tickets/123`, then `tickets`
|
|
357
|
-
|
|
358
|
-
**Also update `appDocMapping`** if the module is the "default" for its application:
|
|
359
|
-
|
|
360
|
-
```typescript
|
|
361
|
-
const appDocMapping: Record<string, string> = {
|
|
362
|
-
'administration': '/docs/business/platform/administration/users', // default for admin
|
|
363
|
-
};
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### index.tsx must pass i18nNamespace
|
|
367
|
-
|
|
368
|
-
Each doc page wrapper MUST pass the correct i18n namespace to DocRenderer:
|
|
369
|
-
|
|
370
|
-
```tsx
|
|
371
|
-
import { DocRenderer } from '@/components/docs';
|
|
372
|
-
import { docData } from './doc-data';
|
|
373
|
-
|
|
374
|
-
export default function {Module}DocPage() {
|
|
375
|
-
return (
|
|
376
|
-
<DocRenderer
|
|
377
|
-
data={docData}
|
|
378
|
-
backPath="/docs/business/platform"
|
|
379
|
-
backLabel="nav.backToAdministration"
|
|
380
|
-
i18nNamespace="docsAdministration{Module}"
|
|
381
|
-
/>
|
|
382
|
-
);
|
|
383
|
-
}
|
|
384
|
-
```
|
|
385
|
-
|
|
386
|
-
### i18n namespace naming convention
|
|
387
|
-
|
|
388
|
-
| Module | Namespace | File |
|
|
389
|
-
|--------|-----------|------|
|
|
390
|
-
| users | `docsAdministrationUsers` | `docs-administration-users.json` |
|
|
391
|
-
| permissions | `docsAdministrationPermissions` | `docs-administration-permissions.json` |
|
|
392
|
-
| tenants | `docsAdministrationTenants` | `docs-administration-tenants.json` |
|
|
393
|
-
|
|
394
|
-
The JSON file root key MUST match the namespace: `{ "docsAdministration{Module}": { ... } }`
|
|
395
|
-
|
|
396
|
-
### i18n config update
|
|
397
|
-
|
|
398
|
-
Add the new namespace to `web/smartstack-web/src/i18n/config.ts`:
|
|
399
|
-
1. Add to the destructured imports in `loadLanguageResources`
|
|
400
|
-
2. Add the dynamic import with `.catch(() => ({ default: {} }))`
|
|
401
|
-
3. Add to the return object
|
|
402
|
-
4. Add to the `ns` array in `i18n.init()`
|
|
403
|
-
|
|
404
|
-
---
|
|
405
|
-
|
|
406
|
-
## DATA SOURCES
|
|
407
|
-
|
|
408
|
-
| Data | Source |
|
|
409
|
-
|------|--------|
|
|
410
|
-
| DB schemas | `src/SmartStack.Infrastructure/Persistence/Configurations/` |
|
|
411
|
-
| Tables | `ApplicationDbContextModelSnapshot.cs` |
|
|
412
|
-
| Existing documentation | `web/smartstack-web/src/pages/docs/` |
|
|
413
|
-
| Testing tools | WebSearch (current versions) |
|
|
414
|
-
|
|
415
|
-
---
|
|
416
|
-
|
|
417
|
-
## ASSOCIATED FILES
|
|
418
|
-
|
|
419
|
-
- **React Templates:** [templates.md](templates.md)
|
|
420
|
-
- **Data Schema:** [data-schema.md](data-schema.md)
|
|
421
|
-
- **DocRenderer:** `web/smartstack-web/src/components/docs/DocRenderer.tsx`
|
|
422
|
-
- **Types:** `web/smartstack-web/src/components/docs/types.ts`
|
|
423
|
-
- **DocPanelContext:** `web/smartstack-web/src/contexts/DocPanelContext.tsx`
|
|
424
|
-
- **DocEdgeButton:** `web/smartstack-web/src/components/ui/DocEdgeButton.tsx`
|
|
425
|
-
- **DocPanel:** `web/smartstack-web/src/components/ui/DocPanel.tsx`
|
|
426
|
-
- **i18n Config:** `web/smartstack-web/src/i18n/config.ts`
|
|
427
|
-
- **Manifest Schema:** `_resources/docs-manifest-schema.md`
|
|
428
|
-
- **Complete Command:** `.claude/commands/documentation-module.md`
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
# Documentation Data Schema
|
|
2
2
|
|
|
3
|
+
> **SCOPE:** This schema applies to `developer`, `database`, and `testing` doc types ONLY.
|
|
4
|
+
> For `user` type modules, generate standalone Mock UI TSX pages — see [templates.md](templates.md).
|
|
5
|
+
|
|
3
6
|
## Purpose
|
|
4
7
|
|
|
5
8
|
This file describes how to generate `doc-data.ts` files for the `DocRenderer` shared component.
|
|
6
|
-
|
|
9
|
+
Used for non-user doc types (`developer`, `database`, `testing`).
|
|
7
10
|
|
|
8
11
|
## DocData Interface Reference
|
|
9
12
|
|
|
@@ -103,7 +106,7 @@ export const docData: DocData = {
|
|
|
103
106
|
},
|
|
104
107
|
|
|
105
108
|
useCases: [
|
|
106
|
-
{ id: 'UC-001', name: 'Create SLA', actor: 'Admin', description: '...', permission: '
|
|
109
|
+
{ id: 'UC-001', name: 'Create SLA', actor: 'Admin', description: '...', permission: 'support.sla.create', priority: 'Must' },
|
|
107
110
|
// ...
|
|
108
111
|
],
|
|
109
112
|
|
|
@@ -140,14 +143,14 @@ export const docData: DocData = {
|
|
|
140
143
|
],
|
|
141
144
|
|
|
142
145
|
permissions: [
|
|
143
|
-
{ path: '
|
|
144
|
-
{ path: '
|
|
146
|
+
{ path: 'support.sla.read', description: 'View SLA policies', roles: ['Admin', 'Manager', 'User', 'ReadOnly'] },
|
|
147
|
+
{ path: 'support.sla.create', description: 'Create SLA policies', roles: ['Admin', 'Manager'] },
|
|
145
148
|
// ...
|
|
146
149
|
],
|
|
147
150
|
|
|
148
151
|
apiEndpoints: [
|
|
149
|
-
{ method: 'GET', path: '/api/
|
|
150
|
-
{ method: 'POST', path: '/api/
|
|
152
|
+
{ method: 'GET', path: '/api/support/sla', handler: 'GetAllSlaQuery', permission: '.read' },
|
|
153
|
+
{ method: 'POST', path: '/api/support/sla', handler: 'CreateSlaCommand', permission: '.create' },
|
|
151
154
|
// ...
|
|
152
155
|
],
|
|
153
156
|
|
|
@@ -157,8 +160,8 @@ export const docData: DocData = {
|
|
|
157
160
|
},
|
|
158
161
|
|
|
159
162
|
technicalRef: {
|
|
160
|
-
permissionBase: '
|
|
161
|
-
controllerRoute: '
|
|
163
|
+
permissionBase: 'support.sla',
|
|
164
|
+
controllerRoute: 'support.sla',
|
|
162
165
|
entityNames: ['Sla', 'SlaPolicy', 'SlaEscalation'],
|
|
163
166
|
},
|
|
164
167
|
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Init - Detect and Gather Context
|
|
3
|
+
description: Detect documentation type and gather context from request
|
|
4
|
+
next_step: step-01-scan.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## STEP 00: Init — Detect Documentation Type and Gather Context
|
|
8
|
+
|
|
9
|
+
### Purpose
|
|
10
|
+
|
|
11
|
+
Analyze the user request to identify documentation type, target name, and gather execution context before proceeding to scanning.
|
|
12
|
+
|
|
13
|
+
### Execution Sequence
|
|
14
|
+
|
|
15
|
+
#### 1. Type Detection
|
|
16
|
+
|
|
17
|
+
Analyze the request to identify:
|
|
18
|
+
|
|
19
|
+
| Clue | → Type |
|
|
20
|
+
|------|--------|
|
|
21
|
+
| Functional module (SLA, Tickets, Users) | `user` |
|
|
22
|
+
| Dev tool (Docker, Postman, VS Code) | `developer` |
|
|
23
|
+
| Tables, schema, database | `database` |
|
|
24
|
+
| Tests (security, load, E2E) | `testing` |
|
|
25
|
+
|
|
26
|
+
#### 2. Target Extraction
|
|
27
|
+
|
|
28
|
+
Identify the specific name:
|
|
29
|
+
- **Module:** `sla`, `tickets`, `users`, `permissions`
|
|
30
|
+
- **Tool:** `docker`, `postman`, `playwright`, `maildev`
|
|
31
|
+
- **Schema:** `support`, `auth`, `nav`, `usr`
|
|
32
|
+
- **Test:** `security`, `load`, `e2e`
|
|
33
|
+
|
|
34
|
+
#### 3. Documentation Mode Detection
|
|
35
|
+
|
|
36
|
+
Determine if this is:
|
|
37
|
+
- **NEW documentation** (type = user|developer|database|testing) → Generate from scratch
|
|
38
|
+
- **UPDATE documentation** (explicit "update" flag or drift detected) → Refresh existing content
|
|
39
|
+
|
|
40
|
+
#### 4. Available Developer Tools Reference
|
|
41
|
+
|
|
42
|
+
| Category | Tools |
|
|
43
|
+
|----------|-------|
|
|
44
|
+
| Local Environment | Docker Compose, MailDev, VS Code, Environment variables |
|
|
45
|
+
| API Testing | Postman, REST Client, Swagger/OpenAPI |
|
|
46
|
+
| E2E Testing | Microsoft Playwright, Inspector, Trace Viewer |
|
|
47
|
+
| Load Testing | NBomber (.NET), k6, Azure Load Testing |
|
|
48
|
+
| Security Testing | OWASP ZAP, Security Code Scan, Snyk, OWASP ASVS |
|
|
49
|
+
|
|
50
|
+
### Output
|
|
51
|
+
|
|
52
|
+
At end of this step, you should have:
|
|
53
|
+
|
|
54
|
+
| Variable | Value | Example |
|
|
55
|
+
|----------|-------|---------|
|
|
56
|
+
| `type` | user \| developer \| database \| testing \| update | `user` |
|
|
57
|
+
| `target` | Module/Tool/Schema name | `users` |
|
|
58
|
+
| `application` | Parent app (for user type) | `administration` |
|
|
59
|
+
| `mode` | new \| update | `new` |
|
|
60
|
+
|
|
61
|
+
### Success Metrics
|
|
62
|
+
|
|
63
|
+
- [x] Type correctly identified from request
|
|
64
|
+
- [x] Target name extracted and validated
|
|
65
|
+
- [x] Application assigned (if type = user)
|
|
66
|
+
- [x] Mode determined (new vs update)
|
|
67
|
+
|
|
68
|
+
### Next Step
|
|
69
|
+
|
|
70
|
+
→ **step-01-scan.md** — Scan source code and existing documentation based on detected type.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Scan - Source Code and Extract Data
|
|
3
|
+
description: Scan source code and existing documentation, extract API endpoints and business rules
|
|
4
|
+
next_step: step-02-generate.md
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## STEP 01: Scan — Source Code and Existing Documentation
|
|
8
|
+
|
|
9
|
+
### Purpose
|
|
10
|
+
|
|
11
|
+
Based on the type detected in step-00, scan the appropriate source and extract data needed for documentation generation.
|
|
12
|
+
|
|
13
|
+
### Execution By Type
|
|
14
|
+
|
|
15
|
+
#### For `user` Type (Functional Module)
|
|
16
|
+
|
|
17
|
+
**MANDATORY FIRST STEP: Read the REAL page TSX before extracting.**
|
|
18
|
+
The Mock UI must match the actual interface, NOT a generic KPI/table layout.
|
|
19
|
+
|
|
20
|
+
**Workflow:**
|
|
21
|
+
|
|
22
|
+
1. **Read the REAL page TSX**
|
|
23
|
+
- Find: `web/smartstack-web/src/pages/{Application}/{Module}Page.tsx` (e.g., `TenantsTemplatePage.tsx`, `UsersPage.tsx`)
|
|
24
|
+
- Understand the actual layout (cards, table, kanban, etc.)
|
|
25
|
+
- Note the exact components, icons, badges, stats shown
|
|
26
|
+
|
|
27
|
+
2. **Extract API Endpoints** from the controller
|
|
28
|
+
- Locate: `src/SmartStack.Api/Controllers/{Module}Controller.cs` (singularized)
|
|
29
|
+
- Scan for `[HttpGet]`, `[HttpPost]`, `[HttpPut]`, `[HttpDelete]`, `[HttpPatch]`
|
|
30
|
+
- Parse `[NavRoute]`, `[RequirePermission]` attributes
|
|
31
|
+
- Resolve permission constants from `Permissions.cs`
|
|
32
|
+
|
|
33
|
+
3. **Extract Business Rules** from Domain entity and tests
|
|
34
|
+
- Locate: `src/SmartStack.Domain/Entities/{Module}/{Entity}.cs`
|
|
35
|
+
- Scan for guard clauses: `if (...) throw new DomainException("...")`
|
|
36
|
+
- Scan validation in Create/Update methods
|
|
37
|
+
- Find unit tests: `src/SmartStack.Domain.Tests/{Module}/{Entity}Tests.cs`
|
|
38
|
+
- Look for `[Fact]` test methods and edge case scenarios
|
|
39
|
+
- Auto-assign BR-XXX IDs and categorize:
|
|
40
|
+
- **Validation:** Required fields, format checks
|
|
41
|
+
- **Security:** Password rules, access control
|
|
42
|
+
- **Business Logic:** State transitions, calculations
|
|
43
|
+
|
|
44
|
+
#### For `developer` Type (Development Tool)
|
|
45
|
+
|
|
46
|
+
1. **Locate source reference**
|
|
47
|
+
- `_resources/developer-tools/` or web search for current versions
|
|
48
|
+
- Extract: purpose, installation, setup, common commands, screenshots
|
|
49
|
+
|
|
50
|
+
2. **Reference available developer tools catalog**
|
|
51
|
+
- Local Environment: Docker Compose, MailDev, VS Code, Environment variables
|
|
52
|
+
- API Testing: Postman, REST Client, Swagger/OpenAPI
|
|
53
|
+
- E2E Testing: Microsoft Playwright, Inspector, Trace Viewer
|
|
54
|
+
- Load Testing: NBomber (.NET), k6, Azure Load Testing
|
|
55
|
+
- Security Testing: OWASP ZAP, Security Code Scan, Snyk, OWASP ASVS
|
|
56
|
+
|
|
57
|
+
#### For `database` Type (Schema)
|
|
58
|
+
|
|
59
|
+
1. **Locate schema configuration**
|
|
60
|
+
- Find: `src/SmartStack.Infrastructure/Persistence/Configurations/{Schema}Configuration.cs`
|
|
61
|
+
- Find: `ApplicationDbContextModelSnapshot.cs` for complete schema
|
|
62
|
+
|
|
63
|
+
2. **Extract:**
|
|
64
|
+
- Table structure (columns, types, constraints)
|
|
65
|
+
- Relationships (foreign keys, one-to-many, many-to-many)
|
|
66
|
+
- Indexes and unique constraints
|
|
67
|
+
|
|
68
|
+
#### For `testing` Type (Testing Tool)
|
|
69
|
+
|
|
70
|
+
1. **Locate testing reference**
|
|
71
|
+
- Current test patterns in project
|
|
72
|
+
- External tool documentation (Playwright, NBomber, Snyk, etc.)
|
|
73
|
+
|
|
74
|
+
2. **Extract:**
|
|
75
|
+
- Tool purpose and integration points
|
|
76
|
+
- Test execution patterns
|
|
77
|
+
- Result interpretation
|
|
78
|
+
|
|
79
|
+
#### For `update` Type
|
|
80
|
+
|
|
81
|
+
Re-read the real page TSX and controller to refresh extracted data:
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
1. Read real page TSX → check if interface changed
|
|
85
|
+
2. Read controller → check for new/modified API endpoints
|
|
86
|
+
3. Read Domain entity → check for new business rules
|
|
87
|
+
4. Gather timestamps for doc-manifest.json update
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Output
|
|
91
|
+
|
|
92
|
+
At end of this step, collected data:
|
|
93
|
+
|
|
94
|
+
| Type | Data Collected |
|
|
95
|
+
|------|-----------------|
|
|
96
|
+
| `user` | Real page interface, API endpoints array, Business rules array |
|
|
97
|
+
| `developer` | Tool metadata, setup steps, commands, examples |
|
|
98
|
+
| `database` | Schema structure, relationships, constraints |
|
|
99
|
+
| `testing` | Tool integration, test patterns, execution flow |
|
|
100
|
+
| `update` | Changed UI elements, new endpoints, new rules, new timestamps |
|
|
101
|
+
|
|
102
|
+
### Success Metrics
|
|
103
|
+
|
|
104
|
+
- [x] Real page TSX read and interface documented (user type)
|
|
105
|
+
- [x] API endpoints extracted with correct HTTP methods and routes
|
|
106
|
+
- [x] Business rules categorized with BR-IDs and statements
|
|
107
|
+
- [x] Permission constants resolved from Permissions.cs
|
|
108
|
+
- [x] Mock data template identified (5+ realistic records)
|
|
109
|
+
- [x] KPI stats template documented (Total, Active, Status breakdown)
|
|
110
|
+
|
|
111
|
+
### Next Step
|
|
112
|
+
|
|
113
|
+
→ **step-02-generate.md** — Generate documentation content based on scanned data.
|