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,118 @@
1
+ # Page Workflow — Single Page SEO Analysis
2
+
3
+ **Triggers:** "analyze this page for SEO", "check the SEO on /about", "deep SEO analysis for this URL", "is this page optimized", "on-page SEO for example.com/product", "why isn't this page ranking"
4
+
5
+ **Goal:** Deep, scored analysis of a single page across 6 SEO dimensions — produces a report card with specific, copy-paste-ready fixes ordered by impact.
6
+
7
+ ## Inputs needed
8
+
9
+ | Input | Required | How to get it |
10
+ | -------------- | -------- | ------------------------------------------------------------------------------------------------------------- |
11
+ | URL | Yes | Ask for it if not provided |
12
+ | target keyword | No | Ask: "What keyword are you trying to rank this page for?" — changes relevance scoring |
13
+ | context | No | "Why are you analyzing this page?" — surfaces whether it's a ranking drop, pre-launch review, or optimization |
14
+
15
+ ## Steps
16
+
17
+ 1. **If URL is not provided**, ask: _"Which page URL should I analyze?"_ If they say the page isn't ranking, also ask: _"What keyword are you trying to rank it for?"_ — this context changes every recommendation.
18
+
19
+ 2. **Fetch the page.** Check HTTP status, response time, HTTPS. Extract full HTML. If the page returns non-200, diagnose the status code issue before proceeding.
20
+
21
+ 3. **Analyze all 6 dimensions:**
22
+
23
+ **On-Page SEO**
24
+ - Title tag: present? 30–60 chars? keyword-forward? unique?
25
+ - Meta description: present? 120–160 chars? has CTA?
26
+ - H1: exactly 1? contains target keyword?
27
+ - H2–H6: logical hierarchy, no skipped levels?
28
+ - Internal links: 2–10 per page, descriptive anchors?
29
+ - URL: clean, short, keyword-relevant?
30
+ - Canonical: self-referencing or correct target?
31
+ - Open Graph: og:title, og:description, og:image all present?
32
+
33
+ **Content Quality**
34
+ - Word count vs page type minimum (homepage: 300+, blog: 800+, product: 500+)
35
+ - Content uniqueness — not boilerplate
36
+ - Readability level appropriate for audience
37
+ - E-E-A-T signals: author attribution, expertise indicators, trust signals
38
+ - AI citation readiness: 134–167 word structured blocks
39
+
40
+ **Technical**
41
+ - HTTP status code and response time / TTFB
42
+ - Mobile viewport configured
43
+ - Robots directives (index/noindex)
44
+ - Structured data presence
45
+
46
+ **Schema Markup**
47
+ - Correct schema type for page content
48
+ - Required properties present
49
+ - No validation errors
50
+ - Matches visible page content
51
+
52
+ **Images**
53
+ - Alt text present on all meaningful images
54
+ - File sizes reasonable (< 200KB for hero images)
55
+ - Next-gen formats (WebP/AVIF)
56
+ - Lazy loading on below-fold images
57
+ - Responsive image attributes
58
+
59
+ **Performance**
60
+ - Core Web Vitals indicators from page source
61
+ - Render-blocking resources
62
+ - Unminified JS/CSS
63
+ - Missing compression signals
64
+
65
+ 4. **Score each dimension 0–100.** Thresholds: 90+ excellent, 75–89 good, 60–74 needs work, below 60 critical.
66
+
67
+ 5. **Present the report card:**
68
+
69
+ ```
70
+ Page: example.com/pricing
71
+ Target keyword: project management software
72
+
73
+ Dimension Score Top Issue
74
+ On-Page SEO 84 H1 missing target keyword
75
+ Content 71 Word count below minimum (320 vs 800+)
76
+ Technical 95 —
77
+ Schema 45 Product schema missing price property
78
+ Images 60 6 images missing alt text
79
+ Performance 78 Render-blocking CSS (2 files)
80
+
81
+ Overall: 72/100
82
+ ```
83
+
84
+ 6. **List specific fixes ordered by impact** — critical issues first, then quick wins, then fine-tuning. For each fix, include the exact change needed (not just "fix the H1" — say "Change H1 from 'Our Pricing Plans' to 'Project Management Software — Pricing'").
85
+
86
+ 7. **Guide next step with AskUserQuestion:**
87
+
88
+ ```xml
89
+ <invoke name="AskUserQuestion">
90
+ <parameter name="questions">[{
91
+ "question": "{page} scored {X}/100. {top_issue} is the biggest drag. Here's what to fix first:",
92
+ "header": "Next action",
93
+ "multiSelect": false,
94
+ "options": [
95
+ {"label": "Fix {top_issue} now (Recommended)", "description": "{exact change needed + expected impact}"},
96
+ {"label": "Generate {missing_schema_type} schema for this page", "description": "I'll produce ready-to-use JSON-LD — copy it into your <head>"},
97
+ {"label": "Compare this page against a ranking competitor", "description": "Find a competitor ranking for {target_keyword} — I'll show you the gap"},
98
+ {"label": "Run full site audit to see site-wide patterns", "description": "Check if these issues affect other pages too — full health score for the whole domain"}
99
+ ]
100
+ }]</parameter>
101
+ </invoke>
102
+ ```
103
+
104
+ ## Output
105
+
106
+ Per-dimension scores (0–100) with specific findings. Prioritized fix list with exact changes. Overall page score. If target keyword was provided, keyword-specific recommendations.
107
+
108
+ ## Fallbacks
109
+
110
+ **If AskUserQuestion is unavailable:**
111
+ Present options as a numbered list. Example:
112
+
113
+ ```
114
+ What would you like to do next?
115
+ 1. Fix the top issue now
116
+ 2. Generate schema markup for this page
117
+ 3. Run a full site audit
118
+ ```
@@ -0,0 +1,16 @@
1
+ id: testing
2
+ name: Testing
3
+ description: Write comprehensive test suites from acceptance criteria and increase code coverage.
4
+ version: 1.0.0
5
+ enabledByDefault: false
6
+ cannotDisable: false
7
+
8
+ depends: []
9
+
10
+ provides:
11
+ skills:
12
+ - id: agileflow-test-writer
13
+ dir: skills/agileflow-test-writer
14
+ agents: []
15
+ hooks: []
16
+ templates: []
@@ -0,0 +1,260 @@
1
+ ---
2
+ name: agileflow-test-writer
3
+ version: 1.0.0
4
+ category: agileflow/testing
5
+ description: |
6
+ Use when the user wants to write tests for new or existing code.
7
+ Generates comprehensive test suites from acceptance criteria, covers
8
+ happy paths, sad paths, and edge cases, and selects the right
9
+ framework for the codebase. Also increases coverage on existing code
10
+ that lacks tests.
11
+ triggers:
12
+ keywords:
13
+ - write tests
14
+ - add tests
15
+ - test this
16
+ - unit test
17
+ - integration test
18
+ - test coverage
19
+ - missing tests
20
+ - tests for
21
+ - spec file
22
+ - test suite
23
+ - tdd
24
+ - test-driven
25
+ - testing
26
+ priority: 50
27
+ exclude:
28
+ - test environment (infrastructure context)
29
+ - user acceptance testing (UAT project management)
30
+ - penetration testing
31
+ provides:
32
+ agents: []
33
+ learns:
34
+ enabled: true
35
+ file: _learnings/test-writer.yaml
36
+ maxEntries: 50
37
+ depends:
38
+ skills: []
39
+ plugins: [core]
40
+ ---
41
+
42
+ # AgileFlow Test Writer
43
+
44
+ Turns acceptance criteria and existing code into complete, well-structured test suites — with happy paths, sad paths, edge cases, and the right mocking strategy for the codebase.
45
+
46
+ ## When this skill activates
47
+
48
+ - User asks to write, add, or generate tests for a feature, function, or module
49
+ - User references a user story and wants tests derived from its AC
50
+ - User wants to increase test coverage on a file or directory
51
+ - User is practicing TDD and needs a failing test written before the implementation
52
+ - User mentions a specific test framework (Jest, Vitest, pytest, RSpec, Go test) and wants help
53
+
54
+ ## Opening discovery flow
55
+
56
+ **When invoked without clear context, ask one focused question to understand scope and framework.**
57
+
58
+ ```xml
59
+ <invoke name="AskUserQuestion">
60
+ <parameter name="questions">[
61
+ {
62
+ "question": "What would you like to test?",
63
+ "header": "Test scope",
64
+ "multiSelect": false,
65
+ "options": [
66
+ {"label": "Write tests from a user story or acceptance criteria (Recommended)", "description": "Paste your story or AC and I'll derive a complete test plan — happy paths, sad paths, edge cases"},
67
+ {"label": "Add tests to existing code with low or no coverage", "description": "Point me at a file or module and I'll analyse what's untested and write the missing tests"},
68
+ {"label": "Write tests first (TDD) — implementation comes after", "description": "Describe the behaviour you want and I'll write the failing tests before you write a single line of production code"},
69
+ {"label": "Write an integration test for a specific flow", "description": "e.g. API endpoint, database round-trip, UI interaction — I'll choose the right layer and tooling"},
70
+ {"label": "Improve a specific existing test file", "description": "Paste the test file; I'll find gaps, weak assertions, missing edge cases, and brittle mocks"}
71
+ ]
72
+ },
73
+ {
74
+ "question": "Which test framework does this project use?",
75
+ "header": "Framework",
76
+ "multiSelect": false,
77
+ "options": [
78
+ {"label": "Vitest (Recommended for Vite/React projects)", "description": "ESM-native, fast, Jest-compatible API"},
79
+ {"label": "Jest", "description": "Most common Node.js test runner — CommonJS or ESM"},
80
+ {"label": "pytest", "description": "Python — fixtures, parametrize, and rich plugin ecosystem"},
81
+ {"label": "Go test (testing package)", "description": "Table-driven tests, subtests, benchmarks"},
82
+ {"label": "RSpec", "description": "Ruby — describe/context/it, let, before hooks"},
83
+ {"label": "Not sure — detect it for me", "description": "I'll read package.json / requirements.txt / go.mod to figure it out"}
84
+ ]
85
+ }
86
+ ]</parameter>
87
+ </invoke>
88
+ ```
89
+
90
+ **Route based on answers:**
91
+
92
+ | Scope | Next action |
93
+ | --------------------- | ---------------------------------------------------------------------------------- |
94
+ | From AC / story | Follow `workflows/write-tests-from-ac.md` |
95
+ | Add coverage | Follow `workflows/add-coverage.md` |
96
+ | TDD | Write the failing tests, then offer to stub the implementation |
97
+ | Integration test | Ask for the endpoint/flow details; choose layer from `references/test-patterns.md` |
98
+ | Improve existing file | Read the file, run gap analysis, present findings first |
99
+
100
+ ## What makes a great test suite
101
+
102
+ ### The test pyramid
103
+
104
+ ```
105
+ /\
106
+ /E2E\ ← few, slow, high-confidence
107
+ /------\
108
+ /Integr. \ ← moderate, tests wiring
109
+ /----------\
110
+ / Unit \ ← many, fast, isolated
111
+ /____________\
112
+ ```
113
+
114
+ Each layer has a job. Don't try to do everything at one layer.
115
+
116
+ | Layer | Purpose | Speed | Isolation |
117
+ | ------------ | ----------------------------------------------- | -------- | ---------------------------- |
118
+ | Unit | Test one function or class in isolation | < 1ms | Full mocks/stubs |
119
+ | Integration | Test two or more real components wired together | 10–500ms | DB, real modules, no network |
120
+ | E2E / System | Test the whole system from the outside | Seconds | Real browser / HTTP |
121
+
122
+ ### The four-phase test structure
123
+
124
+ Every test should follow: **Arrange → Act → Assert → (Cleanup)**
125
+
126
+ ```js
127
+ // Arrange
128
+ const user = createUser({ role: "admin" });
129
+ const service = new UserService({ db: mockDb });
130
+
131
+ // Act
132
+ const result = await service.delete(user.id);
133
+
134
+ // Assert
135
+ expect(result.success).toBe(true);
136
+ expect(mockDb.delete).toHaveBeenCalledWith("users", user.id);
137
+ ```
138
+
139
+ ### Happy / sad / edge coverage
140
+
141
+ For every acceptance criterion, derive three test categories:
142
+
143
+ | Category | Description | Example |
144
+ | -------------- | ---------------------------------------------- | ------------------------------------------------------ |
145
+ | **Happy path** | The criterion succeeds under normal conditions | Valid input, user is authenticated, data exists |
146
+ | **Sad path** | The criterion fails gracefully | Invalid input, unauthorized, resource not found |
147
+ | **Edge case** | Boundary conditions and unusual inputs | Empty string, zero, null, max-length, concurrent calls |
148
+
149
+ ## Framework selection guide
150
+
151
+ | Signal | Recommended framework |
152
+ | ------------------------------------------ | --------------------- |
153
+ | `package.json` contains `vite` or `vitest` | Vitest |
154
+ | `package.json` contains `jest` | Jest |
155
+ | `*.py` source files | pytest |
156
+ | `go.mod` present | Go test |
157
+ | `Gemfile` with `rspec` | RSpec |
158
+ | `.NET` / `*.csproj` | xUnit or NUnit |
159
+ | Unknown — ask | Ask the user |
160
+
161
+ ## Mocking strategy
162
+
163
+ **Mock at the boundary, not inside the unit.**
164
+
165
+ - Mock: external HTTP calls, databases, file system, time (`Date.now`), randomness
166
+ - Don't mock: the module under test, pure functions, domain logic
167
+
168
+ ```js
169
+ // Good — mock the HTTP boundary
170
+ vi.mock("./api-client", () => ({
171
+ fetchUser: vi.fn().mockResolvedValue({ id: 1, name: "Alice" }),
172
+ }));
173
+
174
+ // Bad — mocking the thing you're testing
175
+ vi.mock("./user-service"); // ← this tests nothing
176
+ ```
177
+
178
+ **Prefer fakes over mocks when the interface is stable:**
179
+
180
+ - A fake in-memory database is more robust than 40 `mockResolvedValue` calls
181
+ - Fakes exercise real behaviour; mocks only verify calls were made
182
+
183
+ ## Coverage targets
184
+
185
+ See `references/coverage-targets.md` for the full coverage guide. Quick reference:
186
+
187
+ | Project maturity | Line coverage target |
188
+ | --------------------------- | ------------------------------ |
189
+ | Greenfield / critical path | 90%+ |
190
+ | Established with some tests | 70–80% |
191
+ | Legacy brownfield | 40–60% (improve incrementally) |
192
+ | UI/presentation layer | 60% (unit) + visual regression |
193
+
194
+ Coverage is a floor, not a goal. 80% coverage with weak assertions is worse than 60% coverage with strong assertions. Always prioritise assertion quality over line count.
195
+
196
+ ## Self-improving learnings
197
+
198
+ `_learnings/test-writer.yaml` records:
199
+
200
+ - Preferred test framework and version
201
+ - Coverage thresholds the team uses
202
+ - Mocking library preference (vi.mock, jest.mock, sinon, unittest.mock)
203
+ - Whether the project uses factories/fixtures for test data
204
+ - Naming conventions for test files (`*.test.ts` vs `*.spec.ts`)
205
+ - Whether the team prefers `describe/it` or flat test functions
206
+
207
+ Apply on invocation; update on correction.
208
+
209
+ ## Output format
210
+
211
+ When writing tests, always:
212
+
213
+ 1. Start with a brief comment block explaining what is being tested and why
214
+ 2. Group tests with `describe` blocks by feature / scenario
215
+ 3. Use descriptive `it`/`test` names: `it('returns 404 when user does not exist')`
216
+ 4. Include at least one assertion per test; prefer `toEqual` over `toBeTruthy` for clarity
217
+ 5. End with a coverage summary: which lines/branches are now covered
218
+
219
+ ## Quality checklist
220
+
221
+ Before delivering a test suite:
222
+
223
+ - [ ] At least one happy-path test per acceptance criterion
224
+ - [ ] At least one sad-path test per acceptance criterion
225
+ - [ ] Edge cases for every input that accepts strings, numbers, or arrays
226
+ - [ ] All external dependencies mocked at the correct boundary
227
+ - [ ] No test depends on another test's state
228
+ - [ ] Test names read as documentation
229
+ - [ ] Tests can be run in any order and pass consistently (no flakiness)
230
+ - [ ] Tests are in the correct layer (unit vs integration vs e2e)
231
+
232
+ ## Integration
233
+
234
+ - **agileflow-story-writer** — provides the source acceptance criteria; test-writer maps each AC to one or more test cases and coverage type
235
+ - **agileflow-pr-reviewer** — checks test coverage as part of PR review; test-writer is invoked when the reviewer flags missing coverage
236
+ - **agileflow-refactor** — refactored code must have its tests updated in the same pass; spawn test-writer before a refactor begins to ensure the safety net exists
237
+ - **agileflow-engineering** — spawn test-writer after implementation completes to cover the new code with unit, integration, and E2E tests
238
+ - **agileflow-debug** — after a bug is fixed, spawn test-writer to add a regression test that prevents it from returning; the fix isn't done without the test
239
+ - **agileflow-accessibility** — generate axe-core and keyboard navigation tests alongside functional tests for any UI story
240
+ - **agileflow-performance** — generate benchmark tests to lock in performance gains; test-writer provides the measurement harness, performance provides the thresholds
241
+ - **agileflow-database** — generate migration validation tests and repository-layer integration tests that hit a real database, not mocks
242
+ - **agileflow-delivery** — test-writer is a delivery gate; delivery should confirm coverage thresholds are met before shipping
243
+
244
+ ## References
245
+
246
+ Load these files when you need deeper context:
247
+
248
+ | File | When to load |
249
+ | -------------------------------- | ------------------------------------------------------------------------------------------- |
250
+ | `references/test-patterns.md` | Choosing the right test structure by layer, framework-specific patterns, mocking strategies |
251
+ | `references/coverage-targets.md` | Understanding coverage targets by project type and how to prioritise what to test first |
252
+
253
+ ## Workflows
254
+
255
+ Follow these step-by-step when the user initiates the matching action:
256
+
257
+ | File | When to follow |
258
+ | ---------------------------------- | ------------------------------------------------------------------------------------- |
259
+ | `workflows/write-tests-from-ac.md` | User has acceptance criteria or a user story and wants a test suite generated from it |
260
+ | `workflows/add-coverage.md` | User wants to increase test coverage for existing code that is undertested |
@@ -0,0 +1,239 @@
1
+ # Coverage Targets Reference
2
+
3
+ **Load this when:** setting or evaluating coverage thresholds, prioritising which code to test first, or explaining coverage concepts to the team.
4
+
5
+ ---
6
+
7
+ ## Coverage is a floor, not a goal
8
+
9
+ A test suite with 95% line coverage and weak assertions (`toBeTruthy`, `toBeDefined`) gives false confidence. Coverage measures which lines of code were _executed_ by tests — not whether those tests _verify_ anything useful.
10
+
11
+ **Rule of thumb:** 70% coverage with strong assertions beats 95% coverage with trivial assertions.
12
+
13
+ ---
14
+
15
+ ## Coverage types explained
16
+
17
+ | Type | What it measures | How hard to achieve | Recommended? |
18
+ | ---------------------- | ------------------------------- | ------------------- | ----------------------------------- |
19
+ | **Line coverage** | Was each line executed? | Easiest | Use as baseline metric |
20
+ | **Branch coverage** | Was each if/else branch taken? | Medium | More meaningful than line; use this |
21
+ | **Function coverage** | Was each function called? | Easy | Good sanity check |
22
+ | **Statement coverage** | Was each statement executed? | Similar to line | Use when line coverage unavailable |
23
+ | **Mutation testing** | Do tests catch deliberate bugs? | Hardest | Best signal of test quality |
24
+
25
+ **Recommended combination:** Track branch coverage as your primary metric + function coverage as a quick sanity check. Line coverage is fine as a secondary metric.
26
+
27
+ ---
28
+
29
+ ## Coverage targets by project type
30
+
31
+ ### Greenfield / new features
32
+
33
+ | Layer | Branch coverage target | Rationale |
34
+ | ----------------------------- | ---------------------- | --------------------------------------- |
35
+ | Domain logic / business rules | 95%+ | Bugs here are expensive |
36
+ | API handlers / controllers | 90%+ | All status codes + error paths |
37
+ | Data access / repositories | 85%+ | All query paths including empty results |
38
+ | Utilities / helpers | 90%+ | Pure functions — easy and high-value |
39
+ | UI components (unit) | 70%+ | Focus on behaviour, not render output |
40
+ | Configuration / bootstrap | 50%+ | Often hard to test; smoke tests suffice |
41
+
42
+ ### Established codebase
43
+
44
+ | Layer | Branch coverage target |
45
+ | ------------- | ---------------------- |
46
+ | Domain logic | 85%+ |
47
+ | API handlers | 80%+ |
48
+ | Data access | 75%+ |
49
+ | Utilities | 85%+ |
50
+ | UI components | 60%+ |
51
+
52
+ ### Legacy / brownfield (incremental improvement)
53
+
54
+ Do NOT set a global target on a legacy codebase — it creates perverse incentives (trivial tests to hit a number). Instead:
55
+
56
+ 1. **Protect the happy path** — write integration tests for critical flows first
57
+ 2. **Test before refactoring** — add tests whenever you touch a file
58
+ 3. **Ratchet coverage up** — never reduce coverage; gate PRs on "no regression"
59
+ 4. **Prioritise by risk** — payment flows, auth, data mutations before UI
60
+
61
+ ---
62
+
63
+ ## What NOT to test
64
+
65
+ Do not write tests for code that:
66
+
67
+ | Category | Why |
68
+ | ------------------------------------------------- | --------------------------------------------------------- |
69
+ | Auto-generated code (migrations, generated types) | Code is not hand-authored; tests would test the generator |
70
+ | Configuration constants (colours, strings) | No logic to verify |
71
+ | Framework boilerplate (e.g. `app.listen(3000)`) | Framework is already tested |
72
+ | Third-party library internals | Not your responsibility |
73
+ | Trivial getters/setters with no logic | Zero ROI |
74
+ | Test helpers themselves | Usually overkill; only test helpers if they are complex |
75
+
76
+ Exclude these from coverage reporting in vitest.config.ts / jest.config.js:
77
+
78
+ ```js
79
+ // vitest.config.ts
80
+ export default {
81
+ test: {
82
+ coverage: {
83
+ exclude: [
84
+ "src/generated/**",
85
+ "src/config/constants.ts",
86
+ "**/*.d.ts",
87
+ "**/index.ts", // barrel files — no logic
88
+ ],
89
+ },
90
+ },
91
+ };
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Coverage tooling setup
97
+
98
+ ### Vitest
99
+
100
+ ```js
101
+ // vitest.config.ts
102
+ import { defineConfig } from "vitest/config";
103
+
104
+ export default defineConfig({
105
+ test: {
106
+ coverage: {
107
+ provider: "v8", // or 'istanbul'
108
+ reporter: ["text", "lcov", "html"],
109
+ thresholds: {
110
+ branches: 80,
111
+ functions: 85,
112
+ lines: 85,
113
+ statements: 85,
114
+ },
115
+ include: ["src/**/*.{ts,js}"],
116
+ exclude: ["src/**/*.test.{ts,js}", "src/generated/**"],
117
+ },
118
+ },
119
+ });
120
+ ```
121
+
122
+ Run: `npx vitest run --coverage`
123
+
124
+ ### Jest
125
+
126
+ ```js
127
+ // jest.config.js
128
+ module.exports = {
129
+ collectCoverage: true,
130
+ coverageProvider: "v8",
131
+ coverageReporters: ["text", "lcov", "html"],
132
+ coverageThreshold: {
133
+ global: {
134
+ branches: 80,
135
+ functions: 85,
136
+ lines: 85,
137
+ statements: 85,
138
+ },
139
+ },
140
+ collectCoverageFrom: [
141
+ "src/**/*.{js,ts}",
142
+ "!src/**/*.test.{js,ts}",
143
+ "!src/generated/**",
144
+ ],
145
+ };
146
+ ```
147
+
148
+ Run: `npx jest --coverage`
149
+
150
+ ### pytest + pytest-cov
151
+
152
+ ```ini
153
+ # pytest.ini or pyproject.toml [tool.pytest.ini_options]
154
+ addopts = --cov=src --cov-report=term-missing --cov-report=html --cov-fail-under=80
155
+ ```
156
+
157
+ Run: `pytest --cov`
158
+
159
+ ### Go
160
+
161
+ ```bash
162
+ go test ./... -coverprofile=coverage.out
163
+ go tool cover -html=coverage.out # visual report
164
+ go tool cover -func=coverage.out # per-function summary
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Prioritising what to test first
170
+
171
+ When coverage is low and you need to decide where to start, use this priority order:
172
+
173
+ ### Priority 1: Critical paths (always test these)
174
+
175
+ - Authentication and authorisation checks
176
+ - Payment processing and financial calculations
177
+ - Data mutations that cannot be undone (delete, archive)
178
+ - External API integrations (mock the external call, test the adapter logic)
179
+ - Security-sensitive operations (password hashing, token generation, input sanitisation)
180
+
181
+ ### Priority 2: High-value business logic
182
+
183
+ - Core domain rules (pricing, eligibility, routing)
184
+ - Complex state machines
185
+ - Data transformations used in multiple places
186
+
187
+ ### Priority 3: Error handling
188
+
189
+ - What happens when a dependency returns an error?
190
+ - What happens when input is malformed?
191
+ - Does the system degrade gracefully?
192
+
193
+ ### Priority 4: Happy paths on remaining features
194
+
195
+ Fill in coverage on everything else after the above are covered.
196
+
197
+ ---
198
+
199
+ ## Interpreting a coverage report
200
+
201
+ When reading a coverage report, look for:
202
+
203
+ | Signal | What it means |
204
+ | ----------------------------- | --------------------------------------------------------------------------------------------------- |
205
+ | Branch < 60% on a domain file | Probably missing sad-path tests |
206
+ | Function < 70% | Untested functions — dead code or missing tests |
207
+ | A file at exactly 100% | Usually means tests were written to cover lines, not to verify behaviour — review assertion quality |
208
+ | Large file with 0% | Either dead code (delete it) or a critical gap |
209
+
210
+ ---
211
+
212
+ ## Coverage in CI
213
+
214
+ Add coverage checks to CI to prevent regressions:
215
+
216
+ ```yaml
217
+ # GitHub Actions example
218
+ - name: Test with coverage
219
+ run: npx vitest run --coverage
220
+
221
+ - name: Upload coverage report
222
+ uses: codecov/codecov-action@v4
223
+ with:
224
+ files: ./coverage/lcov.info
225
+ ```
226
+
227
+ **Gate strategy:** Fail the build if coverage drops below threshold (use `coverageThreshold` in config). Don't require 100% — that creates perverse incentives.
228
+
229
+ ---
230
+
231
+ ## Common coverage anti-patterns
232
+
233
+ | Anti-pattern | Problem |
234
+ | ---------------------------------------------------- | --------------------------------------------------------------- |
235
+ | Writing tests just to hit the threshold | Results in trivial tests; wastes time; creates false confidence |
236
+ | 100% coverage as a team rule | Forces tests on trivial getters; makes adding code painful |
237
+ | Testing the test setup (testing mock calls directly) | Proves the mock works, not the production code |
238
+ | No coverage check in CI | Coverage regresses silently over time |
239
+ | Excluding too much from coverage | Hides real gaps; start conservative with exclusions |