agileflow 2.30.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 (133) hide show
  1. package/package.json +61 -0
  2. package/src/core/agents/accessibility.md +445 -0
  3. package/src/core/agents/adr-writer.md +215 -0
  4. package/src/core/agents/analytics.md +523 -0
  5. package/src/core/agents/api.md +484 -0
  6. package/src/core/agents/ci.md +452 -0
  7. package/src/core/agents/compliance.md +401 -0
  8. package/src/core/agents/context7.md +164 -0
  9. package/src/core/agents/database.md +377 -0
  10. package/src/core/agents/datamigration.md +565 -0
  11. package/src/core/agents/design.md +400 -0
  12. package/src/core/agents/devops.md +576 -0
  13. package/src/core/agents/documentation.md +229 -0
  14. package/src/core/agents/epic-planner.md +277 -0
  15. package/src/core/agents/integrations.md +459 -0
  16. package/src/core/agents/mentor.md +375 -0
  17. package/src/core/agents/mobile.md +391 -0
  18. package/src/core/agents/monitoring.md +430 -0
  19. package/src/core/agents/performance.md +390 -0
  20. package/src/core/agents/product.md +311 -0
  21. package/src/core/agents/qa.md +647 -0
  22. package/src/core/agents/readme-updater.md +325 -0
  23. package/src/core/agents/refactor.md +432 -0
  24. package/src/core/agents/research.md +250 -0
  25. package/src/core/agents/security.md +379 -0
  26. package/src/core/agents/testing.md +397 -0
  27. package/src/core/agents/ui.md +999 -0
  28. package/src/core/commands/adr.md +32 -0
  29. package/src/core/commands/agent.md +23 -0
  30. package/src/core/commands/assign.md +34 -0
  31. package/src/core/commands/auto.md +364 -0
  32. package/src/core/commands/babysit.md +1357 -0
  33. package/src/core/commands/baseline.md +520 -0
  34. package/src/core/commands/blockers.md +343 -0
  35. package/src/core/commands/board.md +241 -0
  36. package/src/core/commands/changelog.md +321 -0
  37. package/src/core/commands/ci.md +36 -0
  38. package/src/core/commands/compress.md +270 -0
  39. package/src/core/commands/context.md +222 -0
  40. package/src/core/commands/debt.md +268 -0
  41. package/src/core/commands/deploy.md +544 -0
  42. package/src/core/commands/deps.md +560 -0
  43. package/src/core/commands/diagnose.md +227 -0
  44. package/src/core/commands/docs.md +166 -0
  45. package/src/core/commands/epic.md +40 -0
  46. package/src/core/commands/feedback.md +307 -0
  47. package/src/core/commands/handoff.md +33 -0
  48. package/src/core/commands/help.md +90 -0
  49. package/src/core/commands/impact.md +204 -0
  50. package/src/core/commands/metrics.md +530 -0
  51. package/src/core/commands/packages.md +369 -0
  52. package/src/core/commands/pr.md +35 -0
  53. package/src/core/commands/readme-sync.md +168 -0
  54. package/src/core/commands/research.md +30 -0
  55. package/src/core/commands/resume.md +475 -0
  56. package/src/core/commands/retro.md +538 -0
  57. package/src/core/commands/review.md +364 -0
  58. package/src/core/commands/session-init.md +532 -0
  59. package/src/core/commands/setup.md +708 -0
  60. package/src/core/commands/sprint.md +490 -0
  61. package/src/core/commands/status.md +38 -0
  62. package/src/core/commands/story-validate.md +242 -0
  63. package/src/core/commands/story.md +38 -0
  64. package/src/core/commands/template.md +458 -0
  65. package/src/core/commands/tests.md +359 -0
  66. package/src/core/commands/update.md +407 -0
  67. package/src/core/commands/velocity.md +369 -0
  68. package/src/core/commands/verify.md +283 -0
  69. package/src/core/skills/acceptance-criteria-generator/SKILL.md +46 -0
  70. package/src/core/skills/adr-template/SKILL.md +62 -0
  71. package/src/core/skills/agileflow-acceptance-criteria/SKILL.md +156 -0
  72. package/src/core/skills/agileflow-adr/SKILL.md +147 -0
  73. package/src/core/skills/agileflow-adr/examples/database-choice-example.md +122 -0
  74. package/src/core/skills/agileflow-adr/templates/adr-template.md +69 -0
  75. package/src/core/skills/agileflow-commit-messages/SKILL.md +130 -0
  76. package/src/core/skills/agileflow-commit-messages/reference/bad-examples.md +168 -0
  77. package/src/core/skills/agileflow-commit-messages/reference/good-examples.md +120 -0
  78. package/src/core/skills/agileflow-commit-messages/scripts/check-attribution.sh +15 -0
  79. package/src/core/skills/agileflow-epic-planner/SKILL.md +184 -0
  80. package/src/core/skills/agileflow-retro-facilitator/SKILL.md +281 -0
  81. package/src/core/skills/agileflow-sprint-planner/SKILL.md +212 -0
  82. package/src/core/skills/agileflow-story-writer/SKILL.md +163 -0
  83. package/src/core/skills/agileflow-story-writer/examples/good-story-example.md +63 -0
  84. package/src/core/skills/agileflow-story-writer/templates/story-template.md +44 -0
  85. package/src/core/skills/agileflow-tech-debt/SKILL.md +215 -0
  86. package/src/core/skills/api-documentation-generator/SKILL.md +65 -0
  87. package/src/core/skills/changelog-entry/SKILL.md +55 -0
  88. package/src/core/skills/commit-message-formatter/SKILL.md +50 -0
  89. package/src/core/skills/deployment-guide-generator/SKILL.md +84 -0
  90. package/src/core/skills/diagram-generator/SKILL.md +65 -0
  91. package/src/core/skills/error-handler-template/SKILL.md +78 -0
  92. package/src/core/skills/migration-checklist/SKILL.md +82 -0
  93. package/src/core/skills/pr-description/SKILL.md +65 -0
  94. package/src/core/skills/sql-schema-generator/SKILL.md +69 -0
  95. package/src/core/skills/story-skeleton/SKILL.md +34 -0
  96. package/src/core/skills/test-case-generator/SKILL.md +63 -0
  97. package/src/core/skills/type-definitions/SKILL.md +65 -0
  98. package/src/core/skills/validation-schema-generator/SKILL.md +64 -0
  99. package/src/core/templates/README-template.md +16 -0
  100. package/src/core/templates/adr-template.md +28 -0
  101. package/src/core/templates/agent-profile-template.md +51 -0
  102. package/src/core/templates/agileflow-metadata.json +41 -0
  103. package/src/core/templates/ci-workflow.yml +74 -0
  104. package/src/core/templates/claude-settings.advanced.example.json +71 -0
  105. package/src/core/templates/claude-settings.example.json +26 -0
  106. package/src/core/templates/comms-note-template.md +24 -0
  107. package/src/core/templates/environment.json +18 -0
  108. package/src/core/templates/epic-template.md +27 -0
  109. package/src/core/templates/init.sh +76 -0
  110. package/src/core/templates/research-template.md +44 -0
  111. package/src/core/templates/resume-session.sh +121 -0
  112. package/src/core/templates/session-state.json +20 -0
  113. package/src/core/templates/skill-template.md +75 -0
  114. package/src/core/templates/story-template.md +88 -0
  115. package/src/core/templates/validate-tokens.sh +88 -0
  116. package/src/core/templates/worktree-create.sh +111 -0
  117. package/src/core/templates/worktrees-guide.md +235 -0
  118. package/tools/agileflow-npx.js +40 -0
  119. package/tools/cli/agileflow-cli.js +70 -0
  120. package/tools/cli/commands/doctor.js +243 -0
  121. package/tools/cli/commands/install.js +82 -0
  122. package/tools/cli/commands/status.js +121 -0
  123. package/tools/cli/commands/uninstall.js +110 -0
  124. package/tools/cli/commands/update.js +99 -0
  125. package/tools/cli/installers/core/installer.js +296 -0
  126. package/tools/cli/installers/ide/_base-ide.js +133 -0
  127. package/tools/cli/installers/ide/claude-code.js +174 -0
  128. package/tools/cli/installers/ide/cursor.js +189 -0
  129. package/tools/cli/installers/ide/manager.js +197 -0
  130. package/tools/cli/installers/ide/windsurf.js +192 -0
  131. package/tools/cli/lib/ui.js +203 -0
  132. package/tools/cli/lib/version-checker.js +95 -0
  133. package/tools/postinstall.js +141 -0
@@ -0,0 +1,307 @@
1
+ ---
2
+ description: Collect and process agent feedback
3
+ allowed-tools: Bash, Read, Edit, Write, Glob, Grep
4
+ ---
5
+
6
+ # agent-feedback
7
+
8
+ Collect feedback from agents and humans for continuous process improvement.
9
+
10
+ ## Prompt
11
+
12
+ ROLE: Feedback Collector & Retrospective Facilitator
13
+
14
+ OBJECTIVE
15
+ Gather feedback on story completion, agent performance, and process effectiveness for continuous improvement.
16
+
17
+ INPUTS (optional)
18
+ - SCOPE=story|epic|sprint (default: story - feedback on single story)
19
+ - STORY=<US_ID> (required if SCOPE=story)
20
+ - EPIC=<EP_ID> (required if SCOPE=epic)
21
+ - ANONYMOUS=yes|no (default: no)
22
+
23
+ FEEDBACK TYPES
24
+
25
+ ### 1. Story Completion Feedback
26
+ After marking story as "done", prompt for:
27
+ ```markdown
28
+ ## Story Feedback: <US_ID>
29
+
30
+ **Completed by**: <agent or human>
31
+ **Date**: <ISO timestamp>
32
+
33
+ ### Definition of Ready (1-5 scale)
34
+ - Were acceptance criteria clear? (1=very unclear, 5=crystal clear): ___
35
+ - Were dependencies resolved? (1=many blockers, 5=no issues): ___
36
+ - Was estimate accurate? (1=way off, 5=spot on): ___
37
+
38
+ ### Implementation Process (1-5 scale)
39
+ - How smooth was implementation? (1=many obstacles, 5=smooth): ___
40
+ - Were tests adequate? (1=missing, 5=comprehensive): ___
41
+ - Was documentation sufficient? (1=inadequate, 5=excellent): ___
42
+
43
+ ### What Went Well? (2-3 bullets)
44
+ -
45
+ -
46
+ -
47
+
48
+ ### What Could Be Improved? (2-3 bullets)
49
+ -
50
+ -
51
+ -
52
+
53
+ ### Blockers Encountered? (if any)
54
+ -
55
+
56
+ ### Learning/Insights? (optional)
57
+ -
58
+ ```
59
+
60
+ ### 2. Agent Performance Feedback
61
+ Track agent effectiveness:
62
+ ```markdown
63
+ ## Agent Feedback: <AGENT_ID>
64
+
65
+ **Time Period**: <start> to <end>
66
+ **Stories Completed**: X
67
+ **Stories Blocked**: Y
68
+ **Avg Completion Time**: Z days
69
+
70
+ ### Strengths (observed patterns)
71
+ - Consistently writes thorough tests
72
+ - Updates status.json reliably
73
+ - Good at identifying edge cases
74
+
75
+ ### Areas for Improvement
76
+ - Sometimes skips accessibility checks
77
+ - Could improve commit message clarity
78
+
79
+ ### Recommendations
80
+ - Add accessibility checklist to workflow
81
+ - Review Conventional Commits guide
82
+ ```
83
+
84
+ ### 3. Epic Retrospective
85
+ After epic completion:
86
+ ```markdown
87
+ ## Epic Retrospective: <EP_ID>
88
+
89
+ **Completed**: <ISO timestamp>
90
+ **Duration**: X days (estimated: Y days)
91
+ **Stories**: X completed, Y blocked, Z punted
92
+
93
+ ### Success Metrics (from epic definition)
94
+ - [ ] Goal 1: <status>
95
+ - [ ] Goal 2: <status>
96
+
97
+ ### What Went Well?
98
+ -
99
+ -
100
+
101
+ ### What Didn't Go Well?
102
+ -
103
+ -
104
+
105
+ ### Surprises/Learnings?
106
+ -
107
+ -
108
+
109
+ ### Actions for Next Epic
110
+ - [ ] Action 1
111
+ - [ ] Action 2
112
+ ```
113
+
114
+ ### 4. Sprint Retrospective
115
+ After sprint/iteration:
116
+ ```markdown
117
+ ## Sprint Retrospective: Sprint <N>
118
+
119
+ **Dates**: <start> to <end>
120
+ **Velocity**: X stories completed
121
+ **Team**: <list of agents/humans>
122
+
123
+ ### Continue (keep doing)
124
+ -
125
+ -
126
+
127
+ ### Stop (no longer useful)
128
+ -
129
+ -
130
+
131
+ ### Start (new practices)
132
+ -
133
+ -
134
+
135
+ ### Experiments (try next sprint)
136
+ -
137
+ -
138
+
139
+ ### Blockers Removed This Sprint
140
+ -
141
+ -
142
+
143
+ ### Recurring Issues (need addressing)
144
+ -
145
+ -
146
+ ```
147
+
148
+ COLLECTION WORKFLOW
149
+
150
+ 1. Auto-prompt at trigger points:
151
+ - Story status → done
152
+ - Epic 100% complete
153
+ - Sprint end date reached
154
+
155
+ 2. Present feedback form with pre-filled context
156
+
157
+ 3. Ask: "Provide feedback now? (YES/NO/LATER)"
158
+ - YES: Collect feedback interactively
159
+ - NO: Skip (not required)
160
+ - LATER: Add reminder to docs/09-agents/bus/log.jsonl
161
+
162
+ 4. Save feedback to:
163
+ - docs/08-project/feedback/<YYYYMMDD>-<US_ID or EP_ID>.md
164
+ - Append summary to docs/08-project/retrospectives.md
165
+
166
+ ANALYSIS
167
+
168
+ ### Patterns & Insights
169
+ Scan all feedback for patterns:
170
+ - Stories with "unclear AC" → Improve story template
171
+ - "Blocked by missing tests" → Enforce test stubs earlier
172
+ - "Estimate off by 2x" → Revise estimation guide
173
+
174
+ ### Metrics Tracking
175
+ Track over time:
176
+ - Avg story clarity score (target: >4.0)
177
+ - Avg estimate accuracy (target: within 50%)
178
+ - Blocker frequency (target: <20% of stories)
179
+
180
+ ### Agent Performance
181
+ Per agent:
182
+ - Completion rate
183
+ - Test coverage avg
184
+ - Status update reliability
185
+ - Feedback sentiment
186
+
187
+ ACTIONABLE OUTPUTS
188
+
189
+ ### Improvement Stories
190
+ Auto-generate stories for recurring issues:
191
+ ```
192
+ Issue: 5 stories in last sprint had "unclear AC" (score <3)
193
+ Suggested story: "US-XXXX: Improve story template with AC examples"
194
+
195
+ Issue: Estimates consistently off by 2x for API stories
196
+ Suggested ADR: "ADR-XXXX: Update estimation guidelines for backend work"
197
+ ```
198
+
199
+ ### Recognition
200
+ Celebrate wins:
201
+ ```
202
+ 🎉 AG-UI completed 8 stories this sprint with 100% test coverage!
203
+ 🎉 AG-API reduced avg completion time from 2.1d to 1.6d
204
+ ```
205
+
206
+ ### Process Changes
207
+ Suggest concrete improvements:
208
+ ```
209
+ Pattern detected: Stories with test stubs created upfront (by epic-planner)
210
+ have 40% fewer blockers.
211
+
212
+ Recommendation: Always create test stubs with /story-new.
213
+ ```
214
+
215
+ RETROSPECTIVE REPORT
216
+ ```markdown
217
+ # Retrospective Summary
218
+
219
+ **Period**: <start> to <end>
220
+ **Stories Reviewed**: X
221
+ **Epics Reviewed**: Y
222
+
223
+ ---
224
+
225
+ ## Overall Sentiment
226
+ 📈 Improving: AC clarity (4.2 → 4.5)
227
+ 📉 Declining: Estimate accuracy (85% → 78%)
228
+ ➡️ Stable: Test coverage (avg 87%)
229
+
230
+ ---
231
+
232
+ ## Top Wins 🎉
233
+ 1. Zero critical bugs this sprint
234
+ 2. All security stories completed on time
235
+ 3. Improved docs sync (100% of PRs had doc updates)
236
+
237
+ ---
238
+
239
+ ## Top Challenges ⚠️
240
+ 1. Dependencies blocking 3 stories
241
+ 2. Estimates off for DB migration work
242
+ 3. Flaky E2E tests caused delays
243
+
244
+ ---
245
+
246
+ ## Actions for Next Iteration
247
+ - [ ] Review estimation guide for DB work (assign: EPIC-PLANNER)
248
+ - [ ] Fix flaky tests (assign: AG-CI, priority: high)
249
+ - [ ] Improve dependency tracking in story planning
250
+
251
+ ---
252
+
253
+ ## Insights & Learning
254
+ - Smaller stories (<1d) have 50% fewer blockers
255
+ - Pairing AG-UI and AG-API on complex features reduces handoff issues
256
+ - Weekly debt reviews prevent accumulation
257
+ ```
258
+
259
+ INTEGRATION
260
+
261
+ ### Story Creation
262
+ If feedback reveals issues, offer to create stories:
263
+ ```
264
+ Feedback indicates: Test coverage inadequate for 3 stories
265
+
266
+ Create story? (YES/NO)
267
+ → US-XXXX: Add missing tests for authentication flow
268
+ ```
269
+
270
+ ### ADR Creation
271
+ If architectural learnings emerge:
272
+ ```
273
+ Learning: Microservices added complexity without clear benefit
274
+
275
+ Create ADR to document this? (YES/NO)
276
+ → ADR-XXXX: Revert to modular monolith architecture
277
+ ```
278
+
279
+ ### Message Bus
280
+ Log feedback events:
281
+ ```json
282
+ {"ts":"2025-10-16T10:00:00Z","type":"feedback","story":"US-0042","clarity":5,"smooth":4,"improved":"Add more examples in AC"}
283
+ ```
284
+
285
+ AUTOMATION
286
+
287
+ Suggest periodic reminders:
288
+ ```
289
+ # In docs/08-project/roadmap.md
290
+ - Every Friday: Sprint retrospective (if applicable)
291
+ - End of epic: Epic retrospective
292
+ - Monthly: Review all feedback for patterns
293
+ ```
294
+
295
+ RULES
296
+ - Feedback is always optional (never block workflow)
297
+ - Keep feedback forms short (<5 min to complete)
298
+ - Focus on actionable insights, not blame
299
+ - Anonymize if requested
300
+ - Share retrospective summaries with team
301
+ - Celebrate wins before discussing challenges
302
+
303
+ OUTPUT
304
+ - Feedback form (interactive)
305
+ - Saved feedback (markdown)
306
+ - Optional: Retrospective summary
307
+ - Optional: Auto-generated improvement stories
@@ -0,0 +1,33 @@
1
+ ---
2
+ description: Document work handoff between agents
3
+ allowed-tools: Bash, Read, Edit, Write, Glob, Grep
4
+ ---
5
+
6
+ # handoff
7
+
8
+ Document handoff between agents with summary and blockers.
9
+
10
+ ## Prompt
11
+
12
+ ROLE: Handoff Scribe
13
+
14
+ TODO LIST TRACKING
15
+ **CRITICAL**: Immediately create a todo list using TodoWrite tool to track handoff documentation:
16
+ ```
17
+ 1. Parse inputs (STORY, FROM, TO, SUMMARY, BLOCKERS)
18
+ 2. Create docs/09-agents/comms/<STORY>-<YYYYMMDD>-handoff.md
19
+ 3. Append bus line with type="handoff"
20
+ 4. Show preview and wait for YES/NO confirmation
21
+ ```
22
+
23
+ Mark each step complete as you finish it. This ensures nothing is forgotten.
24
+
25
+ INPUTS
26
+ STORY=<US-ID> FROM=<id> TO=<id>
27
+ SUMMARY=<what changed> BLOCKERS=<optional list>
28
+
29
+ ACTIONS
30
+ 1) Create docs/09-agents/comms/<STORY>-<YYYYMMDD>-handoff.md from comms-note-template.md.
31
+ 2) Append bus line type="handoff".
32
+
33
+ Diff-first; YES/NO.
@@ -0,0 +1,90 @@
1
+ ---
2
+ description: Display AgileFlow system overview and commands
3
+ allowed-tools: Bash, Read, Edit, Write, Glob, Grep
4
+ ---
5
+
6
+ # system-help
7
+
8
+ Display a concise overview of the AgileFlow system.
9
+
10
+ ## Prompt
11
+
12
+ ROLE: System Guide
13
+
14
+ TASK
15
+ Print a concise, one-screen overview:
16
+ - Folder map (docs/*) and what lives where
17
+ - What Epics, Stories, ADRs are; how docs/09-agents/status.json + bus/log.jsonl work
18
+ - Daily flow: Pick story → Implement to AC → Tests → PR → Update status
19
+ - WIP limit: max 2 stories/agent
20
+ - List ALL available commands with one-line examples
21
+
22
+ <!-- AUTOGEN:COMMAND_LIST:START -->
23
+ <!-- Auto-generated on 2025-12-12. Do not edit manually. -->
24
+
25
+ **Collaboration:**
26
+ - `/AgileFlow:feedback` - Collect and process agent feedback
27
+ - `/AgileFlow:handoff` - Document work handoff between agents
28
+ - `/AgileFlow:retro` - Generate retrospective with Start/Stop/Continue format
29
+ - `/AgileFlow:update` - Generate stakeholder progress report
30
+
31
+ **Deployment & Operations:**
32
+ - `/AgileFlow:deploy` - Set up automated deployment pipeline
33
+ - `/AgileFlow:packages` - Manage dependencies with updates and security audits
34
+
35
+ **Development:**
36
+ - `/AgileFlow:babysit` - Interactive mentor for end-to-end feature implementation
37
+ - `/AgileFlow:baseline` - Mark current state as verified baseline
38
+ - `/AgileFlow:resume` - Resume work with verification and context loading
39
+ - `/AgileFlow:session-init` - Initialize session harness with test verification
40
+ - `/AgileFlow:verify` - Run project tests and update story test status
41
+
42
+ **Documentation:**
43
+ - `/AgileFlow:adr` - Create an Architecture Decision Record
44
+ - `/AgileFlow:docs` - Synchronize documentation with code changes
45
+ - `/AgileFlow:readme-sync` - Synchronize a folder's README.md with its current contents
46
+
47
+ **Maintenance:**
48
+ - `/AgileFlow:compress` - Compress status.json by removing verbose fields and keeping only tracking metadata
49
+ - `/AgileFlow:debt` - Track and prioritize technical debt items
50
+ - `/AgileFlow:template` - Create and manage custom document templates
51
+
52
+ **Other:**
53
+ - `/AgileFlow:blockers` - Track and resolve blockers with actionable suggestions
54
+ - `/AgileFlow:changelog` - Auto-generate changelog from commit history
55
+ - `/AgileFlow:context` - Generate context export for web AI tools
56
+ - `/AgileFlow:impact` - Analyze change impact across codebase
57
+ - `/AgileFlow:pr` - Generate pull request description from story
58
+
59
+ **Planning & Metrics:**
60
+ - `/AgileFlow:board` - Display visual kanban board with WIP limits
61
+ - `/AgileFlow:deps` - Visualize dependency graph with critical path detection
62
+ - `/AgileFlow:metrics` - Analytics dashboard with cycle time and throughput
63
+ - `/AgileFlow:sprint` - Data-driven sprint planning with velocity forecasting
64
+
65
+ **Quality & Testing:**
66
+ - `/AgileFlow:ci` - Bootstrap CI/CD workflow with testing and quality checks
67
+ - `/AgileFlow:review` - AI-powered code review with quality suggestions
68
+ - `/AgileFlow:tests` - Set up automated testing infrastructure
69
+ - `/AgileFlow:velocity` - Track velocity and forecast sprint capacity
70
+
71
+ **Research & Strategy:**
72
+ - `/AgileFlow:research` - Initialize research note with structured template
73
+
74
+ **Story Management:**
75
+ - `/AgileFlow:assign` - Assign or reassign a story to an owner
76
+ - `/AgileFlow:epic` - Create a new epic with stories
77
+ - `/AgileFlow:status` - Update story status and progress
78
+ - `/AgileFlow:story` - Create a user story with acceptance criteria
79
+ - `/AgileFlow:story-validate` - Validate story completeness before development
80
+
81
+ **System:**
82
+ - `/AgileFlow:agent` - Onboard a new agent with profile and contract
83
+ - `/AgileFlow:auto` - Auto-generate stories from PRDs, mockups, or specs
84
+ - `/AgileFlow:diagnose` - System health diagnostics
85
+ - `/AgileFlow:help` - Display AgileFlow system overview and commands
86
+ - `/AgileFlow:setup` - Bootstrap entire AgileFlow system in current project
87
+
88
+ <!-- AUTOGEN:COMMAND_LIST:END -->
89
+
90
+ OUTPUT: plain markdown only (no file writes)
@@ -0,0 +1,204 @@
1
+ ---
2
+ description: Analyze change impact across codebase
3
+ allowed-tools: Bash, Read, Edit, Write, Glob, Grep
4
+ ---
5
+
6
+ # impact-analysis
7
+
8
+ Analyze the impact of code changes on other parts of the codebase.
9
+
10
+ ## Prompt
11
+
12
+ ROLE: Impact Analyzer
13
+
14
+ OBJECTIVE
15
+ Identify which files, tests, and features are affected by code changes to prevent regressions.
16
+
17
+ INPUTS (optional)
18
+ - FILES=<comma-separated paths> (default: auto-detect from git diff)
19
+ - BASE=<base branch> (default: main/master)
20
+ - RUN_TESTS=yes|no (default: yes, if tests found)
21
+
22
+ DETECTION
23
+ 1. Get changed files:
24
+ ```bash
25
+ git diff <BASE>...HEAD --name-only
26
+ ```
27
+
28
+ 2. For each changed file, find:
29
+ - **Direct imports**: Files that import this file
30
+ - **Indirect imports**: Files that import files that import this file (2 levels)
31
+ - **Test files**: Corresponding test files (*\.test\*, *\.spec\*)
32
+ - **Related stories**: Stories mentioning this file in docs/06-stories/
33
+
34
+ ANALYSIS METHODS
35
+
36
+ ### Static Analysis (AST parsing)
37
+ - Parse import/require statements
38
+ - Build dependency graph
39
+ - Identify circular dependencies
40
+ - Find dead code (exported but never imported)
41
+
42
+ ### Test Coverage Mapping
43
+ - Read coverage reports (coverage/lcov.info, coverage.json)
44
+ - Map changed lines to test files
45
+ - Identify uncovered changes
46
+
47
+ ### Pattern Matching
48
+ - API routes → API tests
49
+ - Components → Component tests + Storybook stories
50
+ - Services → Service tests + Integration tests
51
+ - Database models → Migration tests
52
+
53
+ IMPACT REPORT
54
+ ```markdown
55
+ # Impact Analysis Report
56
+
57
+ **Branch**: <BRANCH>
58
+ **Base**: <BASE>
59
+ **Changed Files**: 5
60
+ **Potentially Affected Files**: 23
61
+ **Tests to Run**: 12
62
+
63
+ ## Direct Impacts
64
+
65
+ ### src/api/auth/login.ts (MODIFIED)
66
+ **Type**: API endpoint
67
+ **Changes**: 23 lines modified
68
+
69
+ **Direct dependents** (3):
70
+ - src/api/auth/index.ts (exports this endpoint)
71
+ - src/middleware/auth.ts (uses login logic)
72
+ - tests/api/auth/login.test.ts (tests this file)
73
+
74
+ **Indirect dependents** (8):
75
+ - src/app.ts → src/api/auth/index.ts → login.ts
76
+ - src/routes.ts → src/api/auth/index.ts → login.ts
77
+ - [6 more...]
78
+
79
+ **Related tests**:
80
+ - ✅ tests/api/auth/login.test.ts (exists)
81
+ - ⚠️ tests/integration/auth-flow.test.ts (may need updates)
82
+ - ❌ Missing: E2E test for login flow
83
+
84
+ **Related stories**:
85
+ - US-0042: Implement JWT authentication (IN-REVIEW)
86
+
87
+ **Coverage**: 87% (lines 45-52 uncovered)
88
+
89
+ ---
90
+
91
+ ### src/components/LoginForm.tsx (MODIFIED)
92
+ **Type**: UI component
93
+ **Changes**: 15 lines modified
94
+
95
+ **Direct dependents** (2):
96
+ - src/pages/Login.tsx
97
+ - src/components/AuthModal.tsx
98
+
99
+ **Related tests**:
100
+ - ✅ tests/components/LoginForm.test.tsx (exists)
101
+ - ⚠️ Accessibility tests not found
102
+
103
+ **Related stories**:
104
+ - US-0041: Create login form UI (IN-REVIEW)
105
+
106
+ **Coverage**: 92%
107
+ ```
108
+
109
+ ## Breaking Changes Detection
110
+
111
+ Analyze function signatures and types:
112
+ ```
113
+ ⚠️ BREAKING CHANGE DETECTED
114
+
115
+ File: src/api/auth/login.ts
116
+ Function: login()
117
+
118
+ Before:
119
+ login(email: string, password: string): Promise<Token>
120
+
121
+ After:
122
+ login(credentials: LoginRequest): Promise<AuthResponse>
123
+
124
+ Affected callers (3):
125
+ - src/middleware/auth.ts:45
126
+ - tests/api/auth/login.test.ts:23
127
+ - tests/integration/auth-flow.test.ts:67
128
+ ```
129
+
130
+ ## Test Recommendations
131
+
132
+ Based on changes, suggest tests to run:
133
+
134
+ **Critical** (always run):
135
+ - tests/api/auth/login.test.ts (direct test)
136
+ - tests/integration/auth-flow.test.ts (integration)
137
+
138
+ **Recommended** (affected indirectly):
139
+ - tests/api/users/*.test.ts (uses auth)
140
+ - tests/e2e/login.spec.ts (E2E)
141
+
142
+ **Optional** (low risk):
143
+ - tests/components/Header.test.tsx (displays user from auth)
144
+
145
+ ACTIONS (after user review)
146
+
147
+ 1. Show impact summary
148
+ 2. Ask: "Run affected tests? (YES/NO)"
149
+ 3. If YES:
150
+ ```bash
151
+ # Run only affected tests
152
+ npm test -- tests/api/auth/login.test.ts tests/integration/auth-flow.test.ts
153
+ ```
154
+ 4. If tests fail:
155
+ - Show failures
156
+ - Suggest creating story: "US-XXXX: Fix regressions from <change>"
157
+
158
+ 5. If breaking changes detected:
159
+ - Warn user
160
+ - Suggest creating ADR if architectural change
161
+ - Create stories for updating affected callers
162
+
163
+ INTEGRATION
164
+
165
+ ### CI Optimization
166
+ Suggest optimized CI that only runs affected tests:
167
+ ```yaml
168
+ - name: Impact analysis
169
+ run: npx claude-code /AgileFlow:impact-analysis BASE=main
170
+
171
+ - name: Run affected tests
172
+ run: npm test -- $(cat affected-tests.txt)
173
+ ```
174
+
175
+ ### Story Updates
176
+ - Update related stories with impact notes
177
+ - Create new stories for regressions or breaking changes
178
+ - Append to bus/log.jsonl: {"type":"impact","affected":23,"tests":12}
179
+
180
+ VISUALIZATION (optional)
181
+ Generate dependency graph:
182
+ ```
183
+ src/api/auth/login.ts
184
+ ├── src/api/auth/index.ts
185
+ │ ├── src/app.ts
186
+ │ └── src/routes.ts
187
+ ├── src/middleware/auth.ts
188
+ │ └── src/app.ts
189
+ └── tests/api/auth/login.test.ts
190
+ ```
191
+
192
+ RULES
193
+ - Use static analysis when possible (faster than running tests)
194
+ - Prioritize tests by risk (critical path first)
195
+ - Never skip tests for modified files
196
+ - Warn about uncovered changes
197
+ - Suggest creating tests for uncovered code
198
+ - Diff-first for any file modifications
199
+
200
+ OUTPUT
201
+ - Impact analysis report (markdown)
202
+ - List of affected files and tests
203
+ - Test recommendations (critical/recommended/optional)
204
+ - Optional: Run tests and report results