@atlashub/smartstack-cli 3.10.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 (35) 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/db-reader.md +149 -0
  7. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +9 -19
  8. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +12 -2
  9. package/templates/skills/business-analyse/references/deploy-data-build.md +36 -25
  10. package/templates/skills/business-analyse/references/detection-strategies.md +424 -0
  11. package/templates/skills/business-analyse/references/html-data-mapping.md +4 -0
  12. package/templates/skills/business-analyse/references/prd-generation.md +258 -0
  13. package/templates/skills/business-analyse/references/validate-incremental-html.md +47 -4
  14. package/templates/skills/business-analyse/references/validation-checklist.md +281 -0
  15. package/templates/skills/business-analyse/steps/step-00-init.md +50 -221
  16. package/templates/skills/business-analyse/steps/step-01-cadrage.md +8 -22
  17. package/templates/skills/business-analyse/steps/step-03a-data.md +20 -446
  18. package/templates/skills/business-analyse/steps/step-03a1-setup.md +356 -0
  19. package/templates/skills/business-analyse/steps/step-03a2-analysis.md +143 -0
  20. package/templates/skills/business-analyse/steps/step-03b-ui.md +3 -0
  21. package/templates/skills/business-analyse/steps/step-03c-compile.md +1 -1
  22. package/templates/skills/business-analyse/steps/step-03d-validate.md +21 -262
  23. package/templates/skills/business-analyse/steps/step-04-consolidation.md +21 -606
  24. package/templates/skills/business-analyse/steps/step-04a-collect.md +304 -0
  25. package/templates/skills/business-analyse/steps/step-04b-analyze.md +239 -0
  26. package/templates/skills/business-analyse/steps/step-04c-decide.md +186 -0
  27. package/templates/skills/business-analyse/steps/step-05b-deploy.md +21 -0
  28. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +27 -35
  29. package/templates/skills/debug/SKILL.md +156 -53
  30. package/templates/skills/debug/references/team-protocol.md +232 -0
  31. package/templates/skills/ralph-loop/references/category-rules.md +46 -0
  32. package/templates/skills/ralph-loop/references/compact-loop.md +32 -2
  33. package/templates/skills/ralph-loop/references/core-seed-data.md +60 -0
  34. package/templates/skills/ralph-loop/steps/step-00-init.md +64 -1
  35. package/templates/skills/ralph-loop/steps/step-04-check.md +27 -2
@@ -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
 
@@ -1,468 +1,42 @@
1
1
  ---
2
2
  name: step-03a-data
3
- description: Per-module specification - sections, entities, business rules, questionnaires (data & logic phase)
3
+ description: Per-module data specification - REDIRECTS to step-03a1 (refactored into 2 sub-steps)
4
4
  model: opus
5
- next_step: steps/step-03b-ui.md
5
+ next_step: steps/step-03a1-setup.md
6
6
  ---
7
7
 
8
- > **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_module-loop.md`
8
+ > **NOTICE:** This step has been refactored into 2 sub-steps for better context management.
9
9
 
10
- # Step 3a: Specification - Data & Logic
10
+ # Step 3a: Specification - Data & Logic (Entry Point)
11
11
 
12
- ## MANDATORY EXECUTION RULES
12
+ This step has been divided into 2 focused sub-steps:
13
13
 
14
- - ALWAYS use ULTRATHINK mode
15
- - This step is EXECUTED ONCE PER MODULE in topological dependency order
16
- - ALWAYS check workflow state to determine current module
17
- - ALWAYS reference completed modules when specifying current one
18
- - **MANDATORY:** Generate and validate an ASCII/SVG mockup for EVERY section (not optional)
19
- - ALL questions via AskUserQuestion tool
20
- - ALL communication in `{language}`
21
- - NEVER skip per-module validation
22
- - **ID NAMING RULE (MANDATORY, NO EXCEPTION):**
23
- All IDs MUST include a module prefix to guarantee application-wide uniqueness.
24
- The prefix is derived from the module code initials (2-4 chars):
25
- UserManagement → UM | VehicleManagement → VM | PartsInventory → PI
26
- RepairManagement → RM | MaintenanceSchedule → MS | DataSync → DS
27
- Notifications → NT | Dashboard → DB | Orders → OR | Customers → CU
28
-
29
- Patterns:
30
- UC-{PREFIX}-{NNN} → UC-RM-001, UC-PI-003
31
- BR-{CAT}-{PREFIX}-{NNN} → BR-VAL-RM-001, BR-CALC-PI-002
32
- FR-{PREFIX}-{NNN} → FR-RM-001
33
- OBJ-{PREFIX}-{NNN} → OBJ-RM-001
34
- AC-{PREFIX}-{NNN} → AC-RM-001
35
- RISK-{PREFIX}-{NNN} → RISK-RM-001
36
-
37
- NEVER use bare IDs (UC-001, BR-VAL-001) in multi-module mode.
38
- - **SCHEMA CONFORMITY RULE:**
39
- ALL data MUST fit within the defined feature-schema.json structure.
40
- NEVER create custom top-level fields (KPIDefinitions, ChartConfigurations, etc.)
41
- Dashboard modules MUST use specification.dashboards[] (it exists in the schema).
42
- If truly needed, use specification.extensions: {} (additionalProperties: true).
43
-
44
- ## YOUR TASK
45
-
46
- Specify one module's data model and business logic: walk through sections, define entities, business rules, and validate with client before proceeding to UI specification.
14
+ 1. **step-03a1-setup.md** - Module setup, sections walkthrough, questionnaires, cross-refs
15
+ 2. **step-03a2-analysis.md** - Analysis section: objectives, entities, business rules, process flow
47
16
 
48
17
  ---
49
18
 
50
- ## EXECUTION SEQUENCE
51
-
52
- ### 1. Determine Current Module
53
-
54
- ```
55
- ba-reader.readApplicationContext({feature_id})
56
- → Read metadata.workflow: moduleOrder, currentModuleIndex, completedModules
57
- → currentModule = moduleOrder[currentModuleIndex]
58
- → Display: "═══ Module {currentModuleIndex + 1}/{moduleOrder.length}: {currentModule} ═══"
59
- ```
60
-
61
- IF module already specified (status = "specified" in master):
62
- Increment currentModuleIndex, re-check
63
- IF all modules specified → Load step-04-consolidation.md, STOP
64
-
65
- ### 1b. Cache Warming for Module Loop (FIRST MODULE ONLY)
66
-
67
- > **Performance Optimization:** Pre-load module specification references to reduce redundant reads across all modules.
68
- > This step runs ONLY for the FIRST module (currentModuleIndex = 0), not repeated for subsequent modules.
69
-
70
- ```
71
- IF currentModuleIndex === 0:
72
- // Pre-load module specification references (Bucket 3)
73
- const moduleRefs = [
74
- "~/.claude/skills/business-analyse/references/spec-auto-inference.md",
75
- "~/.claude/skills/business-analyse/references/ui-resource-cards.md",
76
- "~/.claude/skills/business-analyse/references/ui-dashboard-spec.md",
77
- "~/.claude/skills/business-analyse/references/cadrage-vibe-coding.md"
78
- ];
79
-
80
- for (const file of moduleRefs) {
81
- read(file); // Pre-load into cache
82
- }
83
-
84
- Display: "✓ Cache warmed: module specification references (23KB, 4 files)"
85
- Display: " Expected token savings: 75% reduction in reference reads across module loop"
86
- Display: " Retention: until step-04 (after all modules specified)"
87
- ELSE:
88
- // Subsequent modules use cached references (no re-load)
89
- Display: "✓ Using cached module references (from first module)"
90
- ```
91
-
92
- **Rationale:**
93
-
94
- - Module specification references are read 2-3× PER MODULE (5 modules = 10-15 reads without caching)
95
- - Pre-loading once at start of module loop eliminates 75% of redundant reads
96
- - Token savings: ~10,000 tokens for a 5-module application
97
- - Cache retained until step-04 (when consolidation starts, references no longer needed)
98
-
99
- See [references/cache-warming-strategy.md](../references/cache-warming-strategy.md) § Bucket 3 for details.
100
-
101
- ### 2. Initialize Module Feature.json
102
-
103
- ```
104
- // Create or load module-level feature.json
105
- ba-writer.create({
106
- scope: "module",
107
- applicationRef: {feature_id},
108
- moduleCode: {currentModule.code},
109
- path: "docs/business/{app}/{module_code}/business-analyse/v1.0/feature.json"
110
- })
111
-
112
- // Inherit application roles from master
113
- ba-reader.readApplicationContext({feature_id})
114
- → Copy cadrage.applicationRoles → module.applicationContext.applicationRoles
115
- ```
116
-
117
- // Update module status in master: "pending" → "in-progress"
118
- ba-writer.updateModuleStatus({feature_id}, {currentModule.code}, "in-progress")
119
-
120
- ### 2-ter. Derive Module Discovery Section (MANDATORY)
121
-
122
- > **The module feature.json MUST have a `discovery` section.** In multi-module mode, derive it from the parent application's `cadrage`. In single-module mode, it should already exist from step-01.
123
-
124
- ```
125
- ba-reader.readApplicationContext({feature_id})
126
- → Read cadrage: problem, asIs, toBe, trigger, stakeholders, risks, acceptanceCriteria
127
-
128
- // Filter to this module's scope
129
- moduleScope = cadrage.coverageMatrix.filter(cm => cm.module === currentModule.code)
130
- moduleStakeholders = cadrage.stakeholders.filter(s => s.tasks relevant to this module)
131
- moduleRisks = cadrage.risks.filter(r => r related to this module)
132
-
133
- ba-writer.enrichSection({
134
- featureId: {module_feature_id},
135
- section: "discovery",
136
- data: {
137
- problem: cadrage.problem,
138
- asIs: cadrage.asIs,
139
- toBe: cadrage.toBe,
140
- trigger: cadrage.trigger,
141
- stakeholders: moduleStakeholders,
142
- scope: {
143
- mustHave: moduleScope.filter(s => s.category === "mustHave").map(s => s.item),
144
- shouldHave: moduleScope.filter(s => s.category === "shouldHave").map(s => s.item),
145
- couldHave: moduleScope.filter(s => s.category === "couldHave").map(s => s.item),
146
- outOfScope: []
147
- },
148
- risks: moduleRisks,
149
- acceptanceCriteria: cadrage.acceptanceCriteria.filter(ac => relevant to module),
150
- codebaseContext: cadrage.codebaseContext
151
- }
152
- })
153
- ```
154
-
155
- > **STRUCTURE CARD: discovery** — Same format as cadrage but module-scoped.
156
- > Fields: `problem`, `asIs`, `toBe`, `trigger`, `stakeholders[]`, `scope{}`, `risks[]`, `acceptanceCriteria[]`, `codebaseContext`, `openQuestions[]`
157
-
158
- ### 2-bis. Coverage Verification (MANDATORY)
159
-
160
- > **Before specifying any module, verify that the coverageMatrix from cadrage covers this module.**
161
-
162
- ```
163
- ba-reader.readApplicationContext({feature_id})
164
- → Read cadrage.coverageMatrix[]
165
- → Filter entries where module = {currentModule.code}
166
- → Group by category: mustHave, shouldHave, couldHave
167
- ```
168
-
169
- Display to client:
170
- ```
171
- Module {currentModule}: Coverage from original brief
172
-
173
- | # | Requirement | Category |
174
- |---|-------------|----------|
175
- | 1 | {item} | {category} |
176
- | ... | ... | ... |
177
-
178
- Total: {N} requirements mapped to this module
179
- - Must-have: {count}
180
- - Should-have: {count}
181
- - Could-have: {count}
182
- ```
183
-
184
- **VALIDATION:** If mustHave count = 0 AND module is in must priority:
185
- → WARNING: "Module {currentModule} is must-priority but has no must-have requirements in coverageMatrix. Verify cadrage coverage."
186
-
187
- **POST-SPECIFICATION CHECK (at end of module, before advancing):**
188
- For EACH mustHave item in coverageMatrix for this module:
189
- → Verify at least 1 UC exists that covers this requirement
190
- → If uncovered: BLOCK and ask client to either add a UC or reclassify the requirement
191
-
192
- ### 3. Section Walkthrough with Client
193
-
194
- > **This is the key interactive phase aligned with the 5-level SmartStack hierarchy.**
195
- > Level 3 = Module, Level 4 = Section, Level 5 = Resource
196
-
197
- #### 3a. Identify Module Sections
198
-
199
- For each module, propose standard sections based on module type:
200
-
201
- | Module Type | Typical Sections |
202
- |-------------|-----------------|
203
- | data-centric | list, detail, create, edit |
204
- | workflow | list, detail, create, edit, approve, history |
205
- | integration | list, detail, config, sync, logs |
206
- | reporting | dashboard, detail, export, schedule |
207
- | full-module | list, detail, create, edit, approve, history, reports, settings |
208
-
209
- Ask via AskUserQuestion:
210
-
211
- ```
212
- question: "Quelles sections le module {currentModule} doit-il avoir ?"
213
- header: "Sections"
214
- multiSelect: true
215
- options:
216
- - label: "Liste"
217
- description: "Page de liste avec filtres, tri et pagination"
218
- - label: "Détail"
219
- description: "Page de détail d'un enregistrement"
220
- - label: "Création/Édition"
221
- description: "Formulaire de création et de modification"
222
- - label: "Validation/Approbation"
223
- description: "Workflow de validation avec changement de statut"
224
- - label: "Dashboard"
225
- description: "Tableau de bord avec KPIs, graphiques (Recharts) et métriques clés"
226
- ```
227
-
228
- #### 3a-depth. Determine Specification Depth
229
-
230
- > **Based on module complexity and type, determine how deeply to specify sections and resources.**
231
- > **This avoids over-specifying simple modules and under-specifying complex ones.**
19
+ ## Automatic Redirect
232
20
 
233
- Read from application master:
234
- ```
235
- ba-reader.readApplicationContext({feature_id})
236
- → module = modules.find(m => m.code === currentModule)
237
- → complexity = module.estimatedComplexity // simple | medium | complex
238
- → featureType = module.featureType // data-centric | workflow | integration | reporting | full-module
239
- ```
21
+ **Loading:** `./step-03a1-setup.md`
240
22
 
241
- **Depth decision matrix:**
242
-
243
- | Complexity | featureType | Depth | Behavior |
244
- |---|---|---|---|
245
- | simple | data-centric | **convention** | Auto-generate sections + resources from entities. Quick client validation. |
246
- | simple | reporting | **convention** | Standard dashboard template. Quick validation. |
247
- | simple | * | **convention** | Standard sections for featureType. Quick validation. |
248
- | medium | data-centric | **override** | Auto-generate then ask client which sections to customize. |
249
- | medium | workflow | **full** | State machine required → always full. |
250
- | medium | * | **override** | Auto-generate then ask client to customize. |
251
- | complex | * | **full** | Full specification: state machine, typed columns, conditional actions. |
252
- | * | workflow | **full** | Always full for workflow modules (state machine is mandatory). |
253
-
254
- Display to client:
255
- ```
256
- "Module {currentModule}: complexité {complexity}, type {featureType} → profondeur: {depth}"
257
- ```
258
-
259
- **IF depth = convention:**
260
- - Execute 3a-infer (auto-inference) → generates sections + resources
261
- - Execute 3b (wireframes) for each section
262
- - Skip 3a-bis detailed walkthrough → present auto-generated spec for quick validation
263
- - Ask client: "La spécification auto-générée convient-elle, ou souhaitez-vous personnaliser certaines sections ?"
264
- - If client says OK → proceed to step 4 (questionnaires)
265
- - If client wants changes → switch to **override** for specified sections
266
-
267
- **IF depth = override:**
268
- - Execute 3a-infer (auto-inference) → generates base sections + resources
269
- - Ask client: "Quelles sections souhaitez-vous personnaliser ?"
270
- - For selected sections → execute full 3a-bis + 3b + 3b-ter
271
- - For other sections → keep auto-generated spec
272
-
273
- **IF depth = full:**
274
- - Execute standard flow: 3a-bis → 3b → 3b-bis → 3b-ter → 3c → 3d (as currently defined below)
275
- - PLUS: 3a-state (state machine definition) for entities with status fields
276
-
277
- #### 3a-infer. Auto-Infer Resources from Entities (Convention/Override)
278
-
279
- > **For convention and override depths, auto-generate resource details from entity definitions.**
280
- > **The goal: produce a complete spec without manual input, that the client only validates.**
281
-
282
- **Prerequisites:** Entity attributes must be defined (from step 6) OR anticipated from decomposition.
283
-
284
- See [references/spec-auto-inference.md](../references/spec-auto-inference.md) for complete inference rules:
285
- - Entity attribute → SmartTable column mapping (9 type rules)
286
- - Entity attribute → SmartForm field mapping (8 type rules)
287
- - Auto-generated sections per featureType (5 types)
288
- - Section generation rules (list, create, detail, edit, dashboard)
289
- - Status/lifecycle enhancement rules
290
-
291
- Write auto-generated sections to `specification.sections[]` via ba-writer.enrichSection()
292
-
293
- ### 4. Conditional Questionnaires
294
-
295
- Based on module type, load questionnaires per-module:
296
-
297
- | Condition | Category | Questionnaire |
298
- |-----------|----------|---------------|
299
- | Always | 04 | `questionnaire/04-data.md` |
300
- | Has UI sections | 07 | `questionnaire/07-ui.md` |
301
- | Has lifecycle | 11 | `questionnaire/11-data-lifecycle.md` |
302
- | Has migration needs | 12 | `questionnaire/12-migration.md` |
303
- | References other modules | 13 | `questionnaire/13-cross-module.md` |
304
- | Documentation needed | 10 | `questionnaire/10-documentation.md` |
305
-
306
- Ask via AskUserQuestion, 1-2 batches per category.
307
-
308
- #### Store Documentation Requirements
309
-
310
- If questionnaire 10 was loaded, persist answers in feature.json:
311
-
312
- ```
313
- ba-writer.enrichSection({
314
- featureId: {feature_id},
315
- section: "documentation",
316
- data: {
317
- userDocRequired: {Q10.1 answer == "Yes"},
318
- techDocRequired: {Q10.2 answer == "Yes"},
319
- status: "pending"
320
- }
321
- })
322
- ```
323
-
324
- This data will be consumed by `/application` step-08 to auto-generate in-app documentation.
325
-
326
- ### 5. Cross-Module References
327
-
328
- > Reference completed modules to help define current one.
329
-
330
- ```
331
- completedModules = ba-reader.getCompletedModulesSummary({feature_id})
332
- → Returns max 100 lines summary: entity names, key BRs, permissions
333
-
334
- Display: "Modules déjà spécifiés : {completedModules.map(m => m.code).join(', ')}"
335
- ```
336
-
337
- For each completed module's entities, ask:
338
-
339
- ```
340
- question: "Le module {currentModule} référence-t-il des entités de {completedModule} ?"
341
- header: "Références"
342
- multiSelect: true
343
- options:
344
- - label: "{Entity1} (FK)"
345
- description: "Référence directe via clé étrangère"
346
- - label: "{Entity2} (Lookup)"
347
- description: "Table de référence / lookup"
348
- - label: "Aucune"
349
- description: "Pas de référence à {completedModule}"
350
- ```
351
-
352
- ### 6. Analysis Section
353
-
354
- #### 6a. Objectives
355
-
356
- Define measurable business objectives for this module:
357
-
358
- > **STRUCTURE CARD: analysis.objectives[]**
359
- > ```json
360
- > { "id": "OBJ-{PREFIX}-001", "objective": "Reduce order processing time", "metric": "Average time to fulfillment", "target": "< 4 hours" }
361
- > ```
362
-
363
- #### 6b. Entity Definition
364
-
365
- Define entities for this module (business attributes, not technical):
366
-
367
- > **STRUCTURE CARD: analysis.entities[]** — Field names are EXACT. Do NOT deviate.
368
- > ```json
369
- > {
370
- > "name": "PascalCase",
371
- > "description": "1-2 sentences describing the entity purpose",
372
- > "attributes": [
373
- > {
374
- > "name": "attributeName",
375
- > "description": "What this attribute represents",
376
- > "required": true,
377
- > "unique": false,
378
- > "validation": "Format: XXX-NNNNN, max 100 chars, etc."
379
- > }
380
- > ],
381
- > "relationships": [
382
- > { "target": "OtherEntity", "type": "1:1|1:N|N:1|N:M", "description": "description" }
383
- > ]
384
- > }
385
- > ```
386
- > **FORBIDDEN fields in attributes:** Do NOT use `type`, `values`, `rules`.
387
- > Use `description` to explain what the attribute is, `validation` for format/constraint rules, `unique` as boolean.
388
-
389
- #### 6c. Process Flow
390
-
391
- Define the main business process flow for this module (not lifecycle — that's in 8j):
392
-
393
- > **STRUCTURE CARD: analysis.processFlow**
394
- > ```json
395
- > {
396
- > "entryPoints": ["User navigates to module", "System event triggers action"],
397
- > "mainFlow": [
398
- > { "step": 1, "actor": "Manager", "action": "Opens the list", "system": "Displays filtered records" },
399
- > { "step": 2, "actor": "Manager", "action": "Creates a record", "system": "Validates BR-VAL-{PREFIX}-001" },
400
- > { "step": 3, "actor": "System", "action": "Saves record", "system": "Sends notification" }
401
- > ],
402
- > "decisionPoints": [
403
- > { "condition": "Is amount > threshold?", "ifTrue": "Route to approver", "ifFalse": "Auto-approve", "rule": "BR-WF-{PREFIX}-001" }
404
- > ],
405
- > "alternativeFlows": ["Bulk import via CSV", "Automatic sync from SFTP"]
406
- > }
407
- > ```
408
- > **FORBIDDEN:** Do NOT put lifecycle/state machine data here. Use `specification.lifeCycles[]` for that.
409
-
410
- #### 6d. Data Lifecycle
411
-
412
- Define data retention and lifecycle policies:
413
-
414
- > **STRUCTURE CARD: analysis.dataLifecycle**
415
- > ```json
416
- > {
417
- > "retentionPeriod": "7 years",
418
- > "archiveStrategy": "Move to cold storage after 2 years",
419
- > "gdprCompliance": "PII anonymized on request, data export available",
420
- > "states": [
421
- > { "name": "active", "transitions": ["archived", "deleted"] },
422
- > { "name": "archived", "transitions": ["active"] },
423
- > { "name": "deleted", "transitions": [] }
424
- > ]
425
- > }
426
- > ```
427
-
428
- ### 7. Business Rules Extraction
429
-
430
- Extract business rules specific to this module:
431
-
432
- > **STRUCTURE CARD: analysis.businessRules[]** — Field names are EXACT. Do NOT deviate.
433
- > ```json
434
- > {
435
- > "id": "BR-VAL-{PREFIX}-001",
436
- > "name": "Short rule name",
437
- > "category": "validation|calculation|workflow|security|data",
438
- > "statement": "IF {condition} THEN {consequence} ELSE {alternative}",
439
- > "priority": "must|should|could",
440
- > "conditions": ["Condition 1", "Condition 2"],
441
- > "examples": [{ "input": "Order total $5000, budget $2000", "expected": "Order rejected" }],
442
- > "testability": "Via unit test with mock data / integration test"
443
- > }
444
- > ```
445
- > **MANDATORY fields:** `id`, `name`, `category`, `statement`, `priority`
446
- > **FORBIDDEN fields:** Do NOT use `rule`, `condition` (singular), `action`. Use `name` + `statement` (IF/THEN/ELSE format) + `conditions` (array).
447
- > **ID PATTERN:** `BR-{CAT}-{PREFIX}-{NNN}` where CAT = VAL|CALC|WF|SEC|DATA, PREFIX = module initials (2-4 chars)
448
- > **category values:** lowercase only: `validation`, `calculation`, `workflow`, `security`, `data`
23
+ The data specification process will execute in sequence:
24
+ - step-03a1-setup → step-03a2-analysis → step-03b-ui
449
25
 
450
26
  ---
451
27
 
452
- ## SELF-VERIFICATION (MANDATORY before loading step-03b-ui)
28
+ ## Why Refactored?
453
29
 
454
- Before proceeding to step-03b-ui.md, VERIFY:
30
+ **Before:** 468 lines in single file (exceeded 400-line recommendation)
455
31
 
456
- 1. **Module feature.json exists** at expected path (`docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`)
457
- 2. **Module feature.json has analysis section** with `entities[]` (at least 1) and `businessRules[]` (at least 1)
458
- 3. **Module status in master** = "in-progress" (set by section 2 above)
459
- 4. **Master modules[].featureJsonPath** for this module ≠ null (set by ba-writer.create)
460
- 5. **Sections identified** with clear roles and entities assigned
32
+ **After:** 2 focused files (~320 + ~150 lines)
461
33
 
462
- **IF any check fails → FIX before proceeding.** Do NOT load step-03b-ui with incomplete data.
34
+ **Benefits:**
35
+ - Better context management
36
+ - Clearer separation: setup vs analysis
37
+ - Module preparation separated from entity/logic definition
38
+ - Reduced cognitive load per step
463
39
 
464
40
  ---
465
41
 
466
- ## NEXT STEP
467
-
468
- Load: `steps/step-03b-ui.md`
42
+ **Proceeding to step-03a1-setup.md...**