@atlashub/smartstack-cli 2.5.3 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.documentation/business-analyse.html +4 -4
  2. package/.documentation/commands.html +2 -2
  3. package/.documentation/index.html +2 -2
  4. package/.documentation/js/app.js +2 -2
  5. package/dist/index.js +163 -56
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/templates/mcp-scaffolding/component.tsx.hbs +14 -14
  9. package/templates/mcp-scaffolding/controller.cs.hbs +6 -5
  10. package/templates/skills/_resources/docs-manifest-schema.md +3 -3
  11. package/templates/skills/_resources/mcp-validate-documentation-spec.md +6 -6
  12. package/templates/skills/apex/steps/step-04b-doc-sync.md +4 -4
  13. package/templates/skills/apex/steps/step-05-examine.md +1 -1
  14. package/templates/skills/apex/templates/04b-doc-sync.md +1 -1
  15. package/templates/skills/application/SKILL.md +33 -16
  16. package/templates/skills/application/steps/step-00-init.md +86 -3
  17. package/templates/skills/application/steps/step-01-navigation.md +34 -0
  18. package/templates/skills/application/steps/step-02-permissions.md +37 -0
  19. package/templates/skills/application/steps/step-03-roles.md +23 -2
  20. package/templates/skills/application/steps/step-03b-provider.md +251 -0
  21. package/templates/skills/application/steps/step-04-backend.md +75 -0
  22. package/templates/skills/application/steps/step-05-frontend.md +149 -10
  23. package/templates/skills/application/steps/step-06-migration.md +27 -15
  24. package/templates/skills/application/steps/step-07-tests.md +404 -0
  25. package/templates/skills/application/steps/step-08-documentation.md +137 -0
  26. package/templates/skills/application/templates-frontend.md +133 -26
  27. package/templates/skills/application/templates-seed.md +116 -0
  28. package/templates/skills/business-analyse/SKILL.md +1 -1
  29. package/templates/skills/business-analyse/questionnaire/07-ui.md +15 -0
  30. package/templates/skills/business-analyse/questionnaire/10-documentation.md +2 -2
  31. package/templates/skills/business-analyse/schemas/feature-schema.json +96 -7
  32. package/templates/skills/business-analyse/steps/step-03-specify.md +134 -5
  33. package/templates/skills/business-analyse/steps/step-05-handoff.md +61 -8
  34. package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
  35. package/templates/skills/business-analyse/templates-frd.md +8 -8
  36. package/templates/skills/business-analyse/templates-react.md +26 -26
  37. package/templates/skills/documentation/SKILL.md +6 -6
  38. package/templates/skills/documentation/data-schema.md +70 -44
  39. package/templates/skills/documentation/templates.md +6 -6
  40. package/templates/skills/ralph-loop/SKILL.md +1 -2
  41. package/templates/skills/ralph-loop/steps/step-01-task.md +1 -1
  42. package/templates/skills/ui-components/SKILL.md +33 -2
  43. package/templates/skills/ui-components/patterns/dashboard-chart.md +327 -0
  44. package/templates/skills/ui-components/style-guide.md +27 -0
@@ -13,10 +13,11 @@ next_step: steps/step-03-specify.md OR steps/step-04-consolidation.md (condition
13
13
  - This step is EXECUTED ONCE PER MODULE in topological dependency order
14
14
  - ALWAYS check workflow state to determine current module
15
15
  - ALWAYS reference completed modules when specifying current one
16
- - ALWAYS propose ASCII/SVG mockups for each section
16
+ - **MANDATORY:** Generate and validate an ASCII/SVG mockup for EVERY section (not optional)
17
17
  - ALL questions via AskUserQuestion tool
18
18
  - ALL communication in `{language}`
19
19
  - NEVER skip per-module validation
20
+ - **WIREFRAME RULE:** Every section MUST have a wireframe in `specification.uiWireframes[]`. No section without a validated mockup.
20
21
 
21
22
  ## YOUR TASK
22
23
 
@@ -89,9 +90,13 @@ options:
89
90
  description: "Formulaire de création et de modification"
90
91
  - label: "Validation/Approbation"
91
92
  description: "Workflow de validation avec changement de statut"
93
+ - label: "Dashboard"
94
+ description: "Tableau de bord avec KPIs, graphiques (Recharts) et métriques clés"
92
95
  ```
93
96
 
94
- #### 3b. For Each Section: Propose ASCII Mockup
97
+ #### 3b. For Each Section: Generate MANDATORY ASCII Mockup
98
+
99
+ > **BLOCKING RULE:** Every section MUST have a wireframe. No section proceeds to entity definition (step 6) without a validated mockup stored in `specification.uiWireframes[]`.
95
100
 
96
101
  For each confirmed section, generate an ASCII mockup and validate with client:
97
102
 
@@ -111,7 +116,7 @@ Example for a list section:
111
116
  ╚═══════════════════════════════════════════════════════════╝
112
117
  ```
113
118
 
114
- Store in specification.wireframes[]:
119
+ Store in specification.uiWireframes[] (**MANDATORY** for every section):
115
120
 
116
121
  ```json
117
122
  {
@@ -126,8 +131,31 @@ Store in specification.wireframes[]:
126
131
  }
127
132
  ```
128
133
 
134
+ > **REQUIRED fields:** `screen`, `mockup`, `elements`, `section` are all mandatory. A wireframe without these fields will FAIL validation in step 9.
135
+
129
136
  Ask client to validate each mockup via AskUserQuestion (batch 2-3 mockups at once if possible).
130
137
 
138
+ > **IF client rejects a mockup:** Revise and re-propose until validated. Do NOT proceed without client approval on the layout.
139
+
140
+ #### 3b-bis. Wireframe-to-Component Mapping
141
+
142
+ After client validates the mockup, map each wireframe element to a SmartStack React component:
143
+
144
+ | Wireframe Element | SmartStack Component | Notes |
145
+ |-------------------|---------------------|-------|
146
+ | DataGrid | `SmartTable` or `EntityCard` grid | Use EntityCard for card layouts |
147
+ | FilterBar | `SmartFilter` | Integrated with SmartTable |
148
+ | SearchInput | `SearchInput` | Debounced search |
149
+ | Pagination | Built into `SmartTable` | Server-side pagination |
150
+ | ActionButton | `Button` + `RequirePermission` | Always wrapped in permission check |
151
+ | StatusBadge | `StatusBadge` | Uses entity lifecycle states |
152
+ | DetailCard | `EntityDetailCard` | Standard detail layout |
153
+ | Form | `SmartForm` | FluentValidation-backed |
154
+ | KpiCard | `StatCard` (Recharts) | Dashboard KPI display |
155
+ | Chart:bar/line/pie | Recharts `BarChart`/`LineChart`/`PieChart` | CSS variables for colors |
156
+
157
+ Store the component mapping alongside the wireframe to ensure downstream skills use the correct components.
158
+
131
159
  #### 3c. Identify Resources per Section
132
160
 
133
161
  For each section, identify what resources/components are needed:
@@ -136,6 +164,88 @@ For each section, identify what resources/components are needed:
136
164
  - Detail section → DetailCard, StatusBadge, ActionButtons, Timeline
137
165
  - Create section → Form, ValidationMessages, SubmitButton
138
166
  - Approve section → StatusTransitionPanel, CommentBox, ApproveRejectButtons
167
+ - Dashboard section → StatCard, RechartsChart (Bar/Line/Pie/Area), DashboardGrid, FilterBar
168
+
169
+ #### 3d. Dashboard Specification (if section = dashboard)
170
+
171
+ When a "dashboard" section is selected, capture structured KPI and chart data **in addition** to the standard ASCII mockup.
172
+
173
+ 1. **Ask client for KPIs** via AskUserQuestion (batch):
174
+ - KPI name and metric description
175
+ - Visualization type: `kpi-card`, `bar`, `line`, `pie`, `area`, `donut`, `stacked-bar`
176
+ - Data source entity
177
+ - Format: `number`, `currency`, `percent`, `duration`
178
+ - Thresholds (warning/critical) if applicable
179
+
180
+ 2. **Ask client for filters:**
181
+ - Date range filter? Default period? (day/week/month/quarter/year)
182
+ - Entity-based filters? (status, category, etc.)
183
+
184
+ 3. **Ask client for refresh mode:**
185
+ - Static (load on page open)
186
+ - Polling (periodic refresh)
187
+ - SignalR (real-time push)
188
+
189
+ 4. **Store in specification.dashboards[]:**
190
+
191
+ ```json
192
+ {
193
+ "code": "{module}-dashboard",
194
+ "title": "{Module} Dashboard",
195
+ "description": "Vue d'ensemble des métriques {module}",
196
+ "linkedUCs": ["UC-XXX"],
197
+ "refreshMode": "static",
198
+ "defaultPeriod": "month",
199
+ "kpis": [
200
+ {
201
+ "code": "total-items",
202
+ "label": "Total Items",
203
+ "metric": "COUNT(entity)",
204
+ "format": "number",
205
+ "visualization": "kpi-card",
206
+ "dataSource": "Entity"
207
+ },
208
+ {
209
+ "code": "items-by-status",
210
+ "label": "Items by Status",
211
+ "metric": "COUNT(entity) GROUP BY status",
212
+ "format": "number",
213
+ "visualization": "pie",
214
+ "dataSource": "Entity",
215
+ "dimensions": ["status"]
216
+ }
217
+ ],
218
+ "filters": [
219
+ { "field": "dateRange", "type": "dateRange", "label": "Période" },
220
+ { "field": "status", "type": "multiselect", "label": "Statut" }
221
+ ],
222
+ "permissionsRequired": ["business.{app}.{module}.read"]
223
+ }
224
+ ```
225
+
226
+ 5. **ALSO generate the standard ASCII mockup** for the dashboard with KPI cards + chart placeholders:
227
+
228
+ ```
229
+ ╔═══════════════════════════════════════════════════════════════╗
230
+ ║ {Module} > Dashboard Période: [Ce mois ▾] ║
231
+ ╠═══════════════════════════════════════════════════════════════╣
232
+ ║ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ║
233
+ ║ │ KPI #1 │ │ KPI #2 │ │ KPI #3 │ │ KPI #4 │ ║
234
+ ║ │ 1,234 │ │ 567 │ │ 89.2% │ │ 12,400 │ ║
235
+ ║ │ ↑ +12% │ │ ↓ -3% │ │ → 0% │ │ ↑ +5% │ ║
236
+ ║ └──────────┘ └──────────┘ └──────────┘ └──────────┘ ║
237
+ ╠═══════════════════════════════════════════════════════════════╣
238
+ ║ ┌─────────────────────────┐ ┌─────────────────────────┐ ║
239
+ ║ │ [Bar Chart] │ │ [Pie Chart] │ ║
240
+ ║ │ Items by Month │ │ Items by Status │ ║
241
+ ║ │ ████ │ │ ████████ │ ║
242
+ ║ │ ████ ████ │ │ ███ ███ │ ║
243
+ ║ │ ████ ████ ████ │ │ ██ 42% ██ │ ║
244
+ ║ └─────────────────────────┘ └─────────────────────────┘ ║
245
+ ╚═══════════════════════════════════════════════════════════════╝
246
+ ```
247
+
248
+ Store the mockup in specification.wireframes[] AS WELL (for visual reference).
139
249
 
140
250
  ### 4. Conditional Questionnaires
141
251
 
@@ -148,9 +258,28 @@ Based on module type, load questionnaires per-module:
148
258
  | Has lifecycle | 11 | `questionnaire/11-data-lifecycle.md` |
149
259
  | Has migration needs | 12 | `questionnaire/12-migration.md` |
150
260
  | References other modules | 13 | `questionnaire/13-cross-module.md` |
261
+ | Documentation needed | 10 | `questionnaire/10-documentation.md` |
151
262
 
152
263
  Ask via AskUserQuestion, 1-2 batches per category.
153
264
 
265
+ #### Store Documentation Requirements
266
+
267
+ If questionnaire 10 was loaded, persist answers in feature.json:
268
+
269
+ ```
270
+ ba-writer.enrichSection({
271
+ featureId: {feature_id},
272
+ section: "documentation",
273
+ data: {
274
+ userDocRequired: {Q10.1 answer == "Yes"},
275
+ techDocRequired: {Q10.2 answer == "Yes"},
276
+ status: "pending"
277
+ }
278
+ })
279
+ ```
280
+
281
+ This data will be consumed by `/application` step-08 to auto-generate in-app documentation.
282
+
154
283
  ### 5. Cross-Module References
155
284
 
156
285
  > Reference completed modules to help define current one.
@@ -286,7 +415,7 @@ Translation keys for all UI text (4 languages: fr, en, it, de)
286
415
  | functionalRequirements | 4 | PASS/FAIL |
287
416
  | permissionMatrix | 1 resource × 2 roles | PASS/FAIL |
288
417
  | entities | 1 | PASS/FAIL |
289
- | wireframes | 2 | PASS/FAIL |
418
+ | wireframes | 1 per section (BLOCKING) | PASS/FAIL |
290
419
  | gherkinScenarios | 2 per UC | PASS/FAIL |
291
420
  | validations | 1 | PASS/FAIL |
292
421
  | messages | 4 | PASS/FAIL |
@@ -463,7 +592,7 @@ Read metadata.workflow.currentModule
463
592
  ## SUCCESS METRICS
464
593
 
465
594
  - All sections walked through with client
466
- - ASCII mockups proposed and validated for key sections
595
+ - ASCII mockups generated and validated for EVERY section (1 wireframe per section minimum)
467
596
  - Entities defined with business attributes
468
597
  - Business rules extracted and categorized
469
598
  - Per-module validation PASS
@@ -225,7 +225,9 @@ Include:
225
225
 
226
226
  #### 4.5 Frontend Files
227
227
 
228
- From `specification.wireframes[]` and `analysis.useCases[]` of the module:
228
+ From `specification.uiWireframes[]`, `specification.dashboards[]` and `analysis.useCases[]` of the module:
229
+
230
+ > **WIREFRAME TRACEABILITY RULE:** Every frontend file (Page, DashboardPage, Component) MUST include `linkedWireframes[]` referencing the wireframe `screen` identifiers from `specification.uiWireframes[]`. This ensures the BA mockups validated by the client are respected during implementation.
229
231
 
230
232
  ```json
231
233
  "frontend": [
@@ -233,12 +235,33 @@ From `specification.wireframes[]` and `analysis.useCases[]` of the module:
233
235
  "path": "src/pages/{ModuleName}/{PageName}Page.tsx",
234
236
  "type": "Page",
235
237
  "linkedUCs": ["UC-001", "UC-002"],
236
- "module": "{moduleCode}"
238
+ "linkedWireframes": ["{module}-list"],
239
+ "module": "{moduleCode}",
240
+ "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-list': elements [{elements}], actions [{actions}]. See specification.uiWireframes[] for exact mockup."
241
+ },
242
+ {
243
+ "path": "src/pages/{ModuleName}/{PageName}DetailPage.tsx",
244
+ "type": "Page",
245
+ "linkedUCs": ["UC-003"],
246
+ "linkedWireframes": ["{module}-detail"],
247
+ "module": "{moduleCode}",
248
+ "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-detail': elements [{elements}], actions [{actions}]. See specification.uiWireframes[] for exact mockup."
249
+ },
250
+ {
251
+ "path": "src/pages/{ModuleName}/{DashboardName}DashboardPage.tsx",
252
+ "type": "DashboardPage",
253
+ "linkedUCs": ["UC-060"],
254
+ "linkedWireframes": ["{module}-dashboard"],
255
+ "module": "{moduleCode}",
256
+ "dashboardRef": "{module}-dashboard",
257
+ "instructions": "Use Recharts library. See specification.dashboards[] for KPI definitions, chart types, filters, and data sources.",
258
+ "wireframeAcceptanceCriteria": "Layout MUST match wireframe '{module}-dashboard': KPI card positions, chart placement, filter bar location. See specification.uiWireframes[] AND specification.dashboards[] for exact mockup and KPI specs."
237
259
  },
238
260
  {
239
261
  "path": "src/components/{ModuleName}/{ComponentName}.tsx",
240
262
  "type": "Component",
241
263
  "linkedUCs": ["UC-001"],
264
+ "linkedWireframes": ["{module}-{section}"],
242
265
  "module": "{moduleCode}"
243
266
  },
244
267
  {
@@ -250,12 +273,38 @@ From `specification.wireframes[]` and `analysis.useCases[]` of the module:
250
273
  ]
251
274
  ```
252
275
 
253
- Include:
276
+ **Wireframe Acceptance Criteria (ALL frontend pages):**
277
+ > **MANDATORY** for every Page and DashboardPage task. These criteria ensure the BA mockups are respected.
278
+ - Layout structure matches the validated ASCII/SVG wireframe from `specification.uiWireframes[]`
279
+ - All `elements` listed in the wireframe are present in the generated component
280
+ - All `actions` listed in the wireframe are implemented with correct permissions
281
+ - Component mapping follows the wireframe-to-component table (see step-03 section 3b-bis)
282
+ - If wireframe shows a DataGrid → implement with `SmartTable` or `EntityCard` grid
283
+ - If wireframe shows FilterBar → implement with `SmartFilter`
284
+ - If wireframe shows ActionButton → wrap in `RequirePermission`
285
+
286
+ **Dashboard pages (type: DashboardPage):**
287
+ - Generated from `specification.dashboards[]` entries
288
+ - `dashboardRef` links to the dashboard code in specification.dashboards[]
289
+ - `linkedWireframes` links to the dashboard wireframe in specification.uiWireframes[]
290
+ - `instructions` MUST reference chart types, KPI definitions, and data sources
291
+ - Acceptance criteria for DashboardPage tasks MUST include:
292
+ - Chart library (Recharts) installed in package.json
293
+ - Chart types matching specification.dashboards[].kpis[].visualization
294
+ - KPI cards for kpi-card type visualizations
295
+ - Filters functional (dateRange, select, etc.)
296
+ - CSS variables used (no hardcoded colors) - see ui-components/patterns/dashboard-chart.md
297
+ - Responsive layout (1-col mobile, 2-col tablet, 3-col desktop)
298
+ - **KPI card positions match wireframe layout** (e.g., 4 cards in a row if wireframe shows 4)
299
+ - **Chart placement matches wireframe** (e.g., 2-column grid if wireframe shows side-by-side)
300
+
301
+ **Standard pages (type: Page):**
254
302
  - Pages for major use cases
255
303
  - Components for reusable UI elements
256
304
  - Custom hooks for business logic
257
305
  - Forms for data entry
258
306
  - List/Detail views
307
+ - **ALL pages MUST reference their wireframe via `linkedWireframes`**
259
308
 
260
309
  #### 4.6 SeedData Files
261
310
 
@@ -620,7 +669,7 @@ options:
620
669
  "application": "Y tasks across services, DTOs, validators",
621
670
  "infrastructure": "Z tasks across repositories, persistence",
622
671
  "api": "A tasks across controllers, error handling",
623
- "frontend": "B tasks across pages, components, hooks",
672
+ "frontend": "B tasks across pages, components, hooks (each with linkedWireframes)",
624
673
  "seedData": "5 CORE + C business seed data tasks",
625
674
  "tests": "D unit + E integration + F security tests",
626
675
  "i18n": "G i18n key implementations"
@@ -756,12 +805,13 @@ Generate `.ralph/progress.txt` as main task tracker:
756
805
  □ Implement error handling and validation responses
757
806
  Total: B tasks
758
807
 
759
- [FRONTEND] UI Components & Pages
760
- □ Create {ModuleName}Page for listing
761
- □ Create {ModuleName}DetailPage for viewing
762
- □ Create {ModuleName}Form component for creation/edit
808
+ [FRONTEND] UI Components & Pages (wireframe-driven)
809
+ □ Create {ModuleName}Page for listing [wireframe: {module}-list]
810
+ □ Create {ModuleName}DetailPage for viewing [wireframe: {module}-detail]
811
+ □ Create {ModuleName}Form component for creation/edit [wireframe: {module}-create]
763
812
  □ Create custom hook use{ModuleName}
764
813
  □ Implement pagination, filtering, sorting
814
+ □ Validate all pages match their wireframe layout
765
815
  Total: C tasks
766
816
 
767
817
  [I18N] Internationalization Keys
@@ -1088,11 +1138,14 @@ Before presenting handoff to user:
1088
1138
  - [ ] Implementation strategy selected or defaulted
1089
1139
  - [ ] Complexity calculated for each module and overall
1090
1140
  - [ ] filesToCreate: 7 categories complete, no free text
1141
+ - [ ] **WIREFRAME TRACEABILITY:** Every frontend Page/DashboardPage has `linkedWireframes[]` referencing specification.uiWireframes[].screen
1142
+ - [ ] **WIREFRAME ACCEPTANCE:** Every frontend Page/DashboardPage has `wireframeAcceptanceCriteria` describing expected layout
1091
1143
  - [ ] brToCodeMapping: All business rules from analysis.businessRules[] mapped
1092
1144
  - [ ] apiEndpointSummary: Exact copy from specification.apiEndpoints[]
1093
1145
  - [ ] prd.json: Derived from feature.json, not independently generated
1094
1146
  - [ ] prd.json: Includes all UCs, FRs, BRs, entities, API endpoints from source
1095
1147
  - [ ] progress.txt: Hierarchical, all modules in topological order, 5 CORE SeedData per module
1148
+ - [ ] progress.txt: Frontend tasks reference wireframe identifiers [wireframe: {screen}]
1096
1149
  - [ ] Module order: Follows topological dependency graph
1097
1150
  - [ ] feature.json updated: handoff section + status "handed-off"
1098
1151
  - [ ] All paths use project namespace from .smartstack/config.json
@@ -6,7 +6,7 @@
6
6
  ---
7
7
 
8
8
  ```markdown
9
- # FRD - {FEAT-XXX} {Feature Name}
9
+ # Specification fonctionnelle - {FEAT-XXX} {Feature Name}
10
10
 
11
11
  > **Module:** business/{application}/{module}
12
12
  > **Version:** 1.0
@@ -1,6 +1,6 @@
1
- # Templates FRD - Business Analysis
1
+ # Templates Specification - Business Analysis
2
2
 
3
- > **Usage:** Templates for functional specification documents (FRD)
3
+ > **Usage:** Templates for functional specification documents
4
4
  > **Context:** Business > Application > Module > Section
5
5
 
6
6
  ---
@@ -76,10 +76,10 @@
76
76
 
77
77
  ---
78
78
 
79
- ## Template 2-brd.md (Business Requirements Document)
79
+ ## Template 2-brd.md (Exigences metier)
80
80
 
81
81
  ```markdown
82
- # BRD - {FEAT-XXX} {Feature Name}
82
+ # Exigences metier - {FEAT-XXX} {Feature Name}
83
83
 
84
84
  > **Module:** business/{application}/{module}
85
85
  > **Version:** 1.0
@@ -171,10 +171,10 @@
171
171
 
172
172
  ---
173
173
 
174
- ## Template 3-frd.md (Functional Requirements Document)
174
+ ## Template 3-frd.md (Specification fonctionnelle)
175
175
 
176
176
  ```markdown
177
- # FRD - {FEAT-XXX} {Feature Name}
177
+ # Specification fonctionnelle - {FEAT-XXX} {Feature Name}
178
178
 
179
179
  > **Module:** business/{application}/{module}
180
180
  > **Version:** 1.0
@@ -352,7 +352,7 @@ Feature: {FEAT-XXX} {Feature Name}
352
352
 
353
353
  > **Module:** business/{application}/{module}
354
354
  > **Version:** 1.0
355
- > **Validated Specs:** FRD v1.0 (validation.json)
355
+ > **Validated Specs:** Specification v1.0 (validation.json)
356
356
  > **Implementation:** `/ralph-loop -r` (iterative) | `/feature-full business/{app}/{module}` (one-shot)
357
357
 
358
358
  ## DEVELOPER INSTRUCTIONS
@@ -456,7 +456,7 @@ FRONTEND:
456
456
  - [ ] EF Core migration created if entity
457
457
  - [ ] Permissions added in PermissionConfiguration.cs
458
458
  - [ ] i18n complete (4 languages)
459
- - [ ] Documentation generated: `/business-analyse:7-doc-html FEAT-XXX`
459
+ - [ ] Documentation generated: `/documentation user {module_name}`
460
460
 
461
461
  ---
462
462
 
@@ -1,6 +1,6 @@
1
- # Templates React - FRD Documentation
1
+ # Templates React - Documentation Module
2
2
 
3
- > **Usage:** Templates for generating HTML (React) documentation of functional specifications
3
+ > **Usage:** Templates for generating HTML (React) documentation of module specifications
4
4
  > **Output:** `web/smartstack-web/src/pages/docs/business/{app}/{module}/`
5
5
  > **Context7:** Use for up-to-date React code generation
6
6
 
@@ -30,10 +30,10 @@
30
30
 
31
31
  ---
32
32
 
33
- ## Template FrdDocPage.tsx
33
+ ## Template DocPage.tsx
34
34
 
35
35
  ```tsx
36
- // web/smartstack-web/src/pages/docs/business/{app}/{module}/FrdDocPage.tsx
36
+ // web/smartstack-web/src/pages/docs/business/{app}/{module}/DocPage.tsx
37
37
  // GENERATE WITH: use context7 with /facebook/react
38
38
 
39
39
  import { Link } from 'react-router-dom';
@@ -51,7 +51,7 @@ import {
51
51
  Database
52
52
  } from 'lucide-react';
53
53
 
54
- // Types for FRD data
54
+ // Types for documentation data
55
55
  interface UseCase {
56
56
  id: string;
57
57
  name: string;
@@ -73,7 +73,7 @@ interface Permission {
73
73
  roles: string[];
74
74
  }
75
75
 
76
- interface FrdData {
76
+ interface DocData {
77
77
  featureId: string;
78
78
  moduleName: string;
79
79
  applicationName: string;
@@ -83,8 +83,8 @@ interface FrdData {
83
83
  permissions: Permission[];
84
84
  }
85
85
 
86
- // Data loaded from FRD (to be generated dynamically)
87
- const frdData: FrdData = {
86
+ // Data loaded from feature.json (to be generated dynamically)
87
+ const docData: DocData = {
88
88
  featureId: 'FEAT-XXX',
89
89
  moduleName: '{ModuleName}',
90
90
  applicationName: '{ApplicationName}',
@@ -162,7 +162,7 @@ function NumberedSection({
162
162
  );
163
163
  }
164
164
 
165
- export function {ModuleName}FrdDocPage() {
165
+ export function {ModuleName}DocPage() {
166
166
  const { t } = useTranslation('docs-business');
167
167
 
168
168
  return (
@@ -177,29 +177,29 @@ export function {ModuleName}FrdDocPage() {
177
177
  {t('breadcrumb.business')}
178
178
  </Link>
179
179
  <span>/</span>
180
- <Link to={`/docs/business/${frdData.applicationName.toLowerCase()}`} className="hover:text-[var(--color-primary-600)]">
181
- {t(`apps.${frdData.applicationName.toLowerCase()}.name`)}
180
+ <Link to={`/docs/business/${docData.applicationName.toLowerCase()}`} className="hover:text-[var(--color-primary-600)]">
181
+ {t(`apps.${docData.applicationName.toLowerCase()}.name`)}
182
182
  </Link>
183
183
  <span>/</span>
184
- <span>{t(`modules.${frdData.moduleName.toLowerCase()}.name`)}</span>
184
+ <span>{t(`modules.${docData.moduleName.toLowerCase()}.name`)}</span>
185
185
  </nav>
186
186
 
187
187
  {/* Header */}
188
188
  <header>
189
189
  <div className="flex items-center gap-2 mb-2">
190
190
  <span className="px-2 py-0.5 rounded bg-[var(--color-primary-600)]/10 text-[var(--color-primary-600)] text-xs font-medium">
191
- {frdData.featureId}
191
+ {docData.featureId}
192
192
  </span>
193
193
  <span className="px-2 py-0.5 rounded bg-green-500/10 text-green-600 text-xs font-medium">
194
- v{frdData.version}
194
+ v{docData.version}
195
195
  </span>
196
196
  </div>
197
197
  <h1 className="text-3xl font-bold mb-4 flex items-center gap-3">
198
198
  <FileText className="w-8 h-8 text-[var(--color-primary-600)]" />
199
- {t(`modules.${frdData.moduleName.toLowerCase()}.title`)}
199
+ {t(`modules.${docData.moduleName.toLowerCase()}.title`)}
200
200
  </h1>
201
201
  <p className="text-lg text-[var(--text-secondary)]">
202
- {t(`modules.${frdData.moduleName.toLowerCase()}.subtitle`)}
202
+ {t(`modules.${docData.moduleName.toLowerCase()}.subtitle`)}
203
203
  </p>
204
204
  </header>
205
205
 
@@ -226,24 +226,24 @@ export function {ModuleName}FrdDocPage() {
226
226
  {/* Section 1: Overview */}
227
227
  <NumberedSection number={1} title={t('sections.overview')} icon={Layout}>
228
228
  <p className="text-[var(--text-secondary)] mb-4">
229
- {t(`modules.${frdData.moduleName.toLowerCase()}.overview`)}
229
+ {t(`modules.${docData.moduleName.toLowerCase()}.overview`)}
230
230
  </p>
231
231
  <div className="grid grid-cols-2 md:grid-cols-4 gap-4 mt-4">
232
232
  <div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
233
233
  <div className="text-2xl font-bold text-[var(--color-primary-600)]">
234
- {frdData.useCases.length}
234
+ {docData.useCases.length}
235
235
  </div>
236
236
  <div className="text-sm text-[var(--text-secondary)]">{t('stats.useCases')}</div>
237
237
  </div>
238
238
  <div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
239
239
  <div className="text-2xl font-bold text-[var(--color-primary-600)]">
240
- {frdData.businessRules.length}
240
+ {docData.businessRules.length}
241
241
  </div>
242
242
  <div className="text-sm text-[var(--text-secondary)]">{t('stats.businessRules')}</div>
243
243
  </div>
244
244
  <div className="p-4 rounded-lg bg-[var(--bg-secondary)] text-center">
245
245
  <div className="text-2xl font-bold text-[var(--color-primary-600)]">
246
- {frdData.permissions.length}
246
+ {docData.permissions.length}
247
247
  </div>
248
248
  <div className="text-sm text-[var(--text-secondary)]">{t('stats.permissions')}</div>
249
249
  </div>
@@ -253,7 +253,7 @@ export function {ModuleName}FrdDocPage() {
253
253
  {/* Section 2: Use Cases */}
254
254
  <NumberedSection number={2} title={t('sections.useCases')} icon={Users}>
255
255
  <div className="space-y-4">
256
- {frdData.useCases.map((uc) => (
256
+ {docData.useCases.map((uc) => (
257
257
  <div key={uc.id} className="border border-[var(--border-color)] rounded-lg p-4">
258
258
  <div className="flex items-center justify-between mb-2">
259
259
  <h3 className="font-semibold flex items-center gap-2">
@@ -289,7 +289,7 @@ export function {ModuleName}FrdDocPage() {
289
289
  </tr>
290
290
  </thead>
291
291
  <tbody>
292
- {frdData.businessRules.map((br, idx) => (
292
+ {docData.businessRules.map((br, idx) => (
293
293
  <tr key={br.id} className={idx % 2 === 1 ? 'bg-[var(--bg-secondary)]/50' : ''}>
294
294
  <td className="py-2 px-3 font-mono text-[var(--color-primary-600)]">{br.id}</td>
295
295
  <td className="py-2 px-3">{br.rule}</td>
@@ -305,7 +305,7 @@ export function {ModuleName}FrdDocPage() {
305
305
  {/* Section 4: Permissions */}
306
306
  <NumberedSection number={4} title={t('sections.permissions')} icon={Shield}>
307
307
  <div className="space-y-3">
308
- {frdData.permissions.map((perm) => (
308
+ {docData.permissions.map((perm) => (
309
309
  <div key={perm.path} className="flex items-center justify-between p-3 rounded-lg bg-[var(--bg-secondary)]">
310
310
  <div>
311
311
  <code className="text-sm font-mono text-[var(--color-primary-600)]">{perm.path}</code>
@@ -398,7 +398,7 @@ export function {ModuleName}FrdDocPage() {
398
398
  {/* Navigation Footer */}
399
399
  <div className="flex justify-between pt-6 border-t border-[var(--border-color)]">
400
400
  <Link
401
- to={`/docs/business/${frdData.applicationName.toLowerCase()}`}
401
+ to={`/docs/business/${docData.applicationName.toLowerCase()}`}
402
402
  className="flex items-center gap-2 text-[var(--text-secondary)] hover:text-[var(--color-primary-600)]"
403
403
  >
404
404
  <ArrowRight className="w-4 h-4 rotate-180" />
@@ -571,10 +571,10 @@ export function {App}DocsIndexPage() {
571
571
 
572
572
  ## Generation Checklist
573
573
 
574
- When generating with `/business-analyse:7-doc-html`:
574
+ When generating documentation:
575
575
 
576
576
  - [ ] Use Context7 for current React patterns
577
- - [ ] Generate `FrdDocPage.tsx` with FRD data
577
+ - [ ] Generate `DocPage.tsx` with module documentation data
578
578
  - [ ] Create/update `docs-business.json` (4 languages)
579
579
  - [ ] Add route in `App.tsx`
580
580
  - [ ] Update parent index if new module
@@ -40,11 +40,11 @@ Claude automatically invokes this skill when it detects:
40
40
 
41
41
  | Type | Description | Output |
42
42
  |------|-------------|--------|
43
- | `user` | User module (data-driven) | `docs/business/{app}/{module}/frd-data.ts` + `index.tsx` |
43
+ | `user` | User module (data-driven) | `docs/business/{app}/{module}/doc-data.ts` + `index.tsx` |
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` |
47
- | `update` | Update existing documentation | Updates `frd-data.ts` + i18n FR |
47
+ | `update` | Update existing documentation | Updates `doc-data.ts` + i18n FR |
48
48
 
49
49
  ### Available Developer tools
50
50
 
@@ -86,8 +86,8 @@ Identify the specific name:
86
86
  Follow the data-driven workflow from [templates.md](templates.md):
87
87
 
88
88
  ```
89
- 1. Read source data (FRD, BRD, code patterns)
90
- 2. Generate frd-data.ts (data file, ~50 lines)
89
+ 1. Read source data (feature.json, code patterns)
90
+ 2. Generate doc-data.ts (data file, ~50 lines)
91
91
  3. Generate index.tsx (page wrapper, ~10 lines)
92
92
  4. Generate i18n FR file (source language only)
93
93
  5. Update docs-manifest.json
@@ -101,7 +101,7 @@ Follow the data-driven workflow from [templates.md](templates.md):
101
101
  2. Invoke docs-context-reader agent → get current doc state
102
102
  3. Identify code changes since last doc update (git diff)
103
103
  4. Map changes to documentation sections (see data-schema.md)
104
- 5. Update frd-data.ts with new/modified data
104
+ 5. Update doc-data.ts with new/modified data
105
105
  6. Update i18n FR file if labels changed
106
106
  7. Update docs-manifest.json timestamps
107
107
  ```
@@ -166,7 +166,7 @@ Follow the data-driven workflow from [templates.md](templates.md):
166
166
 
167
167
  - **React Templates:** [templates.md](templates.md)
168
168
  - **Data Schema:** [data-schema.md](data-schema.md)
169
- - **FrdDocRenderer:** `web/smartstack-web/src/components/docs/FrdDocRenderer.tsx`
169
+ - **DocRenderer:** `web/smartstack-web/src/components/docs/DocRenderer.tsx`
170
170
  - **Types:** `web/smartstack-web/src/components/docs/types.ts`
171
171
  - **Manifest Schema:** `_resources/docs-manifest-schema.md`
172
172
  - **Complete Command:** `.claude/commands/documentation-module.md`