agileflow 2.94.1 → 2.95.1

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 (74) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +3 -3
  3. package/lib/colors.generated.js +117 -0
  4. package/lib/colors.js +59 -109
  5. package/lib/generator-factory.js +333 -0
  6. package/lib/path-utils.js +49 -0
  7. package/lib/session-registry.js +25 -15
  8. package/lib/smart-json-file.js +40 -32
  9. package/lib/state-machine.js +286 -0
  10. package/package.json +1 -1
  11. package/scripts/agileflow-configure.js +7 -6
  12. package/scripts/archive-completed-stories.sh +86 -11
  13. package/scripts/babysit-context-restore.js +89 -0
  14. package/scripts/claude-tmux.sh +111 -5
  15. package/scripts/damage-control/bash-tool-damage-control.js +11 -247
  16. package/scripts/damage-control/edit-tool-damage-control.js +9 -249
  17. package/scripts/damage-control/write-tool-damage-control.js +9 -244
  18. package/scripts/generate-colors.js +314 -0
  19. package/scripts/lib/colors.generated.sh +82 -0
  20. package/scripts/lib/colors.sh +10 -70
  21. package/scripts/lib/configure-features.js +401 -0
  22. package/scripts/lib/context-loader.js +181 -52
  23. package/scripts/precompact-context.sh +54 -17
  24. package/scripts/session-coordinator.sh +2 -2
  25. package/scripts/session-manager.js +653 -10
  26. package/src/core/commands/audit.md +93 -0
  27. package/src/core/commands/auto.md +73 -0
  28. package/src/core/commands/babysit.md +169 -13
  29. package/src/core/commands/baseline.md +73 -0
  30. package/src/core/commands/batch.md +64 -0
  31. package/src/core/commands/blockers.md +60 -0
  32. package/src/core/commands/board.md +66 -0
  33. package/src/core/commands/choose.md +77 -0
  34. package/src/core/commands/ci.md +77 -0
  35. package/src/core/commands/compress.md +27 -1
  36. package/src/core/commands/configure.md +126 -10
  37. package/src/core/commands/council.md +74 -0
  38. package/src/core/commands/debt.md +72 -0
  39. package/src/core/commands/deploy.md +73 -0
  40. package/src/core/commands/deps.md +68 -0
  41. package/src/core/commands/docs.md +60 -0
  42. package/src/core/commands/feedback.md +68 -0
  43. package/src/core/commands/ideate.md +74 -0
  44. package/src/core/commands/impact.md +74 -0
  45. package/src/core/commands/install.md +529 -0
  46. package/src/core/commands/maintain.md +558 -0
  47. package/src/core/commands/metrics.md +75 -0
  48. package/src/core/commands/multi-expert.md +74 -0
  49. package/src/core/commands/packages.md +69 -0
  50. package/src/core/commands/readme-sync.md +64 -0
  51. package/src/core/commands/research/analyze.md +285 -121
  52. package/src/core/commands/research/import.md +281 -109
  53. package/src/core/commands/retro.md +76 -0
  54. package/src/core/commands/review.md +72 -0
  55. package/src/core/commands/rlm.md +83 -0
  56. package/src/core/commands/rpi.md +90 -0
  57. package/src/core/commands/session/cleanup.md +214 -12
  58. package/src/core/commands/session/end.md +155 -17
  59. package/src/core/commands/sprint.md +72 -0
  60. package/src/core/commands/story-validate.md +68 -0
  61. package/src/core/commands/template.md +69 -0
  62. package/src/core/commands/tests.md +83 -0
  63. package/src/core/commands/update.md +59 -0
  64. package/src/core/commands/validate-expertise.md +76 -0
  65. package/src/core/commands/velocity.md +74 -0
  66. package/src/core/commands/verify.md +91 -0
  67. package/src/core/commands/whats-new.md +69 -0
  68. package/src/core/commands/workflow.md +88 -0
  69. package/src/core/templates/command-documentation.md +187 -0
  70. package/tools/cli/commands/session.js +1171 -0
  71. package/tools/cli/commands/setup.js +2 -81
  72. package/tools/cli/installers/core/installer.js +0 -5
  73. package/tools/cli/installers/ide/claude-code.js +6 -0
  74. package/tools/cli/lib/config-manager.js +42 -5
@@ -5,12 +5,12 @@ compact_context:
5
5
  priority: high
6
6
  preserve_rules:
7
7
  - "ACTIVE COMMAND: /agileflow:research:analyze - Analyze saved research for project implementation"
8
- - "MUST use EnterPlanMode to gather project context before analyzing"
8
+ - "MUST use EnterPlanMode and deploy 3-5 domain experts IN PARALLEL for multi-perspective analysis"
9
9
  - "MUST be project-specific: reference actual files and patterns from user's codebase"
10
- - "MUST show benefits FIRST before asking for implementation commitment"
11
- - "MUST intelligently recommend artifact type (ADR/Epic/Stories/Practice) based on scope"
12
- - "DO NOT assume a one-size-fits-all artifact type"
13
- - "Research type + analysis determines artifact: Architecture decision→ADR, Large feature→Epic+Stories, Focused improvement→Story"
10
+ - "MUST synthesize expert results with confidence scoring (HIGH = 2+ experts agree)"
11
+ - "MUST present Implementation Ideation Report with expert consensus before artifact creation"
12
+ - "DO NOT use single-perspective analysis (shallow, misses domain considerations)"
13
+ - "Research type + expert consensus determines artifact: Architecture decision→ADR, Large feature→Epic+Stories, Focused improvement→Story"
14
14
  - "For large research files (50k+ chars) or HIGH complexity: Use RLM approach with document-repl.js"
15
15
  - "Assess file with --info before reading; use targeted extraction for large docs"
16
16
  state_fields:
@@ -20,6 +20,9 @@ compact_context:
20
20
  - research_chars
21
21
  - plan_mode_active
22
22
  - implementation_analysis
23
+ - experts_deployed
24
+ - expert_results
25
+ - consensus_level
23
26
  ---
24
27
 
25
28
  # /agileflow:research:analyze
@@ -58,23 +61,28 @@ node .agileflow/scripts/obtain-context.js research:analyze
58
61
 
59
62
  ---
60
63
 
61
- ### 🚨 RULE #1: ALWAYS ENTER PLAN MODE FIRST
64
+ ### 🚨 RULE #1: IMPLEMENTATION IDEATION = PLAN MODE + MULTI-EXPERT ANALYSIS
62
65
 
63
- **Before analyzing research, ALWAYS call `EnterPlanMode`.** This gathers project context:
66
+ **Before analyzing research, ALWAYS:**
64
67
 
68
+ 1. **Enter plan mode**:
65
69
  ```xml
66
70
  <invoke name="EnterPlanMode"/>
67
71
  ```
68
72
 
69
- Then immediately:
73
+ 2. **Gather project context**:
70
74
  ```bash
71
75
  node .agileflow/scripts/obtain-context.js babysit
72
76
  ```
73
77
 
74
- **Why**: Generic analysis is worthless. You need to know their specific codebase, patterns, files, tech stack.
78
+ 3. **Deploy 3-5 domain experts IN PARALLEL** (see RULE #6 for expert selection)
75
79
 
76
- **❌ WRONG**: Show generic benefits without project context
77
- **✅ RIGHT**: Reference actual files, patterns, and architecture from their codebase
80
+ 4. **Synthesize results** with confidence scoring
81
+
82
+ **Why**: Single-perspective analysis misses domain-specific considerations. Multi-expert analysis provides security, performance, testing, and architecture perspectives for comprehensive implementation guidance.
83
+
84
+ **❌ WRONG**: Single-perspective analysis without expert consultation
85
+ **✅ RIGHT**: Deploy domain experts in parallel, synthesize with confidence scoring
78
86
 
79
87
  ---
80
88
 
@@ -186,23 +194,53 @@ node packages/cli/scripts/document-repl.js --load="FILE" --section="Key Findings
186
194
 
187
195
  ---
188
196
 
197
+ ### 🚨 RULE #6: IMPLEMENTATION IDEATION (Multi-Expert Analysis)
198
+
199
+ When user requests "Yes - Implementation ideation with multi-expert analysis":
200
+
201
+ 1. **Enter Plan Mode** and auto-detect research type to select experts
202
+ 2. **Deploy 3-5 experts IN PARALLEL** (like /ideate pattern)
203
+ 3. **Each expert analyzes from their domain perspective**:
204
+ - Implementation fit for codebase
205
+ - Domain-specific considerations
206
+ - Recommended approach with specific files
207
+ - Risks and gotchas
208
+ 4. **Synthesize with confidence scoring**:
209
+ - HIGH CONFIDENCE: 2+ experts agree on approach/files
210
+ - MEDIUM CONFIDENCE: 1 expert with specific evidence
211
+ 5. **Present unified Implementation Ideation Report** with expert consensus
212
+
213
+ **Expert Selection by Research Type:**
214
+
215
+ | Research Type | Detection Keywords | Experts |
216
+ |--------------|-------------------|---------|
217
+ | **Security/Compliance** | auth, oauth, jwt, encryption, vulnerability, compliance, csrf, xss | security, api, testing, compliance |
218
+ | **Performance** | cache, optimize, latency, throughput, benchmark, profiling | performance, database, api, monitoring |
219
+ | **Architecture/Framework** | migrate, upgrade, framework, refactor, redesign, architecture | api, database, performance, security |
220
+ | **UI/Frontend** | component, styling, accessibility, ux, design system, responsive | ui, api, testing, accessibility |
221
+ | **Database** | schema, migration, query, index, model, postgres, mongo | database, api, performance, datamigration |
222
+ | **Full-Stack (default)** | multiple domains or unclear | api, ui, database, testing, security |
223
+
224
+ ---
225
+
189
226
  ### ANTI-PATTERNS (DON'T DO THESE)
190
227
 
191
228
  ❌ Skip plan mode and analyze without project context
192
- Show generic benefits ("better performance") instead of specific gains
229
+ Single-perspective analysis (shallow, misses domain considerations)
230
+ ❌ Deploy experts one at a time (MUST be parallel)
193
231
  ❌ Reference files that don't exist in their codebase
194
232
  ❌ Assume one artifact type for all research (Epic for everything)
195
233
  ❌ Create artifacts without user asking first
196
- ❌ Finish without asking "Should we implement this?"
197
234
  ❌ Load full large research files (50k+) - use RLM approach
198
235
 
199
236
  ### DO THESE INSTEAD
200
237
 
201
238
  ✅ ALWAYS enter plan mode first
202
- Get project context (obtain-context.js)
239
+ Deploy 3-5 domain experts IN PARALLEL for multi-perspective analysis
240
+ ✅ Synthesize expert results with confidence scoring
241
+ ✅ Present Implementation Ideation Report with expert consensus
203
242
  ✅ Reference actual files and patterns from their codebase
204
- Show specific, quantifiable benefits
205
- ✅ Recommend artifact type based on research scope
243
+ Recommend artifact type based on expert agreement
206
244
  ✅ Confirm user wants to implement before creating anything
207
245
  ✅ Assess research file size/complexity before reading
208
246
  ✅ Use document-repl.js for large or complex research files
@@ -214,28 +252,29 @@ node packages/cli/scripts/document-repl.js --load="FILE" --section="Key Findings
214
252
  **Phase 1: Select Research**
215
253
  1. List research files if FILE not provided
216
254
  2. User selects which research to analyze
217
- 3. Read and display the research summary
255
+ 3. Assess file size/complexity
256
+ 4. Read and display the research summary
218
257
 
219
- **Phase 2: Gather Context**
220
- 4. Enter plan mode
221
- 5. Run obtain-context.js to understand project
222
- 6. Read relevant source files
223
- 7. Understand current patterns and architecture
258
+ **Phase 2: Offer Implementation Ideation**
259
+ 5. Ask if user wants multi-expert analysis
260
+ 6. If "No": Display full research, exit
261
+ 7. If "Yes": Continue to Phase 3
224
262
 
225
- **Phase 3: Analyze & Present**
226
- 8. Write detailed implementation analysis
227
- 9. Show benefits first, then complexity
228
- 10. Include project-specific file references
263
+ **Phase 3: Implementation Ideation**
264
+ 8. Enter plan mode + select 3-5 domain experts
265
+ 9. Deploy experts IN PARALLEL (Task tool with run_in_background)
266
+ 10. Collect results (TaskOutput) + synthesize with confidence scoring
267
+ 11. Present Implementation Ideation Report
229
268
 
230
269
  **Phase 4: Decide on Artifacts**
231
- 11. Ask if user wants to proceed
232
- 12. Recommend artifact type (ADR/Epic/Story/Practice/Tech debt)
233
- 13. Create artifact if user confirms
270
+ 12. Confirm interest in proceeding
271
+ 13. Recommend artifact type based on expert consensus
272
+ 14. Create artifact if user confirms
234
273
 
235
274
  **Phase 5: Finish**
236
- 14. Exit plan mode
237
- 15. Confirm artifact created
238
- 16. Research is now tracked and ready to implement
275
+ 15. Exit plan mode
276
+ 16. Confirm artifact created with expert validation
277
+ 17. Research is now tracked and ready to implement
239
278
 
240
279
  ---
241
280
 
@@ -275,10 +314,11 @@ node packages/cli/scripts/document-repl.js --load="FILE" --section="Key Findings
275
314
  ### REMEMBER AFTER COMPACTION
276
315
 
277
316
  - `/agileflow:research:analyze` IS ACTIVE - you're analyzing research for implementation
278
- - ALWAYS enter plan mode and gather context first
317
+ - ALWAYS enter plan mode + deploy 3-5 domain experts IN PARALLEL
318
+ - Synthesize expert results with confidence scoring (HIGH = 2+ agree)
319
+ - Present unified Implementation Ideation Report
279
320
  - ALWAYS make analysis project-specific (reference actual files)
280
- - Show benefits FIRST, then implementation complexity
281
- - Recommend artifact type based on research scope (not always Epic)
321
+ - Recommend artifact type based on expert consensus (not always Epic)
282
322
  - Confirm user wants to implement before creating artifacts
283
323
 
284
324
  <!-- COMPACT_SUMMARY_END -->
@@ -303,10 +343,12 @@ Upon invocation, execute these steps:
303
343
  <invoke name="TodoWrite">
304
344
  <parameter name="todos">[
305
345
  {"content": "Select research note", "status": "in_progress", "activeForm": "Selecting research"},
306
- {"content": "Display research summary", "status": "pending", "activeForm": "Showing summary"},
307
- {"content": "Enter plan mode and gather context", "status": "pending", "activeForm": "Gathering context"},
308
- {"content": "Analyze implementation approach", "status": "pending", "activeForm": "Analyzing approach"},
309
- {"content": "Present benefits and changes", "status": "pending", "activeForm": "Presenting analysis"},
346
+ {"content": "Assess file and display research summary", "status": "pending", "activeForm": "Showing summary"},
347
+ {"content": "Offer implementation ideation", "status": "pending", "activeForm": "Offering ideation"},
348
+ {"content": "Enter plan mode and select domain experts", "status": "pending", "activeForm": "Selecting experts"},
349
+ {"content": "Deploy 3-5 experts in parallel", "status": "pending", "activeForm": "Deploying experts"},
350
+ {"content": "Synthesize expert results with confidence scoring", "status": "pending", "activeForm": "Synthesizing results"},
351
+ {"content": "Present Implementation Ideation Report", "status": "pending", "activeForm": "Presenting report"},
310
352
  {"content": "Confirm interest in implementing", "status": "pending", "activeForm": "Confirming interest"},
311
353
  {"content": "Suggest and create artifact", "status": "pending", "activeForm": "Creating artifact"}
312
354
  ]</parameter>
@@ -396,7 +438,7 @@ Display a brief summary:
396
438
  "header": "Analyze",
397
439
  "multiSelect": false,
398
440
  "options": [
399
- {"label": "Yes - Enter plan mode and explore (Recommended)", "description": "I'll analyze your codebase and show benefits, implementation steps, and what would change"},
441
+ {"label": "Yes - Implementation ideation with multi-expert analysis (Recommended)", "description": "Deploy 3-5 domain experts to analyze from security, performance, testing, and architecture perspectives"},
400
442
  {"label": "Just view the full research", "description": "Display without analysis"},
401
443
  {"label": "Cancel", "description": "Exit"}
402
444
  ]
@@ -408,116 +450,234 @@ Display a brief summary:
408
450
  **If "Cancel"**: Exit.
409
451
  **If "Yes"**: Continue to Step 5.
410
452
 
411
- ### Step 5: Enter Plan Mode and Gather Context
453
+ ### Step 5: Enter Plan Mode and Select Experts
412
454
 
413
455
  ```xml
414
456
  <invoke name="EnterPlanMode"/>
415
457
  ```
416
458
 
417
- Gather project context:
459
+ Then immediately gather project context:
418
460
 
419
461
  ```bash
420
462
  node .agileflow/scripts/obtain-context.js babysit
421
463
  ```
422
464
 
423
- Also read key files to understand the project:
424
- - `CLAUDE.md` or `README.md` for project overview
425
- - Relevant source files based on research topic
426
- - Existing architecture/pattern files
465
+ **Auto-detect research type and select experts:**
466
+
467
+ Analyze the research TOPIC and CONTENT to determine research type, then select 3-5 experts:
427
468
 
428
- **Goal**: Understand:
429
- - Current project structure
430
- - Existing patterns that apply
431
- - Files that would be affected
432
- - Current tech stack
433
- - How research findings apply to THIS specific project
469
+ | Research Type | Detection Keywords | Experts |
470
+ |--------------|-------------------|---------|
471
+ | **Security/Compliance** | auth, oauth, jwt, encryption, vulnerability, compliance, csrf, xss | security, api, testing, compliance |
472
+ | **Performance** | cache, optimize, latency, throughput, benchmark, profiling | performance, database, api, monitoring |
473
+ | **Architecture/Framework** | migrate, upgrade, framework, refactor, redesign, architecture | api, database, performance, security |
474
+ | **UI/Frontend** | component, styling, accessibility, ux, design system, responsive | ui, api, testing, accessibility |
475
+ | **Database** | schema, migration, query, index, model, postgres, mongo | database, api, performance, datamigration |
476
+ | **Full-Stack (default)** | multiple domains or unclear | api, ui, database, testing, security |
434
477
 
435
- ### Step 6: Analyze and Present Implementation Plan
478
+ ---
436
479
 
437
- Based on the research content AND project context, prepare a detailed analysis:
480
+ ### Step 6: Deploy Experts in Parallel
438
481
 
439
- ```markdown
440
- ## Implementation Analysis for "[Research Topic]"
482
+ **CRITICAL**: Deploy ALL selected experts in a SINGLE message using the Task tool.
483
+
484
+ Each expert receives this prompt template:
485
+
486
+ ```
487
+ EXPERTISE FIRST: Read your expertise.yaml file if it exists at .agileflow/expertise/{domain}.yaml
488
+
489
+ RESEARCH TOPIC: {TOPIC}
490
+ RESEARCH SUMMARY: {2-3 paragraph summary from research file}
491
+ PROJECT CONTEXT: {from obtain-context.js output}
492
+
493
+ TASK: Analyze this research from your {DOMAIN} perspective:
494
+
495
+ 1. **Implementation Fit**: How well does this fit the current codebase?
496
+ - What patterns/files would need to change?
497
+ - Any conflicts with existing architecture?
498
+
499
+ 2. **Domain-Specific Considerations**: From your expertise:
500
+ - For SECURITY: What security implications? Risks? Compliance needs?
501
+ - For PERFORMANCE: What performance impacts? Bottlenecks? Optimization opportunities?
502
+ - For TESTING: What test coverage needed? Edge cases? Regression risks?
503
+ - For API: What API changes? Breaking changes? Versioning needs?
504
+ - For UI: What UX considerations? Accessibility? Design patterns?
505
+ - For DATABASE: What schema changes? Migration strategy? Query impact?
506
+
507
+ 3. **Implementation Approach**: Your recommended approach:
508
+ - Key files to modify (specific paths from codebase)
509
+ - Effort estimate (hours/days/weeks)
510
+ - Dependencies or prerequisites
511
+
512
+ 4. **Risks & Gotchas**: What could go wrong?
513
+ - Technical risks
514
+ - Migration complexity
515
+ - Team adoption concerns
516
+
517
+ FORMAT as structured markdown with specific file paths and evidence from codebase.
518
+ ```
519
+
520
+ **Deploy using Task tool (ALL in one message):**
521
+
522
+ ```xml
523
+ <invoke name="Task">
524
+ <parameter name="description">Security analysis of {TOPIC}</parameter>
525
+ <parameter name="prompt">{prompt with DOMAIN=security}</parameter>
526
+ <parameter name="subagent_type">agileflow-security</parameter>
527
+ <parameter name="run_in_background">true</parameter>
528
+ </invoke>
529
+
530
+ <invoke name="Task">
531
+ <parameter name="description">API analysis of {TOPIC}</parameter>
532
+ <parameter name="prompt">{prompt with DOMAIN=api}</parameter>
533
+ <parameter name="subagent_type">agileflow-api</parameter>
534
+ <parameter name="run_in_background">true</parameter>
535
+ </invoke>
536
+
537
+ <invoke name="Task">
538
+ <parameter name="description">Testing analysis of {TOPIC}</parameter>
539
+ <parameter name="prompt">{prompt with DOMAIN=testing}</parameter>
540
+ <parameter name="subagent_type">agileflow-testing</parameter>
541
+ <parameter name="run_in_background">true</parameter>
542
+ </invoke>
543
+
544
+ <!-- Continue for all selected experts -->
545
+ ```
441
546
 
442
- ### 🎯 Benefits of Implementing This Research
547
+ ---
548
+
549
+ ### Step 7: Collect Results and Synthesize
550
+
551
+ Collect all expert outputs:
552
+
553
+ ```xml
554
+ <invoke name="TaskOutput">
555
+ <parameter name="task_id">{security_task_id}</parameter>
556
+ <parameter name="block">true</parameter>
557
+ <parameter name="timeout">60000</parameter>
558
+ </invoke>
559
+
560
+ <!-- Repeat for each expert -->
561
+ ```
443
562
 
444
- **What you would gain:**
445
- - [Benefit 1 - specific to this project]
446
- - [Benefit 2 - quantifiable if possible]
447
- - [Benefit 3 - addresses current gaps/pain points]
563
+ **Synthesis Process:**
448
564
 
449
- **Problems this solves:**
450
- - [Current issue 1 this addresses]
451
- - [Current issue 2 this addresses]
565
+ 1. **Find Consensus**: Group similar recommendations across experts
566
+ - **HIGH CONFIDENCE**: 2+ experts recommend same approach/files
567
+ - **MEDIUM CONFIDENCE**: 1 expert with specific evidence
452
568
 
453
- **Why now?**
454
- - [Reason this is relevant to current project state]
569
+ 2. **Aggregate Effort Estimates**: Average across experts, note range
570
+
571
+ 3. **Collect All Risks**: Union of risks from all experts, prioritize by frequency
572
+
573
+ 4. **Validate Artifact Recommendation** via expert consensus:
574
+ - If experts mention "decision", "tradeoffs", "alternatives" → **ADR**
575
+ - If experts identify 5+ files across multiple domains → **Epic + Stories**
576
+ - If experts agree on single focus area, 1-3 files → **Story**
577
+ - If experts focus on guidelines, patterns → **Practice doc**
455
578
 
456
579
  ---
457
580
 
458
- ### 🔧 How It Would Be Implemented
581
+ ### Step 8: Present Implementation Ideation Report
459
582
 
460
- **Files to modify:**
461
- | File | Change | Effort |
462
- |------|--------|--------|
463
- | `path/to/file1.ts` | [What changes] | Low |
464
- | `path/to/file2.ts` | [What changes] | Medium |
583
+ Present the synthesized analysis:
465
584
 
466
- **New files to create:**
467
- - `path/to/new/file.ts` - [Purpose]
585
+ ```markdown
586
+ ## 🧠 Implementation Ideation Report
468
587
 
469
- **Implementation steps:**
470
- 1. [Step 1 - specific action]
471
- 2. [Step 2 - specific action]
472
- 3. [Step 3 - specific action]
588
+ **Research**: {TOPIC}
589
+ **Experts Consulted**: {list of 3-5 experts with badges}
590
+ **Consensus Level**: {High/Medium/Low based on agreement}
473
591
 
474
592
  ---
475
593
 
476
- ### 🔄 What Would Change
594
+ ### 🎯 High-Confidence Implementation Steps
595
+ *Agreed by 2+ experts*
596
+
597
+ 1. **{Step title}**
598
+ - Experts: 🔒 security, 🧪 testing
599
+ - Files: `path/to/file1.ts`, `path/to/file2.ts`
600
+ - Effort: {averaged estimate}
601
+ - Approach: {consensus approach}
602
+
603
+ 2. **{Step title}**
604
+ - Experts: ⚡ api, 🗄️ database
605
+ - Files: `path/to/file3.ts`
606
+ - Effort: {averaged estimate}
607
+ - Approach: {consensus approach}
608
+
609
+ ---
477
610
 
478
- **Behavior changes:**
479
- - [User-facing change 1]
480
- - [Developer experience change]
611
+ ### 💡 Domain-Specific Considerations
481
612
 
482
- **Architecture impact:**
483
- - [How this affects current architecture]
484
- - [New patterns introduced]
613
+ **🔒 Security** (security expert):
614
+ - {key consideration 1}
615
+ - {risk flagged}
616
+ - Mitigation: {recommended approach}
485
617
 
486
- **Dependencies:**
487
- - [New packages needed, if any]
488
- - [Internal dependencies affected]
618
+ **⚡ Performance** (performance expert):
619
+ - {optimization opportunity}
620
+ - {bottleneck identified}
621
+
622
+ **🧪 Testing** (testing expert):
623
+ - {coverage requirements}
624
+ - {edge cases to handle}
625
+ - {regression risk assessment}
626
+
627
+ **🔧 API** (api expert):
628
+ - {API changes needed}
629
+ - {versioning considerations}
489
630
 
490
631
  ---
491
632
 
492
- ### ⚠️ Risks & Considerations
633
+ ### ⚠️ Risks & Gotchas
634
+ *Flagged by experts*
493
635
 
494
- - [Risk 1 - migration complexity, breaking changes, etc.]
495
- - [Risk 2 - learning curve, team adoption]
496
- - [Mitigation strategy for each]
636
+ | Risk | Expert(s) | Severity | Mitigation |
637
+ |------|-----------|----------|------------|
638
+ | {risk 1} | 🔒 security | High | {mitigation} |
639
+ | {risk 2} | ⚡ performance | Medium | {mitigation} |
640
+ | {risk 3} | 🧪 testing | Low | {mitigation} |
497
641
 
498
642
  ---
499
643
 
500
- ### ⏱️ Effort Estimate
644
+ ### 📊 Effort Estimate Summary
645
+
646
+ | Expert | Estimate | Notes |
647
+ |--------|----------|-------|
648
+ | security | {estimate} | {notes} |
649
+ | api | {estimate} | {notes} |
650
+ | testing | {estimate} | {notes} |
651
+ | **Consensus** | **{averaged}** | {range: min-max} |
652
+
653
+ ---
654
+
655
+ ### 📋 Recommended Artifact
656
+
657
+ Based on expert consensus: **{ADR/Epic/Story/Practice}**
501
658
 
502
- **Scope**: [Small/Medium/Large]
503
- **Suggested approach**: [Epic with stories / Single story / Quick fix]
504
- **Estimated effort**: [Low/Medium/High]
659
+ **Reason**: {why this artifact type based on scope and expert recommendations}
660
+
661
+ **Evidence**:
662
+ - {expert 1} recommended: {artifact type}
663
+ - {expert 2} recommended: {artifact type}
664
+ - Scope assessment: {small/medium/large}
505
665
  ```
506
666
 
507
- Present this analysis to the user.
667
+ ---
508
668
 
509
- ### Step 7: Confirm Interest in Implementing
669
+ ### Step 9: Confirm Interest in Implementing
510
670
 
511
671
  ```xml
512
672
  <invoke name="AskUserQuestion">
513
673
  <parameter name="questions">[{
514
- "question": "Based on this analysis, would you like to proceed with implementation?",
674
+ "question": "Based on this multi-expert analysis, would you like to proceed with implementation?",
515
675
  "header": "Proceed?",
516
676
  "multiSelect": false,
517
677
  "options": [
518
- {"label": "Yes - Create implementation artifacts", "description": "I'll suggest the best artifact type based on scope"},
678
+ {"label": "Yes - Create implementation artifacts", "description": "I'll create the recommended artifact based on expert consensus"},
519
679
  {"label": "Modify approach first", "description": "Let's adjust the plan before creating artifacts"},
520
- {"label": "Save analysis to research file", "description": "Append this analysis to the research note for later"},
680
+ {"label": "Save analysis to research file", "description": "Append Implementation Ideation Report to the research note for later"},
521
681
  {"label": "Cancel", "description": "Exit plan mode, no changes"}
522
682
  ]
523
683
  }]</parameter>
@@ -525,32 +685,24 @@ Present this analysis to the user.
525
685
  ```
526
686
 
527
687
  **If "Modify approach"**: Discuss changes, update analysis, re-ask.
528
- **If "Save analysis"**: Append the analysis section to the research file, exit plan mode.
688
+ **If "Save analysis"**: Append the Implementation Ideation Report to the research file, exit plan mode.
529
689
  **If "Cancel"**: Exit plan mode, done.
530
- **If "Yes"**: Continue to Step 8.
690
+ **If "Yes"**: Continue to Step 10.
531
691
 
532
- ### Step 8: Intelligently Suggest Artifact Type
533
-
534
- Based on the research content and analysis, determine the BEST artifact to create:
692
+ ---
535
693
 
536
- | Research Type | Suggested Artifact | Indicators |
537
- |---------------|-------------------|------------|
538
- | Architecture/technology decision | **ADR** | "Should we use X or Y?", trade-offs, alternatives |
539
- | Large feature with multiple parts | **Epic + Stories** | 5+ implementation steps, multiple domains |
540
- | Single focused improvement | **Story** | Clear scope, 1-3 files, can be done in one session |
541
- | Best practices/patterns | **Practice doc** | "How to do X", guidelines, not feature work |
542
- | Code quality improvement | **Tech debt item** | Refactoring, cleanup, no user-facing change |
694
+ ### Step 10: Intelligently Suggest Artifact Type
543
695
 
544
- Present the recommendation:
696
+ Based on expert consensus, present the recommendation:
545
697
 
546
698
  ```xml
547
699
  <invoke name="AskUserQuestion">
548
700
  <parameter name="questions">[{
549
- "question": "Based on the scope, I recommend creating: [ARTIFACT TYPE]. What would you like to do?",
701
+ "question": "Based on expert consensus, I recommend creating: [ARTIFACT TYPE]. What would you like to do?",
550
702
  "header": "Create",
551
703
  "multiSelect": false,
552
704
  "options": [
553
- {"label": "[Recommended artifact] (Recommended)", "description": "[Why this is the right choice]"},
705
+ {"label": "[Recommended artifact] (Recommended)", "description": "[Why experts agreed on this choice]"},
554
706
  {"label": "Create ADR instead", "description": "Document this as an architecture decision"},
555
707
  {"label": "Create Epic + Stories instead", "description": "Break down into trackable work items"},
556
708
  {"label": "Create single Story instead", "description": "Track as a single work item"},
@@ -560,36 +712,48 @@ Present the recommendation:
560
712
  </invoke>
561
713
  ```
562
714
 
563
- ### Step 9: Create Selected Artifact
715
+ ---
716
+
717
+ ### Step 11: Create Selected Artifact
564
718
 
565
719
  **If ADR selected**:
566
720
  - Use `/agileflow:adr` command format
567
721
  - Reference the research file
568
- - Include key decisions from analysis
722
+ - Include key decisions from expert analysis
723
+ - Document trade-offs identified by experts
569
724
 
570
725
  **If Epic + Stories selected**:
571
726
  - Create epic in status.json
572
- - Generate stories based on implementation steps
727
+ - Generate stories based on high-confidence implementation steps
728
+ - Include expert-identified risks as acceptance criteria
573
729
  - Reference research in epic
574
730
 
575
731
  **If Story selected**:
576
732
  - Create single story with ACs from implementation steps
733
+ - Include testing requirements from testing expert
577
734
  - Reference research
578
735
 
579
736
  **If Practice doc selected**:
580
737
  - Create doc in `docs/02-practices/`
581
738
  - Format as guidelines/best practices
739
+ - Include expert-recommended patterns
582
740
 
583
741
  After creation, exit plan mode and confirm:
584
742
 
585
743
  ```
586
744
  ✅ Created [ARTIFACT] from research "[TOPIC]"
587
745
 
746
+ **Multi-Expert Analysis Summary:**
747
+ - Experts consulted: {list}
748
+ - Consensus level: {High/Medium/Low}
749
+ - Key insights preserved: {count}
750
+
751
+ **Artifacts:**
588
752
  - Research: docs/10-research/[filename]
589
- - Analysis: [appended to research file / separate]
753
+ - Implementation Ideation Report: [appended to research file]
590
754
  - [Artifact]: [path or ID]
591
755
 
592
- The implementation plan is now tracked and ready to execute.
756
+ The implementation plan is now tracked and ready to execute with expert-validated guidance.
593
757
  ```
594
758
 
595
759
  ---