@atlashub/smartstack-cli 2.8.0 → 3.0.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.
Files changed (74) hide show
  1. package/.documentation/business-analyse.html +81 -17
  2. package/dist/index.js +94 -21
  3. package/dist/index.js.map +1 -1
  4. package/dist/mcp-entry.mjs +1302 -223
  5. package/dist/mcp-entry.mjs.map +1 -1
  6. package/package.json +1 -1
  7. package/templates/agents/efcore/db-deploy.md +1 -1
  8. package/templates/agents/efcore/migration.md +26 -10
  9. package/templates/agents/efcore/rebase-snapshot.md +24 -7
  10. package/templates/agents/efcore/squash.md +73 -57
  11. package/templates/agents/gitflow/commit.md +138 -18
  12. package/templates/agents/gitflow/exec.md +1 -1
  13. package/templates/agents/gitflow/finish.md +79 -62
  14. package/templates/agents/gitflow/init-clone.md +186 -0
  15. package/templates/agents/gitflow/init-detect.md +137 -0
  16. package/templates/agents/gitflow/init-validate.md +210 -0
  17. package/templates/agents/gitflow/init.md +231 -74
  18. package/templates/agents/gitflow/merge.md +65 -33
  19. package/templates/agents/gitflow/pr.md +93 -49
  20. package/templates/agents/gitflow/start.md +76 -33
  21. package/templates/agents/gitflow/status.md +41 -71
  22. package/templates/hooks/appsettings-guard.sh +76 -0
  23. package/templates/hooks/ef-migration-check.md +1 -1
  24. package/templates/hooks/hooks.json +9 -0
  25. package/templates/project/test-frontend/msw/handlers.ts +58 -0
  26. package/templates/project/test-frontend/msw/server.ts +25 -0
  27. package/templates/project/test-frontend/setup.ts +16 -0
  28. package/templates/project/test-frontend/test-utils.tsx +59 -0
  29. package/templates/project/test-frontend/vitest.config.ts +31 -0
  30. package/templates/skills/_resources/config-safety.md +61 -0
  31. package/templates/skills/_resources/formatting-guide.md +2 -2
  32. package/templates/skills/_shared.md +21 -0
  33. package/templates/skills/application/SKILL.md +32 -3
  34. package/templates/skills/application/steps/step-04-backend.md +21 -0
  35. package/templates/skills/application/steps/step-05-frontend.md +20 -36
  36. package/templates/skills/application/steps/step-07-tests.md +259 -120
  37. package/templates/skills/business-analyse/SKILL.md +57 -28
  38. package/templates/skills/business-analyse/_shared.md +70 -39
  39. package/templates/skills/business-analyse/html/ba-interactive.html +2622 -0
  40. package/templates/skills/business-analyse/questionnaire/00-application.md +123 -131
  41. package/templates/skills/business-analyse/questionnaire/01-context.md +173 -24
  42. package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +170 -50
  43. package/templates/skills/business-analyse/questionnaire/03-scope.md +154 -48
  44. package/templates/skills/business-analyse/questionnaire/10-documentation.md +1 -1
  45. package/templates/skills/business-analyse/questionnaire/14-risk-assumptions.md +135 -0
  46. package/templates/skills/business-analyse/questionnaire/15-success-metrics.md +136 -0
  47. package/templates/skills/business-analyse/questionnaire.md +55 -46
  48. package/templates/skills/business-analyse/steps/step-00-init.md +24 -2
  49. package/templates/skills/business-analyse/steps/step-01-cadrage.md +31 -20
  50. package/templates/skills/business-analyse/steps/step-03-specify.md +1 -0
  51. package/templates/skills/business-analyse/steps/step-05-handoff.md +103 -1
  52. package/templates/skills/business-analyse/steps/step-06-extract.md +518 -0
  53. package/templates/skills/check-version/SKILL.md +1 -1
  54. package/templates/skills/efcore/steps/db/step-deploy.md +22 -3
  55. package/templates/skills/efcore/steps/db/step-reset.md +27 -4
  56. package/templates/skills/efcore/steps/db/step-seed.md +46 -2
  57. package/templates/skills/efcore/steps/db/step-status.md +14 -0
  58. package/templates/skills/efcore/steps/migration/step-01-check.md +31 -5
  59. package/templates/skills/efcore/steps/migration/step-02-create.md +20 -4
  60. package/templates/skills/efcore/steps/rebase-snapshot/step-03-create.md +60 -0
  61. package/templates/skills/efcore/steps/shared/step-00-init.md +47 -8
  62. package/templates/skills/efcore/steps/squash/step-03-create.md +27 -5
  63. package/templates/skills/gitflow/SKILL.md +91 -29
  64. package/templates/skills/gitflow/_shared.md +144 -2
  65. package/templates/skills/gitflow/phases/status.md +11 -1
  66. package/templates/skills/gitflow/steps/step-commit.md +1 -1
  67. package/templates/skills/gitflow/steps/step-init.md +202 -39
  68. package/templates/skills/gitflow/templates/config.json +10 -1
  69. package/templates/skills/ralph-loop/steps/step-03-commit.md +2 -2
  70. package/templates/skills/validate-feature/SKILL.md +83 -0
  71. package/templates/skills/validate-feature/steps/step-01-compile.md +38 -0
  72. package/templates/skills/validate-feature/steps/step-02-unit-tests.md +45 -0
  73. package/templates/skills/validate-feature/steps/step-03-integration-tests.md +53 -0
  74. package/templates/skills/validate-feature/steps/step-04-api-smoke.md +157 -0
@@ -18,6 +18,15 @@
18
18
  "command": "${CLAUDE_HOOKS_DIR}/ralph-mcp-logger.sh"
19
19
  }
20
20
  ]
21
+ },
22
+ {
23
+ "matcher": "Write",
24
+ "hooks": [
25
+ {
26
+ "type": "command",
27
+ "command": "${CLAUDE_HOOKS_DIR}/appsettings-guard.sh"
28
+ }
29
+ ]
21
30
  }
22
31
  ],
23
32
  "Stop": [
@@ -0,0 +1,58 @@
1
+ import { http, HttpResponse } from 'msw';
2
+
3
+ /**
4
+ * Default MSW handlers for SmartStack API endpoints.
5
+ * These handlers mock common API calls used across the application.
6
+ *
7
+ * Override these in individual tests using server.use().
8
+ *
9
+ * @example
10
+ * // In a test file:
11
+ * server.use(
12
+ * http.get('/api/products', () =>
13
+ * HttpResponse.json({
14
+ * items: [{ id: '1', code: 'P-01', name: 'Test Product' }],
15
+ * totalCount: 1,
16
+ * pageNumber: 1,
17
+ * pageSize: 10,
18
+ * })
19
+ * )
20
+ * );
21
+ */
22
+ export const handlers = [
23
+ // Auth endpoints
24
+ http.get('/api/auth/me', () =>
25
+ HttpResponse.json({
26
+ id: 'test-user-id',
27
+ email: 'test-admin@smartstack.io',
28
+ name: 'Test Admin',
29
+ role: 'Administrator',
30
+ permissions: ['*'],
31
+ })
32
+ ),
33
+
34
+ http.post('/api/auth/login', () =>
35
+ HttpResponse.json({
36
+ token: 'test-jwt-token',
37
+ user: {
38
+ id: 'test-user-id',
39
+ email: 'test-admin@smartstack.io',
40
+ name: 'Test Admin',
41
+ },
42
+ })
43
+ ),
44
+
45
+ // Navigation endpoints
46
+ http.get('/api/navigation', () =>
47
+ HttpResponse.json([])
48
+ ),
49
+
50
+ // User preferences
51
+ http.get('/api/users/preferences', () =>
52
+ HttpResponse.json({})
53
+ ),
54
+
55
+ http.put('/api/users/preferences', () =>
56
+ HttpResponse.json({ success: true })
57
+ ),
58
+ ];
@@ -0,0 +1,25 @@
1
+ import { setupServer } from 'msw/node';
2
+ import { handlers } from './handlers';
3
+
4
+ /**
5
+ * MSW (Mock Service Worker) server for intercepting API calls in tests.
6
+ * Configured with default handlers that mock common SmartStack API endpoints.
7
+ *
8
+ * Usage:
9
+ * - Default handlers are loaded from ./handlers.ts
10
+ * - Override handlers per-test using server.use()
11
+ *
12
+ * @example
13
+ * import { server } from '@/test/msw/server';
14
+ * import { http, HttpResponse } from 'msw';
15
+ *
16
+ * test('custom handler', () => {
17
+ * server.use(
18
+ * http.get('/api/products', () =>
19
+ * HttpResponse.json({ items: [], totalCount: 0 })
20
+ * )
21
+ * );
22
+ * // ... test code
23
+ * });
24
+ */
25
+ export const server = setupServer(...handlers);
@@ -0,0 +1,16 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+ import { cleanup } from '@testing-library/react';
3
+ import { afterEach, beforeAll, afterAll } from 'vitest';
4
+ import { server } from './msw/server';
5
+
6
+ // Start MSW server before all tests
7
+ beforeAll(() => server.listen({ onUnhandledRequest: 'warn' }));
8
+
9
+ // Reset handlers after each test (to not leak state between tests)
10
+ afterEach(() => {
11
+ cleanup();
12
+ server.resetHandlers();
13
+ });
14
+
15
+ // Close MSW server after all tests
16
+ afterAll(() => server.close());
@@ -0,0 +1,59 @@
1
+ import React, { type ReactElement } from 'react';
2
+ import { render, type RenderOptions } from '@testing-library/react';
3
+ import { BrowserRouter } from 'react-router-dom';
4
+ import { I18nextProvider } from 'react-i18next';
5
+ import i18n from '../i18n'; // Adjust path to your i18n config
6
+
7
+ /**
8
+ * AuthContext mock for tests.
9
+ * Provides a default authenticated user with admin permissions.
10
+ */
11
+ const mockAuthContext = {
12
+ user: {
13
+ id: 'test-user-id',
14
+ email: 'test-admin@smartstack.io',
15
+ name: 'Test Admin',
16
+ role: 'Administrator',
17
+ },
18
+ isAuthenticated: true,
19
+ isLoading: false,
20
+ login: async () => {},
21
+ logout: async () => {},
22
+ hasPermission: () => true,
23
+ refreshPermissions: async () => {},
24
+ };
25
+
26
+ /**
27
+ * Wraps components with all necessary providers for testing.
28
+ * Includes: Router, i18n, Auth context.
29
+ */
30
+ function AllProviders({ children }: { children: React.ReactNode }) {
31
+ return (
32
+ <BrowserRouter>
33
+ <I18nextProvider i18n={i18n}>
34
+ {children}
35
+ </I18nextProvider>
36
+ </BrowserRouter>
37
+ );
38
+ }
39
+
40
+ /**
41
+ * Custom render function that wraps components with test providers.
42
+ * Use this instead of @testing-library/react's render.
43
+ *
44
+ * @example
45
+ * import { renderWithProviders, screen } from '@/test/test-utils';
46
+ * renderWithProviders(<MyComponent />);
47
+ * expect(screen.getByText('Hello')).toBeInTheDocument();
48
+ */
49
+ function renderWithProviders(
50
+ ui: ReactElement,
51
+ options?: Omit<RenderOptions, 'wrapper'>
52
+ ) {
53
+ return render(ui, { wrapper: AllProviders, ...options });
54
+ }
55
+
56
+ // Re-export everything from testing-library
57
+ export * from '@testing-library/react';
58
+ export { renderWithProviders };
59
+ export { mockAuthContext };
@@ -0,0 +1,31 @@
1
+ /// <reference types="vitest/config" />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import path from 'path';
5
+
6
+ export default defineConfig({
7
+ plugins: [react()],
8
+ test: {
9
+ globals: true,
10
+ environment: 'jsdom',
11
+ setupFiles: ['./src/test/setup.ts'],
12
+ css: false,
13
+ include: ['src/**/*.{test,spec}.{ts,tsx}'],
14
+ coverage: {
15
+ provider: 'v8',
16
+ reporter: ['text', 'json', 'html'],
17
+ include: ['src/**/*.{ts,tsx}'],
18
+ exclude: [
19
+ 'src/test/**',
20
+ 'src/**/*.d.ts',
21
+ 'src/main.tsx',
22
+ 'src/vite-env.d.ts',
23
+ ],
24
+ },
25
+ },
26
+ resolve: {
27
+ alias: {
28
+ '@': path.resolve(__dirname, './src'),
29
+ },
30
+ },
31
+ });
@@ -0,0 +1,61 @@
1
+ # Configuration File Safety Rules
2
+
3
+ ## appsettings*.json Protection
4
+
5
+ ### MANDATORY Rules
6
+
7
+ 1. **NEVER use Write tool on `appsettings*.json`** — ALWAYS use Edit for targeted changes
8
+ 2. **NEVER remove existing top-level sections** — only add or modify values within existing structure
9
+ 3. **NEVER delete configuration keys** — replace secret VALUES with `<CONFIGURE_HERE>` placeholder
10
+ 4. **When adding a new section**, use Edit to insert at the correct location (before the closing `}`)
11
+
12
+ ### WHY
13
+
14
+ Claude's Write tool replaces the entire file. If you read a 200-line appsettings.json but only reproduce 150 lines in the Write, 50 lines of configuration are permanently lost. This has caused production incidents where entire authentication, logging, or integration sections disappeared.
15
+
16
+ ### Correct Patterns
17
+
18
+ | Action | Tool | Approach |
19
+ |--------|------|----------|
20
+ | Add new section | Edit | Find closing `}`, replace with new section + `}` |
21
+ | Modify a value | Edit | Target the specific key-value pair |
22
+ | Add a key to section | Edit | Find the section's closing `}`, add key before it |
23
+ | Replace secrets | Edit | Replace the VALUE only, keep the key |
24
+
25
+ ### Example: Adding a New Section
26
+
27
+ ```
28
+ // Use Edit tool with:
29
+ // old_string: "Serilog": { ... }\n}
30
+ // new_string: "Serilog": { ... },\n "NewSection": { "Key": "<CONFIGURE_HERE>" }\n}
31
+ ```
32
+
33
+ ### Secret Value Handling
34
+
35
+ ```json
36
+ // WRONG - removing the key entirely
37
+ "Jwt": { }
38
+
39
+ // WRONG - deleting the section
40
+ // (section missing from file)
41
+
42
+ // CORRECT - placeholder value preserving structure
43
+ "Jwt": {
44
+ "SecretKey": "<CONFIGURE_HERE>",
45
+ "Issuer": "<CONFIGURE_HERE>",
46
+ "Audience": "<CONFIGURE_HERE>",
47
+ "ExpirationMinutes": 60
48
+ }
49
+ ```
50
+
51
+ ### Exception: New File Creation
52
+
53
+ Write is acceptable ONLY when creating a NEW `appsettings.*.json` file that does not yet exist on disk (e.g., `appsettings.Local.json` during `/gitflow start`). The PreToolUse hook automatically allows this case.
54
+
55
+ ### Protection Layers
56
+
57
+ | Layer | Mechanism | When |
58
+ |-------|-----------|------|
59
+ | Hook `appsettings-guard.sh` | PreToolUse on Write | Blocks Write if top-level sections would be lost |
60
+ | Commit agent step 2b | During `/gitflow commit` | Detects section removal vs HEAD before staging |
61
+ | These instructions | During development | Prevents the issue from occurring |
@@ -46,7 +46,7 @@ Always in simple code block:
46
46
 
47
47
  ```markdown
48
48
  ```
49
- /gitflow:1-init --exec
49
+ /gitflow init --exec
50
50
  ```
51
51
  ```
52
52
 
@@ -77,7 +77,7 @@ npm test
77
77
 
78
78
  ```markdown
79
79
  <!-- INCORRECT -->
80
- Execute `/gitflow:1-init`
80
+ Execute `/gitflow init`
81
81
  Run the command `npm run build`
82
82
  ```
83
83
 
@@ -99,6 +99,27 @@ if (entity.UserType == UserType.System || entity.UserType == UserType.LocalAdmin
99
99
  return BadRequest(new { message = "Cannot modify system accounts" });
100
100
  ```
101
101
 
102
+ ## FORBIDDEN: Temporary Files and Scripts (ALL SKILLS)
103
+
104
+ > **ABSOLUTE PROHIBITION: NEVER create temporary files, scripts, or helper files.**
105
+
106
+ This includes but is not limited to:
107
+ - `.ps1`, `.sh`, `.bat`, `.cmd` scripts
108
+ - `temp-*`, `tmp-*`, `helper-*` files
109
+ - Any file created solely to discover types, scan DLLs, or read metadata
110
+
111
+ **How to discover .NET types WITHOUT scripts:**
112
+ | Need | Tool to Use |
113
+ |------|-------------|
114
+ | Find a class/entity | `Grep` for `class {Name}` in `*.cs` files |
115
+ | Find services/interfaces | `Glob` for `**/I*Service.cs` in Application layer |
116
+ | Find NuGet packages | `Read` the `.csproj` file directly |
117
+ | Find existing entities | `Glob` for `**/*.cs` in Domain layer |
118
+ | Validate conventions | MCP `validate_conventions` tool |
119
+ | Cannot find after 2 tries | **ASK the user** |
120
+
121
+ **If you catch yourself about to create a script file: STOP. Use the tools above instead.**
122
+
102
123
  ## Common Validation Checklist
103
124
 
104
125
  ```
@@ -48,7 +48,10 @@ This skill uses progressive step loading. Each step calls MCP tools for generati
48
48
  | `mcp__smartstack__scaffold_api_client` | TypeScript API client |
49
49
  | `mcp__smartstack__scaffold_routes` | React Router configuration |
50
50
  | `mcp__smartstack__suggest_migration` | Migration name suggestion |
51
- | `mcp__smartstack__scaffold_tests` | Test suite generation |
51
+ | `mcp__smartstack__scaffold_tests` | Test suite generation (backend) |
52
+ | `mcp__smartstack__scaffold_frontend_tests` | Test suite generation (frontend React) |
53
+ | `mcp__smartstack__validate_conventions` | Post-generation convention check |
54
+ | `mcp__smartstack__review_code` | Code quality audit |
52
55
 
53
56
  ## WHEN THIS SKILL ACTIVATES
54
57
 
@@ -88,14 +91,17 @@ WEB (React) → API (.NET) → Application → Infrastructure → Database
88
91
  3. ROLES (RolePermission mappings)
89
92
  3b. CLIENT SEED PROVIDER (client projects only - IClientSeedDataProvider)
90
93
  4. API (Controller + DTOs via /controller:create)
94
+ 4b. VALIDATE (/validate - convention check on generated backend)
91
95
  5. SERVICES (Interface + Implementation)
92
96
  6. FRONTEND (Page + Components + Hooks)
93
97
  7. I18N (fr, en, it, de)
94
98
  8. ROUTES (nested routes mandatory)
95
99
  9. PREFERENCES (Hook pattern)
96
100
  10. MIGRATION (/efcore:migration)
97
- 11. TESTS (scaffold_tests - 6 categories)
98
- 12. DOCUMENTATION (in-app user doc via /documentation - if userDocRequired)
101
+ 11. TESTS - Backend (scaffold_tests - 7 categories including real integration)
102
+ 12. TESTS - Frontend (scaffold_frontend_tests - Vitest + Testing Library + MSW)
103
+ 13. REVIEW (/review-code - security + architecture + quality audit)
104
+ 14. DOCUMENTATION (in-app user doc via /documentation - if userDocRequired)
99
105
  ```
100
106
 
101
107
  ### 3b. Client Seed Provider (client projects only)
@@ -151,6 +157,9 @@ export function use{Module}Preferences() {
151
157
  | `/workflow` | Automated emails | IWorkflowService.TriggerAsync |
152
158
  | `/ai-prompt` | AI assistance | IAiCompletionService |
153
159
  | `/feature-full` | Complete feature | Orchestration all skills |
160
+ | `/validate` | After step-04 (backend) | MCP `validate_conventions` on generated code |
161
+ | `/review-code` | After step-07 (tests) | Security (OWASP), architecture, SOLID, performance audit |
162
+ | `/validate-feature` | After step-07 (tests) | Compile + test + API smoke test |
154
163
  | `/documentation` | In-app user doc | Documentation page via doc-data.ts + DocRenderer |
155
164
 
156
165
  ### Notification Integration Pattern
@@ -179,6 +188,26 @@ await _workflowService.TriggerAsync("{entity}.created", new Dictionary<string, o
179
188
  | EntityCard for cards | Manual cards with divs |
180
189
  | DataTable for tables | Sequential GUIDs |
181
190
 
191
+ ### FORBIDDEN ACTIONS (BLOCKING)
192
+
193
+ > **NEVER create temporary files, scripts, or helper files of any kind.**
194
+
195
+ | FORBIDDEN | USE INSTEAD |
196
+ |-----------|-------------|
197
+ | Creating `.ps1` scripts | `Grep` tool to search `.cs` files |
198
+ | Creating `.sh` / `.bat` scripts | `Glob` tool to find files by pattern |
199
+ | Creating `temp-*` files | `Read` tool to inspect file contents |
200
+ | Scanning DLLs / assemblies | Search source `.cs` files directly |
201
+ | Running `dotnet` reflection commands | MCP `validate_conventions` tool |
202
+ | Any file not part of the final deliverable | Ask the user if information is missing |
203
+
204
+ **Type Discovery Rules:**
205
+ - To find base classes: `Grep` for `class BaseEntity` or `class {Name}` in `*.cs` files
206
+ - To find existing services: `Glob` for `**/I*Service.cs` in the Application layer
207
+ - To find NuGet packages: `Read` the `.csproj` files directly
208
+ - To find existing entities: `Glob` for `**/*.cs` in the Domain layer
209
+ - If a type cannot be found after 2 search attempts: **ASK the user**, do NOT create scripts
210
+
182
211
  ## ASSOCIATED FILES
183
212
 
184
213
  ### Step Files (ACTIVE - Use These)
@@ -13,6 +13,8 @@ next_step: steps/step-05-frontend.md
13
13
  - ALWAYS generate Entity + Service + Controller as a unit
14
14
  - NEVER skip controller generation - API is required
15
15
  - YOU ARE AN ORCHESTRATOR calling MCP, not a generator
16
+ - **NEVER use Write on appsettings*.json** - ALWAYS use Edit (see _resources/config-safety.md)
17
+ - **Replace secret VALUES with `<CONFIGURE_HERE>`** - NEVER delete keys or sections
16
18
 
17
19
  ## YOUR TASK
18
20
 
@@ -531,6 +533,25 @@ Scaffold the SQL objects infrastructure:
531
533
 
532
534
  **If SqlObjectHelper already exists:** Skip this check.
533
535
 
536
+ ### Check 6: Convention Validation (RECOMMENDED)
537
+
538
+ Run MCP convention validation on the generated backend code:
539
+
540
+ ```
541
+ Tool: mcp__smartstack__validate_conventions
542
+ Args:
543
+ target: "backend"
544
+ scope: "{entity_name}"
545
+ ```
546
+
547
+ This verifies:
548
+ - Naming conventions (PascalCase entities, correct prefixes)
549
+ - Architecture layers respected (no cross-layer violations)
550
+ - Required attributes present (NavRoute, RequirePermission)
551
+ - DTO patterns followed
552
+
553
+ IF violations found: Fix them before proceeding to step-05.
554
+
534
555
  ---
535
556
 
536
557
  ## SUCCESS METRICS
@@ -40,22 +40,28 @@ From previous steps:
40
40
 
41
41
  ## EXECUTION SEQUENCE
42
42
 
43
- ### 1. Generate React Component
43
+ ### 1. Generate Frontend Pages (conventions-compliant)
44
44
 
45
45
  ```
46
46
  Tool: mcp__smartstack__scaffold_extension
47
47
  Args:
48
- type: "component"
48
+ type: "page"
49
49
  name: "{entity_name}"
50
50
  options:
51
+ navRoute: "{full_path}"
51
52
  outputPath: "web/src/pages/{context}/{application}/{module}"
52
53
  dryRun: false
53
54
  ```
54
55
 
55
- This generates:
56
- - `{EntityName}Page.tsx` - Main page component
57
- - `{EntityName}ListView.tsx` - Reusable list view
58
- - `use{EntityName}.ts` - Custom hook for data
56
+ This generates (all natively compliant with /ui-components conventions):
57
+ - `{EntityName}Page.tsx` List page wrapper with i18n
58
+ - `{EntityName}ListView.tsx` EntityCard grid + DataTable + ViewToggle + responsive + loading/error/empty states
59
+ - `{EntityName}DetailPage.tsx` Detail page with back button + pill tabs + info cards
60
+ - `use{EntityName}Preferences.ts` — Preferences hook (viewMode, sorting, filters, columns)
61
+ - i18n files for 4 languages (fr, en, it, de)
62
+
63
+ > **Note:** The `type: "page"` scaffold already includes CSS variables, EntityCard, responsive grid,
64
+ > semantic HTML, memo/useCallback, and all ui-components conventions. No manual corrections needed.
59
65
 
60
66
  ### 2. Generate API Client
61
67
 
@@ -134,38 +140,16 @@ If the context doesn't have a layout route yet, create one wrapping all child ro
134
140
 
135
141
  **Remember:** Also add the routes inside the tenant-prefixed block (`/t/:slug/...`) if it exists.
136
142
 
137
- ### 4. Generate i18n Files
138
-
139
- Create translation files for each language:
143
+ ### 4. Verify i18n Files
140
144
 
141
- ```markdown
142
- ### French (fr/{entityCode}.json)
143
- ```json
144
- {
145
- "title": "{labels.fr}",
146
- "subtitle": "Gestion de {labels.fr}",
147
- "columns": {
148
- "code": "Code",
149
- "name": "Nom",
150
- "createdAt": "Créé le",
151
- "actions": "Actions"
152
- },
153
- "form": {
154
- "code": "Code",
155
- "name": "Nom",
156
- "submit": "Enregistrer",
157
- "cancel": "Annuler"
158
- },
159
- "messages": {
160
- "created": "{labels.fr} créé avec succès",
161
- "updated": "{labels.fr} mis à jour avec succès",
162
- "deleted": "{labels.fr} supprimé avec succès",
163
- "error": "Une erreur est survenue"
164
- }
165
- }
166
- ```
145
+ > **Note:** i18n files are now auto-generated by `type: "page"` scaffold (step 1).
146
+ > Verify the 4 language files were created and customize the `title`/`subtitle` with the proper labels.
167
147
 
168
- Repeat for en, it, de with appropriate translations.
148
+ If the generated translations need customization (e.g., replacing generic title with `{labels.fr}`):
149
+ - `i18n/locales/fr/{entityCode}.json` → set `"title": "{labels.fr}"`
150
+ - `i18n/locales/en/{entityCode}.json` → set `"title": "{labels.en}"`
151
+ - `i18n/locales/it/{entityCode}.json` → set `"title": "{labels.it}"`
152
+ - `i18n/locales/de/{entityCode}.json` → set `"title": "{labels.de}"`
169
153
 
170
154
  ### 5. Present Output to User
171
155