@atlashub/smartstack-cli 3.8.0 → 3.9.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 (120) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +33 -0
  6. package/templates/agents/explore-codebase.md +1 -0
  7. package/templates/agents/explore-docs.md +1 -0
  8. package/templates/agents/fix-grammar.md +1 -0
  9. package/templates/agents/snipper.md +1 -0
  10. package/templates/skills/admin/SKILL.md +6 -0
  11. package/templates/skills/ai-prompt/SKILL.md +32 -136
  12. package/templates/skills/ai-prompt/steps/step-01-implementation.md +122 -0
  13. package/templates/skills/apex/SKILL.md +120 -0
  14. package/templates/skills/apex/_shared.md +86 -0
  15. package/templates/skills/apex/references/agent-teams-protocol.md +164 -0
  16. package/templates/skills/apex/references/smartstack-layers.md +173 -0
  17. package/templates/skills/apex/steps/step-00-init.md +156 -0
  18. package/templates/skills/apex/steps/step-01-analyze.md +169 -0
  19. package/templates/skills/apex/steps/step-02-plan.md +160 -0
  20. package/templates/skills/apex/steps/step-03-execute.md +166 -0
  21. package/templates/skills/apex/steps/step-04-validate.md +138 -0
  22. package/templates/skills/apex/steps/step-05-examine.md +124 -0
  23. package/templates/skills/apex/steps/step-06-resolve.md +105 -0
  24. package/templates/skills/apex/steps/step-07-tests.md +130 -0
  25. package/templates/skills/apex/steps/step-08-run-tests.md +115 -0
  26. package/templates/skills/application/SKILL.md +10 -0
  27. package/templates/skills/application/references/backend-controller-hierarchy.md +58 -0
  28. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  29. package/templates/skills/application/references/backend-verification.md +88 -0
  30. package/templates/skills/application/references/frontend-verification.md +111 -0
  31. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  32. package/templates/skills/application/references/provider-template.md +134 -0
  33. package/templates/skills/application/references/test-frontend.md +73 -0
  34. package/templates/skills/application/references/test-prerequisites.md +72 -0
  35. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  36. package/templates/skills/application/steps/step-03b-provider.md +4 -128
  37. package/templates/skills/application/steps/step-04-backend.md +20 -350
  38. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  39. package/templates/skills/application/steps/step-07-tests.md +12 -132
  40. package/templates/skills/business-analyse/SKILL.md +11 -2
  41. package/templates/skills/business-analyse/html/ba-interactive.html +176 -14
  42. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +1 -0
  43. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +16 -4
  44. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +7 -2
  45. package/templates/skills/business-analyse/html/src/scripts/09-export.js +103 -0
  46. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +12 -6
  47. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +24 -2
  48. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +12 -0
  49. package/templates/skills/business-analyse/html/src/template.html +1 -0
  50. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  51. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  52. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  53. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  54. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  55. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  56. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  57. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  58. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  59. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  60. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  61. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  62. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  63. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  64. package/templates/skills/business-analyse/steps/step-00-init.md +35 -68
  65. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  66. package/templates/skills/business-analyse/steps/step-03a-data.md +6 -49
  67. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  68. package/templates/skills/business-analyse/steps/step-03d-validate.md +3 -48
  69. package/templates/skills/business-analyse/steps/step-04-consolidation.md +9 -104
  70. package/templates/skills/business-analyse/steps/step-05a-handoff.md +25 -441
  71. package/templates/skills/business-analyse/steps/step-05b-deploy.md +19 -187
  72. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  73. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  74. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  75. package/templates/skills/check-version/SKILL.md +7 -0
  76. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  77. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  78. package/templates/skills/controller/steps/step-03-generate.md +6 -158
  79. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  80. package/templates/skills/debug/SKILL.md +7 -0
  81. package/templates/skills/explore/SKILL.md +6 -0
  82. package/templates/skills/feature-full/SKILL.md +39 -142
  83. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  84. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  85. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  86. package/templates/skills/gitflow/references/plan-template.md +69 -0
  87. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  88. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  89. package/templates/skills/gitflow/steps/step-init.md +18 -289
  90. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  91. package/templates/skills/gitflow/steps/step-start.md +16 -126
  92. package/templates/skills/mcp/SKILL.md +9 -213
  93. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  94. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  95. package/templates/skills/notification/SKILL.md +7 -0
  96. package/templates/skills/quick-search/SKILL.md +5 -0
  97. package/templates/skills/ralph-loop/SKILL.md +99 -381
  98. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  99. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  100. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  101. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  102. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  103. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  104. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  105. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  106. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  107. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  108. package/templates/skills/refactor/SKILL.md +12 -176
  109. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  110. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  111. package/templates/skills/review-code/SKILL.md +19 -257
  112. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  113. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  114. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  115. package/templates/skills/ui-components/SKILL.md +7 -0
  116. package/templates/skills/utils/SKILL.md +6 -0
  117. package/templates/skills/validate/SKILL.md +6 -0
  118. package/templates/skills/validate-feature/SKILL.md +8 -0
  119. package/templates/skills/workflow/SKILL.md +40 -118
  120. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -0,0 +1,110 @@
1
+ # UI: Resource Structure Cards
2
+
3
+ > Reference for step-03b-ui.md — exact JSON formats for section resources (SmartTable, SmartForm) and wireframes.
4
+
5
+ ## specification.sections[] (with resources)
6
+
7
+ ```json
8
+ {
9
+ "code": "list",
10
+ "labels": { "fr": "Liste", "en": "List", "it": "Elenco", "de": "Liste" },
11
+ "route": "/business/{app}/{module}/list",
12
+ "icon": "list",
13
+ "permission": "business.{app}.{module}.read",
14
+ "wireframe": "{module}-list",
15
+ "useCases": ["UC-{PREFIX}-001", "UC-{PREFIX}-002"],
16
+ "businessRules": ["BR-VAL-{PREFIX}-001"],
17
+ "resources": [
18
+ {
19
+ "code": "{module}-grid",
20
+ "type": "SmartTable",
21
+ "entity": "{MainEntity}",
22
+ "permission": "business.{app}.{module}.read",
23
+ "columns": ["name", "status", "createdAt"],
24
+ "columnDefs": [
25
+ { "field": "code", "label": {"fr": "Code", "en": "Code"}, "format": "text", "sortable": true, "filterable": true, "clickAction": "navigate:detail" },
26
+ { "field": "name", "label": {"fr": "Nom", "en": "Name"}, "format": "text", "sortable": true, "filterable": true },
27
+ { "field": "status", "label": {"fr": "Statut", "en": "Status"}, "format": "badge", "sortable": true, "filterable": true, "colorMap": "stateMachine:{Entity}" },
28
+ { "field": "createdAt", "label": {"fr": "Créé le", "en": "Created"}, "format": "date-relative", "sortable": true }
29
+ ],
30
+ "actions": ["view", "edit", "delete"],
31
+ "rowActions": [
32
+ { "action": "view", "icon": "eye", "permission": "business.{app}.{module}.read" },
33
+ { "action": "edit", "icon": "edit", "permission": "business.{app}.{module}.update", "showWhen": {"status": ["draft"]} },
34
+ { "action": "delete", "icon": "trash", "permission": "business.{app}.{module}.delete", "confirm": true }
35
+ ],
36
+ "filters": ["status", "dateRange"],
37
+ "defaultSort": { "field": "createdAt", "direction": "desc" },
38
+ "defaultPageSize": 20,
39
+ "emptyState": { "icon": "inbox", "message": {"fr": "Aucun enregistrement", "en": "No records"}, "createAction": true }
40
+ }
41
+ ]
42
+ }
43
+ ```
44
+
45
+ **MANDATORY for SmartTable:** `columnDefs`, `rowActions`, `defaultSort`, `emptyState`
46
+
47
+ ## SmartForm resource (for create/edit sections)
48
+
49
+ ```json
50
+ {
51
+ "code": "{module}-form",
52
+ "type": "SmartForm",
53
+ "entity": "{MainEntity}",
54
+ "permission": "business.{app}.{module}.create",
55
+ "fields": [
56
+ { "name": "code", "component": "Input", "required": true, "validation": "Unique, auto-generated" },
57
+ { "name": "name", "component": "Input", "required": true },
58
+ { "name": "type", "component": "Select", "required": true, "source": "EntityTypeEnum" },
59
+ { "name": "description", "component": "TextArea", "required": false },
60
+ { "name": "parentId", "component": "EntitySelect", "source": "ParentEntity", "required": true },
61
+ { "name": "startDate", "component": "DatePicker", "required": true },
62
+ { "name": "isActive", "component": "Toggle", "default": true }
63
+ ],
64
+ "formLayout": {
65
+ "type": "tabs",
66
+ "tabs": [
67
+ { "code": "general", "label": {"fr": "Général", "en": "General"}, "fields": ["code", "name", "type", "description"] },
68
+ { "code": "details", "label": {"fr": "Détails", "en": "Details"}, "fields": ["parentId", "startDate", "isActive"] }
69
+ ]
70
+ }
71
+ }
72
+ ```
73
+
74
+ **MANDATORY for SmartForm:** `fields` with `component` type, `formLayout`
75
+
76
+ ## specification.uiWireframes[]
77
+
78
+ ```json
79
+ {
80
+ "screen": "{module}-{section}",
81
+ "section": "{section}",
82
+ "description": "Description of the screen",
83
+ "mockupFormat": "ascii",
84
+ "mockup": "╔═══...",
85
+ "elements": ["DataGrid", "FilterBar", "Pagination", "CreateButton"],
86
+ "actions": ["filter", "sort", "create", "view-detail"],
87
+ "permissionsRequired": ["business.{app}.{module}.read"],
88
+ "componentMapping": [
89
+ { "wireframeElement": "DataGrid", "reactComponent": "SmartTable" },
90
+ { "wireframeElement": "FilterBar", "reactComponent": "SmartFilter" },
91
+ { "wireframeElement": "CreateButton", "reactComponent": "Button" }
92
+ ],
93
+ "layout": {
94
+ "type": "page",
95
+ "regions": [
96
+ { "id": "toolbar", "position": "top", "components": [
97
+ { "type": "FilterBar", "resourceRef": "{module}-filters" },
98
+ { "type": "ActionMenu", "resourceRef": "{module}-actions", "permission": "business.{app}.{module}.create" }
99
+ ]},
100
+ { "id": "content", "position": "main", "span": 12, "components": [
101
+ { "type": "SmartTable", "resourceRef": "{module}-grid" }
102
+ ]}
103
+ ]
104
+ }
105
+ }
106
+ ```
107
+
108
+ **REQUIRED fields:** `screen`, `mockup`, `elements`, `section`, `componentMapping`, `layout` are ALL mandatory.
109
+ A wireframe without `componentMapping` or `layout` will FAIL validation in step 9.
110
+ **layout.regions[].components[].resourceRef** MUST match a `sections[].resources[].code`.
@@ -0,0 +1,55 @@
1
+ # Validate: Incremental Interactive HTML Deployment
2
+
3
+ > Reference for step-03d-validate.md — section 11-bis incremental HTML deploy after each module.
4
+
5
+ ## Why Incremental?
6
+
7
+ The client doesn't have to wait until handoff to start reviewing.
8
+ While module 2 is being specified, the client can already give feedback on module 1.
9
+ Each incremental deployment OVERWRITES the previous HTML (latest state always).
10
+ The FINAL deployment at step-05 (handoff) will include consolidation and handoff data.
11
+
12
+ ## Deployment Steps
13
+
14
+ **Source:** `html/ba-interactive.html` (relative to skill root = `~/.claude/skills/business-analyse/html/`)
15
+
16
+ **Destination:** `docs/business/{app}/business-analyse/v{version}/ba-interactive.html`
17
+
18
+ ### Step 1: Read Sources
19
+
20
+ - Read the HTML template from skill directory
21
+ - Read the master feature.json (application level — now updated with current module status)
22
+ - Read EACH completed module's feature.json (including the one just specified)
23
+
24
+ ### Step 2: Build FEATURE_DATA Object
25
+
26
+ > **Use the EXACT SAME mapping defined in step-05b-deploy.md and references/html-data-mapping.md.**
27
+ > The mapping is identical — the only difference is that `moduleSpecs` only includes completed modules.
28
+ > Modules not yet specified will NOT appear in `moduleSpecs` (their entry in `modules[]` will show `status: "pending"`).
29
+
30
+ Follow step-05 section 9d "Step 2: Build FEATURE_DATA object" for the complete mapping pseudocode:
31
+ - `metadata`, `cadrage`, `modules[]`, `dependencies[]` → from master feature.json
32
+ - `moduleSpecs[moduleCode]` → only for modules with status "specified" (completed so far)
33
+ - `consolidation` → empty `{ interactions: [], e2eFlows: [] }` (not yet consolidated)
34
+ - `handoff` → empty `{}` (not yet handed off)
35
+
36
+ ### Step 3: Replace Placeholders in Template
37
+
38
+ - Serialize the FEATURE_DATA object as JSON (2-space indentation)
39
+ - Replace `{{FEATURE_DATA}}` with the serialized JSON
40
+ - Replace `{{APPLICATION_NAME}}` → `{application_name}`
41
+ - Replace `{{APPLICATION_ID}}` → `{feature_id}`
42
+ - Replace `{{VERSION}}` → `{version}`
43
+ - Replace `{{CREATED_AT}}` → `{ISO timestamp}`
44
+
45
+ ### Step 4: Write and Confirm
46
+
47
+ ```
48
+ ✓ Interactive HTML updated (incremental):
49
+ Path: docs/business/{app}/business-analyse/v{version}/ba-interactive.html
50
+ Modules included: {completedModules.length}/{totalModules} specified
51
+ - {completedModule1}: {uc_count} UCs, {br_count} BRs, {entity_count} entities
52
+ - {completedModule2}: ...
53
+ Remaining: {pendingModules.join(', ')} (will be added after specification)
54
+ → Client can open in browser to review completed modules now.
55
+ ```
@@ -69,7 +69,39 @@ mcp__smartstack__validate_conventions({ checks: ["tables"] })
69
69
  **DO NOT** continue to any subsequent step.
70
70
  **STOP the skill immediately.**
71
71
 
72
- ## Step 2: Scan Existing Applications
72
+ ## Step 2a: Check for Review Mode
73
+
74
+ If `{feature_description}` starts with `-review` (with or without extra text):
75
+
76
+ 1. Set `workflow_type = "review"`
77
+ 2. Scan `docs/business/` for the most recent application (by updatedAt)
78
+ 3. For the latest application version folder, look for `ba-review.json`
79
+ 4. If found:
80
+ - Store `review_json_path` = path to `ba-review.json`
81
+ - Store `application_name` from the master feature.json metadata
82
+ - Store `docs_dir` = directory containing `ba-review.json`
83
+ - Display:
84
+ ```
85
+ Review mode: found ba-review.json at {review_json_path}
86
+ Application: {application_name}
87
+ ```
88
+ - **SKIP all remaining steps** → Load `./step-06-review.md` directly
89
+ 5. If NOT found:
90
+ - Display error:
91
+ ```
92
+ ERROR: No ba-review.json found in docs/business/
93
+
94
+ To create one:
95
+ 1. Open the ba-interactive.html in your browser
96
+ 2. Make your corrections
97
+ 3. Click "Sauvegarder corrections" button
98
+ 4. Save the downloaded ba-review.json in the version folder
99
+ (e.g., docs/business/{app}/business-analyse/v1.0/ba-review.json)
100
+ 5. Run /business-analyse -review again
101
+ ```
102
+ - **STOP EXECUTION**
103
+
104
+ ## Step 2b: Scan Existing Applications
73
105
 
74
106
  Scan `docs/business/` for existing business analysis features.
75
107
 
@@ -86,7 +118,7 @@ Scan `docs/business/` for existing business analysis features.
86
118
  existing_apps: array of { app, featureId, description, version }
87
119
  ```
88
120
 
89
- ## Step 3: Auto-Detect New vs Update
121
+ ## Step 3: Auto-Detect New vs Update (skipped in review mode)
90
122
 
91
123
  Compare the user's `{feature_description}` with existing applications.
92
124
 
@@ -243,72 +275,7 @@ docs_dir: "docs/business/{app}/business-analyse/v{version}"
243
275
  > **The JSON Schemas MUST be present in the project alongside the generated feature.json files.**
244
276
  > Without schemas, feature.json files cannot be validated and have no structural reference.
245
277
 
246
- **Performance optimization:** Use cache file to avoid redundant deployments.
247
-
248
- ### Cache-based deployment logic:
249
-
250
- **Step 1: Check deployment cache**
251
-
252
- Cache file location: `docs/business/{app}/business-analyse/.schema-cache.json`
253
-
254
- ```
255
- IF EXISTS docs/business/{app}/business-analyse/.schema-cache.json:
256
- Read cache file
257
- IF cache.version == "{CLI_VERSION}" (from package.json):
258
- Display: "Schemas already deployed ({CLI_VERSION}) - skipping"
259
- SKIP deployment (trust cache)
260
- → Go to Step 9
261
- ELSE:
262
- Display: "Schema version mismatch (cache: {cache.version}, current: {CLI_VERSION})"
263
- Proceed to deployment
264
- ELSE:
265
- Display: "Deploying schemas (first time)..."
266
- Proceed to deployment
267
- ```
268
-
269
- **Step 2: Deploy schemas (if needed)**
270
-
271
- Source: `schemas/` (relative to skill root = `~/.claude/skills/business-analyse/schemas/`)
272
- Destination: `docs/business/{app}/business-analyse/schemas/`
273
-
274
- ```
275
- Read and Write each file (preserving directory structure):
276
-
277
- docs/business/{app}/business-analyse/schemas/
278
- ├── feature-schema.json
279
- ├── application-schema.json
280
- ├── sections/
281
- │ ├── metadata-schema.json
282
- │ ├── discovery-schema.json
283
- │ ├── analysis-schema.json
284
- │ ├── specification-schema.json
285
- │ ├── validation-schema.json
286
- │ └── handoff-schema.json
287
- └── shared/
288
- └── common-defs.json
289
- ```
290
-
291
- **Total: 9 files to deploy.**
292
-
293
- **Step 3: Write cache file (after successful deployment)**
294
-
295
- ```json
296
- {
297
- "version": "{CLI_VERSION}",
298
- "deployedAt": "{ISO timestamp}",
299
- "schemas": [
300
- "feature-schema.json",
301
- "application-schema.json",
302
- "sections/metadata-schema.json",
303
- "sections/discovery-schema.json",
304
- "sections/analysis-schema.json",
305
- "sections/specification-schema.json",
306
- "sections/validation-schema.json",
307
- "sections/handoff-schema.json",
308
- "shared/common-defs.json"
309
- ]
310
- }
311
- ```
278
+ See [references/init-schema-deployment.md](../references/init-schema-deployment.md) for cache-based deployment logic (9 schema files, version-checked via `.schema-cache.json`).
312
279
 
313
280
  ## Step 9: Create Master feature.json
314
281
 
@@ -92,133 +92,10 @@ ELSE:
92
92
  > Skip organizational questions (adoption, change management, governance, KPIs).
93
93
  > Focus on functional decisions and technical challenges.
94
94
 
95
- ### 3v. Vibe Coding Lot 1: Problem & Scope
96
-
97
- **Goal:** Capture the core need and must-have features in a single batch.
98
-
99
- Ask via AskUserQuestion (2 questions):
100
- ```
101
- question: "Quel est le besoin principal de cette application ?"
102
- header: "Besoin"
103
- options:
104
- - label: "Automatiser un processus manuel"
105
- description: "Remplacer des taches repetitives par une application"
106
- - label: "Creer un outil manquant"
107
- description: "Construire quelque chose qui n'existe pas encore"
108
- - label: "Remplacer un outil existant"
109
- description: "Remplacer un logiciel ou tableur qui ne convient plus"
110
- - label: "Centraliser des donnees"
111
- description: "Rassembler des informations dispersees en un seul endroit"
112
- ```
113
-
114
- ```
115
- question: "Quelles fonctionnalites sont indispensables pour la V1 ?"
116
- header: "Indispensable"
117
- multiSelect: true
118
- options:
119
- → Generate 4 options dynamically from {feature_description}
120
- → Each option = one functional area detected in the description
121
- → Example for HR app: "Gestion des employes", "Saisie des heures", "Gestion des conges", "Rapports et exports"
122
- ```
123
-
124
- **Store:**
125
- ```yaml
126
- problem_type: string (from Q1)
127
- must_have_features: string[] (from Q2)
128
- ```
129
-
130
- ### 4v. Vibe Coding — Lot 2: Users & Permissions
131
-
132
- **Goal:** Determine access model (solo vs multi-user) and roles.
133
-
134
- Ask via AskUserQuestion:
135
- ```
136
- question: "Qui va utiliser cette application ?"
137
- header: "Utilisateurs"
138
- options:
139
- - label: "Moi seul"
140
- description: "Application mono-utilisateur, je suis l'unique admin"
141
- - label: "Quelques utilisateurs (2-10)"
142
- description: "Petite equipe avec des roles differents"
143
- - label: "Organisation (10+)"
144
- description: "Deploiement a l'echelle d'une equipe ou entreprise"
145
- ```
146
-
147
- ```
148
- IF "Moi seul":
149
- Auto-set:
150
- applicationRoles = [{ role: "{App} Admin", level: "admin", permissionPattern: "business.{app}.*" }]
151
- stakeholders = [{ role: "Developpeur", function: "Product owner et developpeur", involvement: "decision-maker", tasks: ["Toutes les operations"] }]
152
- → SKIP role question
153
-
154
- IF "Quelques utilisateurs" or "Organisation":
155
- Display standard 4-tier roles table, then ask:
156
- question: "Ces 4 roles (Admin, Manager, Contributor, Viewer) conviennent-ils ?"
157
- header: "Roles"
158
- options:
159
- - label: "Oui, parfait"
160
- description: "Utiliser les 4 roles standards"
161
- - label: "Personnaliser"
162
- description: "Modifier les roles ou permissions"
163
-
164
- Auto-set stakeholders from user type:
165
- IF "Quelques utilisateurs":
166
- stakeholders = [
167
- { role: "Administrateur", function: "Gere le systeme et les utilisateurs", involvement: "decision-maker", tasks: ["Configuration", "Gestion utilisateurs"] },
168
- { role: "Utilisateur", function: "Utilise le systeme au quotidien", involvement: "end-user", tasks: ["Saisie", "Consultation"] }
169
- ]
170
- IF "Organisation":
171
- stakeholders = [
172
- { role: "Administrateur", function: "Gere le systeme", involvement: "decision-maker", tasks: ["Configuration", "Gestion"] },
173
- { role: "Manager", function: "Supervise et valide", involvement: "approver", tasks: ["Validation", "Reporting"] },
174
- { role: "Utilisateur", function: "Operations quotidiennes", involvement: "end-user", tasks: ["Saisie", "Consultation"] }
175
- ]
176
- ```
177
-
178
- ### 5v. Vibe Coding — Lot 3: Technical Challenges
179
-
180
- **Goal:** Identify technical risks specific to AI-assisted development.
181
-
182
- Ask via AskUserQuestion:
183
- ```
184
- question: "Quels defis techniques anticipez-vous ?"
185
- header: "Defis"
186
- multiSelect: true
187
- options:
188
- - label: "Regles metier complexes"
189
- description: "Calculs, validations ou workflows difficiles a specifier"
190
- - label: "Volume de donnees"
191
- description: "Grandes quantites de donnees a gerer ou migrer"
192
- - label: "Integrations externes"
193
- description: "APIs, services tiers ou synchronisation avec d'autres systemes"
194
- - label: "Interface riche"
195
- description: "Ecrans avec beaucoup d'interactions, graphiques ou visualisations"
196
- ```
197
-
198
- **Auto-infer cadrage data (DO NOT ask these — derive from answers):**
199
-
200
- ```yaml
201
- cadrage.problem: "{feature_description} — {problem_type}"
202
- cadrage.asIs: "Aucun systeme en place" | "Processus manuel existant" | "Outil existant a remplacer"
203
- → Derived from Lot 1 problem_type
204
- cadrage.toBe: "Application {application_name} couvrant: {must_have_features joined}"
205
- cadrage.trigger: "Projet vibe coding initie par le developpeur"
206
- cadrage.risks:
207
- → Map each selected technical challenge to a RISK entry:
208
- - "Regles metier complexes" → RISK-001, type: "technical", probability: "medium", impact: "high"
209
- - "Volume de donnees" → RISK-002, type: "technical", probability: "low", impact: "medium"
210
- - "Integrations externes" → RISK-003, type: "technical", probability: "medium", impact: "medium"
211
- - "Interface riche" → RISK-004, type: "technical", probability: "low", impact: "low"
212
- → Add mitigation for each: "Specification detaillee dans step-03 + generation iterative"
213
- cadrage.acceptanceCriteria:
214
- - { id: "AC-001", criterion: "Toutes les fonctionnalites must-have implementees et fonctionnelles", validated: false }
215
- - { id: "AC-002", criterion: "Application deployable et utilisable", validated: false }
216
- cadrage.globalScope:
217
- mustHave: {must_have_features}
218
- shouldHave: [] → Determined later in coverage matrix
219
- couldHave: [] → Determined later in coverage matrix
220
- outOfScope: []
221
- ```
95
+ See [references/cadrage-vibe-coding.md](../references/cadrage-vibe-coding.md) for the complete 3-lot questionnaire:
96
+ - **Lot 1 (3v):** Problem & Scope — capture core need + must-have features
97
+ - **Lot 2 (4v):** Users & Permissions access model (solo/team/org) + roles
98
+ - **Lot 3 (5v):** Technical Challenges — risks specific to AI-assisted dev + auto-inferred cadrage data
222
99
 
223
100
  **After Lot 3:** Go directly to **section 9 (Coverage Matrix)**.
224
101
 
@@ -389,73 +266,7 @@ If a feature is in mustHave → it MUST have at least one UC in the correspondin
389
266
 
390
267
  Use ba-writer to enrich master feature.json. **Follow the STRUCTURE CARDS below exactly.**
391
268
 
392
- > **STRUCTURE CARD: cadrage.stakeholders[]**
393
- > ```json
394
- > {
395
- > "role": "Fleet Manager",
396
- > "function": "Manages daily fleet operations",
397
- > "involvement": "decision-maker",
398
- > "tasks": ["Monitor vehicles", "Approve repairs", "Export reports"],
399
- > "frequency": "Daily",
400
- > "painPoints": ["Manual tracking in spreadsheets", "No real-time visibility"]
401
- > }
402
- > ```
403
- > **MANDATORY fields:** `role`, `function`, `involvement`, `tasks`
404
- > **involvement values:** `approver`, `decision-maker`, `consulted`, `informed`, `end-user`
405
- > **FORBIDDEN fields:** Do NOT use `expertise`, `systemRole`, `description` (use `function` instead).
406
-
407
- > **STRUCTURE CARD: cadrage.applicationRoles[]**
408
- > ```json
409
- > {
410
- > "role": "{App} Admin",
411
- > "description": "Full access to all modules",
412
- > "level": "admin",
413
- > "permissionPattern": "business.{app}.*"
414
- > }
415
- > ```
416
- > **MANDATORY fields:** `role`, `level`, `permissionPattern`
417
- > **level values:** `admin`, `manager`, `contributor`, `viewer`
418
- > **FORBIDDEN fields:** Do NOT use `permissions` (use `permissionPattern`), `isDefault`.
419
-
420
- > **STRUCTURE CARD: cadrage.risks[]**
421
- > ```json
422
- > {
423
- > "id": "RISK-001",
424
- > "type": "business|technical|organizational",
425
- > "description": "CSV data may contain duplicates and errors",
426
- > "probability": "high|medium|low",
427
- > "impact": "high|medium|low",
428
- > "priority": "critical|medium|low",
429
- > "mitigation": "Data cleaning phase before import, detailed error reports"
430
- > }
431
- > ```
432
- > **MANDATORY fields:** `id` (pattern: RISK-NNN), `type`, `description`, `mitigation`
433
- > **FORBIDDEN fields:** Do NOT use `risk` (name), `severity`. Use `id` + `description` + `priority`.
434
-
435
- > **STRUCTURE CARD: cadrage.acceptanceCriteria[]**
436
- > ```json
437
- > { "id": "AC-001", "criterion": "All must-have features delivered and tested", "validated": false }
438
- > ```
439
- > **MANDATORY:** This section must NOT be omitted.
440
-
441
- > **STRUCTURE CARD: cadrage.coverageMatrix[]**
442
- > ```json
443
- > {
444
- > "item": "User management with CRUD",
445
- > "category": "mustHave|shouldHave|couldHave|outOfScope|implicit",
446
- > "module": "Users",
447
- > "ucRef": "UC-UM-001",
448
- > "notes": "Foundation module, must be implemented first"
449
- > }
450
- > ```
451
- > **MANDATORY fields:** `item`, `category`, `module`
452
- > **category values:** `mustHave`, `shouldHave`, `couldHave`, `outOfScope`, `implicit` (camelCase)
453
- > **FORBIDDEN fields:** Do NOT use `id`, `feature`, `priority`. Use `item` + `category`.
454
-
455
- > **STRUCTURE CARD: cadrage.codebaseContext** — Must be a string, NOT an object.
456
- > ```json
457
- > "codebaseContext": "Greenfield project, no existing entities. SmartStack 2.1.0 with Extensions DbContext."
458
- > ```
269
+ See [references/cadrage-structure-cards.md](../references/cadrage-structure-cards.md) for exact JSON formats of: `stakeholders[]`, `applicationRoles[]`, `risks[]`, `acceptanceCriteria[]`, `coverageMatrix[]`, `codebaseContext`.
459
270
 
460
271
  ```
461
272
  ba-writer.enrichSection({
@@ -245,55 +245,12 @@ Display to client:
245
245
 
246
246
  **Prerequisites:** Entity attributes must be defined (from step 6) OR anticipated from decomposition.
247
247
 
248
- **Inference rules - Entity attribute SmartTable column:**
249
-
250
- | Attribute Type | Column Format | Sortable | Filterable | Notes |
251
- |---|---|---|---|---|
252
- | string + unique | text | yes | yes | clickAction: navigate:detail |
253
- | string | text | yes | yes | — |
254
- | enum / status | badge | yes | yes (multi-select) | colorMap from lifeCycles if exists |
255
- | FK:Entity | text (join .name) | yes | yes (entity-select) | Display related entity name |
256
- | decimal | currency | yes | no | — |
257
- | int | number | yes | no | — |
258
- | datetime | date-relative | yes | yes (date-range) | — |
259
- | bool | boolean | yes | yes (toggle) | — |
260
- | text (long) | — | no | no | Hidden in table, visible in detail |
261
-
262
- **Inference rules - Entity attribute → SmartForm field:**
263
-
264
- | Attribute Type | Component | Required from | Notes |
265
- |---|---|---|---|
266
- | string | Input | entity.required | — |
267
- | string (multiline) | TextArea | entity.required | rows: 4 |
268
- | enum | Select | entity.required | source: enum name |
269
- | FK:Entity | EntitySelect | entity.required | source: target entity, searchable |
270
- | decimal | NumberInput | entity.required | — |
271
- | int | NumberInput | entity.required | — |
272
- | datetime | DatePicker | entity.required | — |
273
- | bool | Toggle | — | default: false |
274
-
275
- **Auto-generated sections per featureType:**
276
-
277
- | featureType | Sections generated |
278
- |---|---|
279
- | data-centric | list, create, detail |
280
- | workflow | list, create, detail, edit |
281
- | integration | list, detail, config |
282
- | reporting | dashboard |
283
- | full-module | list, create, detail, edit, dashboard |
284
-
285
- **For each auto-generated section:**
286
-
287
- 1. **list section:** SmartTable with all non-long-text attributes as columns (convention or columnDefs based on depth), actions = [view, edit, delete], defaultSort = { createdAt, desc }
288
- 2. **create section:** SmartForm with all writable attributes as fields, component inferred from type
289
- 3. **detail section:** DetailCard with all attributes + child SmartTable for each 1:N relationship
290
- 4. **edit section:** Same as create but pre-filled (mode: edit)
291
- 5. **dashboard section:** Trigger 3d (dashboard specification)
292
-
293
- **If entity has a status/enum field AND lifeCycles exists:**
294
- - list section: status column gets `format: badge`, `colorMap: stateMachine:{Entity}`
295
- - list section: rowActions get `showWhen` conditions based on state machine transitions
296
- - detail section: add StatusBadge resource + transition action buttons
248
+ See [references/spec-auto-inference.md](../references/spec-auto-inference.md) for complete inference rules:
249
+ - Entity attribute → SmartTable column mapping (9 type rules)
250
+ - Entity attribute SmartForm field mapping (8 type rules)
251
+ - Auto-generated sections per featureType (5 types)
252
+ - Section generation rules (list, create, detail, edit, dashboard)
253
+ - Status/lifecycle enhancement rules
297
254
 
298
255
  Write auto-generated sections to `specification.sections[]` via ba-writer.enrichSection()
299
256