@atlashub/smartstack-cli 3.10.0 → 3.13.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.
- package/dist/index.js +2544 -2461
- package/dist/index.js.map +1 -1
- package/dist/mcp-entry.mjs +479 -6185
- package/dist/mcp-entry.mjs.map +1 -1
- package/package.json +2 -2
- package/templates/agents/db-reader.md +149 -0
- package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +9 -19
- package/templates/skills/business-analyse/references/consolidation-structural-checks.md +12 -2
- package/templates/skills/business-analyse/references/deploy-data-build.md +36 -25
- package/templates/skills/business-analyse/references/detection-strategies.md +424 -0
- package/templates/skills/business-analyse/references/html-data-mapping.md +4 -0
- package/templates/skills/business-analyse/references/prd-generation.md +258 -0
- package/templates/skills/business-analyse/references/validate-incremental-html.md +47 -4
- package/templates/skills/business-analyse/references/validation-checklist.md +281 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +50 -221
- package/templates/skills/business-analyse/steps/step-01-cadrage.md +8 -22
- package/templates/skills/business-analyse/steps/step-03a-data.md +20 -446
- package/templates/skills/business-analyse/steps/step-03a1-setup.md +356 -0
- package/templates/skills/business-analyse/steps/step-03a2-analysis.md +143 -0
- package/templates/skills/business-analyse/steps/step-03b-ui.md +3 -0
- package/templates/skills/business-analyse/steps/step-03c-compile.md +1 -1
- package/templates/skills/business-analyse/steps/step-03d-validate.md +21 -262
- package/templates/skills/business-analyse/steps/step-04-consolidation.md +21 -606
- package/templates/skills/business-analyse/steps/step-04a-collect.md +304 -0
- package/templates/skills/business-analyse/steps/step-04b-analyze.md +239 -0
- package/templates/skills/business-analyse/steps/step-04c-decide.md +186 -0
- package/templates/skills/business-analyse/steps/step-05b-deploy.md +21 -0
- package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +27 -35
- package/templates/skills/debug/SKILL.md +156 -53
- package/templates/skills/debug/references/team-protocol.md +232 -0
- package/templates/skills/ralph-loop/references/category-rules.md +46 -0
- package/templates/skills/ralph-loop/references/compact-loop.md +32 -2
- package/templates/skills/ralph-loop/references/core-seed-data.md +60 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +64 -1
- package/templates/skills/ralph-loop/steps/step-04-check.md +27 -2
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-03a1-setup
|
|
3
|
+
description: Module setup, sections walkthrough, questionnaires, and cross-module references
|
|
4
|
+
model: opus
|
|
5
|
+
next_step: steps/step-03a2-analysis.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
> **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_module-loop.md`
|
|
9
|
+
|
|
10
|
+
# Step 3a1: Setup - Module Initialization
|
|
11
|
+
|
|
12
|
+
## MANDATORY EXECUTION RULES
|
|
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.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
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.**
|
|
232
|
+
|
|
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
|
+
```
|
|
240
|
+
|
|
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
|
+
---
|
|
353
|
+
|
|
354
|
+
## NEXT STEP
|
|
355
|
+
|
|
356
|
+
Load: `./step-03a2-analysis.md`
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: step-03a2-analysis
|
|
3
|
+
description: Analysis section - objectives, entities, business rules, process flow
|
|
4
|
+
model: opus
|
|
5
|
+
next_step: steps/step-03b-ui.md
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
> **Context files:** `_shared.md` | `_elicitation.md` | `_architecture.md` | `_module-loop.md`
|
|
9
|
+
|
|
10
|
+
# Step 3a2: Analysis - Entities & Business Logic
|
|
11
|
+
|
|
12
|
+
## MANDATORY EXECUTION RULES
|
|
13
|
+
|
|
14
|
+
- ALWAYS use ULTRATHINK mode
|
|
15
|
+
- This step follows step-03a1-setup.md (module already initialized)
|
|
16
|
+
- **ID NAMING RULE:** All IDs MUST include module prefix (BR-{CAT}-{PREFIX}-{NNN}, OBJ-{PREFIX}-{NNN}, etc.)
|
|
17
|
+
- **SCHEMA CONFORMITY RULE:** ALL data MUST fit within feature-schema.json structure
|
|
18
|
+
|
|
19
|
+
## YOUR TASK
|
|
20
|
+
|
|
21
|
+
Define the module's analysis section: objectives, entities (with attributes and relationships), business rules, process flow, and data lifecycle.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## EXECUTION SEQUENCE
|
|
26
|
+
|
|
27
|
+
### 6. Analysis Section
|
|
28
|
+
|
|
29
|
+
#### 6a. Objectives
|
|
30
|
+
|
|
31
|
+
Define measurable business objectives for this module:
|
|
32
|
+
|
|
33
|
+
> **STRUCTURE CARD: analysis.objectives[]**
|
|
34
|
+
> ```json
|
|
35
|
+
> { "id": "OBJ-{PREFIX}-001", "objective": "Reduce order processing time", "metric": "Average time to fulfillment", "target": "< 4 hours" }
|
|
36
|
+
> ```
|
|
37
|
+
|
|
38
|
+
#### 6b. Entity Definition
|
|
39
|
+
|
|
40
|
+
Define entities for this module (business attributes, not technical):
|
|
41
|
+
|
|
42
|
+
> **STRUCTURE CARD: analysis.entities[]** — Field names are EXACT. Do NOT deviate.
|
|
43
|
+
> ```json
|
|
44
|
+
> {
|
|
45
|
+
> "name": "PascalCase",
|
|
46
|
+
> "description": "1-2 sentences describing the entity purpose",
|
|
47
|
+
> "attributes": [
|
|
48
|
+
> {
|
|
49
|
+
> "name": "attributeName",
|
|
50
|
+
> "description": "What this attribute represents",
|
|
51
|
+
> "required": true,
|
|
52
|
+
> "unique": false,
|
|
53
|
+
> "validation": "Format: XXX-NNNNN, max 100 chars, etc."
|
|
54
|
+
> }
|
|
55
|
+
> ],
|
|
56
|
+
> "relationships": [
|
|
57
|
+
> { "target": "OtherEntity", "type": "1:1|1:N|N:1|N:M", "description": "description" }
|
|
58
|
+
> ]
|
|
59
|
+
> }
|
|
60
|
+
> ```
|
|
61
|
+
> **FORBIDDEN fields in attributes:** Do NOT use `type`, `values`, `rules`.
|
|
62
|
+
> Use `description` to explain what the attribute is, `validation` for format/constraint rules, `unique` as boolean.
|
|
63
|
+
|
|
64
|
+
#### 6c. Process Flow
|
|
65
|
+
|
|
66
|
+
Define the main business process flow for this module (not lifecycle — that's in 8j):
|
|
67
|
+
|
|
68
|
+
> **STRUCTURE CARD: analysis.processFlow**
|
|
69
|
+
> ```json
|
|
70
|
+
> {
|
|
71
|
+
> "entryPoints": ["User navigates to module", "System event triggers action"],
|
|
72
|
+
> "mainFlow": [
|
|
73
|
+
> { "step": 1, "actor": "Manager", "action": "Opens the list", "system": "Displays filtered records" },
|
|
74
|
+
> { "step": 2, "actor": "Manager", "action": "Creates a record", "system": "Validates BR-VAL-{PREFIX}-001" },
|
|
75
|
+
> { "step": 3, "actor": "System", "action": "Saves record", "system": "Sends notification" }
|
|
76
|
+
> ],
|
|
77
|
+
> "decisionPoints": [
|
|
78
|
+
> { "condition": "Is amount > threshold?", "ifTrue": "Route to approver", "ifFalse": "Auto-approve", "rule": "BR-WF-{PREFIX}-001" }
|
|
79
|
+
> ],
|
|
80
|
+
> "alternativeFlows": ["Bulk import via CSV", "Automatic sync from SFTP"]
|
|
81
|
+
> }
|
|
82
|
+
> ```
|
|
83
|
+
> **FORBIDDEN:** Do NOT put lifecycle/state machine data here. Use `specification.lifeCycles[]` for that.
|
|
84
|
+
|
|
85
|
+
#### 6d. Data Lifecycle
|
|
86
|
+
|
|
87
|
+
Define data retention and lifecycle policies:
|
|
88
|
+
|
|
89
|
+
> **STRUCTURE CARD: analysis.dataLifecycle**
|
|
90
|
+
> ```json
|
|
91
|
+
> {
|
|
92
|
+
> "retentionPeriod": "7 years",
|
|
93
|
+
> "archiveStrategy": "Move to cold storage after 2 years",
|
|
94
|
+
> "gdprCompliance": "PII anonymized on request, data export available",
|
|
95
|
+
> "states": [
|
|
96
|
+
> { "name": "active", "transitions": ["archived", "deleted"] },
|
|
97
|
+
> { "name": "archived", "transitions": ["active"] },
|
|
98
|
+
> { "name": "deleted", "transitions": [] }
|
|
99
|
+
> ]
|
|
100
|
+
> }
|
|
101
|
+
> ```
|
|
102
|
+
|
|
103
|
+
### 7. Business Rules Extraction
|
|
104
|
+
|
|
105
|
+
Extract business rules specific to this module:
|
|
106
|
+
|
|
107
|
+
> **STRUCTURE CARD: analysis.businessRules[]** — Field names are EXACT. Do NOT deviate.
|
|
108
|
+
> ```json
|
|
109
|
+
> {
|
|
110
|
+
> "id": "BR-VAL-{PREFIX}-001",
|
|
111
|
+
> "name": "Short rule name",
|
|
112
|
+
> "category": "validation|calculation|workflow|security|data",
|
|
113
|
+
> "statement": "IF {condition} THEN {consequence} ELSE {alternative}",
|
|
114
|
+
> "priority": "must|should|could",
|
|
115
|
+
> "conditions": ["Condition 1", "Condition 2"],
|
|
116
|
+
> "examples": [{ "input": "Order total $5000, budget $2000", "expected": "Order rejected" }],
|
|
117
|
+
> "testability": "Via unit test with mock data / integration test"
|
|
118
|
+
> }
|
|
119
|
+
> ```
|
|
120
|
+
> **MANDATORY fields:** `id`, `name`, `category`, `statement`, `priority`
|
|
121
|
+
> **FORBIDDEN fields:** Do NOT use `rule`, `condition` (singular), `action`. Use `name` + `statement` (IF/THEN/ELSE format) + `conditions` (array).
|
|
122
|
+
> **ID PATTERN:** `BR-{CAT}-{PREFIX}-{NNN}` where CAT = VAL|CALC|WF|SEC|DATA, PREFIX = module initials (2-4 chars)
|
|
123
|
+
> **category values:** lowercase only: `validation`, `calculation`, `workflow`, `security`, `data`
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## SELF-VERIFICATION (MANDATORY before loading step-03b-ui)
|
|
128
|
+
|
|
129
|
+
Before proceeding to step-03b-ui.md, VERIFY:
|
|
130
|
+
|
|
131
|
+
1. **Module feature.json exists** at expected path (`docs/business/{app}/{module}/business-analyse/v{X.Y}/feature.json`)
|
|
132
|
+
2. **Module feature.json has analysis section** with `entities[]` (at least 1) and `businessRules[]` (at least 1)
|
|
133
|
+
3. **Module status in master** = "in-progress" (set by section 2 above)
|
|
134
|
+
4. **Master modules[].featureJsonPath** for this module ≠ null (set by ba-writer.create)
|
|
135
|
+
5. **Sections identified** with clear roles and entities assigned
|
|
136
|
+
|
|
137
|
+
**IF any check fails → FIX before proceeding.** Do NOT load step-03b-ui with incomplete data.
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## NEXT STEP
|
|
142
|
+
|
|
143
|
+
Load: `steps/step-03b-ui.md`
|
|
@@ -125,6 +125,7 @@ For EACH section confirmed in 3a, build the `specification.sections[]` structure
|
|
|
125
125
|
See [references/ui-resource-cards.md](../references/ui-resource-cards.md) for exact JSON formats of `specification.sections[]` (SmartTable + SmartForm resources).
|
|
126
126
|
**MANDATORY for SmartTable:** `columnDefs`, `rowActions`, `defaultSort`, `emptyState`
|
|
127
127
|
**MANDATORY for SmartForm:** `fields` with `component` type, `formLayout`
|
|
128
|
+
**FORM FIELD COMPLETENESS RULE:** SmartForm `fields[]` MUST include ALL entity attributes EXCEPT system/audit fields (Id, CreatedAt, CreatedBy, ModifiedAt, ModifiedBy, IsDeleted, TenantId). Missing fields = incomplete form = FAIL.
|
|
128
129
|
|
|
129
130
|
5. Write `specification.sections[]` via ba-writer.enrichSection()
|
|
130
131
|
|
|
@@ -238,6 +239,8 @@ Before proceeding to step-03c-compile.md, VERIFY:
|
|
|
238
239
|
3. **All wireframes have layout** with regions and resourceRef references
|
|
239
240
|
4. **All resource references** in layout.regions[].components[].resourceRef exist in sections[].resources[]
|
|
240
241
|
5. **State machines defined** (if module has status fields) in `specification.lifeCycles[]`
|
|
242
|
+
6. **Form field completeness** — SmartForm fields[] covers ALL entity attributes except system/audit fields
|
|
243
|
+
7. **Navigation entries for all sections** — Every section (including dashboard) has a corresponding entry in `specification.navigation.entries[]`
|
|
241
244
|
|
|
242
245
|
**IF any check fails → FIX before proceeding.** Do NOT load step-03c-compile with incomplete data.
|
|
243
246
|
|
|
@@ -395,7 +395,7 @@ Before loading step-03d-validate, verify all 12 subsections (8a-8l) are populate
|
|
|
395
395
|
3. **8c. Functional Requirements** - At least 4 FRs with linked UCs and BRs
|
|
396
396
|
4. **8d. Permission Matrix** - Resources and role assignments defined
|
|
397
397
|
5. **8e. Navigation** - Module, sections, and resource routes specified
|
|
398
|
-
6. **8f. SeedData Core** - All
|
|
398
|
+
6. **8f. SeedData Core** - All 7 arrays populated with structured objects (navigationModules, navigationSections, navigationResources, navigationTranslations, permissions, rolePermissions, permissionConstants)
|
|
399
399
|
7. **8g. Gherkin Scenarios** - BDD scenarios for each major UC
|
|
400
400
|
8. **8h. Validations** - Field rules with error message keys
|
|
401
401
|
9. **8i. Business Messages** - Minimum 4 messages (success, error CRUD, validation, permission)
|