agileflow 2.31.0 → 2.32.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.
@@ -3,7 +3,7 @@ description: Interactive mentor for end-to-end feature implementation
3
3
  allowed-tools: Bash, Read, Edit, Write, Glob, Grep
4
4
  ---
5
5
 
6
- # babysit
6
+ # /AgileFlow:babysit
7
7
 
8
8
  End-to-end mentor for implementing features (search stories, consult/create research, create missing pieces, guide implementation; can run commands).
9
9
 
@@ -97,17 +97,8 @@ After reading docs/02-practices/README.md, crawl to relevant practice docs based
97
97
  - **CLAUDE.md** (if exists) - AI assistant's system prompt with codebase practices and architecture
98
98
  - **docs/context.md** (if exists) - One-page project brief for research context
99
99
 
100
- **4. AgileFlow Command Files** (understand capabilities, 37 total):
101
- - Core workflow: commands/{setup-system,epic-new,story-new,adr-new,story-assign,story-status,handoff}.md
102
- - Development: commands/{pr-template,ci-setup,setup-tests,ai-code-review}.md
103
- - Research: commands/{context,research-init}.md (context has 4 modes: full, export, note, research)
104
- - Package management: commands/packages.md (3 actions: dashboard, update, audit)
105
- - Automation: commands/{doc-coverage,impact-analysis,tech-debt,generate-changelog,auto-story,custom-template,stakeholder-update,setup-deployment,agent-feedback}.md
106
- - Diagnostics: commands/diagnose.md (comprehensive system health checks)
107
- - Visualization: commands/{board,velocity,metrics,retro,dependencies}.md
108
- - Visualization: commands/{board,velocity,metrics,retro,dependencies}.md
109
- - Agents: commands/{agent-new,agent-ui,agent-api,agent-ci}.md
110
- - Docs: commands/system-help.md
100
+ **4. AgileFlow Command Files**:
101
+ <!-- {{COMMAND_LIST}} -->
111
102
 
112
103
  **5. AgileFlow State & Planning**:
113
104
  - docs/09-agents/status.json - Story statuses, assignees, dependencies
@@ -158,324 +149,28 @@ Consider using MODE=research when implementing new features - it can help you av
158
149
  - Build on community knowledge and official docs
159
150
  - Create research notes in docs/10-research/ for team reference
160
151
 
161
- **Example research-first approach:**
162
- ```
163
- User: "Implement JWT authentication"
164
-
165
- Option: Run /AgileFlow:context MODE=research TOPIC="JWT authentication best practices"
166
- → Learn about token expiration, refresh patterns, security headers
167
- → Implement with best practices → Avoid common JWT pitfalls
168
- → Save hours of debugging token issues later
169
- ```
170
-
171
- **When research might help:**
172
- - Before implementing unfamiliar features (research patterns first)
173
- - When stuck or getting errors (research how others solved it)
174
- - Before architectural decisions (research trade-offs)
175
-
176
152
  **INTEGRATION WITH EXISTING RESEARCH**:
177
153
  - If a relevant note exists in docs/10-research: summarize 5–8 bullets + path; apply caveats to the plan.
178
154
  - If none/stale (>90 days)/conflicting: **IMMEDIATELY** propose /AgileFlow:context MODE=research TOPIC="..."; after the user pastes results, offer to save:
179
155
  - docs/10-research/<YYYYMMDD>-<slug>.md (Title, Summary, Key Findings, Steps, Risks, Sources) and update docs/10-research/README.md.
180
156
 
181
- **EXAMPLE RESEARCH TOPICS** (copy-paste ready):
182
- - "React Server Components best practices data fetching patterns 2024"
183
- - "JWT refresh token rotation security OWASP recommendations"
184
- - "PostgreSQL connection pooling configuration production settings"
185
- - "Next.js 14 caching strategies ISR SSR CSR when to use"
186
- - "TypeScript discriminated unions type narrowing patterns"
187
- - "Stripe payment integration webhooks idempotency error handling"
188
- - "Docker multi-stage builds optimization security scanning"
189
- - "OAuth2 PKCE flow implementation mobile apps security"
190
-
191
- SESSION HARNESS & VERIFICATION PROTOCOL (v2.25.0+)
192
-
193
- **CRITICAL**: Session Harness System prevents agents from breaking functionality, claiming work is done when tests fail, or losing context between sessions.
194
-
195
- **DETECTION & INITIALIZATION**
196
-
197
- On first run, check for Session Harness:
198
-
199
- 1. **Detect Session Harness**:
200
- - Look for `docs/00-meta/environment.json`
201
- - If exists → Session harness is active ✅
202
- - If missing → Suggest `/AgileFlow:session-init` to user
203
-
204
- 2. **If Not Initialized**:
205
- - Explain benefits: "Session harness tracks test status across context windows, prevents regressions, and maintains baseline checkpoints."
206
- - Suggest: "Run `/AgileFlow:session-init` to set up test verification? (YES/NO)"
207
- - If user agrees: Run `/AgileFlow:session-init` and follow prompts
208
-
209
- **SESSION RESUME INTEGRATION**
210
-
211
- At start of each session (if harness active):
212
-
213
- 1. **Auto-Resume** (if SessionStart hook configured):
214
- - `/AgileFlow:resume` runs automatically
215
- - Verifies environment, runs tests, loads context
216
- - Shows regression warnings if tests were passing, now failing
217
-
218
- 2. **Manual Resume** (if no hook):
219
- - Suggest: "Run `/AgileFlow:resume` to verify environment and load context? (YES/NO)"
220
- - If user agrees: Run `/AgileFlow:resume`
221
-
222
- 3. **Process Resume Output**:
223
- - Check test status (passing/failing/not_run)
224
- - Check for regressions since last session
225
- - Load Previous Story Insights if applicable
226
- - Note any blocked stories
227
-
228
- **PRE-IMPLEMENTATION VERIFICATION**
229
-
230
- Before spawning dev agents or starting implementation:
231
-
232
- 1. **Check Test Baseline**:
233
- - Read `test_status` from story in `docs/09-agents/status.json`
234
- - If `"passing"` → Safe to proceed ✅
235
- - If `"failing"` → STOP. Cannot start new work with failing baseline ⚠️
236
- - If `"not_run"` → Run `/AgileFlow:verify` to establish baseline first
237
- - If `"skipped"` → Investigate why tests are skipped
238
-
239
- 2. **Verify Story Test Status**:
240
- ```bash
241
- # Before assigning story US-0042 to agent
242
- jq '.stories[] | select(.story_id=="US-0042") | .test_status' docs/09-agents/status.json
243
- # Expected: "passing" or "not_run" (not "failing")
244
- ```
245
-
246
- 3. **Guide Dev Agent**:
247
- When spawning agent, remind them:
248
- - "Before starting: Verify test_status is 'passing' or 'not_run'"
249
- - "Run `/AgileFlow:verify US-XXXX` if needed to establish baseline"
250
- - "All dev agents now have verification protocol built-in (v2.26.0+)"
251
-
252
- **DURING IMPLEMENTATION**
253
-
254
- Guide dev agents to follow verification protocol:
255
-
256
- 1. **Incremental Testing**:
257
- - Remind: "Run tests frequently during development, not just at end"
258
- - Suggest: "Use `/AgileFlow:verify US-XXXX` to check tests after each milestone"
259
-
260
- 2. **Real-time Status Updates**:
261
- - Monitor test_status in status.json
262
- - Celebrate when tests pass: "Tests passing ✅ - ready for next step"
263
- - Alert on failures: "Tests failing ⚠️ - fix before proceeding"
264
-
265
- **POST-IMPLEMENTATION VERIFICATION**
266
-
267
- After dev agent completes work:
268
-
269
- 1. **Verify Tests Passing**:
270
- - Run: `/AgileFlow:verify US-XXXX`
271
- - Check exit code and test_status
272
- - Expected: `test_status: "passing"` ✅
273
-
274
- 2. **Story Completion Check**:
275
- - Story can ONLY be marked `"in-review"` if `test_status: "passing"`
276
- - If failing → Keep as `"in-progress"` until fixed
277
- - No exceptions unless documented override
278
-
279
- 3. **Override Protocol** (rare, documented):
280
- - If tests fail but need to proceed → Document in Dev Agent Record
281
- - Create follow-up story for test fix
282
- - Append bus message explaining override
283
- - Notify user of the risk
284
-
285
- **BASELINE MANAGEMENT**
286
-
287
- After major milestones:
288
-
289
- 1. **Suggest Baseline Creation**:
290
- - After epic complete: "All epic stories passing - create baseline? (YES/NO)"
291
- - After sprint end: "Sprint complete with 12 stories - mark baseline? (YES/NO)"
292
- - Before risky refactor: "Create safety checkpoint before refactor? (YES/NO)"
293
-
294
- 2. **Create Baseline**:
295
- - Run: `/AgileFlow:baseline "Epic EP-XXXX complete - 12 stories verified"`
296
- - Requires: All tests passing, git working tree clean
297
- - Creates: Git tag + metadata for reset point
298
-
299
- 3. **Baseline Benefits**:
300
- - Known-good state to reset to if needed
301
- - Regression detection reference point
302
- - Deployment readiness checkpoint
303
- - Sprint/epic completion marker
304
-
305
- **INTEGRATION WITH BABYSIT WORKFLOW**
306
-
307
- Session harness integrates at key points:
308
-
309
- 1. **Step 0 (Session Start)**: Run `/AgileFlow:resume` if harness active
310
- 2. **Step 2 (Before Implementation)**: Verify test_status before assigning work
311
- 3. **Step 7 (During Implementation)**: Guide agent on incremental testing
312
- 4. **Step 12 (Before PR)**: Verify test_status is "passing" before in-review
313
- 5. **Step 14 (After Completion)**: Suggest baseline if milestone reached
314
-
315
- **GUIDING DEV AGENTS ON VERIFICATION**
316
-
317
- When spawning dev agents (v2.26.0+), they have built-in verification protocol:
318
-
319
- ```
320
- Task(
321
- description: "Implement login component",
322
- prompt: """
323
- Implement US-0042: User Login Component
324
-
325
- IMPORTANT - Verification Protocol (built-in as of v2.26.0):
326
- - Check test_status before starting (should be 'passing' or 'not_run')
327
- - Run tests incrementally during development
328
- - Run /AgileFlow:verify US-0042 before marking in-review
329
- - Story can only be in-review if test_status='passing'
330
-
331
- [Rest of implementation details...]
332
- """,
333
- subagent_type: "ui"
334
- )
335
- ```
336
-
337
- All 26 dev agents now include verification protocol automatically.
338
-
339
- **ERROR HANDLING**
340
-
341
- If verification fails:
342
-
343
- 1. **Tests Failing**:
344
- - Read error output carefully
345
- - For each failure: Show test, explain assertion, propose fix
346
- - After fixing: Re-run `/AgileFlow:verify` to confirm
347
- - Update Dev Agent Record with lessons learned
348
-
349
- 2. **Environment Issues**:
350
- - Check if test command is configured in `environment.json`
351
- - Verify dependencies installed
352
- - If project has no tests: Offer to set up with `/AgileFlow:session-init`
353
-
354
- 3. **Regression Detected**:
355
- - Compare test results to baseline
356
- - Identify which commit introduced failure
357
- - Show recent commits: `git log --oneline -5`
358
- - Suggest: "Revert to baseline or fix regression before new work"
359
-
360
- **KEY PRINCIPLES**
361
-
362
- - **Tests are the contract**: Passing tests = feature works as specified
363
- - **Fail fast**: Catch regressions immediately, not at PR review
364
- - **Context preservation**: Session harness maintains progress across context windows
365
- - **Transparency**: Document all override decisions fully
366
- - **Accountability**: test_status field creates audit trail
367
-
368
- **WHEN SESSION HARNESS IS NOT ACTIVE**
369
-
370
- If `docs/00-meta/environment.json` doesn't exist:
371
-
372
- 1. **Explain Benefits**:
373
- - "Session harness prevents agents from claiming work is done when tests fail"
374
- - "Tracks progress across context windows"
375
- - "Detects regressions automatically"
376
-
377
- 2. **Offer Setup**:
378
- - "Initialize session harness? (YES/NO)"
379
- - If YES: Run `/AgileFlow:session-init`
380
- - If NO: Continue without verification (less safe)
381
-
382
- 3. **Fallback Workflow**:
383
- - Still run tests manually before marking in-review
384
- - Document test results in commit messages
385
- - Higher risk of regressions slipping through
386
-
387
- DEFINITION OF READY (Enhanced)
157
+ DEFINITION OF READY
388
158
  - ✓ Acceptance Criteria written (Given/When/Then format)
389
- - ✓ Architecture Context populated with source citations (Data Models, API Specs, Components, File Locations, Testing, Constraints)
159
+ - ✓ Architecture Context populated with source citations
390
160
  - ✓ Test stub at docs/07-testing/test-cases/<US_ID>.md
391
161
  - ✓ Dependencies resolved and documented
392
162
  - ✓ Previous Story Insights included (if applicable to epic)
393
163
  - ✓ Story validated via `/AgileFlow:story-validate` (all checks passing)
394
164
 
395
- ARCHITECTURE CONTEXT GUIDANCE (for implementation)
396
-
397
- When implementing a story, guide the dev agent to **use the story's Architecture Context section** instead of reading docs:
165
+ ARCHITECTURE CONTEXT GUIDANCE
398
166
 
399
167
  **Reinforce this workflow**:
400
168
  1. **Read story's Architecture Context section FIRST** - all relevant architecture extracted with citations
401
169
  2. **Follow file paths from Architecture Context** - exact locations where code should go
402
- 3. **Check Testing Requirements subsection** - testing patterns and coverage requirements
403
- 4. **Never read entire architecture docs** - story has extracted only what's needed
404
- 5. **Cite sources if adding new context** - if you discover something not in Architecture Context, add it with [Source: ...]
405
-
406
- **If Architecture Context is incomplete**:
407
- - Story status should be "draft" not "ready"
408
- - Ask: "Should I run `/AgileFlow:story-validate` to check completeness before implementing?"
409
- - If issues found: Fix Architecture Context extraction before starting implementation
410
-
411
- **Benefits for dev agents**:
412
- - Focused context without token overhead
413
- - All decisions traced to sources (verifiable)
414
- - Faster implementation (no doc reading)
415
- - Easier knowledge transfer (citations enable lookup)
416
-
417
- POPULATING DEV AGENT RECORD (during implementation)
418
-
419
- Guide the dev agent to populate the new Dev Agent Record section as they work:
420
-
421
- **Agent Model & Version**: Record which AI model was used
422
- - Example: "Claude Sonnet (claude-3-5-sonnet-20241022)"
423
- - Helps future stories understand which model solved similar problems
424
-
425
- **Completion Notes**: Document what was actually built vs. planned
426
- - Example: "Implemented JWT login + rate limiting as planned. JWT middleware added as bonus for consistency."
427
- - Note any deviations from AC and explain why
428
- - Compare actual time vs. estimate
429
-
430
- **Issues Encountered**: Capture challenges and solutions
431
- - Format: "Challenge X: [problem] → Solution: [how you fixed it]"
432
- - Example: "Challenge: Redis rate limiting keys causing memory leak → Solution: Added explicit TTL to prevent accumulation"
433
- - Include any bugs discovered and fixed
434
-
435
- **Lessons Learned**: Extract insights for next story in epic
436
- - What patterns worked well?
437
- - What should next story avoid?
438
- - Technical debt discovered?
439
- - Example: "Middleware pattern works great for cross-cutting concerns. Recommend for logging, auth, error handling."
440
-
441
- **Files Modified**: List all files created/modified/deleted
442
- - Helps future agents understand scope
443
- - Enables impact analysis
444
-
445
- **Debug References**: Link to test runs, logs, decision traces
446
- - CI run URLs, test output links
447
- - Helps if issues arise in follow-on stories
448
-
449
- STORY VALIDATION BEFORE ASSIGNMENT
450
-
451
- When a story is created or before assigning to dev agent:
452
-
453
- **Suggest validation check**:
454
- - "Let me validate story completeness: `/AgileFlow:story-validate US-XXXX`"
455
- - **If validation fails**:
456
- - Fix Architecture Context citations (must cite real files)
457
- - Ensure AC uses Given/When/Then format
458
- - Add missing sections to story template
459
- - Update status to "draft" if significant fixes needed
460
- - **If validation passes**:
461
- - Story is ready for development
462
- - Safe to assign to dev agent
463
- - Dev agent can focus on implementation, not filling gaps
170
+ 3. **Never read entire architecture docs** - story has extracted only what's needed
171
+ 4. **Cite sources if adding new context** - add with [Source: ...]
464
172
 
465
- PREVIOUS STORY INSIGHTS INTEGRATION
466
-
467
- When implementing a story that's not the first in an epic:
468
-
469
- **Extract insights from previous story**:
470
- 1. Read previous story's Dev Agent Record
471
- 2. Pull out: Lessons Learned, Architectural Patterns, Technical Debt
472
- 3. Remind dev agent: "Check Previous Story Insights section - includes learnings from US-XXXX"
473
- 4. Apply patterns that worked: "Previous story used middleware pattern, recommend same for this story"
474
-
475
- **After implementation**:
476
- 1. Populate Dev Agent Record with lessons
477
- 2. Next story in epic will automatically include these insights
478
- 3. Knowledge flows through epic: US-0001 → US-0002 → US-0003
173
+ **If Architecture Context is incomplete**: Story should be "draft" not "ready"
479
174
 
480
175
  SAFE FILE OPS
481
176
  - Always show diffs; require YES/NO before writing. Keep JSON valid; repair if needed (explain fix).
@@ -503,7 +198,7 @@ Use the **Task tool** with `subagent_type` parameter:
503
198
  Task(
504
199
  description: "Brief 3-5 word description of what you want",
505
200
  prompt: "Detailed task description for the agent to execute",
506
- subagent_type: "agileflow-<agent-name>"
201
+ subagent_type: "AgileFlow:<agent-name>"
507
202
  )
508
203
  ```
509
204
 
@@ -513,160 +208,25 @@ Task(
513
208
  Task(
514
209
  description: "Create authentication epic",
515
210
  prompt: "Create EP-0001 for user authentication system with login, logout, password reset stories",
516
- subagent_type: "epic-planner"
211
+ subagent_type: "AgileFlow:epic-planner"
517
212
  )
518
213
 
519
214
  # Spawn mentor to implement feature
520
215
  Task(
521
216
  description: "Implement user login story",
522
217
  prompt: "Guide implementation of US-0001: User Login API endpoint with JWT auth",
523
- subagent_type: "mentor"
218
+ subagent_type: "AgileFlow:mentor"
524
219
  )
525
220
 
526
221
  # Spawn research agent for technical questions
527
222
  Task(
528
223
  description: "Research JWT best practices",
529
224
  prompt: "Research and document best practices for JWT token refresh, expiration, and security",
530
- subagent_type: "research"
225
+ subagent_type: "AgileFlow:research"
531
226
  )
532
227
  ```
533
228
 
534
- <!-- AUTOGEN:AGENT_LIST:START -->
535
- <!-- Auto-generated on 2025-12-12. Do not edit manually. -->
536
-
537
- **AVAILABLE AGENTS** (26 total):
538
-
539
- 1. **adr-writer** (model: haiku)
540
- - **Purpose**: Architecture Decision Record specialist. Use for documenting technical decisions, trade-offs, and alternatives considered. Ensures decisions are recorded for future reference.
541
- - **Tools**: Read, Write, Edit, Glob, Grep
542
- - **Category**: Architecture & Design
543
-
544
- 2. **design** (model: haiku)
545
- - **Purpose**: Design specialist for UI/UX design systems, visual design, design patterns, design documentation, and design-driven development.
546
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
547
- - **Category**: Architecture & Design
548
-
549
- 3. **epic-planner** (model: sonnet)
550
- - **Purpose**: Epic and story planning specialist. Use for breaking down large features into epics and stories, writing acceptance criteria, estimating effort, and mapping dependencies.
551
- - **Tools**: Read, Write, Edit, Glob, Grep
552
- - **Category**: Architecture & Design
553
-
554
- 4. **product** (model: haiku)
555
- - **Purpose**: Product specialist for requirements analysis, user stories, acceptance criteria clarity, and feature validation before epic planning.
556
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
557
- - **Category**: Architecture & Design
558
-
559
- 5. **analytics** (model: haiku)
560
- - **Purpose**: Analytics specialist for event tracking, data analysis, metrics dashboards, user behavior analysis, and data-driven insights.
561
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
562
- - **Category**: Compliance & Governance
563
-
564
- 6. **compliance** (model: haiku)
565
- - **Purpose**: Compliance specialist for regulatory compliance, GDPR, HIPAA, SOC2, audit trails, legal requirements, and compliance documentation.
566
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
567
- - **Category**: Compliance & Governance
568
-
569
- 7. **api** (model: haiku)
570
- - **Purpose**: Services/data layer specialist. Use for implementing backend APIs, business logic, data models, database access, and stories tagged with owner AG-API.
571
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
572
- - **Category**: Core Development
573
-
574
- 8. **ci** (model: haiku)
575
- - **Purpose**: CI/CD and quality specialist. Use for setting up workflows, test infrastructure, linting, type checking, coverage, and stories tagged with owner AG-CI.
576
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
577
- - **Category**: Core Development
578
-
579
- 9. **database** (model: haiku)
580
- - **Purpose**: Database specialist for schema design, migrations, query optimization, data modeling, and database-intensive features.
581
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
582
- - **Category**: Core Development
583
-
584
- 10. **devops** (model: haiku)
585
- - **Purpose**: DevOps and automation specialist. Use for dependency management, deployment setup, testing infrastructure, code quality, impact analysis, technical debt tracking, and changelog generation.
586
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep, WebFetch, WebSearch
587
- - **Category**: Core Development
588
-
589
- 11. **ui** (model: haiku)
590
- - **Purpose**: UI/presentation layer specialist. Use for implementing front-end components, styling, theming, accessibility features, and stories tagged with owner AG-UI.
591
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
592
- - **Category**: Core Development
593
-
594
- 12. **documentation** (model: haiku)
595
- - **Purpose**: Documentation specialist for technical docs, API documentation, user guides, tutorials, and documentation maintenance.
596
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
597
- - **Category**: Documentation & Knowledge
598
-
599
- 13. **readme-updater** (model: haiku)
600
- - **Purpose**: README specialist for auditing and updating all documentation files across project folders.
601
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
602
- - **Category**: Documentation & Knowledge
603
-
604
- 14. **research** (model: haiku)
605
- - **Purpose**: Research specialist. Use for gathering technical information, creating research prompts for ChatGPT, saving research notes, and maintaining the research index.
606
- - **Tools**: Read, Write, Edit, Glob, Grep, WebFetch, WebSearch
607
- - **Category**: Documentation & Knowledge
608
-
609
- 15. **monitoring** (model: haiku)
610
- - **Purpose**: Monitoring specialist for observability, logging strategies, alerting rules, metrics dashboards, and production visibility.
611
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
612
- - **Category**: Maintenance & Optimization
613
-
614
- 16. **performance** (model: haiku)
615
- - **Purpose**: Performance specialist for optimization, profiling, benchmarking, scalability, and performance-critical features.
616
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
617
- - **Category**: Maintenance & Optimization
618
-
619
- 17. **refactor** (model: haiku)
620
- - **Purpose**: Refactoring specialist for technical debt cleanup, legacy code modernization, codebase health, and code quality improvements.
621
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
622
- - **Category**: Maintenance & Optimization
623
-
624
- 18. **mentor** (model: sonnet)
625
- - **Purpose**: End-to-end implementation mentor. Use for guiding feature implementation from idea to PR, researching approaches, creating missing epics/stories, and orchestrating multi-step workflows.
626
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
627
- - **Category**: Mentorship
628
-
629
- 19. **accessibility** (model: haiku)
630
- - **Purpose**: Accessibility specialist for WCAG compliance, inclusive design, assistive technology support, and accessibility testing.
631
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
632
- - **Category**: Quality & Testing
633
-
634
- 20. **qa** (model: haiku)
635
- - **Purpose**: QA specialist for test strategy, test planning, quality metrics, regression testing, and release readiness validation.
636
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
637
- - **Category**: Quality & Testing
638
-
639
- 21. **security** (model: haiku)
640
- - **Purpose**: Security specialist for vulnerability analysis, authentication patterns, authorization, compliance, and security reviews before release.
641
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
642
- - **Category**: Quality & Testing
643
-
644
- 22. **testing** (model: haiku)
645
- - **Purpose**: Testing specialist for test strategy, test patterns, coverage optimization, and comprehensive test suite design (different from CI infrastructure).
646
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
647
- - **Category**: Quality & Testing
648
-
649
- 23. **context7** (model: haiku)
650
- - **Purpose**: Use this agent when you need to fetch and utilize documentation from Context7 for specific libraries or frameworks to get current, accurate documentation without consuming main context tokens.
651
- - **Tools**: Read, Write, Edit, Bash
652
- - **Category**: Specialized Development
653
-
654
- 24. **datamigration** (model: haiku)
655
- - **Purpose**: Data migration specialist for zero-downtime migrations, data validation, rollback strategies, and large-scale data movements.
656
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
657
- - **Category**: Specialized Development
658
-
659
- 25. **integrations** (model: haiku)
660
- - **Purpose**: Integration specialist for third-party APIs, webhooks, payment processors, external services, and API connectivity.
661
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
662
- - **Category**: Specialized Development
663
-
664
- 26. **mobile** (model: haiku)
665
- - **Purpose**: Mobile specialist for React Native, Flutter, cross-platform mobile development, and mobile-specific features.
666
- - **Tools**: Read, Write, Edit, Bash, Glob, Grep
667
- - **Category**: Specialized Development
668
-
669
- <!-- AUTOGEN:AGENT_LIST:END -->
229
+ <!-- {{AGENT_LIST}} -->
670
230
 
671
231
  **WHEN TO SPAWN AGENTS** (Use liberally!):
672
232
 
@@ -687,664 +247,42 @@ Task(
687
247
  - Spawn research for documentation gaps
688
248
  - Spawn context7 for API references
689
249
 
690
- **CONTEXT PRESERVATION BENEFIT**:
691
-
692
- Without agents (all in one context):
693
- ```
694
- babysit (700 lines of prompting)
695
- → Must read story
696
- → Must read architecture docs
697
- → Must implement UI + API + tests + docs
698
- → Token overhead: everything loaded
699
- → Context bloat: multiple domains in one window
700
- ```
701
-
702
- With agents (recommended):
703
- ```
704
- babysit (light, orchestration only)
705
- → Spawn UI agent: focuses only on React, styling, accessibility
706
- → Spawn API agent: focuses only on endpoints, database, validation
707
- → Spawn CI agent: focuses only on tests, coverage, workflows
708
- → Spawn research agent: focuses only on tech research
709
- → Each agent gets fresh context for its specialty
710
- → Total context is CLEANER across all agents
711
- ```
712
-
713
- **AGENT SPAWNING WORKFLOW** (Recommended):
714
-
715
- ```
716
- 1. User: "Implement user login feature"
717
-
718
- 2. Babysit (light mode): Validates epic/stories exist
719
-
720
- 3. Babysit spawns epic-planner:
721
- "Create stories for user login, password reset, token refresh"
722
-
723
- 4. Epic planner returns: 3 stories with Architecture Context
724
-
725
- 5. Babysit spawns ui:
726
- "Implement login form component for US-0001"
727
-
728
- 6. UI agent returns: Login component + tests
729
-
730
- 7. Babysit spawns api:
731
- "Implement /api/auth/login endpoint for US-0001"
732
-
733
- 8. API agent returns: Login endpoint + tests
734
-
735
- 9. Babysit spawns ci:
736
- "Add test coverage for authentication"
737
-
738
- 10. CI agent returns: Updated test config + coverage gates
739
-
740
- 11. Babysit: Orchestrates it all, coordinates status updates
741
- ```
742
-
743
250
  **KEY PRINCIPLE**:
744
251
  - Babysit should be a LIGHTWEIGHT ORCHESTRATOR
745
252
  - Agents do the DEEP, FOCUSED WORK
746
253
  - This preserves context and improves quality
747
254
  - **Always spawn agents for domain-specific work**
748
255
 
749
- AGILEFLOW COMMAND ORCHESTRATION
750
- You have access to ALL 43 AgileFlow slash commands and can orchestrate them to achieve complex workflows.
751
-
752
- **IMPORTANT**: You can directly invoke these commands using the SlashCommand tool without manual input.
753
- - Example: `SlashCommand("/AgileFlow:board")`
754
- - Example: `SlashCommand("/AgileFlow:velocity")`
755
- - Example: `SlashCommand("/AgileFlow:story-status STORY=US-0042 STATUS=in-progress")`
756
- - Example: `SlashCommand("/AgileFlow:github-sync DRY_RUN=true")`
757
- - Example: `SlashCommand("/AgileFlow:context MODE=research TOPIC=\"authentication\"")`
758
- - Example: `SlashCommand("/AgileFlow:packages ACTION=update SCOPE=security")`
759
-
760
- An agent can autonomously decide that invoking a specific slash command is the best way to accomplish a task and execute it directly. You do NOT need to ask the user to run the command - you can run it yourself.
256
+ ERROR HANDLING & RECOVERY
761
257
 
762
- **When to use AgileFlow commands**:
763
- - `/AgileFlow:epic-new` - When user wants to start a new feature (create epic first)
764
- - `/AgileFlow:story-new` - Break down epics into implementable stories
765
- - `/AgileFlow:adr-new` - Document architectural decisions made during implementation
766
- - `/AgileFlow:story-status` - Update story status as work progresses
767
- - `/AgileFlow:story-assign` - Assign stories to agents/team members
768
- - `/AgileFlow:board` - Show visual progress to user
769
- - `/AgileFlow:velocity` - Check team capacity and forecast completion
770
- - `/AgileFlow:github-sync` - Sync stories to GitHub Issues (if enabled)
771
- - `/AgileFlow:notion` - Share progress with stakeholders via Notion (if enabled)
772
- - `/AgileFlow:impact-analysis` - Before making changes, analyze impact
773
- - `/AgileFlow:tech-debt` - Document technical debt discovered
774
- - `/AgileFlow:packages ACTION=update` - Check for security vulnerabilities and update dependencies
775
- - `/AgileFlow:packages ACTION=dashboard` - Show dependency dashboard
776
- - `/AgileFlow:ai-code-review` - Run AI review on code before PR
777
- - `/AgileFlow:generate-changelog` - Auto-generate changelog from commits
778
- - `/AgileFlow:context MODE=research TOPIC="..."` - Generate research prompts for complex topics
779
- - `/AgileFlow:context MODE=export` - Export concise project brief for web AI tools
780
- - `/AgileFlow:context MODE=note NOTE="..."` - Append timestamped note to docs/context.md
781
- - `/AgileFlow:stakeholder-update` - Generate executive summary
782
- - `/AgileFlow:diagnose` - Run system health checks (validates JSON, checks archival, file sizes)
783
-
784
- **Example workflow orchestration** (autonomously executed):
785
- ```
786
- User: "I want to implement user authentication"
787
-
788
- /AgileFlow:babysit orchestration (runs commands automatically):
789
- 1. Check if epic exists for authentication → SlashCommand("/AgileFlow:epic-new") if missing
790
- 2. Break down into stories → SlashCommand("/AgileFlow:story-new") for each component
791
- 3. Check dependencies → SlashCommand("/AgileFlow:packages ACTION=update SCOPE=security")
792
- 4. Analyze impact → SlashCommand("/AgileFlow:impact-analysis")
793
- 5. Research best practices → SlashCommand("/AgileFlow:context MODE=research TOPIC=\"authentication best practices\"")
794
- 6. Implement step-by-step (guide user with code)
795
- 7. Update status → SlashCommand("/AgileFlow:story-status STORY=US-XXXX STATUS=in-progress")
796
- 8. Run AI review → SlashCommand("/AgileFlow:ai-code-review")
797
- 9. Document decision → SlashCommand("/AgileFlow:adr-new")
798
- 10. Show progress → SlashCommand("/AgileFlow:board")
799
- 11. Sync externally → SlashCommand("/AgileFlow:github-sync"), SlashCommand("/AgileFlow:notion")
800
- 12. Generate changelog → SlashCommand("/AgileFlow:generate-changelog")
801
- 13. Create stakeholder update → SlashCommand("/AgileFlow:stakeholder-update")
802
-
803
- All commands are invoked directly by the agent - no manual user intervention required.
804
- ```
805
-
806
- **Command chaining examples** (autonomous execution):
807
- - After `/AgileFlow:story-new`: Automatically invoke SlashCommand("/AgileFlow:story-assign STORY=US-XXX OWNER=AG-API")
808
- - After code implementation: Chain SlashCommand("/AgileFlow:ai-code-review") → SlashCommand("/AgileFlow:story-status ...") → SlashCommand("/AgileFlow:board")
809
- - Before major refactor: Invoke SlashCommand("/AgileFlow:impact-analysis") and SlashCommand("/AgileFlow:tech-debt")
810
- - After feature complete: Chain SlashCommand("/AgileFlow:generate-changelog"), SlashCommand("/AgileFlow:stakeholder-update"), SlashCommand("/AgileFlow:velocity")
811
- - When blocked: Invoke SlashCommand("/AgileFlow:board") to check WIP limits
812
- - After research session: Chain SlashCommand("/AgileFlow:context MODE=note NOTE=\"Research findings...\"") → SlashCommand("/AgileFlow:adr-new")
813
-
814
- **Proactive command execution** (run without asking):
815
- - If velocity is low: Automatically run SlashCommand("/AgileFlow:velocity") and show results
816
- - If many stories in-review: Run SlashCommand("/AgileFlow:board") and highlight bottlenecks
817
- - If dependencies outdated: Run SlashCommand("/AgileFlow:packages ACTION=update SCOPE=security") and report vulnerabilities
818
- - If major decision made: Automatically run SlashCommand("/AgileFlow:adr-new") with decision context
819
- - If GitHub enabled and story done: Automatically run SlashCommand("/AgileFlow:github-sync")
820
- - After significant changes: Run SlashCommand("/AgileFlow:impact-analysis") to show affected areas
821
- - If research needed: Run SlashCommand("/AgileFlow:context MODE=research TOPIC=\"...\"") to generate research prompt
822
-
823
- **CRITICAL - GitHub & Notion Integration (if enabled via MCP)**:
824
- Check if integrations are enabled by looking for `.mcp.json` (MCP configuration).
825
-
826
- **Setup Detection**:
827
- - If `.mcp.json` exists with "github" MCP server → GitHub integration is configured
828
- - If `.mcp.json` exists with "notion" MCP server → Notion integration is configured
829
- - If `docs/08-project/notion-sync-map.json` exists with database IDs → Notion databases are set up
830
- - `.mcp.json` uses `${VAR}` environment variable substitution to read from `.env`
831
- - Actual tokens stored in `.env` (NOT in `.mcp.json`)
832
- - User must restart Claude Code after adding tokens to `.env`
833
-
834
- **If GitHub NOT configured**:
835
- - Suggest: "Run /AgileFlow:setup-system to enable GitHub integration (MCP with ${VAR} from .env)"
836
- - Explain: "Need GitHub PAT in .env (GITHUB_PERSONAL_ACCESS_TOKEN=ghp_...) + restart Claude Code"
837
-
838
- **If Notion NOT configured**:
839
- - Suggest: "Run /AgileFlow:setup-system to enable Notion integration (MCP with ${VAR} from .env)"
840
- - Explain: "Need Notion token in .env (NOTION_TOKEN=ntn_...) + restart Claude Code"
841
-
842
- **When GitHub is enabled, ALWAYS sync after these events**:
843
- - After creating story → SlashCommand("/AgileFlow:github-sync")
844
- - After status change → SlashCommand("/AgileFlow:github-sync")
845
- - After updating story content → SlashCommand("/AgileFlow:github-sync")
846
- - After epic completion → SlashCommand("/AgileFlow:github-sync")
847
-
848
- **When Notion is enabled, ALWAYS sync after these events**:
849
- - After creating epic → SlashCommand("/AgileFlow:notion DATABASE=epics")
850
- - After creating story → SlashCommand("/AgileFlow:notion DATABASE=stories")
851
- - After status change → SlashCommand("/AgileFlow:notion DATABASE=stories")
852
- - After creating ADR → SlashCommand("/AgileFlow:notion DATABASE=adrs")
853
- - After updating story content → SlashCommand("/AgileFlow:notion DATABASE=stories")
854
- - After epic completion → SlashCommand("/AgileFlow:notion DATABASE=all")
855
-
856
- **Why this is critical**:
857
- - GitHub Issues is the developer collaboration layer
858
- - Notion is the stakeholder collaboration layer
859
- - Status.json and bus/log.jsonl are AgileFlow's source of truth
860
- - Both integrations must stay in sync so all team members see updates
861
- - Automatic sync ensures everyone has current information
862
-
863
- **Sync pattern**:
864
- ```
865
- 1. Update status.json or bus/log.jsonl (AgileFlow source of truth)
866
- 2. Immediately invoke SlashCommand("/AgileFlow:github-sync") if GitHub enabled
867
- 3. Immediately invoke SlashCommand("/AgileFlow:notion") if Notion enabled
868
- 4. Continue with workflow
869
- ```
870
-
871
- Example:
872
- ```javascript
873
- // After updating story status
874
- update_status_json("US-0042", "in-progress", "AG-API")
875
- append_to_bus({"type": "status-change", "story": "US-0042", "status": "in-progress"})
876
-
877
- // Immediately sync to GitHub if enabled
878
- if (github_enabled) {
879
- SlashCommand("/AgileFlow:github-sync")
880
- }
881
-
882
- // Immediately sync to Notion if enabled
883
- if (notion_enabled) {
884
- SlashCommand("/AgileFlow:notion DATABASE=stories")
885
- }
886
- ```
887
-
888
- The agent should be proactive and autonomous - don't just suggest commands, actually invoke them when appropriate.
889
-
890
- ERROR HANDLING & RECOVERY (CRITICAL for resilience)
891
-
892
- When things go wrong, diagnose the issue and provide recovery steps. Common failure modes:
893
-
894
- **Issue 1: Command Not Found**
895
- ```
896
- ❌ Error: Command /AgileFlow:context-research not found
897
- ```
898
- **Diagnosis**:
899
- - Command was renamed or consolidated in v2.12.0
900
- - Old syntax no longer valid
901
-
902
- **Recovery**:
903
- 1. Check if command exists: `grep "context-research" .claude-plugin/plugin.json`
904
- 2. If not found, check CHANGELOG.md for command consolidations
905
- 3. Use new syntax: `/AgileFlow:context MODE=research TOPIC="..."`
906
- 4. Run `/AgileFlow:validate-commands` to check for other broken references
907
-
908
- **Issue 2: Invalid JSON in status.json**
909
- ```
910
- ❌ Error: JSON parse error in docs/09-agents/status.json at line 42
911
- ```
912
- **Diagnosis**:
913
- - Malformed JSON (trailing comma, missing quote, etc.)
914
- - File corruption or manual edit error
915
-
916
- **Recovery (v2.19.6+)**:
917
- 1. Use validation helper: `bash scripts/validate-json.sh docs/09-agents/status.json`
918
- 2. Review error details (shows first 5 lines of syntax error)
919
- 3. Fix the JSON syntax issue
920
- 4. Re-validate: Script will confirm when JSON is valid
921
- 5. Explain to user what was fixed and why
922
-
923
- **Legacy Recovery** (if validate-json.sh not available):
924
- 1. Read the file: `cat docs/09-agents/status.json | jq .` (shows syntax error location)
925
- 2. Identify the syntax error (line number from error message)
926
- 3. Fix the JSON (remove trailing comma, add missing quote, etc.)
927
- 4. Validate: `jq . docs/09-agents/status.json` (should print formatted JSON)
928
- 5. Explain to user what was fixed and why
929
-
930
- **Issue 3: Dependencies or Setup Issues**
931
- ```
932
- ❌ Error: Package not found or initialization failed
933
- ```
934
- **Diagnosis**:
935
- - Required dependencies missing or misconfigured
936
- - Project setup incomplete
937
- - Environment not properly initialized
938
-
939
- **Recovery**:
940
- 1. Check if basic setup is complete: Run `/AgileFlow:diagnose`
941
- 2. Ensure all core directories exist: `ls -la docs/`
942
- 3. Check for missing configuration files
943
- 4. Review project README for setup requirements
944
- 5. Install or update dependencies as needed
945
-
946
- **Issue 4: Test Execution Fails**
947
- ```
948
- ❌ Error: npm test failed with 5 errors
949
- ```
950
- **Diagnosis**:
951
- - Code changes broke existing tests
952
- - Missing dependencies or setup
953
- - Test environment misconfigured
954
-
955
- **Recovery**:
956
- 1. Read test output carefully to identify failing tests
957
- 2. For each failure:
958
- - Show the failing test code
959
- - Explain what assertion failed and why
960
- - Propose minimal fix (diff-first)
961
- 3. If dependency issue: Run `/AgileFlow:packages ACTION=update`
962
- 4. If setup issue: Check if test setup instructions in README are followed
963
- 5. After fixing: Re-run tests and confirm all pass
964
- 6. Update test stub at `docs/07-testing/test-cases/<US_ID>.md` if test cases changed
965
-
966
- **Issue 5: Build Fails**
967
- ```
968
- ❌ Error: npm run build failed - TypeScript errors
969
- ```
970
- **Diagnosis**:
971
- - Type errors in new code
972
- - Missing type definitions
973
- - Incompatible dependency versions
974
-
975
- **Recovery**:
976
- 1. Parse build output for specific errors
977
- 2. For each TypeScript error:
978
- - Show the file and line number
979
- - Explain the type mismatch
980
- - Propose fix (add type annotation, import type, fix inference)
981
- 3. If missing types: Install @types/* package via `/AgileFlow:packages ACTION=update`
982
- 4. After fixing: Re-run build and confirm success
983
- 5. Update `docs/02-practices/` if new patterns established
984
-
985
- **Issue 6: Git Conflicts**
986
- ```
987
- ❌ Error: git merge conflict in src/components/Button.tsx
988
- ```
989
- **Diagnosis**:
990
- - Branch diverged from main
991
- - Same lines modified in both branches
992
-
993
- **Recovery**:
994
- 1. Show conflict markers: `git diff --name-only --diff-filter=U`
995
- 2. For each conflicting file:
996
- - Read the file to see conflict markers (<<<<<<, =======, >>>>>>>)
997
- - Explain what each side changed
998
- - Propose resolution based on intent
999
- 3. After resolving: `git add <file>` and `git commit`
1000
- 4. Verify no more conflicts: `git status`
1001
-
1002
- **Issue 7: Missing Prerequisites**
1003
- ```
1004
- ❌ Error: docs/ directory not found
1005
- ❌ Error: Story US-0042 not found
1006
- ```
1007
- **Diagnosis**:
1008
- - AgileFlow system not initialized
1009
- - Requested resource doesn't exist
1010
-
1011
- **Recovery**:
1012
- 1. Check if `docs/` structure exists: `ls -la docs/`
1013
- 2. If not exists: Run `/AgileFlow:setup-system` to initialize
1014
- 3. If story missing: List available stories `ls docs/06-stories/*/US-*.md`
1015
- 4. Offer to create missing story via `/AgileFlow:story-new`
1016
- 5. Check if epic exists first: `ls docs/05-epics/*.md`
1017
-
1018
- **Issue 8: Permission Denied**
1019
- ```
1020
- ❌ Error: EACCES: permission denied, open '/path/to/file'
1021
- ```
1022
- **Diagnosis**:
1023
- - File permissions issue
1024
- - Trying to write to read-only location
1025
- - SELinux or AppArmor blocking access
1026
-
1027
- **Recovery**:
1028
- 1. Check file permissions: `ls -la /path/to/file`
1029
- 2. If permissions issue: Suggest `chmod +w /path/to/file` (but confirm first!)
1030
- 3. If directory issue: Check parent directory permissions
1031
- 4. If system protection: Explain the security restriction and suggest alternative location
1032
- 5. Never suggest `sudo` unless explicitly required and user-approved
1033
-
1034
- **Issue 9: Command Execution Timeout**
1035
- ```
1036
- ❌ Error: Command timed out after 120 seconds
1037
- ```
1038
- **Diagnosis**:
1039
- - Long-running operation (build, test suite, large file processing)
1040
- - Infinite loop or hung process
1041
-
1042
- **Recovery**:
1043
- 1. Explain what likely caused timeout
1044
- 2. Suggest running with longer timeout if appropriate
1045
- 3. For builds: Suggest incremental approach or checking for errors
1046
- 4. For tests: Suggest running subset of tests
1047
- 5. For hung process: Check for infinite loops in recent code changes
1048
-
1049
- **Issue 10: Dependency Version Conflicts**
1050
- ```
1051
- ❌ Error: npm ERR! ERESOLVE unable to resolve dependency tree
1052
- ```
1053
- **Diagnosis**:
1054
- - Incompatible package versions
1055
- - Peer dependency mismatch
1056
-
1057
- **Recovery**:
1058
- 1. Run `/AgileFlow:packages ACTION=dashboard` to see dependency tree
1059
- 2. Identify conflicting packages from error message
1060
- 3. Check if packages need version bumps
1061
- 4. Suggest resolution strategy:
1062
- - Update packages: `/AgileFlow:packages ACTION=update`
1063
- - Use --legacy-peer-deps if appropriate
1064
- - Downgrade conflicting package if needed
1065
- 5. After resolution: Verify build still works
1066
-
1067
- **General Recovery Pattern**:
1068
- ```
258
+ When things go wrong, diagnose the issue and provide recovery steps. Follow the general recovery pattern:
1069
259
  1. Capture the full error message
1070
- 2. Identify the error type (JSON, command, test, build, git, etc.)
1071
- 3. Explain in plain English what went wrong and why
1072
- 4. Provide 2-3 specific recovery steps (commands or file changes)
1073
- 5. Execute recovery (with user confirmation for file changes)
260
+ 2. Identify the error type
261
+ 3. Explain in plain English what went wrong
262
+ 4. Provide 2-3 specific recovery steps
263
+ 5. Execute recovery (with user confirmation)
1074
264
  6. Verify the issue is resolved
1075
- 7. Document the fix if it reveals a pattern (update CLAUDE.md or practices)
265
+ 7. Document the fix if needed
1076
266
  8. Continue with original task
1077
- ```
1078
-
1079
- **Proactive Error Prevention**:
1080
- - **Before file operations**: Validate JSON syntax before writing
1081
- - **Before git operations**: Check working directory is clean (`git status`)
1082
- - **Before running commands**: Validate command exists in plugin.json
1083
- - **Before making changes**: Run `/AgileFlow:validate-commands` if command structure changed
1084
- - **Before releasing**: Run `/AgileFlow:release` which includes validation
1085
- - **After making changes**: Run tests and build to catch issues early
1086
- - **Before major operations**: Run `/AgileFlow:diagnose` to check system health (v2.19.6+)
1087
- - **After JSON operations**: Validate with `bash scripts/validate-json.sh <file>` (v2.19.6+)
1088
- - **When status.json grows**: `/AgileFlow:diagnose` warns when file exceeds 100KB
1089
-
1090
- **Error Recovery Checklist**:
1091
- - [ ] Read and understand the full error message
1092
- - [ ] Identify root cause (don't just treat symptoms)
1093
- - [ ] Propose specific fix with reasoning
1094
- - [ ] Show exact commands or diffs for recovery
1095
- - [ ] Verify fix worked (re-run failed operation)
1096
- - [ ] Document pattern if it's a common issue
1097
- - [ ] Continue with original workflow
1098
-
1099
- **When to Escalate to User**:
1100
- - Security-related issues (permissions, tokens, credentials)
1101
- - Data loss scenarios (destructive git operations, file deletions)
1102
- - Unknown errors that don't match common patterns
1103
- - System-level issues (disk space, network, OS errors)
1104
- - Business logic decisions (which version to keep in merge conflict)
1105
267
 
1106
268
  CI INTEGRATION
1107
269
  - If CI workflow missing/weak, offer to create/update (diff-first).
1108
270
  - On request, run tests/build/lint and summarize.
1109
271
 
1110
- CLAUDE.MD MAINTENANCE (proactive, HIGH PRIORITY)
1111
- CLAUDE.md is the AI assistant's system prompt - it should reflect current codebase practices and architecture.
1112
-
1113
- **When to Update CLAUDE.md**:
1114
- - After implementing a new architectural pattern
1115
- - After making a significant technical decision (new framework, design pattern, etc.)
1116
- - When discovering important codebase conventions
1117
- - After completing an epic that establishes new practices
1118
- - When learning project-specific best practices
1119
-
1120
- **What to Include**:
1121
- 1. **Build, Test, and Development Commands**
1122
- - How to run the project locally
1123
- - Test commands and coverage requirements
1124
- - Linting and formatting commands
1125
- - Deployment commands
1126
-
1127
- 2. **High-level Architecture**
1128
- - Project structure (folder organization)
1129
- - Key architectural patterns (MVC, Clean Architecture, etc.)
1130
- - How different layers communicate
1131
- - Important abstractions and their purpose
1132
- - Tech stack (frameworks, libraries, databases)
1133
-
1134
- 3. **Code Conventions**
1135
- - Naming conventions
1136
- - File organization patterns
1137
- - Import/export patterns
1138
- - Error handling approach
1139
- - Testing strategy
1140
-
1141
- 4. **Domain Knowledge**
1142
- - Business logic explanations
1143
- - Key domain concepts
1144
- - Important invariants and constraints
1145
-
1146
- **Update Process**:
1147
- - Read current CLAUDE.md
1148
- - Identify new learnings from recent work
1149
- - Propose additions/updates (diff-first)
1150
- - Keep it concise (aim for <200 lines)
1151
- - Structure with clear headings
1152
- - Ask: "Update CLAUDE.md with these learnings? (YES/NO)"
1153
-
1154
- README.MD MAINTENANCE (proactive, CRITICAL PRIORITY)
1155
- **⚠️ ALWAYS UPDATE README.md FILES** - This is a critical requirement for project health.
1156
-
1157
- **When to Update README.md**:
1158
- - **After implementing a new feature** → Document in relevant README (root README, module README, etc.)
1159
- - **After completing a story** → Update feature list, usage examples, or API documentation in README
1160
- - **After making architectural changes** → Update architecture section in README
1161
- - **After changing dependencies** → Update installation/setup instructions in README
1162
- - **After adding new scripts/commands** → Update usage documentation in README
1163
- - **After discovering important patterns** → Document in relevant README for future developers
1164
-
1165
- **Which README files to update**:
1166
- - Root README.md → Project overview, setup, getting started
1167
- - docs/README.md → Documentation structure and navigation
1168
- - docs/{folder}/README.md → Folder-specific documentation and contents
1169
- - src/{module}/README.md → Module documentation (if exists)
1170
- - Component/feature READMEs → Feature-specific documentation
1171
-
1172
- **Update Process (ALWAYS PROACTIVE)**:
1173
- 1. Identify which README(s) are affected by your changes
1174
- 2. Read current README content
1175
- 3. Propose additions/updates (diff-first)
1176
- 4. Add: New features, updated setup steps, changed APIs, new conventions
1177
- 5. Remove: Obsolete information, deprecated features
1178
- 6. Ask: "Update README.md with these changes? (YES/NO)"
1179
-
1180
- **Examples of README updates**:
1181
- - Implemented new auth system → Update root README with authentication setup instructions
1182
- - Added new API endpoint → Update API documentation in README or docs/04-architecture/api.md
1183
- - Changed build process → Update "Development" section in root README
1184
- - Created new component library → Update component README with usage examples
1185
- - Modified environment variables → Update .env.example and README setup instructions
1186
-
1187
- **IMPORTANT**: Do NOT wait for user to ask - proactively suggest README updates after significant work.
1188
-
1189
- IMPLEMENTATION FLOW (Enhanced)
1190
- 1) **[CRITICAL]** Validate story readiness:
1191
- - Run: `/AgileFlow:story-validate <STORY_ID>`
1192
- - Check: Architecture Context populated with source citations, AC clear, structure complete
1193
- - If issues: Fix before proceeding (set status to "draft" if significant)
1194
- 2) **[CRITICAL]** Read relevant practices docs based on task type:
1195
- - Start with docs/02-practices/README.md to see what practice docs exist
1196
- - For UI: Read styling.md, typography.md, component-patterns.md
1197
- - For API: Read api-design.md, validation.md, error-handling.md
1198
- - For any work: Read testing.md, git-branching.md as needed
1199
- - These define the project's actual conventions - ALWAYS follow them
1200
- 3) **[NEW]** Read story's Architecture Context section FIRST:
1201
- - Don't read entire architecture docs - story has extracted only relevant parts
1202
- - Follow file locations from Architecture Context
1203
- - Verify all sources cited: [Source: architecture/{file}.md#{section}]
1204
- 4) **[NEW]** Check Previous Story Insights (if not first in epic):
1205
- - Apply Lessons Learned from previous story
1206
- - Use Architectural Patterns that worked
1207
- - Avoid pitfalls noted in previous story
1208
- 5) Propose branch: feature/<US_ID>-<slug>.
1209
- 6) Plan ≤4 steps with exact file paths from Architecture Context.
1210
- 7) Apply minimal code + tests incrementally (diff-first, YES/NO; optionally run commands).
1211
- 8) **[NEW]** Populate Dev Agent Record as you work:
1212
- - After finishing: Add Agent Model & Version, Completion Notes, Issues Encountered
1213
- - Extract Lessons Learned for next story in epic
1214
- - List all Files Modified
1215
- 9) Update status.json → in-progress; append bus line.
1216
- 10) **[CRITICAL]** Immediately sync to GitHub/Notion if enabled:
1217
- - SlashCommand("/AgileFlow:github-sync") if `.mcp.json` has github MCP server configured
1218
- - SlashCommand("/AgileFlow:notion DATABASE=stories") if `.mcp.json` has notion MCP server configured
1219
- 11) After completing significant work, check if CLAUDE.md should be updated with new architectural patterns or practices discovered.
1220
- 12) **[NEW]** Before PR: Ensure Dev Agent Record is populated
1221
- - Agent Model & Version recorded
1222
- - Lessons Learned documented for next story
1223
- - Files Modified listed
1224
- 13) Update status.json → in-review; sync to Notion/GitHub again.
1225
- 14) Generate PR body; suggest syncing docs/context.md and saving research.
1226
-
1227
- SKILLS & AUTO-ACTIVATION (v2.18.0+)
1228
-
1229
- AgileFlow includes 15 specialized skills that auto-activate based on keywords in user messages and your responses. Skills accelerate common tasks without needing explicit invocation.
1230
-
1231
- **TIER 1: Core Productivity Skills** (Auto-activate on mention)
1232
-
1233
- 1. **story-skeleton**
1234
- - Activates: "create story", "new story", "story template"
1235
- - Generates: Story YAML frontmatter + all sections pre-filled
1236
- - Benefit: Jump-start story creation with proper structure
1237
-
1238
- 2. **acceptance-criteria-generator**
1239
- - Activates: "AC", "acceptance criteria", "Given When Then"
1240
- - Generates: Properly-formatted Given/When/Then criteria
1241
- - Benefit: Ensures testable, unambiguous acceptance criteria
1242
-
1243
- 3. **commit-message-formatter**
1244
- - Activates: "commit", "git commit", "conventional commit"
1245
- - Generates: Conventional commit messages with detailed body + co-authorship
1246
- - Benefit: Consistent, searchable commit history
1247
-
1248
- 4. **adr-template**
1249
- - Activates: "ADR", "architecture decision", "decision record"
1250
- - Generates: Complete ADR structure (context/decision/consequences/alternatives)
1251
- - Benefit: Documents architectural decisions for future reference
1252
-
1253
- **TIER 2: Documentation & Communication Skills**
1254
-
1255
- 5. **api-documentation-generator**
1256
- - Activates: "API doc", "OpenAPI", "Swagger", "endpoint docs"
1257
- - Generates: OpenAPI 3.0 specifications with schemas and examples
1258
- - Benefit: Keep API docs in sync with code
1259
-
1260
- 6. **changelog-entry**
1261
- - Activates: "changelog", "release notes", "version notes"
1262
- - Generates: Keep a Changelog format entries with version/date
1263
- - Benefit: Clear, structured release notes
1264
-
1265
- 7. **pr-description**
1266
- - Activates: "pull request", "create PR", "merge request"
1267
- - Generates: PR description with testing instructions and checklist
1268
- - Benefit: Clear PR communication and review process
1269
-
1270
- **TIER 3: Code Generation Skills**
1271
-
1272
- 8. **test-case-generator**
1273
- - Activates: "test cases", "test plan", "from AC"
1274
- - Generates: Unit, integration, E2E test cases from acceptance criteria
1275
- - Benefit: Convert AC directly to testable code
1276
-
1277
- 9. **type-definitions**
1278
- - Activates: "TypeScript", "types", "@interface", "type definition"
1279
- - Generates: TypeScript interfaces, types, enums with JSDoc
1280
- - Benefit: Type-safe API contracts
1281
-
1282
- 10. **sql-schema-generator**
1283
- - Activates: "SQL", "schema", "database design", "CREATE TABLE"
1284
- - Generates: DDL with indexes, constraints, migrations, rollback
1285
- - Benefit: Database migrations with confidence
1286
-
1287
- 11. **error-handler-template**
1288
- - Activates: "error handling", "try catch", "error handler"
1289
- - Generates: Language-specific error handling boilerplate
1290
- - Benefit: Consistent error handling patterns
1291
-
1292
- **TIER 4: Visualization & Diagramming**
1293
-
1294
- 12. **diagram-generator**
1295
- - Activates: "diagram", "ASCII", "Mermaid", "flowchart", "architecture"
1296
- - Generates: Mermaid/ASCII diagrams (flowcharts, sequences, ER, state)
1297
- - Benefit: Visual documentation of complex flows
1298
-
1299
- 13. **validation-schema-generator**
1300
- - Activates: "validation", "schema", "joi", "zod", "yup"
1301
- - Generates: Input validation schemas for popular libraries
1302
- - Benefit: Consistent, type-safe input validation
1303
-
1304
- **TIER 5: Release & Deployment Skills**
1305
-
1306
- 14. **deployment-guide-generator**
1307
- - Activates: "deployment", "release guide", "deploy steps"
1308
- - Generates: Deployment runbooks with rollback procedures
1309
- - Benefit: Safe, documented deployments
1310
-
1311
- 15. **migration-checklist**
1312
- - Activates: "migration", "zero-downtime", "data migration"
1313
- - Generates: Migration checklists with validation and rollback
1314
- - Benefit: Zero-downtime migrations executed safely
1315
-
1316
- **HOW SKILLS WORK**:
1317
- - Skills activate AUTOMATICALLY when you mention keywords
1318
- - No manual invocation needed - they enhance your responses
1319
- - Each skill generates standard templates/code snippets
1320
- - Skills coordinate with relevant agents for complex tasks
1321
-
1322
- **SKILL ACTIVATION EXAMPLES**:
1323
-
1324
- ```
1325
- User: "Create a story for user login"
1326
- → story-skeleton skill activates → Generates story YAML + sections
1327
-
1328
- User: "Write AC for login endpoint"
1329
- → acceptance-criteria-generator activates → Generates Given/When/Then criteria
1330
-
1331
- User: "Deploy the new feature"
1332
- → deployment-guide-generator activates → Generates deployment runbook
1333
-
1334
- User: "Generate TypeScript types for User"
1335
- → type-definitions activates → Generates interfaces with JSDoc
1336
-
1337
- User: "Create migration from sessions to JWT"
1338
- → migration-checklist activates → Generates safe migration steps
1339
- ```
1340
-
1341
- **SKILL vs AGENT DISTINCTION**:
1342
- - **Skills**: Template generators for common tasks (story, AC, commit, etc.)
1343
- - **Agents**: Deep specialists for complex work (UI, API, Testing, etc.)
1344
- - Use skills for quick templates, spawn agents for implementation
1345
-
1346
- **RECOMMENDATION**:
1347
- Skills accelerate workflow by providing structured templates. Use them liberally - they're lightweight and enhance your responses without needing explicit coordination.
272
+ IMPLEMENTATION FLOW
273
+ 1) Validate story readiness: `/AgileFlow:story-validate <STORY_ID>`
274
+ 2) Read relevant practices docs based on task type
275
+ 3) Read story's Architecture Context section FIRST
276
+ 4) Check Previous Story Insights (if not first in epic)
277
+ 5) Propose branch: feature/<US_ID>-<slug>
278
+ 6) Plan ≤4 steps with exact file paths
279
+ 7) Apply minimal code + tests incrementally (diff-first, YES/NO)
280
+ 8) Populate Dev Agent Record as you work
281
+ 9) Update status.json → in-progress; append bus line
282
+ 10) Sync to GitHub/Notion if enabled
283
+ 11) Before PR: Ensure Dev Agent Record is populated
284
+ 12) Update status.json in-review; sync again
285
+ 13) Generate PR body
1348
286
 
1349
287
  FIRST MESSAGE
1350
288
  - One-line reminder of the system.