@atlashub/smartstack-cli 3.9.0 → 3.10.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 (22) hide show
  1. package/package.json +1 -1
  2. package/templates/agents/ba-writer.md +178 -0
  3. package/templates/skills/application/references/application-roles-template.md +227 -0
  4. package/templates/skills/application/references/provider-template.md +30 -6
  5. package/templates/skills/application/steps/step-03-roles.md +45 -7
  6. package/templates/skills/application/steps/step-03b-provider.md +13 -6
  7. package/templates/skills/business-analyse/SKILL.md +56 -4
  8. package/templates/skills/business-analyse/references/agent-pooling-best-practices.md +477 -0
  9. package/templates/skills/business-analyse/references/cache-warming-strategy.md +578 -0
  10. package/templates/skills/business-analyse/references/robustness-checks.md +538 -0
  11. package/templates/skills/business-analyse/schemas/sections/specification-schema.json +33 -1
  12. package/templates/skills/business-analyse/steps/step-00-init.md +166 -0
  13. package/templates/skills/business-analyse/steps/step-03a-data.md +36 -0
  14. package/templates/skills/business-analyse/steps/step-03c-compile.md +71 -2
  15. package/templates/skills/business-analyse/steps/step-03d-validate.md +274 -0
  16. package/templates/skills/business-analyse/steps/step-04-consolidation.md +166 -0
  17. package/templates/skills/business-analyse/steps/step-05a-handoff.md +44 -0
  18. package/templates/skills/business-analyse/steps/step-05b-deploy.md +21 -2
  19. package/templates/skills/business-analyse/steps/step-05c-ralph-readiness.md +526 -0
  20. package/templates/skills/controller/steps/step-03-generate.md +184 -24
  21. package/templates/skills/controller/templates.md +11 -2
  22. package/templates/skills/ralph-loop/references/core-seed-data.md +173 -21
@@ -75,6 +75,52 @@ docs/business/
75
75
  **No intermediate markdown files - all state in feature.json**
76
76
  </output_structure>
77
77
 
78
+ <navigation_hierarchy>
79
+ **SmartStack uses a 5-level navigation structure mapped to database tables:**
80
+
81
+ | Level | Entity | Table DB | Created in Step | Description |
82
+ |-------|--------|----------|-----------------|-------------|
83
+ | 1 | Context | `core.nav_Contexts` | N/A | Fixed ("business", "platform", "system") |
84
+ | 2 | Application | `core.nav_Applications` | 00-01 | Top-level application (e.g., "RessourcesHumaines") |
85
+ | 3 | Module | `core.nav_Modules` | 02 | Functional module (e.g., "Employees", "TimeManagement") |
86
+ | 4 | **Section** | **`core.nav_Sections`** | **03a-03c** | **Page within module (e.g., "list", "detail", "create", "dashboard")** |
87
+ | 5 | **Resource** | **`core.nav_Resources`** | **03b-03c** | **React component (SmartTable, SmartForm, Chart, KpiCard, etc.)** |
88
+
89
+ **Hierarchical relationship:**
90
+ - Context → Application → Module → **Section** → **Resource**
91
+ - Each Section MUST have ≥1 Resource
92
+ - Each Section corresponds to 1 React page route
93
+ - Each Resource corresponds to 1 SmartStack UI component
94
+
95
+ **SeedData generation (step-03c):**
96
+
97
+ The `specification.seedDataCore` contains **7 mandatory arrays** for database seeding:
98
+
99
+ | Array | Table | Source | Description |
100
+ |-------|-------|--------|-------------|
101
+ | `navigationModules` | `core.nav_Modules` | Manual (step-03c) | Module entry (Level 3) |
102
+ | **`navigationSections`** | **`core.nav_Sections`** | **Derived from `specification.sections[]`** | **Section entries (Level 4)** |
103
+ | **`navigationResources`** | **`core.nav_Resources`** | **Derived from `specification.sections[].resources[]`** | **Resource entries (Level 5)** |
104
+ | `navigationTranslations` | `core.nav_Translations` | Manual (i18n) | Multi-language labels |
105
+ | `permissions` | `core.Permissions` | Manual (step-03c) | Permission definitions |
106
+ | `rolePermissions` | `core.RolePermissions` | Manual (step-03c) | Role-permission mappings |
107
+ | `permissionConstants` | `PermissionConstants.cs` | Manual (step-03c) | C# permission constants |
108
+
109
+ **Transform algorithm (step-03c section 8f-bis):**
110
+ - `navigationSections` = transform `specification.sections[]` → flatten to { code, label, icon, route, parentCode, permission, sort }
111
+ - `navigationResources` = transform `specification.sections[].resources[]` → flatten to { code, type, entity, parentCode, permission }
112
+
113
+ **Example:**
114
+ - Module: `Employees` (Level 3)
115
+ - Section: `list` (Level 4) → contains resources:
116
+ - Resource: `employees-grid` (SmartTable) (Level 5)
117
+ - Resource: `status-filter` (FilterBar) (Level 5)
118
+ - Section: `detail` (Level 4) → contains resources:
119
+ - Resource: `employee-card` (DetailCard) (Level 5)
120
+ - Resource: `contract-history` (SmartTable) (Level 5)
121
+
122
+ </navigation_hierarchy>
123
+
78
124
  <resume_workflow>
79
125
  **Update mode (auto-detected):**
80
126
 
@@ -104,9 +150,12 @@ When step-00 detects that the description matches an existing application:
104
150
  - **Step 03c:** Per-module compile: actors, UCs, FRs, permissions, navigation, seed data, i18n
105
151
  - **Step 03d:** Per-module validate: completeness checks, write feature.json, incremental HTML, loop
106
152
  - Loop: 03a → 03b → 03c → 03d → 03a (next module) until all specified (specified)
107
- - **Step 04:** Cross-module consolidation (consolidated)
153
+ - **Step 04a:** Collect: module summaries, cross-module interactions (FK, events, shared data)
154
+ - **Step 04b:** Analyze: permission coherence, semantic validation, E2E flows, global risks
155
+ - **Step 04c:** Decide: final approval, write consolidation section, proceed to handoff (consolidated)
108
156
  - **Step 05a:** Handoff: file mapping (7 categories), BR-to-code mapping, API summary, write to feature.json
109
157
  - **Step 05b:** Deploy: prd.json, progress.txt, manifest, ba-interactive.html pre-populated (handed-off)
158
+ - **Step 05c:** Ralph Readiness Check: validation gate before /ralph-loop (optional but recommended)
110
159
 
111
160
  **Update workflow (same phases, delta focus):**
112
161
  - **Step 00:** Detection, locate existing feature, create version N+1
@@ -152,11 +201,14 @@ When step-00 detects that the description matches an existing application:
152
201
  | 02 | `steps/step-02-decomposition.md` | Opus | Module decomposition, dependency graph, client checkpoint |
153
202
  | 03a | `steps/step-03a-data.md` | Opus | Per-module: sections, entities, BRs, questionnaires |
154
203
  | 03b | `steps/step-03b-ui.md` | Opus | Per-module: state machines, wireframes, layouts, dashboards |
155
- | 03c | `steps/step-03c-compile.md` | Opus | Per-module: actors, UCs, FRs, permissions, nav, seed data, i18n |
204
+ | 03c | `steps/step-03c-compile.md` | Opus | Per-module: actors, UCs, FRs, permissions, navigation, seedDataCore (7 arrays), i18n |
156
205
  | 03d | `steps/step-03d-validate.md` | Sonnet | Per-module: validation, write, incremental HTML, loop decision |
157
- | 04 | `steps/step-04-consolidation.md` | Opus | Cross-module validation, E2E flows, permissions coherence |
206
+ | 04a | `steps/step-04a-collect.md` | Opus | Collect module summaries & cross-module interactions |
207
+ | 04b | `steps/step-04b-analyze.md` | Opus | Analyze permission coherence, semantic validation, E2E flows |
208
+ | 04c | `steps/step-04c-decide.md` | Opus | Final approval, write consolidation, proceed to handoff |
158
209
  | 05a | `steps/step-05a-handoff.md` | Sonnet | Handoff: file mapping (7 categories), BR-to-code mapping, API summary, write handoff |
159
- | 05b | `steps/step-05b-deploy.md` | Sonnet | Deploy: prd.json, progress.txt, manifest, ba-interactive.html, auto-launch ralph-loop |
210
+ | 05b | `steps/step-05b-deploy.md` | Sonnet | Deploy: prd.json, progress.txt, manifest, ba-interactive.html |
211
+ | 05c | `steps/step-05c-ralph-readiness.md` | Sonnet | Ralph readiness validation gate (optional but recommended) |
160
212
  | 06 | `steps/step-06-review.md` | Opus | Apply review corrections, create new version, regenerate all artifacts |
161
213
 
162
214
  </step_files>
@@ -0,0 +1,477 @@
1
+ # Agent Pooling Best Practices
2
+
3
+ > **Objective:** Minimize agent proliferation and token waste by reusing agents strategically.
4
+
5
+ ## Problem Statement
6
+
7
+ **Observed issue:** Business-analyse sessions create 20-24 subagents, many of which are ultra-short (4-13 lines) for trivial tasks like summaries or consolidations.
8
+
9
+ **Impact:**
10
+ - Organizational overhead (tracking 24 agents)
11
+ - Token waste (spawning + context setup for each agent)
12
+ - Complexity in debugging and monitoring
13
+ - 1540+ lines of JSONL logs for a single session
14
+
15
+ **Goal:** Reduce to 5-7 agents per session while maintaining quality and parallelism.
16
+
17
+ ---
18
+
19
+ ## Agent Pooling Strategy
20
+
21
+ ### Core Principle
22
+
23
+ > **Reuse agents for sequential operations, spawn new agents only for genuine parallelism.**
24
+
25
+ ### When to Spawn a NEW Agent
26
+
27
+ ✅ **Spawn new agent when:**
28
+ 1. **Parallel operations** - Multiple independent tasks can run simultaneously
29
+ - Example: Specifying 2+ modules in parallel (step-03)
30
+ - Example: Reading multiple PRD files concurrently (step-05)
31
+
32
+ 2. **Domain separation** - Task requires fundamentally different expertise
33
+ - Example: ba-writer for JSON writes, Explore for codebase search
34
+ - Example: MCP healthcheck vs. code generation
35
+
36
+ 3. **Long-running tasks** - Task will take multiple turns and could block main flow
37
+ - Example: Deep codebase exploration with 10+ searches
38
+ - Example: Complex validation requiring many file reads
39
+
40
+ ### When to REUSE Existing Agent
41
+
42
+ ✅ **Reuse agent when:**
43
+ 1. **Sequential operations** - Tasks depend on previous results
44
+ - Example: Read module 1 → process → read module 2 → process
45
+ - Example: Validate → fix → re-validate
46
+
47
+ 2. **Same domain** - Task uses same tools and context as previous
48
+ - Example: Multiple ba-writer calls in step-05 module loop
49
+ - Example: Multiple ba-reader calls for different modules
50
+
51
+ 3. **Short tasks** - Task will complete in 1-2 turns
52
+ - Example: Generate summary (inline, not separate agent)
53
+ - Example: Format output (inline, not separate agent)
54
+
55
+ 4. **Consolidation** - Aggregating results from multiple sources
56
+ - Example: Combine module summaries into master (inline)
57
+ - Example: Build dependency graph from module data (inline)
58
+
59
+ ---
60
+
61
+ ## Anti-Patterns to Avoid
62
+
63
+ ### ❌ Anti-Pattern 1: Ultra-Short Summary Agents
64
+
65
+ **Bad:**
66
+ ```
67
+ FOR each module:
68
+ Spawn agent "summarize-module-{i}"
69
+ Agent reads module → generates 4-line summary → exits
70
+ ```
71
+
72
+ **Result:** 5 agents created for 20 total lines of output
73
+
74
+ **Good:**
75
+ ```
76
+ Main agent reads all modules sequentially
77
+ Generates summaries inline
78
+ Returns consolidated result
79
+ ```
80
+
81
+ **Result:** 1 agent, same output, 80% fewer tokens
82
+
83
+ ---
84
+
85
+ ### ❌ Anti-Pattern 2: Spawning for Every Step Transition
86
+
87
+ **Bad:**
88
+ ```
89
+ Step 03a: Spawn agent-data
90
+ → Agent completes → exits
91
+ Step 03b: Spawn agent-ui
92
+ → Agent completes → exits
93
+ Step 03c: Spawn agent-compile
94
+ → Agent completes → exits
95
+ ```
96
+
97
+ **Result:** 3 agents per module, 15 agents for 5 modules
98
+
99
+ **Good:**
100
+ ```
101
+ Step 03: Spawn ONE agent-module-spec
102
+ → Agent executes 03a → 03b → 03c internally
103
+ → Agent exits after module complete
104
+ ```
105
+
106
+ **Result:** 5 agents for 5 modules (1 per module)
107
+
108
+ ---
109
+
110
+ ### ❌ Anti-Pattern 3: Parallel Agents for Sequential Dependency
111
+
112
+ **Bad:**
113
+ ```
114
+ Spawn agent-read-master (reads master feature.json)
115
+ Spawn agent-read-module-1 (reads module 1 feature.json)
116
+ Spawn agent-consolidate (waits for both, then merges)
117
+ ```
118
+
119
+ **Result:** 3 agents when 2 have sequential dependency
120
+
121
+ **Good:**
122
+ ```
123
+ Spawn agent-consolidate
124
+ → Reads master
125
+ → Reads module 1
126
+ → Merges inline
127
+ → Returns result
128
+ ```
129
+
130
+ **Result:** 1 agent, same output, faster execution
131
+
132
+ ---
133
+
134
+ ## Implementation Patterns
135
+
136
+ ### Pattern 1: Module Loop with Single Agent
137
+
138
+ **Scenario:** Step 03 - Specify 5 modules sequentially
139
+
140
+ **Recommended:**
141
+ ```
142
+ 1. Main flow spawns ONE agent: "ba-module-orchestrator"
143
+ 2. Agent receives: modules[], currentModuleIndex
144
+ 3. Agent executes loop:
145
+ FOR i = 0; i < modules.length; i++:
146
+ Execute step-03a (data)
147
+ Execute step-03b (ui)
148
+ Execute step-03c (compile)
149
+ Execute step-03d (validate)
150
+ Write module feature.json
151
+ Advance to next module
152
+ 4. Agent exits when all modules specified
153
+ ```
154
+
155
+ **Result:** 1 agent for all 5 modules (vs. 20 agents in current implementation)
156
+
157
+ **Exception:** If modules have NO dependencies and can be specified in parallel:
158
+ - Spawn 2-3 agents maximum
159
+ - Each agent handles 1-2 modules
160
+ - Results merged by main flow
161
+
162
+ ---
163
+
164
+ ### Pattern 2: Batch Operations with Checkpoints
165
+
166
+ **Scenario:** Step 05a - Generate handoff for 5 modules
167
+
168
+ **Recommended:**
169
+ ```
170
+ 1. Main flow spawns ONE agent: "ba-handoff-generator"
171
+ 2. Agent receives: modules[], master feature.json
172
+ 3. Agent executes batch:
173
+ FOR each module:
174
+ Calculate complexity
175
+ Map files to create (7 categories)
176
+ Map business rules to code
177
+ Generate API endpoint summary
178
+ Write to module feature.json
179
+ CHECKPOINT: Display progress "✓ Module {i+1}/5 complete"
180
+ 4. After ALL modules: Write master handoff
181
+ 5. Agent exits
182
+ ```
183
+
184
+ **Result:** 1 agent for all handoff generation (vs. 5-10 agents in current)
185
+
186
+ **Checkpoint benefits:**
187
+ - User sees progress
188
+ - Agent can be interrupted/resumed if needed
189
+ - Failures isolated to specific module
190
+
191
+ ---
192
+
193
+ ### Pattern 3: Parallel Domain Operations
194
+
195
+ **Scenario:** Step 00 - Initialize schemas + scan existing features + create config
196
+
197
+ **Recommended:**
198
+ ```
199
+ 1. Spawn agent-deploy-schemas (deploy 9 schema files)
200
+ 2. Spawn agent-scan-features (glob + read existing features)
201
+ 3. Main flow waits for both
202
+ 4. Main flow creates config (inline)
203
+ 5. Main flow creates master feature.json (inline via ba-writer)
204
+ ```
205
+
206
+ **Result:** 2 agents for genuinely parallel tasks
207
+
208
+ **Why parallel:**
209
+ - Schema deployment and feature scanning are independent
210
+ - Both are I/O-bound (file operations)
211
+ - No shared state until merge
212
+
213
+ ---
214
+
215
+ ## Metrics & Monitoring
216
+
217
+ ### Target Metrics (per BA session)
218
+
219
+ | Metric | Current | Target | Improvement |
220
+ |--------|---------|--------|-------------|
221
+ | Total agents | 24 | 5-7 | 71-79% reduction |
222
+ | Ultra-short agents (<20 lines) | 4 | 0 | 100% elimination |
223
+ | Agents per module loop | 4-5 | 1 | 80% reduction |
224
+ | JSONL log lines | 1540 | <500 | 68% reduction |
225
+
226
+ ### Agent Spawn Decision Checklist
227
+
228
+ Before spawning a new agent, ask:
229
+
230
+ 1. ☐ Can this be done inline in current agent? (80% of cases: YES)
231
+ 2. ☐ Can I reuse an existing agent? (10% of cases: YES)
232
+ 3. ☐ Is this truly parallel? (5% of cases: YES)
233
+ 4. ☐ Is this a different domain? (5% of cases: YES)
234
+
235
+ If ALL answers are NO → spawn new agent.
236
+ Otherwise → inline or reuse.
237
+
238
+ ---
239
+
240
+ ## Step-by-Step Migration Guide
241
+
242
+ ### Step 00: Init
243
+
244
+ **Current:** 3-4 agents (schema deploy, scan, config, create)
245
+ **Target:** 1-2 agents
246
+
247
+ **Changes:**
248
+ - Inline config creation
249
+ - Inline master feature.json creation via ba-writer
250
+ - Keep schema deployment as separate agent (parallel with scan)
251
+
252
+ ---
253
+
254
+ ### Step 01: Cadrage
255
+
256
+ **Current:** 2-3 agents (questionnaire, suggestions, write)
257
+ **Target:** 1 agent
258
+
259
+ **Changes:**
260
+ - ONE agent executes entire cadrage
261
+ - Inline questionnaire processing
262
+ - Inline suggestion generation
263
+ - Single ba-writer call at end
264
+
265
+ ---
266
+
267
+ ### Step 02: Decomposition
268
+
269
+ **Current:** 3-4 agents (analysis, dependency graph, client checkpoint, write)
270
+ **Target:** 1 agent
271
+
272
+ **Changes:**
273
+ - ONE agent for decomposition
274
+ - Inline dependency graph calculation
275
+ - Inline client checkpoint (AskUserQuestion)
276
+ - Single ba-writer call for modules + dependencyGraph
277
+
278
+ ---
279
+
280
+ ### Step 03: Module Specification (BIGGEST IMPACT)
281
+
282
+ **Current:** 4-5 agents PER module × 5 modules = 20-25 agents
283
+ **Target:** 1 agent per module (5 total) OR 1 agent for all modules (1 total)
284
+
285
+ **Changes:**
286
+ - **Option A:** ONE agent for ALL modules (sequential)
287
+ - Agent loops through modules
288
+ - Executes 03a → 03b → 03c → 03d internally
289
+ - Displays progress checkpoints
290
+
291
+ - **Option B:** ONE agent PER module (if parallel possible)
292
+ - Max 2-3 modules in parallel
293
+ - Each agent handles 1 module end-to-end
294
+
295
+ **Recommended:** Option A (sequential) for most cases, Option B only if modules truly independent
296
+
297
+ ---
298
+
299
+ ### Step 04: Consolidation
300
+
301
+ **Current:** 2-3 agents (cross-module validation, E2E flows, write)
302
+ **Target:** 1 agent
303
+
304
+ **Changes:**
305
+ - ONE agent for consolidation
306
+ - Inline cross-module interaction detection
307
+ - Inline E2E flow generation
308
+ - Single ba-writer call
309
+
310
+ ---
311
+
312
+ ### Step 05: Handoff & Deploy
313
+
314
+ **Current:** 5-7 agents (handoff per module + master + PRD generation + HTML deploy)
315
+ **Target:** 2-3 agents
316
+
317
+ **Changes:**
318
+ - ONE agent for all handoff generation (modules + master)
319
+ - ONE agent for artifact deployment (PRD + HTML + manifest)
320
+ - Optional: ONE agent for validation (step-05c)
321
+
322
+ ---
323
+
324
+ ## Cache Warming Strategy
325
+
326
+ > **Complement to agent pooling:** Pre-load frequently-used files to reduce redundant reads.
327
+
328
+ ### Step 00: Pre-Load Core Context
329
+
330
+ ```
331
+ At Step-00 initialization:
332
+ 1. Read + cache all 9 schemas
333
+ 2. Read + cache master feature template
334
+ 3. Read + cache questionnaire templates
335
+ 4. Read + cache suggestion catalog
336
+
337
+ Result: 90% of Step-01 context pre-loaded, no re-reads needed
338
+ ```
339
+
340
+ ### Step 03: Pre-Load Module Context
341
+
342
+ ```
343
+ At start of module loop:
344
+ 1. Read + cache application context (from master)
345
+ 2. Read + cache completed module summaries (via ba-reader)
346
+ 3. Read + cache shared patterns and templates
347
+
348
+ Result: 70% of per-module context pre-loaded
349
+ ```
350
+
351
+ ### Benefits
352
+
353
+ - 15-20% token savings across session
354
+ - Faster agent execution (no wait for file reads)
355
+ - Reduced risk of file read failures
356
+ - Better cache hit rates (98.5% cache read in analysis → 50% reduction with warming)
357
+
358
+ ---
359
+
360
+ ## Rollout Plan
361
+
362
+ ### Phase 1: Quick Wins (Week 1)
363
+
364
+ 1. ✅ Eliminate ultra-short summary agents
365
+ - Make summaries inline in calling agent
366
+ - Remove dedicated "summary-request" agents
367
+
368
+ 2. ✅ Consolidate Step 01 + 02 to 1 agent each
369
+ - Combine questionnaire + suggestions + write
370
+ - Combine decomposition + dependency + write
371
+
372
+ **Expected impact:** 30% reduction in agent count
373
+
374
+ ---
375
+
376
+ ### Phase 2: Module Loop Optimization (Week 2)
377
+
378
+ 1. ✅ Refactor Step 03 to use 1 agent per module (or 1 for all)
379
+ - Agent executes 03a → 03b → 03c → 03d internally
380
+ - Display progress checkpoints
381
+ - Single ba-writer call per module
382
+
383
+ **Expected impact:** 60% reduction in agent count
384
+
385
+ ---
386
+
387
+ ### Phase 3: Handoff & Deploy Optimization (Week 3)
388
+
389
+ 1. ✅ Consolidate Step 05a to 1 agent for all modules
390
+ - Batch handoff generation
391
+ - Progress checkpoints
392
+
393
+ 2. ✅ Consolidate Step 05b to 1 agent for all artifacts
394
+ - PRD generation + HTML deploy + manifest
395
+
396
+ **Expected impact:** 70% reduction in agent count
397
+
398
+ ---
399
+
400
+ ### Phase 4: Cache Warming (Week 4)
401
+
402
+ 1. ✅ Implement pre-loading in Step 00
403
+ 2. ✅ Implement context caching in Step 03
404
+ 3. ✅ Monitor cache hit rates
405
+
406
+ **Expected impact:** 15-20% token savings
407
+
408
+ ---
409
+
410
+ ## Monitoring & Success Criteria
411
+
412
+ ### Before Optimization (Baseline)
413
+
414
+ ```
415
+ Session: Business-analyse for HumanResources application
416
+ - Total agents: 24
417
+ - Ultra-short agents: 4
418
+ - JSONL lines: 1540
419
+ - Tokens (largest agent): 106,881
420
+ - Cache efficiency: 98.5% read (inefficient)
421
+ ```
422
+
423
+ ### After Optimization (Target)
424
+
425
+ ```
426
+ Session: Business-analyse for HumanResources application
427
+ - Total agents: 5-7
428
+ - Ultra-short agents: 0
429
+ - JSONL lines: <500
430
+ - Tokens (largest agent): <80,000
431
+ - Cache efficiency: 50-60% read (optimal)
432
+ ```
433
+
434
+ ### Success Metrics
435
+
436
+ - ✅ Agent count reduced by 70-79%
437
+ - ✅ Ultra-short agents eliminated
438
+ - ✅ JSONL complexity reduced by 68%
439
+ - ✅ Token usage reduced by 15-20%
440
+ - ✅ Same output quality (no regressions)
441
+
442
+ ---
443
+
444
+ ## References
445
+
446
+ - **Analysis Report:** Session 03b76b8b-ea1c-4f1e-a636-bd46b0c33e02
447
+ - **File Size Management:** See ba-writer.md § File Size Management
448
+ - **Cache Strategy:** See MEMORY.md § Cache Warming Strategy
449
+ - **Agent Types:** See Task tool documentation
450
+
451
+ ---
452
+
453
+ ## Quick Reference Card
454
+
455
+ ### ✅ DO
456
+
457
+ - Reuse agents for sequential operations
458
+ - Spawn 1 agent per logical phase (not per sub-step)
459
+ - Do summaries/formatting inline
460
+ - Pre-load context at phase start
461
+ - Display progress checkpoints
462
+ - Use ba-writer for all JSON operations
463
+
464
+ ### ❌ DON'T
465
+
466
+ - Spawn agents for trivial tasks (<20 lines output)
467
+ - Spawn new agent for each step transition
468
+ - Spawn agents for sequential dependencies
469
+ - Re-read same files multiple times
470
+ - Create summary-only agents
471
+ - Spawn more than 7 agents per BA session
472
+
473
+ ---
474
+
475
+ **Last Updated:** 2026-02-08
476
+ **Version:** 1.0
477
+ **Author:** SmartStack CLI Team