agileflow 4.0.0-alpha.2 → 4.0.0-alpha.21

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 (372) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/content/plugins/accessibility/plugin.yaml +14 -0
  3. package/content/plugins/accessibility/skills/agileflow-accessibility/SKILL.md +392 -0
  4. package/content/plugins/accessibility/skills/agileflow-accessibility/references/aria-patterns.md +528 -0
  5. package/content/plugins/accessibility/skills/agileflow-accessibility/references/testing-checklist.md +457 -0
  6. package/content/plugins/accessibility/skills/agileflow-accessibility/references/wcag-guide.md +683 -0
  7. package/content/plugins/accessibility/skills/agileflow-accessibility/workflows/audit-page.md +310 -0
  8. package/content/plugins/accessibility/skills/agileflow-accessibility/workflows/implement-accessible-component.md +479 -0
  9. package/content/plugins/ads/agents/ads-audit-budget.md +185 -0
  10. package/content/plugins/ads/agents/ads-audit-compliance.md +171 -0
  11. package/content/plugins/ads/agents/ads-audit-creative.md +168 -0
  12. package/content/plugins/ads/agents/ads-audit-google.md +227 -0
  13. package/content/plugins/ads/agents/ads-audit-meta.md +184 -0
  14. package/content/plugins/ads/agents/ads-audit-tracking.md +205 -0
  15. package/content/plugins/ads/agents/ads-consensus.md +410 -0
  16. package/content/plugins/ads/agents/ads-generate.md +152 -0
  17. package/content/plugins/ads/agents/ads-performance-tracker.md +212 -0
  18. package/content/plugins/ads/plugin.yaml +23 -4
  19. package/content/plugins/ads/skills/agileflow-ads/SKILL.md +218 -0
  20. package/content/plugins/ads/skills/agileflow-ads/references/ad-copy-formula-guide.md +131 -0
  21. package/content/plugins/ads/skills/agileflow-ads/references/audience-targeting-guide.md +137 -0
  22. package/content/plugins/ads/skills/agileflow-ads/references/bid-strategy-guide.md +115 -0
  23. package/content/plugins/ads/skills/agileflow-ads/references/platform-benchmarks.md +100 -0
  24. package/content/plugins/ads/skills/agileflow-ads/workflows/audit.md +118 -0
  25. package/content/plugins/ads/skills/agileflow-ads/workflows/generate.md +84 -0
  26. package/content/plugins/audit/agents/a11y-analyzer-aria.md +173 -0
  27. package/content/plugins/audit/agents/a11y-analyzer-forms.md +173 -0
  28. package/content/plugins/audit/agents/a11y-analyzer-keyboard.md +183 -0
  29. package/content/plugins/audit/agents/a11y-analyzer-semantic.md +169 -0
  30. package/content/plugins/audit/agents/a11y-analyzer-visual.md +172 -0
  31. package/content/plugins/audit/agents/a11y-consensus.md +249 -0
  32. package/content/plugins/audit/agents/accessibility.md +558 -0
  33. package/content/plugins/audit/agents/api-quality-analyzer-conventions.md +156 -0
  34. package/content/plugins/audit/agents/api-quality-analyzer-docs.md +184 -0
  35. package/content/plugins/audit/agents/api-quality-analyzer-errors.md +191 -0
  36. package/content/plugins/audit/agents/api-quality-analyzer-pagination.md +179 -0
  37. package/content/plugins/audit/agents/api-quality-analyzer-versioning.md +150 -0
  38. package/content/plugins/audit/agents/api-quality-consensus.md +217 -0
  39. package/content/plugins/audit/agents/api-validator.md +191 -0
  40. package/content/plugins/audit/agents/arch-analyzer-circular.md +156 -0
  41. package/content/plugins/audit/agents/arch-analyzer-complexity.md +193 -0
  42. package/content/plugins/audit/agents/arch-analyzer-coupling.md +152 -0
  43. package/content/plugins/audit/agents/arch-analyzer-layering.md +160 -0
  44. package/content/plugins/audit/agents/arch-analyzer-patterns.md +210 -0
  45. package/content/plugins/audit/agents/arch-consensus.md +228 -0
  46. package/content/plugins/audit/agents/browser-qa.md +342 -0
  47. package/content/plugins/audit/agents/code-reviewer.md +298 -0
  48. package/content/plugins/audit/agents/completeness-analyzer-api.md +199 -0
  49. package/content/plugins/audit/agents/completeness-analyzer-conditional.md +211 -0
  50. package/content/plugins/audit/agents/completeness-analyzer-handlers.md +166 -0
  51. package/content/plugins/audit/agents/completeness-analyzer-imports.md +165 -0
  52. package/content/plugins/audit/agents/completeness-analyzer-routes.md +190 -0
  53. package/content/plugins/audit/agents/completeness-analyzer-state.md +196 -0
  54. package/content/plugins/audit/agents/completeness-analyzer-stubs.md +206 -0
  55. package/content/plugins/audit/agents/completeness-consensus.md +295 -0
  56. package/content/plugins/audit/agents/error-analyzer.md +213 -0
  57. package/content/plugins/audit/agents/flow-analyzer-authorization.md +182 -0
  58. package/content/plugins/audit/agents/flow-analyzer-discovery.md +174 -0
  59. package/content/plugins/audit/agents/flow-analyzer-errors.md +186 -0
  60. package/content/plugins/audit/agents/flow-analyzer-feedback.md +185 -0
  61. package/content/plugins/audit/agents/flow-analyzer-navigation.md +177 -0
  62. package/content/plugins/audit/agents/flow-analyzer-persistence.md +193 -0
  63. package/content/plugins/audit/agents/flow-analyzer-wiring.md +169 -0
  64. package/content/plugins/audit/agents/flow-consensus.md +237 -0
  65. package/content/plugins/audit/agents/legal-analyzer-a11y.md +114 -0
  66. package/content/plugins/audit/agents/legal-analyzer-ai.md +121 -0
  67. package/content/plugins/audit/agents/legal-analyzer-consumer.md +114 -0
  68. package/content/plugins/audit/agents/legal-analyzer-content.md +117 -0
  69. package/content/plugins/audit/agents/legal-analyzer-international.md +119 -0
  70. package/content/plugins/audit/agents/legal-analyzer-licensing.md +119 -0
  71. package/content/plugins/audit/agents/legal-analyzer-privacy.md +112 -0
  72. package/content/plugins/audit/agents/legal-analyzer-security.md +116 -0
  73. package/content/plugins/audit/agents/legal-analyzer-terms.md +115 -0
  74. package/content/plugins/audit/agents/legal-consensus.md +250 -0
  75. package/content/plugins/audit/agents/logic-analyzer-edge.md +179 -0
  76. package/content/plugins/audit/agents/logic-analyzer-flow.md +264 -0
  77. package/content/plugins/audit/agents/logic-analyzer-invariant.md +215 -0
  78. package/content/plugins/audit/agents/logic-analyzer-race.md +280 -0
  79. package/content/plugins/audit/agents/logic-analyzer-type.md +227 -0
  80. package/content/plugins/audit/agents/logic-consensus.md +259 -0
  81. package/content/plugins/audit/agents/perf-analyzer-assets.md +182 -0
  82. package/content/plugins/audit/agents/perf-analyzer-bundle.md +173 -0
  83. package/content/plugins/audit/agents/perf-analyzer-caching.md +170 -0
  84. package/content/plugins/audit/agents/perf-analyzer-compute.md +173 -0
  85. package/content/plugins/audit/agents/perf-analyzer-memory.md +193 -0
  86. package/content/plugins/audit/agents/perf-analyzer-network.md +165 -0
  87. package/content/plugins/audit/agents/perf-analyzer-queries.md +162 -0
  88. package/content/plugins/audit/agents/perf-analyzer-rendering.md +168 -0
  89. package/content/plugins/audit/agents/perf-consensus.md +287 -0
  90. package/content/plugins/audit/agents/qa.md +820 -0
  91. package/content/plugins/audit/agents/quality-analyzer-comments.md +159 -0
  92. package/content/plugins/audit/agents/quality-analyzer-duplication.md +184 -0
  93. package/content/plugins/audit/agents/quality-analyzer-naming.md +160 -0
  94. package/content/plugins/audit/agents/quality-consensus.md +241 -0
  95. package/content/plugins/audit/agents/schema-validator.md +473 -0
  96. package/content/plugins/audit/agents/security-analyzer-api.md +210 -0
  97. package/content/plugins/audit/agents/security-analyzer-auth.md +169 -0
  98. package/content/plugins/audit/agents/security-analyzer-authz.md +180 -0
  99. package/content/plugins/audit/agents/security-analyzer-deps.md +153 -0
  100. package/content/plugins/audit/agents/security-analyzer-infra.md +184 -0
  101. package/content/plugins/audit/agents/security-analyzer-injection.md +155 -0
  102. package/content/plugins/audit/agents/security-analyzer-input.md +201 -0
  103. package/content/plugins/audit/agents/security-analyzer-secrets.md +183 -0
  104. package/content/plugins/audit/agents/security-consensus.md +283 -0
  105. package/content/plugins/audit/agents/test-analyzer-assertions.md +188 -0
  106. package/content/plugins/audit/agents/test-analyzer-coverage.md +189 -0
  107. package/content/plugins/audit/agents/test-analyzer-fragility.md +193 -0
  108. package/content/plugins/audit/agents/test-analyzer-integration.md +161 -0
  109. package/content/plugins/audit/agents/test-analyzer-maintenance.md +180 -0
  110. package/content/plugins/audit/agents/test-analyzer-mocking.md +188 -0
  111. package/content/plugins/audit/agents/test-analyzer-patterns.md +196 -0
  112. package/content/plugins/audit/agents/test-analyzer-structure.md +184 -0
  113. package/content/plugins/audit/agents/test-consensus.md +301 -0
  114. package/content/plugins/audit/agents/testing.md +561 -0
  115. package/content/plugins/audit/agents/ui-validator.md +344 -0
  116. package/content/plugins/audit/plugin.yaml +186 -5
  117. package/content/plugins/audit/skills/agileflow-audit/SKILL.md +113 -0
  118. package/content/plugins/audit/skills/agileflow-audit/references/audit-depth-guide.md +151 -0
  119. package/content/plugins/audit/skills/agileflow-audit/references/dependency-risk-guide.md +139 -0
  120. package/content/plugins/audit/skills/agileflow-audit/references/owasp-top10.md +120 -0
  121. package/content/plugins/audit/skills/agileflow-audit/references/performance-budget-guide.md +143 -0
  122. package/content/plugins/audit/skills/agileflow-audit/references/wcag-criteria.md +117 -0
  123. package/content/plugins/audit/skills/agileflow-audit/workflows/run-audit.md +52 -0
  124. package/content/plugins/audit/skills/agileflow-audit/workflows/tdd.md +66 -0
  125. package/content/plugins/core/agents/adr-writer.md +521 -0
  126. package/content/plugins/core/agents/epic-planner.md +520 -0
  127. package/content/plugins/core/agents/mentor.md +709 -0
  128. package/content/plugins/core/agents/orchestrator.md +776 -0
  129. package/content/plugins/core/agents/team-coordinator.md +334 -0
  130. package/content/plugins/core/agents/team-lead.md +181 -0
  131. package/content/plugins/core/agents/workspace-orchestrator.md +146 -0
  132. package/content/plugins/core/hooks/context-loader.js +31 -4
  133. package/content/plugins/core/hooks/damage-control-bash.js +10 -2
  134. package/content/plugins/core/hooks/damage-control-edit.js +4 -1
  135. package/content/plugins/core/hooks/damage-control-patterns.yaml +1 -1
  136. package/content/plugins/core/hooks/damage-control-write.js +4 -1
  137. package/content/plugins/core/hooks/{pre-compact-state.js → post-compact-state.js} +25 -8
  138. package/content/plugins/core/hooks/preferences-injector.js +352 -0
  139. package/content/plugins/core/plugin.yaml +24 -28
  140. package/content/plugins/core/skills/agileflow-adr/SKILL.md +34 -8
  141. package/content/plugins/core/skills/agileflow-adr/references/madr-format-guide.md +86 -0
  142. package/content/plugins/core/skills/agileflow-adr/workflows/write-adr.md +57 -0
  143. package/content/plugins/core/skills/agileflow-babysit-mentor/SKILL.md +94 -27
  144. package/content/plugins/core/skills/agileflow-babysit-mentor/references/mentor-decision-guide.md +81 -0
  145. package/content/plugins/core/skills/agileflow-babysit-mentor/workflows/mentor-session.md +79 -0
  146. package/content/plugins/core/skills/agileflow-epic-planner/SKILL.md +37 -7
  147. package/content/plugins/core/skills/agileflow-epic-planner/references/epic-sizing-guide.md +81 -0
  148. package/content/plugins/core/skills/agileflow-epic-planner/workflows/plan-epic.md +55 -0
  149. package/content/plugins/core/skills/agileflow-status-updater/SKILL.md +36 -20
  150. package/content/plugins/core/skills/agileflow-status-updater/references/status-transitions.md +89 -0
  151. package/content/plugins/core/skills/agileflow-status-updater/workflows/update-status.md +56 -0
  152. package/content/plugins/core/skills/agileflow-story-writer/SKILL.md +39 -114
  153. package/content/plugins/core/skills/agileflow-story-writer/references/estimation-reference.md +36 -0
  154. package/content/plugins/core/skills/agileflow-story-writer/references/story-template.md +92 -0
  155. package/content/plugins/core/skills/agileflow-story-writer/workflows/write-story.md +138 -0
  156. package/content/plugins/council/agents/council-advocate.md +223 -0
  157. package/content/plugins/council/agents/council-analyst.md +278 -0
  158. package/content/plugins/council/agents/council-compounder.md +204 -0
  159. package/content/plugins/council/agents/council-contrarian.md +217 -0
  160. package/content/plugins/council/agents/council-moonshot.md +217 -0
  161. package/content/plugins/council/agents/council-optimist.md +185 -0
  162. package/content/plugins/council/agents/council-revenue.md +200 -0
  163. package/content/plugins/council/agents/council-technical.md +218 -0
  164. package/content/plugins/council/agents/multi-expert.md +334 -0
  165. package/content/plugins/council/plugin.yaml +23 -4
  166. package/content/plugins/council/skills/agileflow-council/SKILL.md +102 -0
  167. package/content/plugins/council/skills/agileflow-council/references/decision-log-template.md +109 -0
  168. package/content/plugins/council/skills/agileflow-council/references/perspective-guide.md +104 -0
  169. package/content/plugins/council/skills/agileflow-council/references/when-to-convene-guide.md +112 -0
  170. package/content/plugins/council/skills/agileflow-council/workflows/convene.md +73 -0
  171. package/content/plugins/council/skills/agileflow-council/workflows/multi-expert.md +75 -0
  172. package/content/plugins/database/plugin.yaml +14 -0
  173. package/content/plugins/database/skills/agileflow-database/SKILL.md +284 -0
  174. package/content/plugins/database/skills/agileflow-database/references/indexing-guide.md +313 -0
  175. package/content/plugins/database/skills/agileflow-database/references/migration-guide.md +328 -0
  176. package/content/plugins/database/skills/agileflow-database/references/schema-design-guide.md +467 -0
  177. package/content/plugins/database/skills/agileflow-database/workflows/design-schema.md +213 -0
  178. package/content/plugins/database/skills/agileflow-database/workflows/optimize-query.md +253 -0
  179. package/content/plugins/debugging/plugin.yaml +14 -0
  180. package/content/plugins/debugging/skills/agileflow-debug/SKILL.md +236 -0
  181. package/content/plugins/debugging/skills/agileflow-debug/references/common-patterns.md +350 -0
  182. package/content/plugins/debugging/skills/agileflow-debug/references/debugging-strategies.md +328 -0
  183. package/content/plugins/debugging/skills/agileflow-debug/workflows/debug-issue.md +187 -0
  184. package/content/plugins/debugging/skills/agileflow-debug/workflows/reproduce-bug.md +194 -0
  185. package/content/plugins/delivery/agents/ci.md +547 -0
  186. package/content/plugins/delivery/agents/devops.md +789 -0
  187. package/content/plugins/delivery/plugin.yaml +19 -0
  188. package/content/plugins/delivery/skills/agileflow-delivery/SKILL.md +111 -0
  189. package/content/plugins/delivery/skills/agileflow-delivery/references/changelog-format-guide.md +133 -0
  190. package/content/plugins/delivery/skills/agileflow-delivery/references/ci-pipeline-guide.md +158 -0
  191. package/content/plugins/delivery/skills/agileflow-delivery/references/pr-checklist-guide.md +133 -0
  192. package/content/plugins/delivery/skills/agileflow-delivery/references/release-checklist.md +142 -0
  193. package/content/plugins/delivery/skills/agileflow-delivery/workflows/changelog.md +72 -0
  194. package/content/plugins/delivery/skills/agileflow-delivery/workflows/deploy.md +74 -0
  195. package/content/plugins/delivery/skills/agileflow-delivery/workflows/pr.md +75 -0
  196. package/content/plugins/docs/agents/documentation.md +544 -0
  197. package/content/plugins/docs/agents/readme-updater.md +640 -0
  198. package/content/plugins/docs/plugin.yaml +19 -0
  199. package/content/plugins/docs/skills/agileflow-docs/SKILL.md +106 -0
  200. package/content/plugins/docs/skills/agileflow-docs/references/api-doc-template.md +167 -0
  201. package/content/plugins/docs/skills/agileflow-docs/references/doc-types-guide.md +141 -0
  202. package/content/plugins/docs/skills/agileflow-docs/references/readme-template.md +156 -0
  203. package/content/plugins/docs/skills/agileflow-docs/workflows/readme-sync.md +57 -0
  204. package/content/plugins/docs/skills/agileflow-docs/workflows/sync.md +64 -0
  205. package/content/plugins/engineering/agents/api.md +718 -0
  206. package/content/plugins/engineering/agents/codebase-query.md +285 -0
  207. package/content/plugins/engineering/agents/compliance.md +559 -0
  208. package/content/plugins/engineering/agents/database.md +644 -0
  209. package/content/plugins/engineering/agents/integrations.md +644 -0
  210. package/content/plugins/engineering/agents/mobile.md +552 -0
  211. package/content/plugins/engineering/agents/monitoring.md +585 -0
  212. package/content/plugins/engineering/agents/performance.md +529 -0
  213. package/content/plugins/engineering/agents/refactor.md +592 -0
  214. package/content/plugins/engineering/agents/security.md +524 -0
  215. package/content/plugins/engineering/agents/ui.md +1336 -0
  216. package/content/plugins/engineering/plugin.yaml +37 -0
  217. package/content/plugins/engineering/skills/agileflow-engineering/SKILL.md +127 -0
  218. package/content/plugins/engineering/skills/agileflow-engineering/references/code-review-guide.md +126 -0
  219. package/content/plugins/engineering/skills/agileflow-engineering/references/domain-routing-guide.md +89 -0
  220. package/content/plugins/engineering/skills/agileflow-engineering/references/refactoring-guide.md +136 -0
  221. package/content/plugins/engineering/skills/agileflow-engineering/workflows/diagnose.md +63 -0
  222. package/content/plugins/engineering/skills/agileflow-engineering/workflows/impact.md +60 -0
  223. package/content/plugins/ideation/agents/brainstorm-analyzer-features.md +179 -0
  224. package/content/plugins/ideation/agents/brainstorm-analyzer-growth.md +169 -0
  225. package/content/plugins/ideation/agents/brainstorm-analyzer-integration.md +181 -0
  226. package/content/plugins/ideation/agents/brainstorm-analyzer-market.md +150 -0
  227. package/content/plugins/ideation/agents/brainstorm-analyzer-ux.md +180 -0
  228. package/content/plugins/ideation/agents/brainstorm-consensus.md +245 -0
  229. package/content/plugins/ideation/agents/design.md +568 -0
  230. package/content/plugins/ideation/agents/product.md +582 -0
  231. package/content/plugins/ideation/plugin.yaml +31 -0
  232. package/content/plugins/ideation/skills/agileflow-ideation/SKILL.md +109 -0
  233. package/content/plugins/ideation/skills/agileflow-ideation/references/brainstorm-techniques.md +138 -0
  234. package/content/plugins/ideation/skills/agileflow-ideation/references/competitive-analysis-template.md +148 -0
  235. package/content/plugins/ideation/skills/agileflow-ideation/references/feature-prioritization-guide.md +147 -0
  236. package/content/plugins/ideation/skills/agileflow-ideation/references/user-story-patterns.md +152 -0
  237. package/content/plugins/ideation/skills/agileflow-ideation/workflows/features.md +65 -0
  238. package/content/plugins/ideation/skills/agileflow-ideation/workflows/ideate.md +54 -0
  239. package/content/plugins/migration/agents/datamigration.md +757 -0
  240. package/content/plugins/migration/plugin.yaml +17 -0
  241. package/content/plugins/migration/skills/agileflow-migration/SKILL.md +106 -0
  242. package/content/plugins/migration/skills/agileflow-migration/references/data-validation-checklist.md +154 -0
  243. package/content/plugins/migration/skills/agileflow-migration/references/migration-patterns.md +209 -0
  244. package/content/plugins/migration/skills/agileflow-migration/references/rollback-playbook.md +171 -0
  245. package/content/plugins/migration/skills/agileflow-migration/references/version-compatibility-matrix.md +155 -0
  246. package/content/plugins/migration/skills/agileflow-migration/workflows/plan.md +73 -0
  247. package/content/plugins/migration/skills/agileflow-migration/workflows/validate.md +71 -0
  248. package/content/plugins/performance/plugin.yaml +14 -0
  249. package/content/plugins/performance/skills/agileflow-performance/SKILL.md +224 -0
  250. package/content/plugins/performance/skills/agileflow-performance/references/optimization-patterns.md +554 -0
  251. package/content/plugins/performance/skills/agileflow-performance/references/profiling-guide.md +383 -0
  252. package/content/plugins/performance/skills/agileflow-performance/references/web-vitals-guide.md +360 -0
  253. package/content/plugins/performance/skills/agileflow-performance/workflows/improve-web-vitals.md +344 -0
  254. package/content/plugins/performance/skills/agileflow-performance/workflows/profile-and-fix.md +254 -0
  255. package/content/plugins/planning/agents/analytics.md +670 -0
  256. package/content/plugins/planning/agents/rlm-subcore.md +215 -0
  257. package/content/plugins/planning/plugin.yaml +19 -0
  258. package/content/plugins/planning/skills/agileflow-planning/SKILL.md +111 -0
  259. package/content/plugins/planning/skills/agileflow-planning/references/estimation-guide.md +114 -0
  260. package/content/plugins/planning/skills/agileflow-planning/references/rpi-workflow.md +119 -0
  261. package/content/plugins/planning/skills/agileflow-planning/references/sprint-planning-guide.md +145 -0
  262. package/content/plugins/planning/skills/agileflow-planning/workflows/impact.md +63 -0
  263. package/content/plugins/planning/skills/agileflow-planning/workflows/rpi.md +104 -0
  264. package/content/plugins/psychology/plugin.yaml +14 -0
  265. package/content/plugins/psychology/skills/agileflow-retention/SKILL.md +252 -0
  266. package/content/plugins/psychology/skills/agileflow-retention/references/competitor-analysis.md +240 -0
  267. package/content/plugins/psychology/skills/agileflow-retention/references/psychology-models.md +349 -0
  268. package/content/plugins/psychology/skills/agileflow-retention/references/retention-patterns.md +279 -0
  269. package/content/plugins/psychology/skills/agileflow-retention/workflows/design-retention-feature.md +287 -0
  270. package/content/plugins/psychology/skills/agileflow-retention/workflows/retention-audit.md +259 -0
  271. package/content/plugins/refactoring/plugin.yaml +14 -0
  272. package/content/plugins/refactoring/skills/agileflow-refactor/SKILL.md +235 -0
  273. package/content/plugins/refactoring/skills/agileflow-refactor/references/refactoring-patterns.md +405 -0
  274. package/content/plugins/refactoring/skills/agileflow-refactor/references/safety-checks.md +177 -0
  275. package/content/plugins/refactoring/skills/agileflow-refactor/workflows/extract-module.md +226 -0
  276. package/content/plugins/refactoring/skills/agileflow-refactor/workflows/safe-refactor.md +169 -0
  277. package/content/plugins/research/agents/research.md +503 -0
  278. package/content/plugins/research/plugin.yaml +17 -0
  279. package/content/plugins/research/skills/agileflow-research/SKILL.md +110 -0
  280. package/content/plugins/research/skills/agileflow-research/references/knowledge-decay-guide.md +121 -0
  281. package/content/plugins/research/skills/agileflow-research/references/research-prompt-guide.md +141 -0
  282. package/content/plugins/research/skills/agileflow-research/references/synthesis-template.md +154 -0
  283. package/content/plugins/research/skills/agileflow-research/workflows/analyze.md +60 -0
  284. package/content/plugins/research/skills/agileflow-research/workflows/ask.md +64 -0
  285. package/content/plugins/research/skills/agileflow-research/workflows/import.md +66 -0
  286. package/content/plugins/research/skills/agileflow-research/workflows/synthesize.md +66 -0
  287. package/content/plugins/reviews/plugin.yaml +14 -0
  288. package/content/plugins/reviews/skills/agileflow-pr-reviewer/SKILL.md +241 -0
  289. package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/review-checklist.md +200 -0
  290. package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/security-patterns.md +328 -0
  291. package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/review-pr.md +153 -0
  292. package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/security-review.md +177 -0
  293. package/content/plugins/seo/agents/seo-analyzer-content.md +169 -0
  294. package/content/plugins/seo/agents/seo-analyzer-images.md +198 -0
  295. package/content/plugins/seo/agents/seo-analyzer-performance.md +217 -0
  296. package/content/plugins/seo/agents/seo-analyzer-schema.md +184 -0
  297. package/content/plugins/seo/agents/seo-analyzer-sitemap.md +177 -0
  298. package/content/plugins/seo/agents/seo-analyzer-technical.md +151 -0
  299. package/content/plugins/seo/agents/seo-consensus.md +304 -0
  300. package/content/plugins/seo/plugin.yaml +19 -4
  301. package/content/plugins/seo/skills/agileflow-seo/SKILL.md +188 -0
  302. package/content/plugins/seo/skills/agileflow-seo/references/cwv-thresholds.md +110 -0
  303. package/content/plugins/seo/skills/agileflow-seo/references/eeat-framework.md +144 -0
  304. package/content/plugins/seo/skills/agileflow-seo/references/keyword-research-guide.md +125 -0
  305. package/content/plugins/seo/skills/agileflow-seo/references/schema-types.md +139 -0
  306. package/content/plugins/seo/skills/agileflow-seo/references/technical-seo-checklist.md +139 -0
  307. package/content/plugins/seo/skills/agileflow-seo/workflows/audit.md +98 -0
  308. package/content/plugins/seo/skills/agileflow-seo/workflows/page.md +118 -0
  309. package/content/plugins/testing/plugin.yaml +16 -0
  310. package/content/plugins/testing/skills/agileflow-test-writer/SKILL.md +260 -0
  311. package/content/plugins/testing/skills/agileflow-test-writer/references/coverage-targets.md +239 -0
  312. package/content/plugins/testing/skills/agileflow-test-writer/references/test-patterns.md +420 -0
  313. package/content/plugins/testing/skills/agileflow-test-writer/workflows/add-coverage.md +154 -0
  314. package/content/plugins/testing/skills/agileflow-test-writer/workflows/write-tests-from-ac.md +225 -0
  315. package/package.json +2 -2
  316. package/src/cli/commands/doctor.js +818 -30
  317. package/src/cli/commands/hook.js +17 -14
  318. package/src/cli/commands/launch.js +1454 -0
  319. package/src/cli/commands/learn.js +149 -0
  320. package/src/cli/commands/plugins.js +113 -0
  321. package/src/cli/commands/setup.js +455 -110
  322. package/src/cli/commands/skills.js +324 -0
  323. package/src/cli/commands/status.js +8 -10
  324. package/src/cli/commands/update.js +76 -15
  325. package/src/cli/index.js +90 -26
  326. package/src/cli/wizard/babysit-mode-picker.js +192 -0
  327. package/src/cli/wizard/behaviors-picker.js +208 -54
  328. package/src/cli/wizard/ide-picker.js +40 -28
  329. package/src/cli/wizard/install-scope-picker.js +57 -0
  330. package/src/cli/wizard/launch-alias-picker.js +50 -0
  331. package/src/cli/wizard/launch-cli-picker.js +129 -0
  332. package/src/cli/wizard/launch-tmux-picker.js +133 -0
  333. package/src/cli/wizard/learnings-picker.js +40 -0
  334. package/src/cli/wizard/plugin-picker.js +47 -16
  335. package/src/lib/brand.js +116 -0
  336. package/src/lib/errors.js +120 -0
  337. package/src/lib/path-check.js +39 -0
  338. package/src/runtime/config/defaults.js +22 -17
  339. package/src/runtime/config/loader.js +77 -8
  340. package/src/runtime/config/schema.json +43 -16
  341. package/src/runtime/config/writer.js +3 -1
  342. package/src/runtime/ide/babysit-skill.js +202 -0
  343. package/src/runtime/ide/capabilities.js +84 -29
  344. package/src/runtime/ide/claude-code-content.js +177 -0
  345. package/src/runtime/ide/claude-code-settings.js +67 -29
  346. package/src/runtime/ide/claude-code-skills.js +47 -32
  347. package/src/runtime/ide/codex-config.js +295 -0
  348. package/src/runtime/installer/install.js +252 -24
  349. package/src/runtime/launch/alias-installer.js +191 -0
  350. package/src/runtime/launch/cli-resume.js +244 -0
  351. package/src/runtime/launch/closed-windows.js +338 -0
  352. package/src/runtime/launch/defaults.js +66 -0
  353. package/src/runtime/launch/detect-clis.js +69 -0
  354. package/src/runtime/launch/doctor.js +464 -0
  355. package/src/runtime/launch/exec-wrapper.js +114 -0
  356. package/src/runtime/launch/parallel-session.js +247 -0
  357. package/src/runtime/launch/prefs.js +211 -0
  358. package/src/runtime/launch/project-prefs.js +234 -0
  359. package/src/runtime/launch/resolve-cli.js +56 -0
  360. package/src/runtime/launch/restore.js +152 -0
  361. package/src/runtime/launch/schema.json +75 -0
  362. package/src/runtime/launch/session-lifecycle.js +313 -0
  363. package/src/runtime/launch/session-registry.js +401 -0
  364. package/src/runtime/launch/spawn.js +103 -0
  365. package/src/runtime/launch/tabs.js +350 -0
  366. package/src/runtime/launch/tmux.js +764 -0
  367. package/src/runtime/launch/worktree.js +260 -0
  368. package/src/runtime/plugins/registry.js +16 -11
  369. package/src/runtime/plugins/validator.js +57 -43
  370. package/src/runtime/skills/learnings.js +308 -0
  371. package/content/plugins/core/hooks/babysit-mentor-injector.js +0 -55
  372. package/src/cli/wizard/personalization.js +0 -64
@@ -0,0 +1,37 @@
1
+ id: engineering
2
+ name: Engineering
3
+ description: Engineering skill pack.
4
+ version: 1.0.0
5
+ enabledByDefault: false
6
+
7
+ depends: []
8
+
9
+ provides:
10
+ skills:
11
+ - id: agileflow-engineering
12
+ dir: skills/agileflow-engineering
13
+ agents:
14
+ - id: api
15
+ path: agents/api.md
16
+ - id: codebase-query
17
+ path: agents/codebase-query.md
18
+ - id: compliance
19
+ path: agents/compliance.md
20
+ - id: database
21
+ path: agents/database.md
22
+ - id: integrations
23
+ path: agents/integrations.md
24
+ - id: mobile
25
+ path: agents/mobile.md
26
+ - id: monitoring
27
+ path: agents/monitoring.md
28
+ - id: performance
29
+ path: agents/performance.md
30
+ - id: refactor
31
+ path: agents/refactor.md
32
+ - id: security
33
+ path: agents/security.md
34
+ - id: ui
35
+ path: agents/ui.md
36
+ hooks: []
37
+ templates: []
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: agileflow-engineering
3
+ version: 1.0.0
4
+ category: agileflow/engineering
5
+ description: |
6
+ Use when the user is implementing a specific technical domain: API
7
+ endpoints, database schema, UI components, mobile, security hardening,
8
+ performance optimization, integrations, compliance, or refactoring.
9
+ Routes to the right domain expert for the task.
10
+ triggers:
11
+ keywords:
12
+ - build api
13
+ - database schema
14
+ - ui component
15
+ - security hardening
16
+ - integration
17
+ - mobile
18
+ - compliance
19
+ - monitoring
20
+ - implement
21
+ - build this feature
22
+ priority: 50
23
+ provides:
24
+ agents: []
25
+ learns:
26
+ enabled: true
27
+ file: _learnings/engineering.yaml
28
+ maxEntries: 50
29
+ depends:
30
+ skills: []
31
+ plugins: [engineering]
32
+ ---
33
+
34
+ # AgileFlow Engineering
35
+
36
+ Domain expert routing for implementation work. Delegates to the right
37
+ specialist based on what's being built.
38
+
39
+ ## When this skill activates
40
+
41
+ - User wants to implement a specific technical feature
42
+ - User asks for help with a domain-specific problem (DB, API, UI, etc.)
43
+ - Babysit mentor needs to delegate implementation work
44
+
45
+ ## Domain experts
46
+
47
+ | Command / Expert | When to use |
48
+ | --------------------------- | --------------------------------------------------------- |
49
+ | `/agileflow:api` | REST endpoints, business logic, request/response handling |
50
+ | `agileflow-database` | Schema design, migrations, query optimization |
51
+ | `agileflow-ui` | Components, styling, theming, accessibility |
52
+ | `agileflow-mobile` | React Native, Flutter, cross-platform mobile |
53
+ | `agileflow-security` | Auth, authorization, vulnerability analysis |
54
+ | `agileflow-performance` | Profiling, optimization, benchmarking |
55
+ | `agileflow-integrations` | Third-party APIs, webhooks, payment processors |
56
+ | `agileflow-compliance` | GDPR, HIPAA, SOC2, audit trails |
57
+ | `agileflow-monitoring` | Observability, logging, alerting, metrics |
58
+ | `/agileflow:refactor` | Technical debt, legacy code cleanup |
59
+ | `/agileflow:codebase-query` | Search and understand the existing codebase |
60
+
61
+ ## Routing logic
62
+
63
+ ```
64
+ Single domain (DB only) → delegate to agileflow-database
65
+ Single domain (UI only) → delegate to agileflow-ui
66
+ Multi-domain (API + UI) → delegate to agileflow-orchestrator
67
+ Security concern → always include agileflow-security
68
+ Unknown codebase pattern → /agileflow:codebase-query first
69
+ ```
70
+
71
+ ## Common flows
72
+
73
+ **Add new API endpoint:**
74
+
75
+ 1. `agileflow-database` (schema if needed)
76
+ 2. `agileflow-api` (endpoint + business logic)
77
+ 3. `agileflow-testing` (tests)
78
+
79
+ **Add UI feature:**
80
+
81
+ 1. `agileflow-ui` (component + styling)
82
+ 2. `agileflow-testing` (tests)
83
+ 3. Accessibility audit if interactive elements added
84
+
85
+ ## Integration
86
+
87
+ ### Before implementation
88
+
89
+ - **agileflow-planning** — run an impact analysis before touching existing code; understand blast radius before writing anything
90
+ - **agileflow-research** — activate when the story requires an unfamiliar library, API, or integration pattern; research resolves the unknowns before coding starts
91
+ - **agileflow-council** — convene for architectural decisions that emerge mid-implementation: database choice, API design, service boundaries
92
+ - **agileflow-adr** — create an ADR when a meaningful architecture or technology decision is made during implementation
93
+
94
+ ### During implementation
95
+
96
+ - **agileflow-database** — delegate schema design, index planning, migration scripts, and query optimisation; engineering owns the feature, database owns the storage layer
97
+ - **agileflow-debug** — hand off when hitting a persistent error after two different fix attempts; don't guess a third time
98
+ - **agileflow-refactor** — use alongside implementation when the story explicitly involves cleaning up existing code before adding new functionality
99
+ - **agileflow-migration** — use when the story involves upgrading a framework, library, or schema alongside the new feature work
100
+
101
+ ### After implementation
102
+
103
+ - **agileflow-test-writer** — spawn to generate unit, integration, and E2E tests from the acceptance criteria after implementation completes
104
+ - **agileflow-accessibility** — required after any UI or interactive element changes; invoke before marking the story done
105
+ - **agileflow-performance** — invoke when the implementation touches query paths, renders, or data processing; confirm no regressions
106
+ - **agileflow-audit** — run after implementation for P0/P1 sweep before merging into main
107
+ - **agileflow-docs** — sync API docs, README, or configuration docs after any public-facing change
108
+ - **agileflow-pr-reviewer** — invoke before creating the PR, especially for changes touching 5+ files
109
+
110
+ ## References
111
+
112
+ Load these files when you need deeper context for the relevant task:
113
+
114
+ | File | When to load |
115
+ | ------------------------------------ | ----------------------------------------------------------------------------------------------------------- |
116
+ | `references/domain-routing-guide.md` | Deciding which expert to delegate to — single vs multi-domain routing, parallel vs sequential execution |
117
+ | `references/code-review-guide.md` | Reviewing code or preparing code for review — what to look for per layer, blocking vs non-blocking comments |
118
+ | `references/refactoring-guide.md` | Planning a refactor — when to refactor, extract vs inline decisions, naming conventions |
119
+
120
+ ## Workflows
121
+
122
+ Follow these step-by-step when the user initiates the matching action:
123
+
124
+ | File | When to follow |
125
+ | ----------------------- | ------------------------------------------------------------------------------- |
126
+ | `workflows/impact.md` | User wants to understand the blast radius of a change before implementing |
127
+ | `workflows/diagnose.md` | User is stuck or wants to diagnose a bottleneck — systematic debugging approach |
@@ -0,0 +1,126 @@
1
+ # Code Review Guide
2
+
3
+ **Load this when:** Conducting a code review, giving review feedback, or setting review standards.
4
+
5
+ ## Review Layers (check in this order)
6
+
7
+ ### 1. Correctness (blocking)
8
+
9
+ - [ ] Does it do what the story/ticket describes?
10
+ - [ ] Edge cases handled: null, empty, zero, max values, concurrent access
11
+ - [ ] Error paths handled and errors surfaced appropriately
12
+ - [ ] No silent failures (swallowed exceptions, unchecked return values)
13
+ - [ ] State mutations are intentional and safe
14
+
15
+ ### 2. Security (blocking)
16
+
17
+ - [ ] No secrets, tokens, or PII in code or logs
18
+ - [ ] User input validated/sanitized before use
19
+ - [ ] SQL: parameterized queries only
20
+ - [ ] Auth checks present on new endpoints/routes
21
+ - [ ] File paths constructed safely (no traversal risk)
22
+
23
+ ### 3. Tests (blocking)
24
+
25
+ - [ ] New behavior has tests
26
+ - [ ] Tests test behavior, not implementation
27
+ - [ ] No tests commented out or skipped without explanation
28
+ - [ ] Unhappy paths tested (errors, empty state, unauthorized)
29
+
30
+ ### 4. Design (non-blocking by default, blocking if severe)
31
+
32
+ - [ ] Follows existing patterns in the codebase
33
+ - [ ] No unnecessary abstraction (YAGNI)
34
+ - [ ] No obvious performance issues (N+1 queries, unbounded loops)
35
+ - [ ] Dependencies justified (not adding a package for one utility function)
36
+
37
+ ### 5. Readability (non-blocking, suggestions)
38
+
39
+ - [ ] Variable/function names reveal intent
40
+ - [ ] Complex logic has a comment explaining _why_, not _what_
41
+ - [ ] Function length appropriate (suggest refactor if >50 lines)
42
+ - [ ] Magic numbers/strings have named constants
43
+
44
+ ---
45
+
46
+ ## Feedback Tone Guide
47
+
48
+ ### Framing principles
49
+
50
+ - Critique the code, never the person
51
+ - Ask questions before asserting problems ("Could this be null here, or is it always set?")
52
+ - Explain the _why_ behind every blocking comment
53
+ - Lead with the positive when the overall PR is good
54
+
55
+ ### Blocking vs. Non-blocking
56
+
57
+ | Label | Meaning | PR can merge? |
58
+ | ------------- | ---------------------- | ----------------- |
59
+ | `blocking:` | Must fix before merge | No |
60
+ | `suggestion:` | Preferred but optional | Yes |
61
+ | `nit:` | Tiny style preference | Yes |
62
+ | `question:` | Seeking understanding | Yes, after answer |
63
+ | `praise:` | Call out good work | Yes |
64
+
65
+ **Use inline labels.** Example:
66
+
67
+ ```
68
+ blocking: This will throw if `user` is undefined. Add a null check or early return.
69
+
70
+ suggestion: This could use `Array.from()` instead of `[...spread]` for clarity.
71
+
72
+ nit: Missing semicolon on line 42.
73
+
74
+ question: Is there a reason we're not using the existing `formatDate` utility here?
75
+ ```
76
+
77
+ ---
78
+
79
+ ## What NOT to Block On
80
+
81
+ | Topic | Handle it differently |
82
+ | -------------------------------------------- | ---------------------------------------------------------------------- |
83
+ | Formatting / whitespace | Enforce with a formatter (Prettier, ESLint). Never block PRs manually. |
84
+ | Pure style preference | Use `nit:` or `suggestion:`, never `blocking:` |
85
+ | "I would have done it differently" | Only block if the approach has a concrete defect |
86
+ | Missing tests for pre-existing untested code | Add a tech debt ticket; don't block the PR |
87
+
88
+ ---
89
+
90
+ ## Reviewer Efficiency Heuristics
91
+
92
+ | PR size | Suggested approach |
93
+ | ------------- | --------------------------------------------------------------------------- |
94
+ | <100 lines | Full review all layers |
95
+ | 100–400 lines | All layers; read all code |
96
+ | 400–800 lines | All layers; focus on structure and interface design |
97
+ | >800 lines | Request split. If urgent: review architecture + security, defer readability |
98
+
99
+ **Time budget:** ~1 hour per 400 lines. If taking longer, scope is too large.
100
+
101
+ ---
102
+
103
+ ## Common Code Smells to Flag
104
+
105
+ | Smell | Blocking? | Typical fix |
106
+ | --------------------------- | ---------- | ------------------------------------------ |
107
+ | `any` type in TypeScript | Suggestion | Proper type or `unknown` |
108
+ | `console.log` in prod code | Blocking | Remove or use logger |
109
+ | Hardcoded URL/env value | Blocking | Move to config/env |
110
+ | Commented-out code block | Nit | Delete it |
111
+ | Function with >3 parameters | Suggestion | Options object |
112
+ | Deep nesting (>3 levels) | Suggestion | Early return / extract function |
113
+ | Boolean parameter flags | Suggestion | Named options object or separate functions |
114
+ | `TODO` without issue link | Nit | Add issue reference |
115
+
116
+ ---
117
+
118
+ ## Approving a PR
119
+
120
+ Approve when:
121
+
122
+ - All blocking issues resolved
123
+ - You understand what the code does and why
124
+ - You'd be comfortable being woken up at 2am if it causes an incident
125
+
126
+ Do NOT approve just to unblock — a ship-it with unresolved blocking issues is worse than a delay.
@@ -0,0 +1,89 @@
1
+ # Domain Routing Guide
2
+
3
+ **Load this when:** deciding which expert to delegate to, or whether to use
4
+ the orchestrator for multi-domain work.
5
+
6
+ ## Single-domain routing
7
+
8
+ | Work involves... | Route to | Notes |
9
+ | ----------------------------------------------------------- | -------------------------- | --------------------------- |
10
+ | SQL schema, migrations, indexes, ORM queries | `agileflow-database` | Always for schema changes |
11
+ | REST endpoints, GraphQL, business logic, request handling | `agileflow-api` | Backend routes and services |
12
+ | React/Vue/Angular components, CSS, theming, accessibility | `agileflow-ui` | Frontend presentation layer |
13
+ | React Native, Flutter, iOS, Android, cross-platform | `agileflow-mobile` | Mobile-specific concerns |
14
+ | Auth flows, authorization, vulnerability analysis, pen test | `agileflow-security` | Any security-sensitive code |
15
+ | Profiling, caching, query optimization, bundle size | `agileflow-performance` | Performance bottlenecks |
16
+ | Stripe, Twilio, SendGrid, OAuth, external APIs | `agileflow-integrations` | Third-party service wiring |
17
+ | GDPR, HIPAA, SOC2, audit logging, compliance docs | `agileflow-compliance` | Regulatory requirements |
18
+ | Prometheus, Grafana, Datadog, logging, alerting | `agileflow-monitoring` | Observability setup |
19
+ | Legacy code cleanup, extracting functions, naming | `agileflow-refactor` | Technical debt work |
20
+ | Codebase exploration, finding patterns, understanding code | `agileflow-codebase-query` | Discovery and research |
21
+
22
+ ## Multi-domain routing → orchestrator
23
+
24
+ Use `agileflow-orchestrator` when work spans 2+ domains:
25
+
26
+ | Example work | Domains involved |
27
+ | ----------------------------- | -------------------------------- |
28
+ | New user profile feature | API + UI (+ DB if schema change) |
29
+ | Payment integration | API + Security + Integrations |
30
+ | Real-time notifications | API + UI + Monitoring |
31
+ | New data model with endpoints | DB + API |
32
+ | Auth system | API + Security + UI |
33
+ | Performance investigation | DB + Performance + Monitoring |
34
+
35
+ ## Parallel vs sequential expert execution
36
+
37
+ ```
38
+ Independent domains → run in PARALLEL (faster)
39
+ Example: UI component + API endpoint (neither needs the other's output)
40
+
41
+ Dependent domains → run SEQUENTIALLY
42
+ Example: DB schema → API endpoint → UI (each builds on previous)
43
+ Common order: Database → API → UI → Tests
44
+ ```
45
+
46
+ ## When to involve security
47
+
48
+ **Always involve `agileflow-security` when:**
49
+
50
+ - Authentication or session management changes
51
+ - New API endpoints that accept user input
52
+ - File upload functionality
53
+ - Payment or financial data handling
54
+ - User permission or role changes
55
+ - New third-party integrations that receive webhooks
56
+ - Any data encryption or key management
57
+
58
+ Security review doesn't block other experts — run it in parallel with API/UI work,
59
+ then review findings before committing.
60
+
61
+ ## Testing
62
+
63
+ `agileflow-testing` is for test strategy and comprehensive test suites.
64
+ For quick test additions alongside implementation, the domain expert handles it directly.
65
+
66
+ Use `agileflow-testing` when:
67
+
68
+ - Coverage is systematically low and needs a strategy
69
+ - Complex testing setup (mocking, fixtures, test data)
70
+ - End-to-end test suite design
71
+ - Test quality audit results show structural problems
72
+
73
+ ## When to use multi-expert vs orchestrator
74
+
75
+ | Need | Use |
76
+ | ------------------------------------------------ | ------------------------- |
77
+ | Implement a feature across 2+ domains | `agileflow-orchestrator` |
78
+ | Get multiple opinions/analysis on the same thing | `/agileflow:multi-expert` |
79
+ | Review code for correctness | `agileflow-code-reviewer` |
80
+ | Architecture decision | `/agileflow:council` |
81
+
82
+ ## Escalation triggers
83
+
84
+ Escalate from single expert to orchestrator mid-task if:
85
+
86
+ - Expert discovers the work spans more domains than expected
87
+ - Schema change is needed (always add `agileflow-database`)
88
+ - Security issue found (always add `agileflow-security`)
89
+ - Performance problem discovered (add `agileflow-performance`)
@@ -0,0 +1,136 @@
1
+ # Refactoring Guide
2
+
3
+ **Load this when:** Deciding whether to refactor, choosing a refactoring technique, or reviewing a refactoring PR.
4
+
5
+ ## When to Refactor
6
+
7
+ ### Strong signals (do it)
8
+
9
+ - [ ] Same logic copy-pasted in 3+ places
10
+ - [ ] Function >50 lines doing multiple things
11
+ - [ ] Adding a feature requires understanding >200 lines of tangled code first
12
+ - [ ] Tests are brittle because they depend on implementation details
13
+ - [ ] Name of function/variable no longer describes what it does
14
+
15
+ ### Weak signals (consider it)
16
+
17
+ - Code works but feels awkward to navigate
18
+ - New team members consistently get confused in this area
19
+ - The same area keeps appearing in bug reports
20
+
21
+ ### Do NOT refactor when
22
+
23
+ - You're in a code freeze or release window
24
+ - You don't have test coverage to verify behavior is preserved
25
+ - The refactoring would touch >500 lines without a clear benefit
26
+ - You're on a deadline and the code works
27
+
28
+ **Rule of three:** Fix inline once, extract on the second instance, refactor on the third.
29
+
30
+ ---
31
+
32
+ ## Extract vs. Inline Decision
33
+
34
+ ### Extract (create a new function/module) when
35
+
36
+ - Logic is reused in 2+ places
37
+ - A block of code has a single, nameable purpose
38
+ - The function is testable in isolation
39
+ - The enclosing function is doing too many things
40
+
41
+ ### Inline (collapse a function/variable back) when
42
+
43
+ - The function is called from exactly one place
44
+ - The abstraction adds no clarity — you have to read the definition to understand the call
45
+ - A variable just aliases another variable (`const x = y; doThing(x)`)
46
+
47
+ ---
48
+
49
+ ## Core Refactoring Techniques
50
+
51
+ | Technique | When to use | Risk |
52
+ | ---------------------------------------------- | ----------------------------------------- | ------ |
53
+ | Extract function | Block of code with a clear single purpose | Low |
54
+ | Rename | Name no longer reflects purpose | Low |
55
+ | Extract variable | Complex expression used multiple times | Low |
56
+ | Inline function | One-use wrapper adds no clarity | Low |
57
+ | Move function | Function belongs in a different module | Medium |
58
+ | Replace conditional with polymorphism | Long if/switch on type | Medium |
59
+ | Extract class/module | File doing unrelated things | Medium |
60
+ | Replace magic number with named constant | Unexplained literal values | Low |
61
+ | Introduce parameter object | Function with >3 related params | Low |
62
+ | Replace nested conditionals with guard clauses | Deep nesting | Low |
63
+
64
+ ---
65
+
66
+ ## Guard Clause Pattern (flatten nesting)
67
+
68
+ **Before:**
69
+
70
+ ```js
71
+ function process(user) {
72
+ if (user) {
73
+ if (user.isActive) {
74
+ if (user.hasPermission("admin")) {
75
+ // actual logic
76
+ }
77
+ }
78
+ }
79
+ }
80
+ ```
81
+
82
+ **After:**
83
+
84
+ ```js
85
+ function process(user) {
86
+ if (!user) return;
87
+ if (!user.isActive) return;
88
+ if (!user.hasPermission("admin")) return;
89
+ // actual logic — unindented, readable
90
+ }
91
+ ```
92
+
93
+ ---
94
+
95
+ ## Naming Conventions
96
+
97
+ | Pattern | Wrong | Right |
98
+ | ---------------------------- | --------------------------- | ---------------------------------------- |
99
+ | Boolean variables | `flag`, `status`, `data` | `isActive`, `hasPermission`, `canEdit` |
100
+ | Functions that return values | `userData()`, `processIt()` | `getUser()`, `formatDate()` |
101
+ | Event handlers | `click()`, `handler()` | `handleSubmit()`, `onUserCreated()` |
102
+ | Async functions | Same as sync | `fetchUser()`, `loadConfig()` |
103
+ | Generic array names | `list`, `arr`, `items` | `users`, `activeOrders`, `errorMessages` |
104
+
105
+ ---
106
+
107
+ ## Refactoring Safely
108
+
109
+ ### Required before starting
110
+
111
+ 1. Ensure test coverage for the area being refactored
112
+ 2. Commit current state ("before" snapshot)
113
+ 3. Define what "done" looks like — what are you making better?
114
+
115
+ ### During
116
+
117
+ - One refactoring technique at a time
118
+ - Commit after each atomic change
119
+ - Run tests after each commit (never let tests break between commits)
120
+
121
+ ### After
122
+
123
+ - All existing tests still pass
124
+ - New tests cover any previously untested behavior
125
+ - Code review confirms intent is clear
126
+
127
+ ---
128
+
129
+ ## Refactoring PR Checklist
130
+
131
+ - [ ] No behavior changes — only structure
132
+ - [ ] Tests pass without modification (or test names updated to match new names)
133
+ - [ ] PR description explains _why_ this refactoring, not just what changed
134
+ - [ ] No new features bundled in (keep refactoring PRs pure)
135
+ - [ ] Performance not degraded (run benchmarks if relevant)
136
+ - [ ] PR is reviewable (not 2,000 lines of renames — consider splitting)
@@ -0,0 +1,63 @@
1
+ # Diagnose Workflow — System Health Check
2
+
3
+ **Triggers:** "something feels off with AgileFlow", "run diagnostics", "check system health", "diagnose the setup", "AgileFlow not working right", "validate the installation"
4
+
5
+ **Goal:** Run comprehensive health checks on the AgileFlow installation — validate JSON files, check the hooks system, verify auto-archival config, and report file size warnings — with clear PASS/FAIL/WARN indicators.
6
+
7
+ ## Inputs needed
8
+
9
+ None — runs full diagnostics automatically.
10
+
11
+ ## Steps
12
+
13
+ 1. Run JSON file validation on all critical files using `jq empty`:
14
+ - `docs/09-agents/status.json`
15
+ - `docs/00-meta/agileflow-metadata.json`
16
+ - `.claude/settings.json`
17
+ Report: file size, valid/invalid status. For invalid files, show the parse error.
18
+
19
+ 2. Check file size thresholds:
20
+ - `status.json` over 50KB → warn: recommend archiving completed stories
21
+ - `status.json` over 100KB → critical: use `jq '.stories | length'` to count stories
22
+
23
+ 3. Validate the auto-archival system:
24
+ - Check if the archive script exists and is executable (`-x` check)
25
+ - Verify the hook is configured in `.claude/settings.json` (check for the SessionStart hook referencing the archive script)
26
+ - Read the archival threshold from metadata
27
+
28
+ 4. Validate the hooks system:
29
+ - Parse `.claude/settings.json` structure
30
+ - Count SessionStart, UserPromptSubmit, and Stop hooks
31
+ - Flag missing hooks or misconfigurations
32
+
33
+ 5. Check file structure integrity — verify these directories exist:
34
+ - `docs/09-agents/`
35
+ - `docs/00-meta/`
36
+ - `.agileflow/`
37
+ - `.claude/`
38
+
39
+ 6. Generate the health report with status indicators:
40
+ - Pass: check passed
41
+ - Fail: issue found, action needed
42
+ - Warn: potential issue, monitor
43
+ - Info: informational only
44
+
45
+ 7. If any failures are found, list them with specific fix instructions. If all checks pass, confirm the system is healthy.
46
+
47
+ 8. Ask the user: [A] Fix the listed issues now (if any failures), [B] Archive completed stories (if size warning), [C] No action needed.
48
+
49
+ ## Output
50
+
51
+ Health report with check results for JSON validation, auto-archival, hooks system, and file sizes. Specific fix instructions for any failures. Exit summary: N passed, M warnings, K failures.
52
+
53
+ ## Fallbacks
54
+
55
+ **If interactive prompts (AskUserQuestion) are unavailable:**
56
+ Present options as a numbered list in your response. Ask the user to reply with a number. Example:
57
+
58
+ ```
59
+ How would you like to proceed?
60
+ 1. Save and continue
61
+ 2. Review before saving
62
+ 3. Discard
63
+ ```
@@ -0,0 +1,60 @@
1
+ # Impact Workflow — Code Change Impact Analysis
2
+
3
+ **Triggers:** "what will this change break", "impact analysis", "what tests should I run", "show me what depends on this file", "check for breaking changes", "what's affected by my changes"
4
+
5
+ **Goal:** Build a dependency graph for recently changed files, identify direct and indirect callers, detect breaking changes, and produce a risk-scored impact report with actionable test recommendations.
6
+
7
+ ## Inputs needed
8
+
9
+ | Input | Required | How to get it |
10
+ | ------------- | -------- | --------------------------------------------- |
11
+ | changed files | No | Auto-detected from `git diff` if not provided |
12
+ | base branch | No | Default: `main` |
13
+ | run tests | No | Default: yes if tests are found |
14
+
15
+ ## Steps
16
+
17
+ 1. Detect changed files. If files are not specified, run `git diff <base> --name-only` to get the list. If no changes are staged, ask: "Which files should I analyze? (paste paths or describe the change)"
18
+
19
+ 2. For each changed file, build the dependency graph:
20
+ - **Direct imports**: which files import this file
21
+ - **Indirect imports**: files that import the direct importers (2 levels deep)
22
+ Show the graph as a table: changed file → callers → callers-of-callers.
23
+
24
+ 3. Detect breaking changes in each modified file:
25
+ - Function signature changes (parameters added/removed/reordered)
26
+ - Exported type modifications
27
+ - Return type changes
28
+ - Removed exports
29
+ Mark each as: breaking (callers will fail) or non-breaking (additive change).
30
+
31
+ 4. Find related tests:
32
+ - Unit tests that import or reference the changed files
33
+ - Integration tests in the same module area
34
+ - E2E tests that exercise the affected user flows
35
+ Use both pattern matching (file naming conventions) and coverage mapping if available.
36
+
37
+ 5. Generate the impact report with risk scores:
38
+ - **Critical**: breaking changes with known callers
39
+ - **Recommended**: non-breaking changes but callers should be tested
40
+ - **Optional**: test files in the same area, low change risk
41
+
42
+ 6. Show the impact report. Ask: [A] Run the affected tests now (recommended), [B] Show me the full caller list for a specific file, [C] Just the report — I'll run tests myself.
43
+
44
+ 7. If running tests, execute the critical and recommended test files. Report results: pass/fail with counts and any new failures.
45
+
46
+ ## Output
47
+
48
+ Impact report with changed files, dependency graph (2 levels), breaking change detection, related tests by risk level. Optional: test run results.
49
+
50
+ ## Fallbacks
51
+
52
+ **If interactive prompts (AskUserQuestion) are unavailable:**
53
+ Present options as a numbered list in your response. Ask the user to reply with a number. Example:
54
+
55
+ ```
56
+ How would you like to proceed?
57
+ 1. Save and continue
58
+ 2. Review before saving
59
+ 3. Discard
60
+ ```