@atlashub/smartstack-cli 3.9.0 → 3.12.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 (48) hide show
  1. package/dist/index.js +2544 -2461
  2. package/dist/index.js.map +1 -1
  3. package/dist/mcp-entry.mjs +479 -6185
  4. package/dist/mcp-entry.mjs.map +1 -1
  5. package/package.json +1 -1
  6. package/templates/agents/ba-writer.md +178 -0
  7. package/templates/agents/db-reader.md +149 -0
  8. package/templates/skills/application/references/application-roles-template.md +227 -0
  9. package/templates/skills/application/references/provider-template.md +30 -6
  10. package/templates/skills/application/steps/step-03-roles.md +45 -7
  11. package/templates/skills/application/steps/step-03b-provider.md +13 -6
  12. package/templates/skills/business-analyse/SKILL.md +56 -4
  13. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +477 -0
  14. package/templates/skills/business-analyse/references/cache-warming-strategy.md +578 -0
  15. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +9 -19
  16. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +12 -2
  17. package/templates/skills/business-analyse/references/deploy-data-build.md +36 -25
  18. package/templates/skills/business-analyse/references/detection-strategies.md +424 -0
  19. package/templates/skills/business-analyse/references/html-data-mapping.md +4 -0
  20. package/templates/skills/business-analyse/references/prd-generation.md +258 -0
  21. package/templates/skills/business-analyse/references/robustness-checks.md +538 -0
  22. package/templates/skills/business-analyse/references/validate-incremental-html.md +47 -4
  23. package/templates/skills/business-analyse/references/validation-checklist.md +281 -0
  24. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +33 -1
  25. package/templates/skills/business-analyse/steps/step-00-init.md +70 -75
  26. package/templates/skills/business-analyse/steps/step-01-cadrage.md +8 -22
  27. package/templates/skills/business-analyse/steps/step-03a-data.md +20 -410
  28. package/templates/skills/business-analyse/steps/step-03a1-setup.md +356 -0
  29. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +143 -0
  30. package/templates/skills/business-analyse/steps/step-03b-ui.md +3 -0
  31. package/templates/skills/business-analyse/steps/step-03c-compile.md +72 -3
  32. package/templates/skills/business-analyse/steps/step-03d-validate.md +36 -3
  33. package/templates/skills/business-analyse/steps/step-04-consolidation.md +21 -440
  34. package/templates/skills/business-analyse/steps/step-04a-collect.md +304 -0
  35. package/templates/skills/business-analyse/steps/step-04b-analyze.md +239 -0
  36. package/templates/skills/business-analyse/steps/step-04c-decide.md +186 -0
  37. package/templates/skills/business-analyse/steps/step-05a-handoff.md +44 -0
  38. package/templates/skills/business-analyse/steps/step-05b-deploy.md +42 -2
  39. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +518 -0
  40. package/templates/skills/controller/steps/step-03-generate.md +184 -24
  41. package/templates/skills/controller/templates.md +11 -2
  42. package/templates/skills/debug/SKILL.md +156 -53
  43. package/templates/skills/debug/references/team-protocol.md +232 -0
  44. package/templates/skills/ralph-loop/references/category-rules.md +46 -0
  45. package/templates/skills/ralph-loop/references/compact-loop.md +32 -2
  46. package/templates/skills/ralph-loop/references/core-seed-data.md +233 -21
  47. package/templates/skills/ralph-loop/steps/step-00-init.md +64 -1
  48. package/templates/skills/ralph-loop/steps/step-04-check.md +27 -2
@@ -0,0 +1,281 @@
1
+ # Module Specification Checklist
2
+
3
+ > **CRITICAL:** This checklist MUST be FULLY COMPLETED before marking module status = "specified".
4
+ > **Rationale:** Prevents incomplete modules from reaching handoff, reduces ralph-loop failures.
5
+
6
+ ## Checklist Structure
7
+
8
+ **Execute BEFORE updating module status to "specified":**
9
+
10
+ ```javascript
11
+ const checklist = {
12
+ // SECTION 1: DATA MODEL (BLOCKING)
13
+ entities: {
14
+ minimum: 2,
15
+ actual: specification.entities.length,
16
+ status: actual >= minimum ? "PASS" : "FAIL",
17
+ blocking: true,
18
+ details: "At least 2 entities required for a meaningful module"
19
+ },
20
+
21
+ entityAttributes: {
22
+ check: "All entities have ≥3 attributes",
23
+ status: validateAllEntities(e => e.attributes.length >= 3) ? "PASS" : "FAIL",
24
+ blocking: true,
25
+ details: "Entities with <3 attributes are likely incomplete"
26
+ },
27
+
28
+ entityRelationships: {
29
+ check: "All entities have relationships defined (or explicitly marked as standalone)",
30
+ status: validateEntityRelationships() ? "PASS" : "FAIL",
31
+ blocking: false, // WARNING only
32
+ details: "Standalone entities should be rare in business modules"
33
+ },
34
+
35
+ // SECTION 2: BUSINESS RULES (BLOCKING)
36
+ businessRules: {
37
+ minimum: 4,
38
+ actual: analysis.businessRules.length,
39
+ status: actual >= minimum ? "PASS" : "FAIL",
40
+ blocking: true,
41
+ details: "Minimum 4 BRs (mix of VAL/CALC/WF/SEC/DATA)"
42
+ },
43
+
44
+ businessRuleCategories: {
45
+ check: "BRs cover ≥2 categories (VAL, CALC, WF, SEC, DATA)",
46
+ status: countUniqueCategories(analysis.businessRules) >= 2 ? "PASS" : "FAIL",
47
+ blocking: true,
48
+ details: "Single-category modules are likely incomplete"
49
+ },
50
+
51
+ businessRulePrefixes: {
52
+ check: "All BR IDs use module prefix (e.g., BR-VAL-{PREFIX}-NNN)",
53
+ status: validateBRPrefixes() ? "PASS" : "FAIL",
54
+ blocking: true,
55
+ details: "Missing prefixes cause ID collisions in multi-module apps"
56
+ },
57
+
58
+ // SECTION 3: USE CASES & REQUIREMENTS (BLOCKING)
59
+ useCases: {
60
+ minimum: 6,
61
+ actual: specification.useCases.length,
62
+ status: actual >= minimum ? "PASS" : "FAIL",
63
+ blocking: true,
64
+ details: "Minimum 6 UCs (CRUD + 2 business-specific)"
65
+ },
66
+
67
+ useCasePrefixes: {
68
+ check: "All UC IDs use module prefix (UC-{PREFIX}-NNN)",
69
+ status: validateUCPrefixes() ? "PASS" : "FAIL",
70
+ blocking: true,
71
+ details: "Missing prefixes cause ID collisions"
72
+ },
73
+
74
+ functionalRequirements: {
75
+ minimum: 4,
76
+ actual: specification.functionalRequirements.length,
77
+ status: actual >= minimum ? "PASS" : "FAIL",
78
+ blocking: true,
79
+ details: "FRs must cover key functionality"
80
+ },
81
+
82
+ ucFrLinkage: {
83
+ check: "Every UC has ≥1 linked FR",
84
+ status: validateUCtoFRLinkage() ? "PASS" : "FAIL",
85
+ blocking: true,
86
+ details: "Orphan UCs indicate incomplete requirements"
87
+ },
88
+
89
+ frBrLinkage: {
90
+ check: "Every FR has ≥1 linked BR",
91
+ status: validateFRtoBRLinkage() ? "PASS" : "FAIL",
92
+ blocking: false, // WARNING only
93
+ details: "FRs without BRs may lack validation/calculation logic"
94
+ },
95
+
96
+ // SECTION 4: PERMISSIONS (BLOCKING)
97
+ permissions: {
98
+ minimum: 5,
99
+ actual: specification.permissionMatrix.permissions.length,
100
+ status: actual >= minimum ? "PASS" : "FAIL",
101
+ blocking: true,
102
+ details: "Minimum 5 permissions (CRUD + 1 business action)"
103
+ },
104
+
105
+ permissionFormat: {
106
+ check: "All permissions use full format: business.{app}.{module}.{resource}.{action}",
107
+ status: validatePermissionFormat() ? "PASS" : "FAIL",
108
+ blocking: true,
109
+ details: "Wrong format breaks RBAC system"
110
+ },
111
+
112
+ rolePermissions: {
113
+ check: "All application roles have ≥1 permission assigned",
114
+ status: validateRoleAssignments() ? "PASS" : "FAIL",
115
+ blocking: true,
116
+ details: "Roles without permissions are useless"
117
+ },
118
+
119
+ // SECTION 5: UI & NAVIGATION (BLOCKING)
120
+ sections: {
121
+ minimum: 2,
122
+ actual: specification.sections.length,
123
+ status: actual >= minimum ? "PASS" : "FAIL",
124
+ blocking: true,
125
+ details: "Modules need ≥2 sections (list + form minimum)"
126
+ },
127
+
128
+ wireframes: {
129
+ minimum: specification.sections.length, // 1 wireframe PER section
130
+ actual: specification.uiWireframes.length,
131
+ status: actual >= minimum ? "PASS" : "FAIL",
132
+ blocking: true,
133
+ details: "EVERY section MUST have a wireframe (ASCII/SVG)"
134
+ },
135
+
136
+ navigation: {
137
+ check: "Module has ≥1 navigation entry",
138
+ status: specification.navigation.entries.length >= 1 ? "PASS" : "FAIL",
139
+ blocking: true,
140
+ details: "Module must be accessible in menu"
141
+ },
142
+
143
+ // SECTION 6: I18N & MESSAGES (BLOCKING)
144
+ i18nKeys: {
145
+ minimum: 42, // Realistic minimum for a module
146
+ actual: specification.i18nKeys.length,
147
+ status: actual >= minimum ? "PASS" : "FAIL",
148
+ blocking: true,
149
+ details: "Keys needed: entities (×2), fields, messages, validation, navigation"
150
+ },
151
+
152
+ i18nLanguages: {
153
+ check: "All i18n keys have 4 languages (fr, en, nl, de)",
154
+ status: validateI18nCompleteness() ? "PASS" : "FAIL",
155
+ blocking: true,
156
+ details: "Missing translations break multi-language support"
157
+ },
158
+
159
+ messages: {
160
+ minimum: 4,
161
+ actual: specification.messages.length,
162
+ status: actual >= minimum ? "PASS" : "FAIL",
163
+ blocking: true,
164
+ details: "Minimum: 1 success, 1 error, 1 warning, 1 info"
165
+ },
166
+
167
+ // SECTION 7: SEED DATA (BLOCKING)
168
+ seedDataCore: {
169
+ check: "All 7 CORE seed data sections present",
170
+ requiredSections: [
171
+ "navigationModules",
172
+ "navigationSections",
173
+ "navigationResources",
174
+ "navigationTranslations",
175
+ "permissions",
176
+ "rolePermissions",
177
+ "permissionConstants"
178
+ ],
179
+ status: validateSeedDataCore() ? "PASS" : "FAIL",
180
+ blocking: true,
181
+ details: "Missing CORE seed data breaks module deployment"
182
+ },
183
+
184
+ seedDataBusiness: {
185
+ check: "Business seed data template defined for modules with reference/lookup entities",
186
+ status: specification.seedDataBusiness !== undefined ? "PASS" : "FAIL",
187
+ blocking: true, // BLOCKING — missing seed data causes empty dropdowns and test failures
188
+ details: "Business seed data (reference types, categories, statuses) is required for testing and dev environment"
189
+ },
190
+
191
+ // SECTION 8: API ENDPOINTS (BLOCKING)
192
+ apiEndpoints: {
193
+ minimum: 5,
194
+ actual: specification.apiEndpoints.length,
195
+ status: actual >= minimum ? "PASS" : "FAIL",
196
+ blocking: true,
197
+ details: "Minimum 5 endpoints (CRUD + 1 business action)"
198
+ },
199
+
200
+ apiPermissions: {
201
+ check: "Every API endpoint has permission defined",
202
+ status: validateAPIPermissions() ? "PASS" : "FAIL",
203
+ blocking: true,
204
+ details: "Endpoints without permissions are security holes"
205
+ },
206
+
207
+ // SECTION 9: VALIDATIONS (BLOCKING)
208
+ validations: {
209
+ minimum: 1,
210
+ actual: specification.validations.length,
211
+ status: actual >= minimum ? "PASS" : "FAIL",
212
+ blocking: true,
213
+ details: "Modules need field validation rules"
214
+ },
215
+
216
+ // SECTION 10: GHERKIN SCENARIOS (WARNING)
217
+ gherkinScenarios: {
218
+ minimum: 2,
219
+ actual: specification.gherkinScenarios.scenarios.length,
220
+ status: actual >= minimum ? "PASS" : "FAIL",
221
+ blocking: false, // WARNING only
222
+ details: "Gherkin scenarios enable automated testing"
223
+ }
224
+ };
225
+ ```
226
+
227
+ ## Blocking Check Logic
228
+
229
+ ```javascript
230
+ // BLOCKING CHECK: Count failures in BLOCKING items
231
+ const blockingFailures = Object.entries(checklist)
232
+ .filter(([key, check]) => check.blocking === true && check.status === "FAIL")
233
+ .map(([key, check]) => ({ section: key, ...check }));
234
+
235
+ IF blockingFailures.length > 0:
236
+ **BLOCKING ERROR:** Module specification incomplete
237
+
238
+ Display table:
239
+ | Section | Required | Actual | Status | Details |
240
+ |---------|----------|--------|--------|---------|
241
+ {for each blocking failure}
242
+
243
+ ACTIONS REQUIRED:
244
+ 1. Fix ALL blocking failures listed above
245
+ 2. Re-run step-03d validation
246
+ 3. DO NOT mark module as "specified" until ALL blocking checks pass
247
+
248
+ STOP - DO NOT PROCEED TO UPDATE STATUS
249
+ ELSE:
250
+ All blocking checks passed ✓
251
+ {count} warnings (non-blocking)
252
+ Proceed to mark module as "specified"
253
+ ```
254
+
255
+ ## Display Format
256
+
257
+ ```
258
+ ═══════════════════════════════════════════════════════════════
259
+ MODULE SPECIFICATION CHECKLIST - {currentModule}
260
+ ═══════════════════════════════════════════════════════════════
261
+
262
+ | Category | Checks | Passed | Failed | Warnings |
263
+ |----------|--------|--------|--------|----------|
264
+ | Data Model | 3 | {n} | {n} | {n} |
265
+ | Business Rules | 3 | {n} | {n} | {n} |
266
+ | Use Cases & FRs | 4 | {n} | {n} | {n} |
267
+ | Permissions | 3 | {n} | {n} | {n} |
268
+ | UI & Navigation | 3 | {n} | {n} | {n} |
269
+ | I18N & Messages | 3 | {n} | {n} | {n} |
270
+ | Seed Data | 2 | {n} | {n} | {n} |
271
+ | API Endpoints | 2 | {n} | {n} | {n} |
272
+ | Validations | 1 | {n} | {n} | {n} |
273
+ | Gherkin | 1 | {n} | {n} | {n} |
274
+
275
+ TOTAL: {total_checks} checks | {passed} ✓ | {failed} ✗ | {warnings} ⚠
276
+
277
+ STATUS: {failed === 0 ? "READY FOR SPECIFIED" : "INCOMPLETE - FIX REQUIRED"}
278
+ ═══════════════════════════════════════════════════════════════
279
+ ```
280
+
281
+ **IF ALL BLOCKING CHECKS PASS → Proceed to update module status to "specified"**
@@ -382,7 +382,7 @@
382
382
  },
383
383
  "seedDataCore": {
384
384
  "type": "object",
385
- "description": "5 mandatory SmartStack core SeedData definitions",
385
+ "description": "7 mandatory SmartStack core SeedData definitions (modules, sections, resources, translations, permissions, rolePermissions, permissionConstants)",
386
386
  "properties": {
387
387
  "navigationModules": {
388
388
  "type": "array",
@@ -399,6 +399,38 @@
399
399
  }
400
400
  }
401
401
  },
402
+ "navigationSections": {
403
+ "type": "array",
404
+ "description": "Level 4 (Section) navigation entries for core.nav_Sections table. Derived from specification.sections[].",
405
+ "items": {
406
+ "type": "object",
407
+ "required": ["code", "label", "icon", "route", "parentCode", "permission"],
408
+ "properties": {
409
+ "code": { "type": "string", "description": "Section code (list, detail, create, dashboard)" },
410
+ "label": { "type": "string", "description": "Section label in default language (fr)" },
411
+ "icon": { "type": "string", "description": "Lucide icon name" },
412
+ "route": { "type": "string", "description": "Full route path" },
413
+ "parentCode": { "type": "string", "description": "Parent module code" },
414
+ "permission": { "type": "string", "description": "Required permission path" },
415
+ "sort": { "type": "integer", "description": "Display order within module" }
416
+ }
417
+ }
418
+ },
419
+ "navigationResources": {
420
+ "type": "array",
421
+ "description": "Level 5 (Resource) navigation entries for core.nav_Resources table. Derived from specification.sections[].resources[].",
422
+ "items": {
423
+ "type": "object",
424
+ "required": ["code", "type", "parentCode"],
425
+ "properties": {
426
+ "code": { "type": "string", "description": "Resource code (kebab-case)" },
427
+ "type": { "type": "string", "description": "SmartStack component type (SmartTable, SmartForm, DetailCard, KpiCard, Chart, etc.)" },
428
+ "entity": { "type": "string", "description": "Primary entity this resource operates on" },
429
+ "parentCode": { "type": "string", "description": "Parent section code" },
430
+ "permission": { "type": "string", "description": "Required permission path (optional if inherited from section)" }
431
+ }
432
+ }
433
+ },
402
434
  "navigationTranslations": {
403
435
  "type": "array",
404
436
  "items": {
@@ -69,94 +69,51 @@ 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 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
105
-
106
- Scan `docs/business/` for existing business analysis features.
72
+ ## Step 2-3: Workflow Detection (Review / New / Update)
107
73
 
108
- ```
109
- 1. Glob: docs/business/*/business-analyse/*/feature.json
110
- 2. For each feature.json found:
111
- - Read metadata.application, metadata.featureDescription
112
- - Store: { app: string, featureId: string, description: string, version: string }
113
- 3. Build list of existing applications
114
- ```
74
+ **Objective:** Detect workflow type and match against existing applications.
115
75
 
116
- **Store:**
117
- ```yaml
118
- existing_apps: array of { app, featureId, description, version }
119
- ```
76
+ **Process:**
120
77
 
121
- ## Step 3: Auto-Detect New vs Update (skipped in review mode)
78
+ Execute workflow detection algorithm:
79
+ 1. **Review Mode Detection:** Check if `{feature_description}` starts with `-review`
80
+ 2. **Existing Applications Scanner:** Glob `docs/business/*/business-analyse/*/feature.json`
81
+ 3. **Similarity Analysis:** Score user intent against existing apps (>= 80 = strong match)
82
+ 4. **Decision Tree:** Prompt user with relevant options
122
83
 
123
- Compare the user's `{feature_description}` with existing applications.
84
+ ```javascript
85
+ const detectionResult = detectWorkflowType(feature_description, existingApps);
124
86
 
125
- ```
126
- IF existing_apps is empty:
127
- workflow_type = "new"
128
- → Go to Step 4
87
+ IF detectionResult.error OR detectionResult.ambiguous:
88
+ // CONDITIONAL LOAD: Only load detection strategies on error or ambiguity
89
+ Read references/detection-strategies.md
90
+ Display:
91
+ - Detailed similarity scoring algorithm
92
+ - Decision tree with thresholds
93
+ - Error handling procedures
94
+ - Review mode troubleshooting (if review mode failed)
129
95
 
130
- IF existing_apps has entries:
131
- Analyze {feature_description} for similarity with existing apps:
132
- - Same application domain?
133
- - References an existing module name?
134
- - Mentions adding/changing/modifying something existing?
96
+ Resolve ambiguity with user clarification
135
97
 
136
- Ask via AskUserQuestion:
137
- question: "J'ai trouvé des analyses existantes. Que souhaitez-vous faire ?"
138
- header: "Mode"
139
- options:
140
- - label: "Nouvelle application"
141
- description: "Créer une nouvelle analyse complète"
142
- - label: "Mise à jour de {appName} (FEAT-NNN)"
143
- description: "Enrichir ou modifier l'application existante (crée v{next})"
144
- (repeat for each existing app, max 3 options + "Nouvelle application")
145
-
146
- IF user selects "Nouvelle application":
147
- workflow_type = "new"
148
- ELSE:
149
- workflow_type = "update"
150
- existing_feature_id = selected app's featureId
151
- Call ba-writer.createVersion(existing_feature_id, {feature_description})
152
- version = new version number
98
+ ELSE:
99
+ Workflow detected: {detectionResult.workflow_type}
100
+ Continue to application name determination
153
101
  ```
154
102
 
103
+ **Key decision points:**
104
+ 1. IF review mode → load ba-review.json, skip to step-06-review.md
105
+ 2. IF no existing apps → workflow_type = "new"
106
+ 3. IF existing apps → analyze similarity → prompt user
107
+
108
+ **Optimization:** The detailed 400-line detection-strategies.md is loaded **only when detection fails or is ambiguous** (saves ~15,000 tokens on clear detection path).
109
+
155
110
  **Store:**
156
111
  ```yaml
157
- workflow_type: "new" | "update"
112
+ workflow_type: "new" | "update" | "review"
158
113
  existing_feature_id: string | null
159
114
  version: "1.0" (new) | "1.1"+ (update)
115
+ review_json_path: string | null (review only)
116
+ existing_apps: array of { app, featureId, description, version }
160
117
  ```
161
118
 
162
119
  ## Step 4: Determine Application Name
@@ -277,6 +234,44 @@ docs_dir: "docs/business/{app}/business-analyse/v{version}"
277
234
 
278
235
  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`).
279
236
 
237
+ ## Step 8b: Cache Warming (PERFORMANCE OPTIMIZATION)
238
+
239
+ > **Objective:** Pre-load frequently-used templates and context files to reduce redundant reads.
240
+ > **Expected token savings:** 15-20% across entire BA session
241
+
242
+ **Implementation:**
243
+
244
+ ```javascript
245
+ // Pre-load CRITICAL (schemas) and HIGH (questionnaires) priority buckets
246
+ const schemaFiles = glob("docs/business/{app}/business-analyse/schemas/**/*.json");
247
+ for (const file of schemaFiles) {
248
+ read(file); // Triggers cache
249
+ }
250
+
251
+ const questionnaireFiles = glob("~/.claude/skills/business-analyse/questionnaire/*.md");
252
+ for (const file of questionnaireFiles) {
253
+ read(file); // Triggers cache
254
+ }
255
+
256
+ read("~/.claude/skills/business-analyse/patterns/suggestion-catalog.md");
257
+
258
+ // Display status
259
+ console.log(`
260
+ ✓ Cache warmed: 9 schemas + 16 questionnaires + 1 catalog
261
+ Expected savings: 15-20% session tokens
262
+ Retention: schemas (session-wide), questionnaires (until step-02)
263
+ `);
264
+ ```
265
+
266
+ **Bucket Strategy:**
267
+
268
+ See [references/cache-warming-strategy.md](../references/cache-warming-strategy.md) for complete documentation on:
269
+ - 5 cache buckets (schemas, questionnaires, moduleSpec, handoff, etc.)
270
+ - Retention policies and clearing rules
271
+ - Token savings calculations (baseline vs optimized)
272
+ - Monitoring cache efficiency
273
+ - When to pre-load vs lazy-load
274
+
280
275
  ## Step 9: Create Master feature.json
281
276
 
282
277
  Create the master feature document using ba-writer agent.
@@ -70,34 +70,20 @@ Launch 3 agents in parallel:
70
70
  Merge findings into {codebase_context}
71
71
  ```
72
72
 
73
- ### 3. MODE ROUTING
73
+ ### 3. VIBE CODING FLOW (always — 2 lots)
74
74
 
75
- ```
76
- Read metadata.vibeCoding from feature.json
77
-
78
- IF metadata.vibeCoding == true:
79
- → Execute VIBE CODING FLOW (section 3v below)
80
- → SKIP sections 3s through 8s (standard flow)
81
- → Go directly to section 9 (Coverage Matrix)
82
-
83
- ELSE:
84
- → Execute STANDARD FLOW (sections 3s through 8s below)
85
- ```
86
-
87
- ---
88
-
89
- ## VIBE CODING FLOW (accelerated — 3 lots max)
90
-
91
- > **In vibe coding mode, the developer IS the product owner, the user, and the builder.**
75
+ > **The developer IS the product owner, the user, and the builder.**
92
76
  > Skip organizational questions (adoption, change management, governance, KPIs).
93
77
  > Focus on functional decisions and technical challenges.
78
+ > **Always optimize for high traffic and production-grade performance.**
94
79
 
95
- See [references/cadrage-vibe-coding.md](../references/cadrage-vibe-coding.md) for the complete 3-lot questionnaire:
80
+ See [references/cadrage-vibe-coding.md](../references/cadrage-vibe-coding.md) for the 2-lot questionnaire:
96
81
  - **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
82
+ - **Lot 2 (4v):** Technical Challengesrisks specific to AI-assisted dev + auto-inferred cadrage data
83
+
84
+ **Users & Permissions:** Always auto-set to Organisation (500+ users) with standard 4-tier roles (Admin, Manager, Contributor, Viewer) and 3 stakeholders. No question needed. Pagination, caching, indexed queries, and async operations are mandatory defaults — not optimizations to discuss.
99
85
 
100
- **After Lot 3:** Go directly to **section 9 (Coverage Matrix)**.
86
+ **After Lot 2:** Go directly to **section 9 (Coverage Matrix)**.
101
87
 
102
88
  ---
103
89