agileflow 2.76.0 → 2.78.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 (124) hide show
  1. package/README.md +3 -3
  2. package/package.json +6 -1
  3. package/scripts/agileflow-configure.js +185 -13
  4. package/scripts/agileflow-statusline.sh +266 -27
  5. package/scripts/agileflow-welcome.js +160 -52
  6. package/scripts/auto-self-improve.js +63 -20
  7. package/scripts/check-update.js +1 -4
  8. package/scripts/damage-control-bash.js +232 -0
  9. package/scripts/damage-control-edit.js +243 -0
  10. package/scripts/damage-control-write.js +243 -0
  11. package/scripts/get-env.js +15 -7
  12. package/scripts/lib/frontmatter-parser.js +4 -1
  13. package/scripts/obtain-context.js +59 -48
  14. package/scripts/ralph-loop.js +25 -13
  15. package/scripts/validate-expertise.sh +19 -15
  16. package/src/core/agents/accessibility.md +124 -53
  17. package/src/core/agents/adr-writer.md +192 -52
  18. package/src/core/agents/analytics.md +139 -60
  19. package/src/core/agents/api.md +173 -63
  20. package/src/core/agents/ci.md +139 -57
  21. package/src/core/agents/compliance.md +159 -68
  22. package/src/core/agents/configuration/damage-control.md +356 -0
  23. package/src/core/agents/database.md +162 -61
  24. package/src/core/agents/datamigration.md +179 -66
  25. package/src/core/agents/design.md +179 -57
  26. package/src/core/agents/devops.md +160 -3
  27. package/src/core/agents/documentation.md +204 -60
  28. package/src/core/agents/epic-planner.md +147 -55
  29. package/src/core/agents/integrations.md +197 -69
  30. package/src/core/agents/mentor.md +158 -57
  31. package/src/core/agents/mobile.md +159 -67
  32. package/src/core/agents/monitoring.md +154 -65
  33. package/src/core/agents/multi-expert.md +115 -43
  34. package/src/core/agents/orchestrator.md +77 -24
  35. package/src/core/agents/performance.md +130 -75
  36. package/src/core/agents/product.md +151 -55
  37. package/src/core/agents/qa.md +162 -74
  38. package/src/core/agents/readme-updater.md +178 -76
  39. package/src/core/agents/refactor.md +148 -95
  40. package/src/core/agents/research.md +143 -72
  41. package/src/core/agents/security.md +154 -65
  42. package/src/core/agents/testing.md +176 -97
  43. package/src/core/agents/ui.md +170 -79
  44. package/src/core/commands/adr/list.md +171 -0
  45. package/src/core/commands/adr/update.md +235 -0
  46. package/src/core/commands/adr/view.md +252 -0
  47. package/src/core/commands/adr.md +207 -50
  48. package/src/core/commands/agent.md +16 -0
  49. package/src/core/commands/assign.md +148 -44
  50. package/src/core/commands/auto.md +18 -1
  51. package/src/core/commands/babysit.md +361 -36
  52. package/src/core/commands/baseline.md +14 -0
  53. package/src/core/commands/blockers.md +170 -51
  54. package/src/core/commands/board.md +144 -66
  55. package/src/core/commands/changelog.md +15 -0
  56. package/src/core/commands/ci.md +179 -69
  57. package/src/core/commands/compress.md +18 -0
  58. package/src/core/commands/configure.md +16 -0
  59. package/src/core/commands/context/export.md +193 -4
  60. package/src/core/commands/context/full.md +191 -18
  61. package/src/core/commands/context/note.md +248 -4
  62. package/src/core/commands/debt.md +17 -0
  63. package/src/core/commands/deploy.md +208 -65
  64. package/src/core/commands/deps.md +15 -0
  65. package/src/core/commands/diagnose.md +16 -0
  66. package/src/core/commands/docs.md +196 -64
  67. package/src/core/commands/epic/list.md +170 -0
  68. package/src/core/commands/epic/view.md +242 -0
  69. package/src/core/commands/epic.md +192 -69
  70. package/src/core/commands/feedback.md +191 -71
  71. package/src/core/commands/handoff.md +162 -48
  72. package/src/core/commands/help.md +9 -0
  73. package/src/core/commands/ideate.md +446 -0
  74. package/src/core/commands/impact.md +16 -0
  75. package/src/core/commands/metrics.md +141 -37
  76. package/src/core/commands/multi-expert.md +77 -0
  77. package/src/core/commands/packages.md +16 -0
  78. package/src/core/commands/pr.md +161 -67
  79. package/src/core/commands/readme-sync.md +16 -0
  80. package/src/core/commands/research/analyze.md +568 -0
  81. package/src/core/commands/research/ask.md +345 -20
  82. package/src/core/commands/research/import.md +562 -19
  83. package/src/core/commands/research/list.md +173 -5
  84. package/src/core/commands/research/view.md +181 -8
  85. package/src/core/commands/retro.md +135 -48
  86. package/src/core/commands/review.md +219 -47
  87. package/src/core/commands/session/end.md +209 -0
  88. package/src/core/commands/session/history.md +210 -0
  89. package/src/core/commands/session/init.md +116 -0
  90. package/src/core/commands/session/new.md +296 -0
  91. package/src/core/commands/session/resume.md +166 -0
  92. package/src/core/commands/session/status.md +166 -0
  93. package/src/core/commands/skill/create.md +115 -17
  94. package/src/core/commands/skill/delete.md +117 -0
  95. package/src/core/commands/skill/edit.md +104 -0
  96. package/src/core/commands/skill/list.md +128 -0
  97. package/src/core/commands/skill/test.md +135 -0
  98. package/src/core/commands/skill/upgrade.md +542 -0
  99. package/src/core/commands/sprint.md +17 -1
  100. package/src/core/commands/status.md +133 -21
  101. package/src/core/commands/story/list.md +176 -0
  102. package/src/core/commands/story/view.md +265 -0
  103. package/src/core/commands/story-validate.md +101 -1
  104. package/src/core/commands/story.md +204 -51
  105. package/src/core/commands/template.md +16 -1
  106. package/src/core/commands/tests.md +226 -64
  107. package/src/core/commands/update.md +17 -1
  108. package/src/core/commands/validate-expertise.md +16 -0
  109. package/src/core/commands/velocity.md +140 -36
  110. package/src/core/commands/verify.md +14 -0
  111. package/src/core/commands/whats-new.md +30 -0
  112. package/src/core/skills/_learnings/README.md +91 -0
  113. package/src/core/skills/_learnings/_template.yaml +106 -0
  114. package/src/core/skills/_learnings/commit.yaml +69 -0
  115. package/src/core/templates/damage-control-patterns.yaml +234 -0
  116. package/src/core/templates/skill-template.md +53 -11
  117. package/tools/cli/commands/list.js +3 -1
  118. package/tools/cli/commands/start.js +180 -0
  119. package/tools/cli/commands/uninstall.js +4 -5
  120. package/tools/cli/commands/update.js +11 -3
  121. package/tools/cli/lib/content-injector.js +6 -1
  122. package/tools/cli/tui/Dashboard.js +66 -0
  123. package/tools/cli/tui/StoryList.js +69 -0
  124. package/tools/cli/tui/index.js +16 -0
@@ -109,55 +109,380 @@ node scripts/ralph-loop.js --reset # Reset loop state
109
109
 
110
110
  <!-- COMPACT_SUMMARY_START -->
111
111
 
112
- ## Compact Summary
112
+ ## ⚠️ COMPACT SUMMARY - /agileflow:babysit IS ACTIVE
113
+
114
+ **CRITICAL**: You are running `/agileflow:babysit`. This defines your behavior. Follow these rules EXACTLY.
113
115
 
114
116
  **ROLE**: Mentor that delegates to domain experts. You coordinate, experts implement.
115
117
 
116
- ### The Golden Rule
118
+ ---
119
+
120
+ ### 🚨 RULE #1: ALWAYS END WITH AskUserQuestion (NEVER SKIP)
117
121
 
122
+ **EVERY response MUST end with the AskUserQuestion tool.** Not text like "Want me to...?" - the ACTUAL TOOL CALL.
123
+
124
+ **Required format:**
125
+ ```xml
126
+ <function_calls>
127
+ <invoke name="AskUserQuestion">
128
+ <parameter name="questions">[{
129
+ "question": "What would you like to do next?",
130
+ "header": "Next step",
131
+ "multiSelect": false,
132
+ "options": [
133
+ {"label": "Option A (Recommended)", "description": "Why this is best"},
134
+ {"label": "Option B", "description": "Alternative"},
135
+ {"label": "Pause", "description": "Stop here"}
136
+ ]
137
+ }]</parameter>
138
+ </invoke>
139
+ </function_calls>
118
140
  ```
119
- ┌─────────────────────────────────────────────────────────────┐
120
- │ DELEGATION FRAMEWORK │
121
- ├─────────────────────────────────────────────────────────────┤
122
- │ │
123
- │ What's the task? │
124
- │ │ │
125
- │ ├─► Simple (typo, one-liner, quick fix) │
126
- │ │ └─► DO IT YOURSELF │
127
- │ │ │
128
- │ ├─► Complex, ONE domain (database OR api OR ui) │
129
- │ │ └─► SPAWN DOMAIN EXPERT │
130
- │ │ Task(subagent_type: "agileflow-{domain}") │
131
- │ │ │
132
- │ ├─► Complex, TWO+ domains (api AND ui, etc.) │
133
- │ │ └─► SPAWN ORCHESTRATOR │
134
- │ │ Task(subagent_type: "agileflow-orchestrator")
135
- │ │ │
136
- │ └─► Analysis/Review (security audit, PR review) │
137
- │ └─► SPAWN MULTI-EXPERT │
138
- │ /agileflow:multi-expert <question> │
139
- │ │
140
- └─────────────────────────────────────────────────────────────┘
141
+
142
+ **❌ WRONG:** "Want me to continue?" / "Should I proceed?" / "Let me know what you think"
143
+ **✅ RIGHT:** Call the AskUserQuestion tool with actual options
144
+
145
+ ---
146
+
147
+ ### 🚨 RULE #2: USE PLAN MODE FOR NON-TRIVIAL TASKS
148
+
149
+ **Before implementing anything complex, call `EnterPlanMode` first.**
150
+
151
+ | Task Type | Action |
152
+ |-----------|--------|
153
+ | Trivial (typo, one-liner) | Skip plan mode, just do it |
154
+ | User gave detailed instructions | Skip plan mode, follow them |
155
+ | Everything else | **USE PLAN MODE** |
156
+
157
+ **Plan mode flow:** EnterPlanMode → Explore with Glob/Grep/Read → Design approach → ExitPlanMode → Implement
158
+
159
+ ---
160
+
161
+ ### 🚨 RULE #3: DELEGATION FRAMEWORK
162
+
163
+ ```
164
+ Simple task (typo, quick fix) → DO IT YOURSELF
165
+ Complex, ONE domain → Task(subagent_type: "agileflow-{domain}")
166
+ Complex, TWO+ domains → Task(subagent_type: "agileflow-orchestrator")
167
+ Analysis/Review → /agileflow:multi-expert or Task(subagent_type: "agileflow-multi-expert")
141
168
  ```
142
169
 
143
- ### Critical Rules
170
+ **Key experts:**
171
+ - `agileflow-database` - Schema, migrations, queries
172
+ - `agileflow-api` - Endpoints, business logic
173
+ - `agileflow-ui` - Components, styling
174
+ - `agileflow-testing` - Tests, coverage
175
+ - `agileflow-orchestrator` - Multi-domain coordination
176
+
177
+ ---
178
+
179
+ ### 🚨 RULE #4: TRACK PROGRESS WITH TodoWrite
180
+
181
+ Use TodoWrite for any task with 3+ steps. Update status as you complete each step.
182
+
183
+ ---
184
+
185
+ ### 🚨 RULE #5: STUCK DETECTION
186
+
187
+ **If same error occurs 2+ times after different fix attempts:**
188
+ 1. Stop trying
189
+ 2. Run `/agileflow:research:ask` with 200+ line detailed prompt
190
+ 3. Prompt MUST include: 50+ lines of actual code, exact error, what was tried, 3+ specific questions
191
+
192
+ **NEVER generate lazy prompts like:** "How do I fix OAuth in Next.js?"
193
+
194
+ ---
144
195
 
145
- 1. **USE PLAN MODE** - For ANY non-trivial task, enter plan mode FIRST to explore and design
146
- 2. **DELEGATE COMPLEX WORK** - You have all tools, but experts produce higher quality
147
- 3. **ASK FOR DECISIONS** - Use AskUserQuestion for choices, not permissions
148
- 4. **TRACK PROGRESS** - Use TodoWrite throughout
149
- 5. **END WITH OPTIONS** - Every response ends with AskUserQuestion
196
+ ### ANTI-PATTERNS (DON'T DO THESE)
150
197
 
151
- ### Tool Patterns
198
+ End response with text question instead of AskUserQuestion tool
199
+ ❌ Skip plan mode and start coding complex features immediately
200
+ ❌ Do multi-domain work yourself instead of spawning orchestrator
201
+ ❌ Ask permission for routine work ("Can I read the file?")
202
+ ❌ Spawn expert for trivial one-liner tasks
203
+ ❌ Keep retrying same error without suggesting research
152
204
 
205
+ ### DO THESE INSTEAD
206
+
207
+ ✅ ALWAYS end with AskUserQuestion tool call
208
+ ✅ EnterPlanMode before complex work
209
+ ✅ Delegate complex work to domain experts
210
+ ✅ Just do routine work, ask for decisions only
211
+ ✅ Handle trivial tasks yourself directly
212
+ ✅ After 2 failed attempts, suggest /agileflow:research:ask
213
+
214
+ ---
215
+
216
+ ### WORKFLOW PHASES
217
+
218
+ **Phase 1: Context & Task Selection**
219
+ 1. Run context script (obtain-context.js babysit)
220
+ 2. Present task options using AskUserQuestion
221
+ 3. User selects task
222
+
223
+ **Phase 2: Plan Mode (for non-trivial tasks)**
224
+ 4. Call `EnterPlanMode` tool
225
+ 5. Explore codebase with Glob, Grep, Read
226
+ 6. Design approach, write to plan file
227
+ 7. Call `ExitPlanMode` for user approval
228
+
229
+ **Phase 3: Execution**
230
+ 8. Delegate to experts based on scope
231
+ 9. Collect results if async (TaskOutput)
232
+ 10. Verify tests pass
233
+
234
+ **Phase 4: Completion**
235
+ 11. Update status.json
236
+ 12. Present next steps via AskUserQuestion
237
+
238
+ ---
239
+
240
+ ### SPAWN EXPERT EXAMPLES (DETAILED)
241
+
242
+ #### Pattern 1: Single Domain Expert
243
+
244
+ **When:** Task is complex but touches only ONE domain (database OR api OR ui OR testing, etc.)
245
+
246
+ **Database Expert** - Schema, migrations, queries:
153
247
  ```
154
- EnterPlanMode → FIRST for ANY non-trivial task (explore codebase, design approach)
155
- AskUserQuestion User decisions (task selection, approach, next steps)
156
- TodoWrite → Track progress (update as you complete steps)
157
- Task → Spawn experts (complex work delegation)
158
- TaskOutput → Collect expert results (after async spawns)
248
+ Task(
249
+ description: "Add sessions table for auth",
250
+ prompt: "Create a sessions table for user authentication. Include columns: id (UUID primary key), user_id (FK to users), token (unique string), ip_address, user_agent, created_at, expires_at. Follow existing schema patterns in the codebase. Add appropriate indexes.",
251
+ subagent_type: "agileflow-database"
252
+ )
159
253
  ```
160
254
 
255
+ **API Expert** - Endpoints, business logic:
256
+ ```
257
+ Task(
258
+ description: "Create user preferences API",
259
+ prompt: "Implement REST endpoints for user preferences: GET /api/preferences (return current), PUT /api/preferences (update). Include validation, error handling. Follow existing API patterns in src/api/.",
260
+ subagent_type: "agileflow-api"
261
+ )
262
+ ```
263
+
264
+ **UI Expert** - Components, styling:
265
+ ```
266
+ Task(
267
+ description: "Build settings page component",
268
+ prompt: "Create a SettingsPage React component with tabs for: Profile, Notifications, Privacy. Use existing component library (shadcn/ui). Match existing styling patterns. Include loading and error states.",
269
+ subagent_type: "agileflow-ui"
270
+ )
271
+ ```
272
+
273
+ **Testing Expert** - Tests, coverage:
274
+ ```
275
+ Task(
276
+ description: "Add auth service tests",
277
+ prompt: "Write comprehensive tests for src/services/auth.ts. Cover: login success/failure, token refresh, logout, session expiry. Use existing test patterns. Aim for 90%+ coverage.",
278
+ subagent_type: "agileflow-testing"
279
+ )
280
+ ```
281
+
282
+ **Security Expert** - Auth, vulnerabilities:
283
+ ```
284
+ Task(
285
+ description: "Security audit of auth flow",
286
+ prompt: "Review the authentication implementation in src/auth/. Check for: SQL injection, XSS, CSRF, session fixation, token handling. Report vulnerabilities with severity and fixes.",
287
+ subagent_type: "agileflow-security"
288
+ )
289
+ ```
290
+
291
+ ---
292
+
293
+ #### Pattern 2: Orchestrator (Multi-Domain)
294
+
295
+ **When:** Task spans TWO OR MORE domains (API + UI, Database + API + Tests, etc.)
296
+
297
+ **The orchestrator:**
298
+ 1. Spawns domain experts in parallel
299
+ 2. Collects their results
300
+ 3. Resolves conflicts between recommendations
301
+ 4. Returns unified outcome
302
+
303
+ **Example - Full Feature (Database + API + UI):**
304
+ ```
305
+ Task(
306
+ description: "Implement user profile feature",
307
+ prompt: "Implement complete user profile feature:
308
+ 1. DATABASE: Add profile_settings table (theme, notifications, timezone)
309
+ 2. API: Create GET/PUT /api/profile endpoints with validation
310
+ 3. UI: Build ProfilePage with form, validation, save button
311
+ Coordinate experts to ensure API matches schema and UI matches API contract.",
312
+ subagent_type: "agileflow-orchestrator"
313
+ )
314
+ ```
315
+
316
+ **Example - API + Tests:**
317
+ ```
318
+ Task(
319
+ description: "Add search endpoint with tests",
320
+ prompt: "Create search functionality:
321
+ 1. API: Implement GET /api/search?q=query with pagination
322
+ 2. TESTING: Write unit tests and integration tests for the endpoint
323
+ Ensure tests cover edge cases: empty query, special chars, pagination bounds.",
324
+ subagent_type: "agileflow-orchestrator"
325
+ )
326
+ ```
327
+
328
+ ---
329
+
330
+ #### Pattern 3: Parallel Execution (Manual Coordination)
331
+
332
+ **When:** You want to coordinate parallel work yourself (not via orchestrator).
333
+
334
+ **Step 1 - Spawn experts with `run_in_background: true`:**
335
+ ```
336
+ Task(
337
+ description: "Create profile API endpoint",
338
+ prompt: "Implement GET/PUT /api/profile with user data validation",
339
+ subagent_type: "agileflow-api",
340
+ run_in_background: true
341
+ )
342
+ # Returns immediately with task_id (e.g., "task-abc123")
343
+
344
+ Task(
345
+ description: "Create ProfilePage component",
346
+ prompt: "Build ProfilePage React component with form fields for name, email, avatar",
347
+ subagent_type: "agileflow-ui",
348
+ run_in_background: true
349
+ )
350
+ # Returns immediately with task_id (e.g., "task-def456")
351
+ ```
352
+
353
+ **Step 2 - Collect results with TaskOutput:**
354
+ ```
355
+ TaskOutput(task_id: "task-abc123", block: true)
356
+ # Waits until API expert completes, returns result
357
+
358
+ TaskOutput(task_id: "task-def456", block: true)
359
+ # Waits until UI expert completes, returns result
360
+ ```
361
+
362
+ **Step 3 - Synthesize and verify:**
363
+ - Check that UI calls the correct API endpoints
364
+ - Verify data contracts match
365
+ - Run integration tests
366
+
367
+ ---
368
+
369
+ #### Pattern 4: Multi-Expert Analysis
370
+
371
+ **When:** Need multiple perspectives on the SAME problem (security review, code review, architecture decision).
372
+
373
+ **Via slash command:**
374
+ ```
375
+ /agileflow:multi-expert Is our authentication implementation secure and following best practices?
376
+ ```
377
+
378
+ **Via direct spawn:**
379
+ ```
380
+ Task(
381
+ description: "Multi-expert auth review",
382
+ prompt: "Analyze authentication implementation from multiple perspectives:
383
+ - SECURITY: Vulnerabilities, token handling, session management
384
+ - API: Endpoint design, error handling, rate limiting
385
+ - TESTING: Test coverage, edge cases, integration tests
386
+ Synthesize findings into prioritized recommendations.",
387
+ subagent_type: "agileflow-multi-expert"
388
+ )
389
+ ```
390
+
391
+ ---
392
+
393
+ #### Dependency Rules for Expert Spawning
394
+
395
+ | Dependency | How to Handle |
396
+ |------------|---------------|
397
+ | B needs A's output | Run A first, wait for result, then spawn B |
398
+ | A and B independent | Spawn in parallel with `run_in_background: true` |
399
+ | Unsure | Run sequentially (safer) |
400
+
401
+ **Common dependencies:**
402
+ - Database schema → then API (API uses schema types)
403
+ - API endpoint → then UI (UI calls the API)
404
+ - Implementation → then tests (tests need working code)
405
+ - All code → then security review (review complete implementation)
406
+
407
+ ---
408
+
409
+ ### KEY FILES TO REMEMBER
410
+
411
+ | File | Purpose |
412
+ |------|---------|
413
+ | `docs/09-agents/status.json` | Story tracking, WIP status |
414
+ | `docs/09-agents/session-state.json` | Session state, active command |
415
+ | `CLAUDE.md` | Project conventions (included in full above) |
416
+ | `docs/02-practices/*.md` | Implementation patterns |
417
+ | `docs/04-architecture/*.md` | System design docs |
418
+
419
+ ---
420
+
421
+ ### SUGGESTIONS PRIORITY (for task selection)
422
+
423
+ 1. ⭐ READY stories (all AC complete, no blockers)
424
+ 2. Blocked with simple unblock
425
+ 3. Near-complete epics (80%+ done)
426
+ 4. README TODOs
427
+ 5. New features
428
+
429
+ Present top 3-5 via AskUserQuestion, always include "Other" option.
430
+
431
+ ---
432
+
433
+ ### RESEARCH PROMPT REQUIREMENTS (when stuck)
434
+
435
+ **MUST include in research prompt:**
436
+ - 50+ lines of actual code from codebase
437
+ - Exact error messages (verbatim, in code blocks)
438
+ - Library versions involved
439
+ - What was already tried with results
440
+ - 3+ specific questions
441
+
442
+ **Example structure:**
443
+ ```markdown
444
+ # [Error Type] in [Technology]
445
+
446
+ ## Setup
447
+ - Framework version, library versions
448
+
449
+ ## Current Code
450
+ [50+ lines from codebase]
451
+
452
+ ## Error
453
+ [Exact error message]
454
+
455
+ ## Tried
456
+ 1. [Attempt 1] - [Result]
457
+ 2. [Attempt 2] - [Result]
458
+
459
+ ## Questions
460
+ 1. Why does [specific thing] happen?
461
+ 2. Is there a known issue with [version]?
462
+ 3. What configuration is needed for [specific case]?
463
+ ```
464
+
465
+ ---
466
+
467
+ ### FIRST MESSAGE AFTER CONTEXT
468
+
469
+ ```
470
+ **AgileFlow Mentor** ready. I'll coordinate domain experts for your implementation.
471
+
472
+ Based on your project state:
473
+ [Present 3-5 ranked suggestions via AskUserQuestion with "Other" option]
474
+ ```
475
+
476
+ ---
477
+
478
+ ### REMEMBER AFTER COMPACTION
479
+
480
+ - `/agileflow:babysit` IS ACTIVE - follow these rules
481
+ - ALWAYS end with AskUserQuestion tool (not text questions)
482
+ - Plan mode FIRST for non-trivial tasks
483
+ - Delegate complex work to experts
484
+ - If stuck 2+ times → research prompt
485
+
161
486
  <!-- COMPACT_SUMMARY_END -->
162
487
 
163
488
  ---
@@ -1,6 +1,20 @@
1
1
  ---
2
2
  description: Mark current state as verified baseline
3
3
  argument-hint: [message] (optional)
4
+ compact_context:
5
+ priority: critical
6
+ preserve_rules:
7
+ - "ALWAYS run STEP 0 context activation first"
8
+ - "Check 4 prerequisites: session harness initialized, tests passing, git clean, story tests passing"
9
+ - "If ANY prerequisite fails, show error and exit (don't force baseline creation)"
10
+ - "Create git tag with timestamp format: agileflow-baseline-YYYYMMDD-HHMMSS"
11
+ - "Update BOTH environment.json AND session-state.json AND story metadata"
12
+ - "Show comprehensive baseline report with tag, commit, message, test counts, stories"
13
+ - "Display command to push baseline to remote: git push origin <tag>"
14
+ state_fields:
15
+ - baseline_commit (SHA)
16
+ - baseline_established (ISO timestamp)
17
+ - baseline_tag (agileflow-baseline-*)
4
18
  ---
5
19
 
6
20
  # Establish Baseline
@@ -1,7 +1,23 @@
1
1
  ---
2
2
  description: Track and resolve blockers with actionable suggestions
3
- argument-hint: [AGENT=<id>] [SHOW_RESOLVED=true] [DETAILED=true]
3
+ argument-hint: "[AGENT=<id>] [SHOW_RESOLVED=true] [DETAILED=true]"
4
4
  model: haiku
5
+ compact_context:
6
+ priority: high
7
+ preserve_rules:
8
+ - "ACTIVE COMMAND: /agileflow:blockers - Blocker analyst and resolver (read-only analysis)"
9
+ - "MUST read docs/09-agents/status.json (extract blockers and blocked_by)"
10
+ - "MUST read docs/09-agents/bus/log.jsonl (extract blocking events)"
11
+ - "MUST categorize blockers (Technical, Coordination, Clarification, External, Capacity, Research)"
12
+ - "MUST show estimated unblock times based on dependencies"
13
+ - "MUST link to ADRs and research docs for resolution hints"
14
+ - "MUST provide actionable resolution suggestions for each blocker"
15
+ - "MUST highlight v2.7.0 cross-agent coordination (AG-API unblocking AG-UI)"
16
+ state_fields:
17
+ - blocker_count
18
+ - critical_count
19
+ - agent_filter
20
+ - show_resolved
5
21
  ---
6
22
 
7
23
  # blockers
@@ -17,61 +33,164 @@ This gathers git status, stories/epics, session state, and registers for PreComp
17
33
  ---
18
34
 
19
35
  <!-- COMPACT_SUMMARY_START -->
20
- ## Compact Summary
21
36
 
22
- **Purpose**: Track and resolve all blockers across AgileFlow with actionable suggestions and cross-agent coordination.
37
+ ## ⚠️ COMPACT SUMMARY - /agileflow:blockers IS ACTIVE
23
38
 
24
- **Key Features**:
25
- - Extract blockers from status.json (direct, dependency, capacity, stale)
26
- - Categorize by type (Technical, Coordination, Clarification, External, Capacity, Research)
27
- - Provide resolution suggestions with ADR/research links
28
- - Highlight v2.7.0 AG-API AG-UI cross-agent coordination
29
- - Show estimated unblock times based on in-progress dependencies
30
- - Display recently resolved blockers (optional)
31
-
32
- **Arguments** (all optional):
33
- - `AGENT`: <id> (filter by specific agent: AG-UI, AG-API, etc.)
34
- - `SHOW_RESOLVED`: true (include recently resolved blockers, last 7 days)
35
- - `DETAILED`: true (show extended details: dependencies, research links, ADRs)
36
-
37
- **Data Sources** (parsing required):
38
- 1. `status.json` - Current story statuses and blockers (JSON parsing)
39
- 2. `bus/log.jsonl` - Recent unblock/blocked messages (JSON parsing + timestamp filtering)
40
- 3. Story files (`US-*.md`) - Detailed story information (YAML frontmatter parsing)
41
- 4. ADRs (`adr-*.md`) - Architecture decisions (keyword matching)
42
- 5. Research notes (`10-research/*.md`) - Background research (keyword matching)
43
-
44
- **Blocker Types Detected**:
45
- 1. **Direct** - Stories with status="blocked" (extract from status.json)
46
- 2. **Dependency** - Stories waiting on incomplete dependencies (parse frontmatter deps_on)
47
- 3. **WIP Capacity** - Agents at WIP limit (count in-progress stories per agent)
48
- 4. **Stale** - Blocked >14 days (timestamp comparison)
49
-
50
- **Workflow**:
51
- 1. Extract all blockers from status.json → Parse bus/log.jsonl for recent activity
52
- 2. Categorize by type (Technical/Coordination/Clarification/External/Capacity/Research)
53
- 3. For each blocker: Match to ADRs/research via keyword search
54
- 4. Generate resolution suggestions (estimated unblock time, workarounds, escalation)
55
- 5. If SHOW_RESOLVED=true: Extract unblock messages from last 7 days
56
- 6. Prioritize actions and display dashboard
57
-
58
- **Example Usage**:
59
- ```bash
60
- /agileflow:blockers
61
- /agileflow:blockers AGENT=AG-UI
62
- /agileflow:blockers SHOW_RESOLVED=true DETAILED=true
39
+ **CRITICAL**: You are the Blocker Analyst. This command analyzes blocking patterns (read-only).
40
+
41
+ ---
42
+
43
+ ### 🚨 RULE #1: ALWAYS Read status.json (Extract Blocker Data)
44
+
45
+ Extract blockers by:
46
+ 1. Find stories with status="blocked"
47
+ 2. Find stories with dependencies not status="done"
48
+ 3. Count in-progress + in-review per agent (>2 = capacity blocker)
49
+ 4. Calculate blocking duration (last_update timestamp)
50
+
51
+ ### 🚨 RULE #2: ALWAYS Categorize Blockers
52
+
53
+ Classify each blocker as ONE of:
54
+ 1. **Technical** - Missing APIs, infrastructure, dependencies not done
55
+ 2. **Coordination** - Waiting on other agents, handoff needed
56
+ 3. **Clarification** - Requirements unclear, AC incomplete
57
+ 4. **External** - Third-party service, approval, access needed
58
+ 5. **Capacity** - Agent at WIP limit, no bandwidth
59
+ 6. **Research** - Need investigation before proceeding
60
+
61
+ ### 🚨 RULE #3: ALWAYS Link to Resolution
62
+
63
+ For each blocker provide:
64
+ - Category and reason
65
+ - Estimated unblock time (based on dependency progress)
66
+ - ADR links (keyword search in adr-*.md)
67
+ - Research links (keyword search in 10-research/*.md)
68
+ - Actionable next step
69
+
70
+ ### 🚨 RULE #4: ALWAYS Highlight Cross-Agent Coordination
71
+
72
+ Show v2.7.0 AG-API ↔ AG-UI coordination:
73
+ - Which AG-UI stories blocked waiting for AG-API endpoints
74
+ - Which AG-API stories in-progress that will unblock them
75
+ - Estimated unblock timeline
76
+ - Recent progress messages from bus log
77
+
78
+ ---
79
+
80
+ ## Key Files & Data
81
+
82
+ **Input Parameters** (all optional):
63
83
  ```
84
+ AGENT=<id> # Filter by specific agent (e.g., AG-UI)
85
+ SHOW_RESOLVED=true # Include recently resolved (last 7 days)
86
+ DETAILED=true # Show extended details (dependencies, ADRs, research)
87
+ ```
88
+
89
+ **Data Sources** (read-only):
90
+ 1. docs/09-agents/status.json - Blocker data + blocked_by field
91
+ 2. docs/09-agents/bus/log.jsonl - Blocking events + timestamps
92
+ 3. docs/06-stories/**/US-*.md - Story dependencies
93
+ 4. docs/03-decisions/adr-*.md - Architecture decisions (keyword match)
94
+ 5. docs/10-research/*.md - Research notes (keyword match)
95
+
96
+ **Blocker Detection**:
97
+ - Direct: status="blocked"
98
+ - Dependency: deps not all status="done"
99
+ - Capacity: in-progress + in-review count >2
100
+ - Stale: blocked >14 days old
101
+
102
+ ---
103
+
104
+ ## Output Structure
105
+
106
+ **Summary Section**:
107
+ - Total active blockers
108
+ - Breakdown by category (Technical, Coordination, etc.)
109
+ - Critical count (>14 days)
110
+ - Cross-agent coordination needs
111
+
112
+ **Critical Blockers** (>14 days):
113
+ - Listed first (highest priority)
114
+ - Include story ID, owner, type, reason, duration
115
+
116
+ **Active Blockers** (grouped by category):
117
+ - Category heading
118
+ - List of stories with:
119
+ - ID, owner, blocker type
120
+ - Blocker reason
121
+ - Estimated unblock time
122
+ - Related ADR/research links
123
+ - Actionable resolution
124
+
125
+ **AG-API Coordination Status**:
126
+ - Which AG-UI stories blocked waiting for AG-API
127
+ - Which AG-API stories in-progress that will unblock them
128
+ - Recent AG-API progress messages
129
+ - Estimated unblock timeline
130
+
131
+ **Recently Resolved** (if SHOW_RESOLVED=true):
132
+ - Last 7 days of unblock events
133
+ - Who unblocked, when, what blocker
134
+
135
+ **Prioritized Actions**:
136
+ - Ranked next steps (HIGH/MEDIUM/LOW)
137
+ - Specific commands to resolve
138
+
139
+ ---
140
+
141
+ ## Anti-Patterns & Correct Usage
142
+
143
+ ❌ **DON'T**:
144
+ - Modify status.json (read-only analysis)
145
+ - Skip categorization (helps identify patterns)
146
+ - Ignore cross-agent coordination
147
+ - Hide stale blockers (>14 days)
148
+
149
+ ✅ **DO**:
150
+ - Read status.json (no updates)
151
+ - Categorize all blockers
152
+ - Show AG-API unblocking progress
153
+ - Highlight stale blockers for escalation
154
+
155
+ ---
156
+
157
+ ## Confirmation & Integration
158
+
159
+ After displaying blockers:
160
+ ```xml
161
+ <invoke name="AskUserQuestion">
162
+ <parameter name="questions">[{
163
+ "question": "What would you like to do?",
164
+ "header": "Blocker Actions",
165
+ "multiSelect": false,
166
+ "options": [
167
+ {"label": "Update blocker status", "description": "Mark blocker as resolved"},
168
+ {"label": "Create unblocking story", "description": "Create story to unblock"},
169
+ {"label": "View ADR details", "description": "See related architecture decisions"},
170
+ {"label": "Escalate blocker", "description": "Escalate for decision"}
171
+ ]
172
+ }]</parameter>
173
+ </invoke>
174
+ ```
175
+
176
+ Integration with other commands:
177
+ - `/status` - Update blocker statuses
178
+ - `/story-new` - Create unblocking stories
179
+ - `/adr-new` - Document blocker decisions
180
+ - `/board` - Visualize blocked stories
181
+
182
+ ---
183
+
184
+ ## REMEMBER AFTER COMPACTION
64
185
 
65
- **Output Sections**:
66
- - Summary Stats (count by type, critical count)
67
- - Critical Blockers (stale >14 days)
68
- - Active Blockers (grouped by category with solutions)
69
- - AG-API Unblocking Status (v2.7.0 coordination)
70
- - Capacity Analysis (agents at WIP limit)
71
- - Recently Resolved (last 7 days if requested)
72
- - Prioritized Actions (ranked next steps)
186
+ - Command is read-only (analyzes status.json, no updates)
187
+ - Extracts 4 blocker types (direct, dependency, capacity, stale)
188
+ - Categorizes by 6 types (Technical, Coordination, Clarification, External, Capacity, Research)
189
+ - Links to ADRs and research for resolution hints
190
+ - Highlights v2.7.0 AG-API ↔ AG-UI cross-agent coordination
191
+ - Shows estimated unblock times and actionable next steps
192
+ - Highlights stale blockers (>14 days) for escalation
73
193
 
74
- **Integration**: With `/status`, `/story-new`, `/handoff`, `/adr-new`, `/board`, `/validate-system`
75
194
  <!-- COMPACT_SUMMARY_END -->
76
195
 
77
196
  Comprehensive blocker tracking, resolution suggestions, and cross-agent coordination (leverages v2.7.0 AG-API unblocking capabilities).