agileflow 3.4.0 → 3.4.2

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 (115) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +4 -4
  3. package/package.json +1 -1
  4. package/scripts/agileflow-welcome.js +79 -0
  5. package/scripts/claude-tmux.sh +12 -36
  6. package/scripts/lib/ac-test-matcher.js +452 -0
  7. package/scripts/lib/audit-registry.js +94 -2
  8. package/scripts/lib/configure-features.js +35 -0
  9. package/scripts/lib/model-profiles.js +25 -5
  10. package/scripts/lib/quality-gates.js +163 -0
  11. package/scripts/lib/signal-detectors.js +43 -0
  12. package/scripts/lib/status-writer.js +255 -0
  13. package/scripts/lib/story-claiming.js +128 -45
  14. package/scripts/lib/task-sync.js +32 -38
  15. package/scripts/lib/tmux-audit-monitor.js +611 -0
  16. package/scripts/lib/tmux-group-colors.js +2 -2
  17. package/scripts/lib/tool-registry.yaml +241 -0
  18. package/scripts/lib/tool-shed.js +441 -0
  19. package/scripts/native-team-observer.js +219 -0
  20. package/scripts/obtain-context.js +14 -0
  21. package/scripts/ralph-loop.js +30 -5
  22. package/scripts/smart-detect.js +21 -0
  23. package/scripts/spawn-audit-sessions.js +373 -45
  24. package/scripts/team-manager.js +19 -0
  25. package/src/core/agents/a11y-analyzer-aria.md +155 -0
  26. package/src/core/agents/a11y-analyzer-forms.md +162 -0
  27. package/src/core/agents/a11y-analyzer-keyboard.md +175 -0
  28. package/src/core/agents/a11y-analyzer-semantic.md +153 -0
  29. package/src/core/agents/a11y-analyzer-visual.md +158 -0
  30. package/src/core/agents/a11y-consensus.md +248 -0
  31. package/src/core/agents/ads-consensus.md +74 -0
  32. package/src/core/agents/ads-generate.md +145 -0
  33. package/src/core/agents/ads-performance-tracker.md +197 -0
  34. package/src/core/agents/api-quality-analyzer-conventions.md +148 -0
  35. package/src/core/agents/api-quality-analyzer-docs.md +176 -0
  36. package/src/core/agents/api-quality-analyzer-errors.md +183 -0
  37. package/src/core/agents/api-quality-analyzer-pagination.md +171 -0
  38. package/src/core/agents/api-quality-analyzer-versioning.md +143 -0
  39. package/src/core/agents/api-quality-consensus.md +214 -0
  40. package/src/core/agents/arch-analyzer-circular.md +148 -0
  41. package/src/core/agents/arch-analyzer-complexity.md +171 -0
  42. package/src/core/agents/arch-analyzer-coupling.md +146 -0
  43. package/src/core/agents/arch-analyzer-layering.md +151 -0
  44. package/src/core/agents/arch-analyzer-patterns.md +162 -0
  45. package/src/core/agents/arch-consensus.md +227 -0
  46. package/src/core/commands/adr.md +1 -0
  47. package/src/core/commands/ads/audit.md +67 -5
  48. package/src/core/commands/ads/generate.md +238 -0
  49. package/src/core/commands/ads/health.md +327 -0
  50. package/src/core/commands/ads/test-plan.md +317 -0
  51. package/src/core/commands/ads/track.md +288 -0
  52. package/src/core/commands/ads.md +28 -16
  53. package/src/core/commands/assign.md +1 -0
  54. package/src/core/commands/audit.md +43 -6
  55. package/src/core/commands/babysit.md +90 -6
  56. package/src/core/commands/baseline.md +1 -0
  57. package/src/core/commands/blockers.md +1 -0
  58. package/src/core/commands/board.md +1 -0
  59. package/src/core/commands/changelog.md +1 -0
  60. package/src/core/commands/choose.md +1 -0
  61. package/src/core/commands/ci.md +1 -0
  62. package/src/core/commands/code/accessibility.md +347 -0
  63. package/src/core/commands/code/api.md +297 -0
  64. package/src/core/commands/code/architecture.md +297 -0
  65. package/src/core/commands/code/completeness.md +43 -6
  66. package/src/core/commands/code/legal.md +43 -6
  67. package/src/core/commands/code/logic.md +43 -6
  68. package/src/core/commands/code/performance.md +43 -6
  69. package/src/core/commands/code/security.md +43 -6
  70. package/src/core/commands/code/test.md +43 -6
  71. package/src/core/commands/configure.md +1 -0
  72. package/src/core/commands/council.md +1 -0
  73. package/src/core/commands/deploy.md +1 -0
  74. package/src/core/commands/diagnose.md +1 -0
  75. package/src/core/commands/docs.md +1 -0
  76. package/src/core/commands/epic/edit.md +213 -0
  77. package/src/core/commands/epic.md +1 -0
  78. package/src/core/commands/export.md +238 -0
  79. package/src/core/commands/help.md +16 -1
  80. package/src/core/commands/ideate/discover.md +7 -3
  81. package/src/core/commands/ideate/features.md +65 -4
  82. package/src/core/commands/ideate/new.md +158 -124
  83. package/src/core/commands/impact.md +1 -0
  84. package/src/core/commands/learn/explain.md +118 -0
  85. package/src/core/commands/learn/glossary.md +135 -0
  86. package/src/core/commands/learn/patterns.md +138 -0
  87. package/src/core/commands/learn/tour.md +126 -0
  88. package/src/core/commands/migrate/codemods.md +151 -0
  89. package/src/core/commands/migrate/plan.md +131 -0
  90. package/src/core/commands/migrate/scan.md +114 -0
  91. package/src/core/commands/migrate/validate.md +119 -0
  92. package/src/core/commands/multi-expert.md +1 -0
  93. package/src/core/commands/pr.md +1 -0
  94. package/src/core/commands/review.md +1 -0
  95. package/src/core/commands/seo/audit.md +61 -6
  96. package/src/core/commands/sprint.md +1 -0
  97. package/src/core/commands/status/undo.md +191 -0
  98. package/src/core/commands/status.md +1 -0
  99. package/src/core/commands/story/edit.md +204 -0
  100. package/src/core/commands/story/view.md +29 -7
  101. package/src/core/commands/story-validate.md +1 -0
  102. package/src/core/commands/story.md +1 -0
  103. package/src/core/commands/tdd.md +1 -0
  104. package/src/core/commands/team/start.md +10 -6
  105. package/src/core/commands/tests.md +1 -0
  106. package/src/core/commands/verify.md +27 -1
  107. package/src/core/commands/workflow.md +2 -0
  108. package/src/core/teams/backend.json +41 -0
  109. package/src/core/teams/frontend.json +41 -0
  110. package/src/core/teams/qa.json +41 -0
  111. package/src/core/teams/solo.json +35 -0
  112. package/src/core/templates/agileflow-metadata.json +5 -0
  113. package/tools/cli/commands/setup.js +85 -3
  114. package/tools/cli/commands/update.js +42 -0
  115. package/tools/cli/installers/ide/claude-code.js +68 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Multi-agent test quality analysis with consensus voting for finding test suite weaknesses
3
- argument-hint: "[file|directory] [DEPTH=quick|deep|ultradeep] [FOCUS=coverage|fragility|mocking|assertions|structure|integration|maintenance|patterns|all] [MODEL=haiku|sonnet|opus]"
3
+ argument-hint: "[file|directory] [DEPTH=quick|deep|ultradeep|extreme] [FOCUS=coverage|fragility|mocking|assertions|structure|integration|maintenance|patterns|all] [MODEL=haiku|sonnet|opus]"
4
4
  compact_context:
5
5
  priority: high
6
6
  preserve_rules:
@@ -111,12 +111,49 @@ FOCUS = all (default) or comma-separated list
111
111
  - `ultradeep`: Spawn each analyzer as a separate Claude Code session in tmux. Requires tmux. Uses model profiles from metadata. Falls back to `deep` if tmux unavailable.
112
112
 
113
113
  **ULTRADEEP mode** (DEPTH=ultradeep):
114
- 1. Show cost estimate: `node .agileflow/scripts/spawn-audit-sessions.js --audit=test --target=TARGET --focus=FOCUS --model=MODEL --dry-run`
114
+ 1. Show cost estimate:
115
+ ```bash
116
+ node .agileflow/scripts/spawn-audit-sessions.js --audit=test --target=TARGET --focus=FOCUS --model=MODEL --dry-run
117
+ ```
115
118
  2. Confirm with user before launching
116
- 3. Spawn sessions: `node .agileflow/scripts/spawn-audit-sessions.js --audit=test --target=TARGET --focus=FOCUS --model=MODEL`
117
- 4. Monitor sentinel files in `docs/09-agents/ultradeep/{trace_id}/` for completion
118
- 5. Collect all findings and run consensus coordinator (same as deep mode)
119
- 6. If tmux unavailable, fall back to `DEPTH=deep` with warning
119
+ 3. Spawn sessions (use `--json` to capture trace ID):
120
+ ```bash
121
+ node .agileflow/scripts/spawn-audit-sessions.js --audit=test --target=TARGET --focus=FOCUS --model=MODEL --json
122
+ ```
123
+ Parse the JSON output to get `traceId`. Example: `{"ok":true,"traceId":"abc123ef",...}`
124
+ 4. Wait for all analyzers to complete:
125
+ ```bash
126
+ node .agileflow/scripts/lib/tmux-audit-monitor.js wait TRACE_ID --timeout=1800
127
+ ```
128
+ - Exit 0 = all complete (JSON results on stdout)
129
+ - Exit 1 = timeout (partial results on stdout, `missing` array shows what's left)
130
+ - To check progress without blocking: `node .agileflow/scripts/lib/tmux-audit-monitor.js status TRACE_ID`
131
+ - To retry stalled analyzers: `node .agileflow/scripts/lib/tmux-audit-monitor.js retry TRACE_ID`
132
+ 5. Parse `results` array from the JSON output. Pass all findings to consensus coordinator (same as deep mode).
133
+ 6. If tmux unavailable (spawn exits code 2), fall back to `DEPTH=deep` with warning
134
+
135
+ **EXTREME mode** (DEPTH=extreme):
136
+ Partition-based multi-agent audit. Instead of 1 analyzer per tmux window, the codebase is split into partitions and each partition runs ALL analyzers.
137
+ 1. Scan the target directory to understand the codebase structure:
138
+ - Use Glob to find top-level source directories
139
+ - Group related directories into 3-7 logical partitions (coherent domains: auth, api, ui, etc.)
140
+ - If user provided PARTITIONS=N (a number), split into exactly N partitions
141
+ - If user provided PARTITIONS=dir1,dir2,dir3, use those exact directories
142
+ 2. Show the partition plan and agent count to the user, confirm before launching:
143
+ Example: "5 partitions x 8 analyzers = 40 agents. Estimated cost: $X. Proceed?"
144
+ 3. Spawn sessions with partitions:
145
+ ```bash
146
+ node .agileflow/scripts/spawn-audit-sessions.js --audit=test --target=TARGET --depth=extreme --partitions=dir1,dir2,dir3 --model=MODEL --json
147
+ ```
148
+ 4. Wait and collect results (same as ultradeep - use tmux-audit-monitor.js)
149
+ 5. Run consensus on combined results from all partitions
150
+
151
+ **PARTITIONS argument** (only used with DEPTH=extreme):
152
+ | Value | Behavior |
153
+ |-------|----------|
154
+ | Not set | AI decides partitions (3-7 based on codebase size) |
155
+ | `PARTITIONS=5` | AI creates exactly 5 partitions |
156
+ | `PARTITIONS=src/auth,src/api,lib` | Use these exact directories |
120
157
 
121
158
  ### STEP 2: Deploy Analyzers in Parallel
122
159
 
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Configure AgileFlow features, hooks, and project infrastructure (Visual E2E, CI, git)
3
+ phase: pre-story
3
4
  argument-hint: "[--profile=<name>] [--save-profile=<name>] [--list-profiles] [--export-profile=<name>] [--import-profile=<file>] [--enable/--disable=features]"
4
5
  compact_context:
5
6
  priority: critical
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Convene AI Council for strategic decisions with three perspectives (Optimist, Advocate, Analyst)
3
+ phase: planning
3
4
  argument-hint: "<question> [--mode parallel|debate] [--rounds N]"
4
5
  compact_context:
5
6
  priority: high
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Set up automated deployment pipeline
3
+ phase: implementation
3
4
  argument-hint: "(no arguments)"
4
5
  compact_context:
5
6
  priority: high
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: System health diagnostics
3
+ phase: post-impl
3
4
  argument-hint: "(no arguments)"
4
5
  compact_context:
5
6
  priority: high
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Synchronize documentation with code changes
3
+ phase: post-impl
3
4
  argument-hint: "[BRANCH=<name>] [BASE=<branch>] [AUTO_CREATE=true|false]"
4
5
  compact_context:
5
6
  priority: high
@@ -0,0 +1,213 @@
1
+ ---
2
+ description: Edit an existing epic's fields (title, owner, goal, status)
3
+ argument-hint: "EPIC=<EP-ID> [TITLE=<text>] [OWNER=<id>] [GOAL=<text>] [STATUS=<status>]"
4
+ compact_context:
5
+ priority: high
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:epic:edit - Edit epic fields with diff-preview-confirm"
8
+ - "{{RULES:json_operations}}"
9
+ - "{{RULES:user_confirmation}}"
10
+ - "{{RULES:file_preview}}"
11
+ - "MUST read current epic from status.json BEFORE proposing changes"
12
+ - "MUST show diff of old vs new values"
13
+ - "MUST confirm with AskUserQuestion before writing"
14
+ - "MUST log edit event to bus/log.jsonl"
15
+ - "MUST update epic file in docs/05-epics/ if it exists"
16
+ state_fields:
17
+ - epic_id
18
+ - fields_changed
19
+ ---
20
+
21
+ # /agileflow:epic:edit
22
+
23
+ Edit an existing epic's metadata fields with diff preview and confirmation.
24
+
25
+ ---
26
+
27
+ ## STEP 0: Gather Context
28
+
29
+ ```bash
30
+ node .agileflow/scripts/obtain-context.js epic:edit
31
+ ```
32
+
33
+ ---
34
+
35
+ <!-- COMPACT_SUMMARY_START -->
36
+ ## Compact Summary
37
+
38
+ **Command**: `/agileflow:epic:edit EPIC=<EP-ID> [TITLE=...] [OWNER=...] [GOAL=...] [STATUS=...]`
39
+ **Purpose**: Edit epic fields in status.json with diff-preview-confirm workflow
40
+
41
+ ### Flow
42
+ 1. Parse EPIC parameter (required) and optional field overrides
43
+ 2. Read current epic from status.json
44
+ 3. Show diff of proposed changes
45
+ 4. Confirm via AskUserQuestion
46
+ 5. Apply changes to status.json
47
+ 6. Update epic file in docs/05-epics/ if it exists
48
+ 7. Log edit event to bus/log.jsonl
49
+
50
+ ### Critical Rules
51
+ - **Diff preview**: Always show old vs new before writing
52
+ - **Confirmation**: Never write without user approval
53
+ - **Bus logging**: Always append epic-edited event
54
+ - **Epic file sync**: Update markdown file if it exists
55
+ - **Validation**: Verify JSON integrity after write
56
+ <!-- COMPACT_SUMMARY_END -->
57
+
58
+ ---
59
+
60
+ ## Arguments
61
+
62
+ | Argument | Required | Description |
63
+ |----------|----------|-------------|
64
+ | EPIC | Yes | Epic ID (e.g., EP-0041) |
65
+ | TITLE | No | New epic title |
66
+ | OWNER | No | New owner (e.g., AG-DEVOPS, AG-API) |
67
+ | GOAL | No | New epic goal description |
68
+ | STATUS | No | New status (ready, active, complete, on-hold) |
69
+
70
+ At least one optional field must be provided (otherwise suggest `/agileflow:epic:view`).
71
+
72
+ ---
73
+
74
+ ## IMMEDIATE ACTIONS
75
+
76
+ ### Step 1: Validate Input
77
+
78
+ If EPIC not provided:
79
+
80
+ ```xml
81
+ <invoke name="AskUserQuestion">
82
+ <parameter name="questions">[{
83
+ "question": "Which epic would you like to edit?",
84
+ "header": "Select",
85
+ "multiSelect": false,
86
+ "options": [
87
+ {"label": "Enter epic ID", "description": "Provide an EP-XXXX identifier"}
88
+ ]
89
+ }]</parameter>
90
+ </invoke>
91
+ ```
92
+
93
+ ### Step 2: Read Current Epic
94
+
95
+ Read the epic entry from `docs/09-agents/status.json`:
96
+
97
+ ```javascript
98
+ const data = JSON.parse(fs.readFileSync('docs/09-agents/status.json', 'utf8'));
99
+ const epic = data.epics[epicId];
100
+ ```
101
+
102
+ If epic not found, show error: "Epic {EPIC} not found in status.json"
103
+
104
+ ### Step 3: Build Change Set
105
+
106
+ Compare provided fields against current values. Skip fields that match current values (no-op).
107
+
108
+ If no fields would change, inform user: "No changes detected. Current values match provided values."
109
+
110
+ ### Step 4: Show Diff Preview
111
+
112
+ Display a clear diff of what will change:
113
+
114
+ ```markdown
115
+ ## Editing EP-0041: Current Title
116
+
117
+ | Field | Current | New |
118
+ |-------|---------|-----|
119
+ | title | "DX Quick Wins" | "DX Quick Wins - March 2026" |
120
+ | owner | AG-DEVOPS | AG-API |
121
+ | status | ready | active |
122
+
123
+ Files modified:
124
+ 1. docs/09-agents/status.json (epic entry update)
125
+ 2. docs/05-epics/EP-0041-*.md (if exists, update frontmatter)
126
+ 3. docs/09-agents/bus/log.jsonl (edit event append)
127
+ ```
128
+
129
+ ### Step 5: Confirm Changes
130
+
131
+ ```xml
132
+ <invoke name="AskUserQuestion">
133
+ <parameter name="questions">[{
134
+ "question": "Apply these changes to EP-0041?",
135
+ "header": "Confirm edit",
136
+ "multiSelect": false,
137
+ "options": [
138
+ {"label": "Yes, apply changes (Recommended)", "description": "Update status.json and log edit event"},
139
+ {"label": "No, cancel", "description": "Discard changes"}
140
+ ]
141
+ }]</parameter>
142
+ </invoke>
143
+ ```
144
+
145
+ ### Step 6: Apply Changes
146
+
147
+ On confirmation:
148
+
149
+ 1. **Update status.json** using Edit tool or jq:
150
+ - Update only the changed fields in the epic entry
151
+ - Set `updated` timestamp to current ISO date
152
+
153
+ 2. **Update epic file** (if exists in `docs/05-epics/`):
154
+ - Find matching file: `docs/05-epics/EP-XXXX-*.md`
155
+ - Update title in heading and frontmatter
156
+ - Update owner, status, goal fields
157
+
158
+ 3. **Validate JSON**:
159
+ ```bash
160
+ node -e "JSON.parse(require('fs').readFileSync('docs/09-agents/status.json','utf8')); console.log('valid')"
161
+ ```
162
+
163
+ 4. **Append to bus/log.jsonl**:
164
+ ```json
165
+ {"ts":"<ISO>","type":"epic-edited","from":"USER","epic":"<EPIC>","changes":{"field":"old_value->new_value"},"text":"Epic edited: <changed fields>"}
166
+ ```
167
+
168
+ ### Step 7: Confirm Success
169
+
170
+ ```
171
+ Epic EP-0041 updated:
172
+ title: "DX Quick Wins" -> "DX Quick Wins - March 2026"
173
+ status: ready -> active
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Example Usage
179
+
180
+ ```bash
181
+ # Edit title
182
+ /agileflow:epic:edit EPIC=EP-0041 TITLE="Updated Title"
183
+
184
+ # Change owner and status
185
+ /agileflow:epic:edit EPIC=EP-0041 OWNER=AG-API STATUS=active
186
+
187
+ # Update goal
188
+ /agileflow:epic:edit EPIC=EP-0041 GOAL="New goal description for this epic"
189
+
190
+ # Multiple fields at once
191
+ /agileflow:epic:edit EPIC=EP-0041 TITLE="New Title" OWNER=AG-UI STATUS=active
192
+ ```
193
+
194
+ ---
195
+
196
+ ## Rules
197
+
198
+ - **Always preview**: Show diff before applying
199
+ - **Always confirm**: Use AskUserQuestion before writes
200
+ - **Always log**: Append edit event to bus/log.jsonl
201
+ - **Always validate**: Check JSON integrity after write
202
+ - **Sync epic file**: Update docs/05-epics/ markdown if it exists
203
+ - **No silent changes**: Every change must be visible to the user
204
+
205
+ ---
206
+
207
+ ## Related Commands
208
+
209
+ - `/agileflow:epic:view` - View epic details
210
+ - `/agileflow:epic:list` - List all epics
211
+ - `/agileflow:epic` - Create new epic
212
+ - `/agileflow:story:edit` - Edit story fields
213
+ - `/agileflow:status` - Quick status update
@@ -1,5 +1,6 @@
1
1
  ---
2
2
  description: Create a new epic with stories
3
+ phase: pre-story
3
4
  argument-hint: "EPIC=<EP-ID> TITLE=<text> OWNER=<id> GOAL=<text> [STORIES=<list>] [RESEARCH=<file>]"
4
5
  compact_context:
5
6
  priority: high
@@ -0,0 +1,238 @@
1
+ ---
2
+ description: Export stories and epics to CSV, JSON, or Markdown for stakeholder reporting
3
+ argument-hint: "FORMAT=csv|json|md [EPIC=<EP-ID>] [STATUS=<status>] [OWNER=<id>]"
4
+ compact_context:
5
+ priority: medium
6
+ preserve_rules:
7
+ - "ACTIVE COMMAND: /agileflow:export - Export stories/epics to CSV/JSON/Markdown"
8
+ - "{{RULES:json_operations}}"
9
+ - "MUST read status.json as data source"
10
+ - "MUST support FORMAT=csv|json|md (default: csv)"
11
+ - "MUST support optional filters: EPIC, STATUS, OWNER"
12
+ - "MUST save output to docs/08-project/exports/"
13
+ state_fields:
14
+ - format
15
+ - filter_epic
16
+ - filter_status
17
+ - filter_owner
18
+ - output_path
19
+ ---
20
+
21
+ # /agileflow:export
22
+
23
+ Export stories and epics from status.json to CSV, JSON, or Markdown for stakeholder reporting.
24
+
25
+ ---
26
+
27
+ ## STEP 0: Gather Context
28
+
29
+ ```bash
30
+ node .agileflow/scripts/obtain-context.js export
31
+ ```
32
+
33
+ ---
34
+
35
+ <!-- COMPACT_SUMMARY_START -->
36
+ ## Compact Summary
37
+
38
+ **Command**: `/agileflow:export FORMAT=csv|json|md [EPIC=...] [STATUS=...] [OWNER=...]`
39
+ **Purpose**: Export filtered stories to CSV, JSON, or Markdown files
40
+
41
+ ### Flow
42
+ 1. Parse FORMAT and optional filters
43
+ 2. Read status.json
44
+ 3. Apply filters (epic, status, owner)
45
+ 4. Generate output in requested format
46
+ 5. Save to docs/08-project/exports/export-YYYYMMDD.{csv|json|md}
47
+ 6. Show summary and file path
48
+
49
+ ### Critical Rules
50
+ - **Default format**: CSV if not specified
51
+ - **CSV must be Excel-compatible**: Proper quoting, comma-separated
52
+ - **JSON mirrors status.json**: Filtered subset of stories structure
53
+ - **Markdown generates table**: Paste-ready for docs/reports
54
+ - **Always show count**: "Exported N stories to <path>"
55
+ <!-- COMPACT_SUMMARY_END -->
56
+
57
+ ---
58
+
59
+ ## Arguments
60
+
61
+ | Argument | Required | Default | Description |
62
+ |----------|----------|---------|-------------|
63
+ | FORMAT | No | csv | Output format: `csv`, `json`, or `md` |
64
+ | EPIC | No | all | Filter by epic ID (e.g., EP-0041) |
65
+ | STATUS | No | all | Filter by status: ready, in_progress, blocked, done, completed |
66
+ | OWNER | No | all | Filter by owner (e.g., AG-API, AG-UI) |
67
+
68
+ Multiple filters can be combined. All are AND-joined (stories must match all filters).
69
+
70
+ ---
71
+
72
+ ## IMMEDIATE ACTIONS
73
+
74
+ ### Step 1: Parse Arguments
75
+
76
+ ```
77
+ FORMAT = argument or "csv" (default)
78
+ EPIC = optional epic filter
79
+ STATUS = optional status filter
80
+ OWNER = optional owner filter
81
+ ```
82
+
83
+ Validate FORMAT is one of: csv, json, md. If invalid, show error and suggest valid values.
84
+
85
+ ### Step 2: Read and Filter Data
86
+
87
+ Read `docs/09-agents/status.json` and filter stories:
88
+
89
+ ```javascript
90
+ const data = JSON.parse(fs.readFileSync('docs/09-agents/status.json', 'utf8'));
91
+ let stories = Object.entries(data.stories).map(([id, s]) => ({ id, ...s }));
92
+
93
+ // Apply filters
94
+ if (EPIC) stories = stories.filter(s => s.epic === EPIC);
95
+ if (STATUS) stories = stories.filter(s => s.status === STATUS);
96
+ if (OWNER) stories = stories.filter(s => s.owner === OWNER);
97
+ ```
98
+
99
+ If no stories match, inform user: "No stories match the given filters."
100
+
101
+ ### Step 3: Generate Output
102
+
103
+ #### CSV Format
104
+
105
+ Columns: ID, Title, Epic, Status, Owner, Priority, Estimate
106
+
107
+ ```csv
108
+ ID,Title,Epic,Status,Owner,Priority,Estimate
109
+ US-0380,"Add story:edit and epic:edit commands",EP-0041,done,AG-API,high,3h
110
+ US-0381,"Add status:undo command for story status rollback",EP-0041,done,AG-API,high,2h
111
+ ```
112
+
113
+ Rules:
114
+ - First row is header
115
+ - Quote fields containing commas or quotes
116
+ - Escape quotes by doubling them
117
+ - Use UTF-8 encoding
118
+
119
+ #### JSON Format
120
+
121
+ ```json
122
+ {
123
+ "exported_at": "2026-03-03T12:00:00Z",
124
+ "filters": { "epic": "EP-0041", "status": null, "owner": null },
125
+ "count": 8,
126
+ "stories": [
127
+ {
128
+ "id": "US-0380",
129
+ "title": "Add story:edit and epic:edit commands",
130
+ "epic": "EP-0041",
131
+ "status": "done",
132
+ "owner": "AG-API",
133
+ "priority": "high",
134
+ "estimate": "3h"
135
+ }
136
+ ]
137
+ }
138
+ ```
139
+
140
+ #### Markdown Format
141
+
142
+ ```markdown
143
+ # Story Export - 2026-03-03
144
+
145
+ **Filters**: Epic: EP-0041
146
+ **Count**: 8 stories
147
+
148
+ | ID | Title | Epic | Status | Owner | Priority | Estimate |
149
+ |----|-------|------|--------|-------|----------|----------|
150
+ | US-0380 | Add story:edit and epic:edit commands | EP-0041 | done | AG-API | high | 3h |
151
+ | US-0381 | Add status:undo command | EP-0041 | done | AG-API | high | 2h |
152
+ ```
153
+
154
+ ### Step 4: Save Output
155
+
156
+ Create output directory if needed:
157
+ ```bash
158
+ mkdir -p docs/08-project/exports
159
+ ```
160
+
161
+ Save to: `docs/08-project/exports/export-YYYYMMDD.{csv|json|md}`
162
+
163
+ If file already exists for today, append a counter: `export-YYYYMMDD-2.csv`
164
+
165
+ ### Step 5: Show Summary
166
+
167
+ ```
168
+ Exported 8 stories to docs/08-project/exports/export-20260303.csv
169
+
170
+ Filters applied:
171
+ Epic: EP-0041
172
+ Status: all
173
+ Owner: all
174
+
175
+ Preview (first 3 rows):
176
+ US-0380 | Add story:edit and epic:edit commands | done
177
+ US-0381 | Add status:undo command | done
178
+ US-0382 | Add export command | in_progress
179
+ ```
180
+
181
+ Then offer next steps:
182
+
183
+ ```xml
184
+ <invoke name="AskUserQuestion">
185
+ <parameter name="questions">[{
186
+ "question": "Export complete. What next?",
187
+ "header": "Next steps",
188
+ "multiSelect": false,
189
+ "options": [
190
+ {"label": "Open/view the exported file", "description": "Display full file contents"},
191
+ {"label": "Export in another format", "description": "Re-export as json/md/csv"},
192
+ {"label": "Done", "description": "Export saved successfully"}
193
+ ]
194
+ }]</parameter>
195
+ </invoke>
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Example Usage
201
+
202
+ ```bash
203
+ # Export all stories as CSV (default)
204
+ /agileflow:export
205
+
206
+ # Export specific epic as JSON
207
+ /agileflow:export FORMAT=json EPIC=EP-0041
208
+
209
+ # Export ready stories as Markdown
210
+ /agileflow:export FORMAT=md STATUS=ready
211
+
212
+ # Export specific owner's stories as CSV
213
+ /agileflow:export OWNER=AG-API STATUS=done
214
+
215
+ # Combine filters
216
+ /agileflow:export FORMAT=md EPIC=EP-0041 STATUS=ready OWNER=AG-API
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Rules
222
+
223
+ - **CSV Excel-compatible**: Proper quoting, commas, UTF-8
224
+ - **JSON well-formed**: Pretty-printed, includes metadata
225
+ - **Markdown paste-ready**: Standard table format
226
+ - **Always show preview**: Display first few rows after export
227
+ - **Always show path**: User needs to know where the file is
228
+ - **No destructive overwrites**: Counter suffix for same-day exports
229
+
230
+ ---
231
+
232
+ ## Related Commands
233
+
234
+ - `/agileflow:story:list` - Interactive story listing
235
+ - `/agileflow:epic:list` - Interactive epic listing
236
+ - `/agileflow:board` - Visual kanban board
237
+ - `/agileflow:sprint` - Sprint planning view
238
+ - `/agileflow:changelog` - Generate changelog
@@ -87,7 +87,22 @@ Print a concise, one-screen overview:
87
87
  - What Epics, Stories, ADRs are; how docs/09-agents/status.json + bus/log.jsonl work
88
88
  - Daily flow: Pick story → Implement to AC → Tests → PR → Update status
89
89
  - WIP limit: max 2 stories/agent
90
- - List ALL available commands with one-line examples
90
+ - List ALL available commands grouped by lifecycle phase
91
+ - Show the current detected phase (from smart-detect.json) to highlight relevant commands
92
+
93
+ ### Lifecycle Phases
94
+
95
+ Commands are organized by the project phase where they're most useful:
96
+
97
+ | Phase | Description | Key Commands |
98
+ |-------|------------|--------------|
99
+ | **Pre-Story** | Story selection and project setup | epic, story, board, sprint, choose, configure |
100
+ | **Planning** | Architecture and research decisions | adr, impact, council, multi-expert, baseline |
101
+ | **Implementation** | Active development work | babysit, tdd, tests, verify, ci, workflow |
102
+ | **Post-Impl** | Review, docs, and quality checks | audit, review, docs, changelog, diagnose |
103
+ | **Pre-PR** | Final checks before pull request | pr, compress |
104
+
105
+ **Tip**: Commands have a `phase` tag in their frontmatter. Run the command most relevant to your current phase.
91
106
 
92
107
  <!-- {{COMMAND_LIST}} -->
93
108
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Run structured discovery workflow - brainstorm, research, and generate a Product Brief
3
- argument-hint: "TOPIC=<text> [DEPTH=quick|guided|deep]"
3
+ argument-hint: "TOPIC=<text> [DEPTH=quick|guided|deep] [MODEL=haiku|sonnet|opus]"
4
4
  compact_context:
5
5
  priority: critical
6
6
  preserve_rules:
@@ -10,11 +10,12 @@ compact_context:
10
10
  - "Phase 2: Research via /agileflow:research:ask (optional in quick mode)"
11
11
  - "Phase 3: Generate Product Brief via /agileflow:ideate:brief"
12
12
  - "Output: docs/08-project/briefs/{date}-{topic-slug}-brief.md"
13
- - "MUST parse TOPIC (required) and DEPTH (default: guided)"
13
+ - "MUST parse TOPIC (required), DEPTH (default: guided), and MODEL (default: haiku, passed to ideate:new)"
14
14
  - "After brief generation, offer: create epic, refine brief, or done"
15
15
  state_fields:
16
16
  - topic
17
17
  - depth
18
+ - model
18
19
  - brainstorm_complete
19
20
  - research_complete
20
21
  - brief_generated
@@ -57,6 +58,7 @@ node .agileflow/scripts/obtain-context.js ideate:discover
57
58
  /agileflow:ideate:discover TOPIC="Mobile time tracking app"
58
59
  /agileflow:ideate:discover TOPIC="AI code review tool" DEPTH=deep
59
60
  /agileflow:ideate:discover TOPIC="Internal dashboard" DEPTH=quick
61
+ /agileflow:ideate:discover TOPIC="Enterprise CRM" MODEL=opus
60
62
  ```
61
63
 
62
64
  **Phases**:
@@ -142,6 +144,7 @@ Parse the user's input:
142
144
  |----------|----------|---------|-------------|
143
145
  | TOPIC | Yes | - | The product/feature idea to explore |
144
146
  | DEPTH | No | guided | Discovery depth: quick, guided, or deep |
147
+ | MODEL | No | haiku | Model for expert subagents (haiku, sonnet, opus). Passed through to ideate:new brainstorm phase. |
145
148
 
146
149
  **If TOPIC is missing**, ask the user:
147
150
 
@@ -191,7 +194,7 @@ From your {DOMAIN} perspective, generate 3-5 ideas covering:
191
194
  Be specific and actionable. Reference real-world examples where helpful.
192
195
  ```
193
196
 
194
- Deploy all experts with `run_in_background: true`, then collect results with TaskOutput.
197
+ Deploy all experts with `run_in_background: true`, then collect results with TaskOutput. **If MODEL is specified**, pass it to each Task call via the `model` parameter.
195
198
 
196
199
  #### Guided Mode
197
200
  Same as Quick, but after collecting results:
@@ -343,6 +346,7 @@ Present the completed brief and ask what to do next:
343
346
  |----------|--------|---------|-------------|
344
347
  | TOPIC | Free text | (required) | The product/feature idea to explore |
345
348
  | DEPTH | quick, guided, deep | guided | Discovery depth level |
349
+ | MODEL | haiku, sonnet, opus | haiku | Model for expert subagents. Passed to brainstorm phase Task calls. |
346
350
 
347
351
  {{argument}}
348
352