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,145 @@
1
+ # Sprint Planning Guide
2
+
3
+ **Load this when:** Running sprint planning, setting sprint goals, calculating capacity, or ordering the backlog.
4
+
5
+ ## Sprint Planning Structure
6
+
7
+ ```
8
+ Total time: 1 hour per sprint week (2-week sprint = 2 hours max)
9
+
10
+ Part 1 — What (30-50% of time)
11
+ - Product owner presents sprint goal
12
+ - Review top backlog items
13
+ - Clarify acceptance criteria
14
+ - Confirm stories are ready
15
+
16
+ Part 2 — How (50-70% of time)
17
+ - Team pulls stories into sprint to capacity
18
+ - Break stories into tasks if needed
19
+ - Flag dependencies and blockers
20
+ - Confirm sprint goal commitment
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Capacity Calculation
26
+
27
+ ```
28
+ Raw capacity = team members × hours/day × sprint days
29
+
30
+ Adjusted capacity = raw capacity
31
+ - planned time off (PTO, holidays)
32
+ - ceremonies (standups, planning, retro, review)
33
+ - planned non-feature work (on-call, support, tech debt)
34
+ - ramp-up factor for new team members
35
+
36
+ Rule of thumb: 60–70% of raw capacity = realistic capacity
37
+ ```
38
+
39
+ ### Example (2-week sprint)
40
+
41
+ ```
42
+ Team: 4 developers
43
+ Raw: 4 × 8h × 10 days = 320 hours
44
+
45
+ Deductions:
46
+ Ceremonies: 4 × 2h × 10 days = 80h (standups + misc)
47
+ Support rotation: 1 person × 0.25 FTE = 20h
48
+ PTO: 1 person × 1 day = 8h
49
+
50
+ Adjusted: 320 - 108 = 212 dev-hours ≈ 65% utilization
51
+ Points: 212h / 7h per point ≈ 30 points
52
+ ```
53
+
54
+ ---
55
+
56
+ ## Sprint Goal Framework
57
+
58
+ A good sprint goal answers: **What business or user outcome will we deliver this sprint?**
59
+
60
+ ### Template
61
+
62
+ ```
63
+ By end of sprint [N], we will [capability delivered]
64
+ so that [user/business outcome].
65
+
66
+ Key stories: [list 2–4 anchor stories]
67
+ Success metric: [how we'll know we achieved it]
68
+ ```
69
+
70
+ ### Examples
71
+
72
+ Good:
73
+
74
+ > "By end of Sprint 14, users can invite team members and set their roles, so teams can onboard collaborators without involving support."
75
+
76
+ Bad:
77
+
78
+ > "Complete stories PROJ-45, PROJ-47, and PROJ-51."
79
+
80
+ ---
81
+
82
+ ## Backlog Ordering Criteria
83
+
84
+ Score each story, order by composite score:
85
+
86
+ | Criterion | Weight | How to score |
87
+ | ------------------- | ------ | ---------------------------------------------- |
88
+ | User/business value | 30% | 1–5 (5 = highest impact) |
89
+ | Urgency / deadline | 25% | 1–5 (5 = this sprint or miss commitment) |
90
+ | Risk reduction | 20% | 1–5 (5 = critical risk if not done) |
91
+ | Effort (inverse) | 15% | 5 = 1pt, 4 = 2pt, 3 = 3-5pt, 2 = 8pt, 1 = 13pt |
92
+ | Dependencies | 10% | 5 = unblocks others, 1 = blocked by others |
93
+
94
+ **Weighted priority score = Σ(score × weight)**
95
+
96
+ ---
97
+
98
+ ## Story Readiness Checklist (INVEST)
99
+
100
+ Before pulling a story into sprint planning, verify:
101
+
102
+ | Letter | Criterion | Check |
103
+ | ------ | ----------- | --------------------------------------- |
104
+ | I | Independent | Not blocked by another incomplete story |
105
+ | N | Negotiable | Scope can flex; not a fixed spec |
106
+ | V | Valuable | Clear user or business value stated |
107
+ | E | Estimable | Team can estimate it (enough detail) |
108
+ | S | Small | Completable within one sprint |
109
+ | T | Testable | Clear acceptance criteria exist |
110
+
111
+ If any are missing — do not pull into sprint. Refine first.
112
+
113
+ ---
114
+
115
+ ## Sprint Commitment Rules
116
+
117
+ - Commit to the **sprint goal**, not a list of stories
118
+ - If sprint is at risk, protect the goal — negotiate scope of supporting stories
119
+ - Never add scope mid-sprint without removing equivalent scope
120
+ - Unfinished stories return to the top of the backlog for next sprint (re-estimate if needed)
121
+
122
+ ---
123
+
124
+ ## Common Sprint Planning Failures
125
+
126
+ | Failure | Symptom | Fix |
127
+ | --------------------------- | ----------------------------------------- | ------------------------------------------------------- |
128
+ | Overcommitment | Stories spill every sprint | Use 80% of velocity, not 100% |
129
+ | No sprint goal | Team has no compass when trade-offs arise | Write goal before pulling stories |
130
+ | Unrefined stories in sprint | Estimation errors, mid-sprint discovery | Enforce INVEST checklist |
131
+ | No task breakdown | Stories "in progress" for days | Break into tasks <1 day each during planning |
132
+ | Planning == assigning | Engineers don't know context | Stories are chosen by team, not assigned by manager |
133
+ | Skipping retrospective data | Repeat same mistakes | Review previous retro action items at start of planning |
134
+
135
+ ---
136
+
137
+ ## Sprint Metrics to Review at Planning Start
138
+
139
+ | Metric | What it tells you |
140
+ | ------------------------- | --------------------------------- |
141
+ | Velocity (last 3 sprints) | Baseline for capacity planning |
142
+ | Story completion rate | Are we finishing what we start? |
143
+ | Carryover % | How much spills sprint to sprint? |
144
+ | Defect rate | Are we shipping quality? |
145
+ | Retro action item status | Are we improving? |
@@ -0,0 +1,63 @@
1
+ # Impact Workflow — Code Change Impact Analysis
2
+
3
+ **Triggers:** "what will this change break", "impact analysis", "what files depend on this", "check for regressions before I merge", "what else might be affected", "dependency graph for [file]"
4
+
5
+ **Goal:** Build a dependency graph for changed files, detect breaking changes, find related tests, and generate a risk-scored impact report so the user knows exactly what to test before merging.
6
+
7
+ ## Inputs needed
8
+
9
+ | Input | Required | How to get it |
10
+ | ------------- | -------- | -------------------------------------------- |
11
+ | changed files | No | Auto-detected from `git diff` against `main` |
12
+ | base branch | No | Default: `main` |
13
+ | run tests | No | Ask the user |
14
+
15
+ ## Steps
16
+
17
+ 1. Detect changed files. Run `git diff main --name-only`. If no changes are staged or if the user specified particular files, use those. If the working tree is clean, ask: "Which files should I analyze?"
18
+
19
+ 2. For each changed file, find what imports it (direct callers). Then find what imports those callers (indirect callers — 2 levels max). Show the dependency chain as a table with file paths and the line numbers where they import the changed file.
20
+
21
+ 3. Detect breaking changes in each modified file by comparing the current version to the base branch version:
22
+ - Function parameters added, removed, or reordered
23
+ - Exported type or interface modifications
24
+ - Return type changes
25
+ - Removed exports or renamed exports
26
+ Label each: **Breaking** (callers will likely fail) or **Non-breaking** (additive change only).
27
+
28
+ 4. Find related tests using both pattern-matching (test files that reference the changed file by name) and directory proximity (tests in the same module area).
29
+
30
+ 5. Assign risk scores:
31
+ - **Critical**: breaking changes with identified callers
32
+ - **Recommended**: non-breaking changes in highly-used files
33
+ - **Optional**: test files in the vicinity, low likelihood of impact
34
+
35
+ 6. Present the impact report. Example format:
36
+
37
+ ```
38
+ Changed: src/auth/session.ts
39
+ Direct callers (3): src/api/users.ts, src/middleware/auth.ts, src/pages/login.tsx
40
+ Indirect callers (5): ...
41
+ Breaking changes: parameter type in getUserSession() changed
42
+ Related tests: tests/auth/session.test.ts (critical), tests/api/users.test.ts (recommended)
43
+ ```
44
+
45
+ 7. Ask: [A] Run the critical and recommended tests now, [B] Show me the full caller list for a specific file, [C] I'll run tests myself — just give me the list.
46
+
47
+ 8. If running tests, execute them and report the results. Flag any new failures compared to the base branch.
48
+
49
+ ## Output
50
+
51
+ Impact report with dependency graph (2 levels), breaking change detection, related tests by risk level (Critical / Recommended / Optional). Optional: test run with pass/fail results.
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,104 @@
1
+ # RPI Workflow — Research → Plan → Implement
2
+
3
+ **Triggers:** "use the RPI workflow", "let's do Research Plan Implement", "I need to think this through carefully", "complex task I don't fully understand yet", "brownfield feature in unfamiliar code", "RPI for [feature]"
4
+
5
+ **Goal:** Guide a complex task through three sequential phases — Research, Plan, Implement — each producing a compressed artifact that seeds the next phase, preserving context quality across conversation boundaries.
6
+
7
+ ## Inputs needed
8
+
9
+ | Input | Required | How to get it |
10
+ | ---------------- | -------- | ---------------------------------------- |
11
+ | task description | Yes | Ask if not provided |
12
+ | starting phase | No | Default: auto-detect based on complexity |
13
+
14
+ ## Complexity assessment
15
+
16
+ Before starting, assess the task complexity:
17
+
18
+ | Level | Signs | Approach |
19
+ | ----------- | ----------------------------- | -------------------------------- |
20
+ | Trivial | Typo, config tweak | Skip RPI — just do it |
21
+ | Simple | Single file, clear path | Plan → Implement (skip Research) |
22
+ | Moderate | Multi-file, known patterns | Plan → Implement |
23
+ | Complex | Brownfield, unfamiliar code | Full Research → Plan → Implement |
24
+ | Exploratory | Unknown territory, multi-repo | Full RPI with iteration |
25
+
26
+ ## Steps
27
+
28
+ ### Phase 0: Triage
29
+
30
+ 1. Read the task. Assess complexity using the table above. If the task is trivial or simple, say so and suggest a more direct approach. For complex or exploratory tasks, proceed with full RPI.
31
+
32
+ 2. Ask: [A] Full RPI (Research → Plan → Implement), [B] Skip to Plan (I understand the codebase area), [C] Skip to Implement (I have a plan already).
33
+
34
+ ---
35
+
36
+ ### Phase 1: RESEARCH
37
+
38
+ 3. Explore the relevant codebase areas without making changes. Read the files that will be affected. Understand existing patterns, data structures, dependencies, and constraints.
39
+
40
+ 4. Identify unknowns: things that need external research (unfamiliar APIs, library patterns, architectural questions). Use the research import workflow if external lookups are needed.
41
+
42
+ 5. Produce the Research Artifact — a compressed markdown summary:
43
+
44
+ ```
45
+ ## Research Summary: [Task]
46
+ Codebase findings: [key patterns, files, constraints]
47
+ Unknowns resolved: [what was looked up]
48
+ Approach options: [2–3 options considered]
49
+ Recommended approach: [chosen option + rationale]
50
+ ```
51
+
52
+ Save to `docs/10-research/<task-slug>-research.md`.
53
+
54
+ 6. Ask: [A] Start a new conversation for the Plan phase (recommended — fresh context), [B] Continue in this conversation.
55
+
56
+ ---
57
+
58
+ ### Phase 2: PLAN
59
+
60
+ 7. Read the Research Artifact. Design the implementation in detail:
61
+ - Files to create or modify (specific paths)
62
+ - Order of changes
63
+ - How to handle edge cases
64
+ - Test strategy
65
+
66
+ 8. Produce the Plan Artifact:
67
+
68
+ ```
69
+ ## Implementation Plan: [Task]
70
+ Files to change: [list with purpose]
71
+ Step-by-step: [numbered implementation steps]
72
+ Tests: [what to write and when]
73
+ Risk: [breaking changes, migration needs]
74
+ ```
75
+
76
+ Save to `docs/<task-slug>-plan.md`.
77
+
78
+ 9. Ask: [A] Start a new conversation for the Implement phase (recommended), [B] Continue in this conversation.
79
+
80
+ ---
81
+
82
+ ### Phase 3: IMPLEMENT
83
+
84
+ 10. Read the Plan Artifact. Execute the plan step by step. After each step, run the relevant tests. Do not skip steps or add scope.
85
+
86
+ 11. When all steps are complete, run the full test suite. Fix any failures before declaring done.
87
+
88
+ 12. Ask: [A] Run the story audit to verify AC coverage, [B] Create the PR.
89
+
90
+ ## Output
91
+
92
+ Research artifact, Plan artifact, and implemented code — each in a separate, high-quality context. Context health is monitored throughout; the user is warned if utilization exceeds 40%.
93
+
94
+ ## Fallbacks
95
+
96
+ **If interactive prompts (AskUserQuestion) are unavailable:**
97
+ Present options as a numbered list in your response. Ask the user to reply with a number. Example:
98
+
99
+ ```
100
+ How would you like to proceed?
101
+ 1. Save and continue
102
+ 2. Review before saving
103
+ 3. Discard
104
+ ```
@@ -0,0 +1,14 @@
1
+ id: psychology
2
+ name: Psychology & Retention
3
+ description: Apply behavioral psychology and UX research to improve user retention.
4
+ version: 1.0.0
5
+ enabledByDefault: false
6
+ cannotDisable: false
7
+ depends: []
8
+ provides:
9
+ skills:
10
+ - id: agileflow-retention
11
+ dir: skills/agileflow-retention
12
+ agents: []
13
+ hooks: []
14
+ templates: []
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: agileflow-retention
3
+ version: 1.0.0
4
+ category: agileflow/psychology
5
+ description: |
6
+ Use when the user wants to improve user retention, reduce churn,
7
+ increase engagement, design habit-forming features, or apply
8
+ behavioral psychology to product decisions. Draws on evidence-based
9
+ models (Hook Model, Fogg Behavior Model, Habit Loop) and competitor
10
+ patterns from high-retention products.
11
+ triggers:
12
+ keywords:
13
+ - retention
14
+ - engagement
15
+ - habit
16
+ - keep users
17
+ - churn
18
+ - activation
19
+ - onboarding flow
20
+ - user psychology
21
+ - sticky features
22
+ - daily active users
23
+ - streak
24
+ - progress bar
25
+ - notification strategy
26
+ - user motivation
27
+ priority: 50
28
+ exclude:
29
+ - data retention (legal)
30
+ - retention policy
31
+ - memory retention
32
+ provides:
33
+ agents: []
34
+ learns:
35
+ enabled: true
36
+ file: _learnings/retention.yaml
37
+ maxEntries: 50
38
+ depends:
39
+ skills: []
40
+ plugins: [core]
41
+ ---
42
+
43
+ # AgileFlow Retention
44
+
45
+ Applies evidence-based behavioral psychology to product design decisions — improving user retention, reducing churn, increasing engagement, and building habit-forming features that users actually want.
46
+
47
+ ## When this skill activates
48
+
49
+ - User wants to reduce churn or improve D1/D7/D30 retention rates
50
+ - User is designing or auditing onboarding and activation flows
51
+ - User asks how to make a feature "sticky" or build habits
52
+ - User wants to design a streak system, notification strategy, progress indicator, or social feature
53
+ - User wants to understand why users drop off and what to do about it
54
+ - User asks about user psychology, behavioral economics, or motivation design
55
+ - Should NOT activate for data retention policies, legal retention requirements, or memory science
56
+
57
+ ## What this skill does
58
+
59
+ 1. Identify which psychological model fits the user's retention challenge
60
+ 2. Diagnose the current funnel: where are users dropping off and why?
61
+ 3. Map the product against the Hook Model, Fogg Behavior Model, and Habit Loop
62
+ 4. Recommend specific mechanics with evidence from high-retention products
63
+ 5. Design the trigger, action, reward, and investment for new retention features
64
+ 6. Apply an ethical check: is this genuine value or dark pattern manipulation?
65
+ 7. Define the measurement framework: what metric proves the mechanic works?
66
+
67
+ ## The three core behavioral models
68
+
69
+ ### 1. BJ Fogg's Behavior Model (B=MAP)
70
+
71
+ Behavior occurs when **Motivation**, **Ability**, and **Prompt** converge at the same moment.
72
+
73
+ The key insight: you don't need high motivation if you increase ability (reduce friction). You don't need high ability if you catch a user at peak motivation. The prompt (trigger) must fire at exactly the right moment.
74
+
75
+ **Application:** Audit each step in your activation flow for where motivation drops or where ability is too low. The fix is either to increase motivation (social proof, progress feedback) or to reduce friction (fewer steps, defaults, auto-fill).
76
+
77
+ See `references/psychology-models.md` for the full model detail.
78
+
79
+ ### 2. Nir Eyal's Hook Model
80
+
81
+ **Trigger → Action → Variable Reward → Investment**
82
+
83
+ The Hook Model (from "Hooked", 2014) explains how products build unprompted usage habits. Each completed hook cycle increases habit strength. The goal over time is to replace external triggers (notifications) with internal triggers (emotional cues like boredom or FOMO).
84
+
85
+ **Application:** Map your product against all four phases. Most products have triggers and actions. Few invest in variable rewards and even fewer design for investment — but investment is what makes users feel they have something to lose by leaving.
86
+
87
+ See `references/psychology-models.md` for the full model detail.
88
+
89
+ ### 3. Duhigg's Habit Loop
90
+
91
+ **Cue → Routine → Reward → Craving**
92
+
93
+ Once a habit loop is established, the brain disengages its prefrontal cortex and the basal ganglia runs the routine automatically. The craving is what drives repetition — users don't return for the reward itself; they return in anticipation of it.
94
+
95
+ **Application:** Identify the cue your product can "own" (a time of day, an emotion, an activity context), design the routine to be frictionless, deliver the reward immediately and sometimes variably.
96
+
97
+ See `references/psychology-models.md` for the full model detail.
98
+
99
+ ### 4. Self-Determination Theory (SDT)
100
+
101
+ Three basic psychological needs drive intrinsic motivation: **Autonomy**, **Competence**, **Relatedness**. Products that satisfy all three build the deepest, most resilient retention because users want to be there — not because they're trapped.
102
+
103
+ **Important warning:** Extrinsic rewards (points, badges, coins) can crowd out intrinsic motivation for activities users already find interesting. Use gamification carefully.
104
+
105
+ See `references/psychology-models.md` for the full model detail.
106
+
107
+ ## Key retention mechanics
108
+
109
+ | Mechanic | Psychological basis | Best example |
110
+ | ------------------------ | ----------------------------------------- | ------------------------------------------ |
111
+ | Streaks | Loss aversion (Kahneman & Tversky, 1979) | Duolingo — 2.4× retention at 30-day streak |
112
+ | Progress bars | Zeigarnik Effect + commitment consistency | LinkedIn profile completeness |
113
+ | Variable rewards | Skinner's variable ratio schedule (1938) | Instagram like reveals, Wordle |
114
+ | Social proof | Cialdini's influence principles (1984) | Airbnb "usually books within 24 hours" |
115
+ | Personalized onboarding | Aha moment optimization | Facebook: 7 friends in 10 days |
116
+ | Behavioral notifications | Urban Airship data (2016): 2–5× lift | Triggered > scheduled blasts |
117
+ | Endowed progress | Nunes & Dreze loyalty card study (2006) | Pre-filled stamp cards |
118
+ | Loss aversion triggers | Kahneman: losses felt 2× more than gains | Duolingo streak saver notification |
119
+
120
+ See `references/retention-patterns.md` for full implementation guides with evidence.
121
+
122
+ ## Competitor patterns to learn from
123
+
124
+ | Product | Key mechanic | Measurable outcome |
125
+ | -------- | ------------------------------ | ------------------------------------------------- |
126
+ | Duolingo | Streaks + XP + leagues | ~50% DAU/MAU ratio |
127
+ | LinkedIn | Profile completeness bar | Measurably higher registration completion |
128
+ | Slack | Unreads + reactions + channels | Teams sending 2,000+ messages are deeply retained |
129
+ | Strava | Social feed + kudos + segments | Activity habit reinforcement |
130
+ | Spotify | Discover Weekly + Wrapped | Reduces genre fatigue churn |
131
+ | Notion | Templates + public pages | Lower activation friction |
132
+
133
+ See `references/competitor-analysis.md` for detailed breakdowns of what each product does and why it works.
134
+
135
+ ## Opening discovery flow
136
+
137
+ When invoked without a specific task, ask one focused question:
138
+
139
+ ```xml
140
+ <invoke name="AskUserQuestion">
141
+ <parameter name="questions">[
142
+ {
143
+ "question": "What retention challenge are you working on?",
144
+ "header": "Retention focus",
145
+ "multiSelect": false,
146
+ "options": [
147
+ {"label": "Audit my existing product for retention gaps (Recommended)", "description": "Map your current product against the Hook Model, Fogg, and Habit Loop — get a prioritized gap list"},
148
+ {"label": "Design a new retention mechanic (streak, progress, notifications, etc.)", "description": "Choose a mechanic, design its trigger/reward/investment, and define how to measure it"},
149
+ {"label": "Improve my onboarding and activation flow", "description": "Identify the 'aha moment' and redesign the path to reach it faster"},
150
+ {"label": "Analyze competitor retention strategies", "description": "Deep-dive on how a specific high-retention product keeps users coming back"},
151
+ {"label": "Understand the psychology behind a specific mechanic", "description": "Get the research, models, and evidence behind streaks, variable rewards, social proof, etc."}
152
+ ]
153
+ }
154
+ ]</parameter>
155
+ </invoke>
156
+ ```
157
+
158
+ **Route based on answer:**
159
+
160
+ | Answer | Next action |
161
+ | ---------------------- | --------------------------------------------------------------------------- |
162
+ | Audit existing product | Follow `workflows/retention-audit.md` |
163
+ | Design new mechanic | Follow `workflows/design-retention-feature.md` |
164
+ | Onboarding/activation | Start with aha moment identification, then Fogg audit |
165
+ | Competitor analysis | Load `references/competitor-analysis.md` |
166
+ | Psychology explanation | Load `references/psychology-models.md` + `references/retention-patterns.md` |
167
+
168
+ ## Ethical framework
169
+
170
+ Retention mechanics exist on a spectrum from **genuine value** to **manipulation**:
171
+
172
+ **Genuine value:** The mechanic improves the user's actual experience. Streaks work for Duolingo because they help users actually learn a language. Users would thank you for designing this.
173
+
174
+ **Engagement bait:** The mechanic keeps users in the product without delivering real value. Infinite scroll with algorithmically outraged content keeps users engaged but doesn't serve them.
175
+
176
+ **Dark patterns:** The mechanic exploits psychological vulnerabilities to extract value from users (dark subscriptions, artificial urgency, hidden cancellations).
177
+
178
+ For every mechanic you design, apply this test: **"Would a user who understood exactly what you were doing thank you for it?"**
179
+
180
+ If yes: ship it.
181
+ If no: redesign until the answer is yes, or don't build it.
182
+
183
+ ## Retention metric hierarchy
184
+
185
+ Define your primary retention metric before designing any mechanic:
186
+
187
+ | Metric | Definition | Best for |
188
+ | --------------------- | -------------------------------------------- | ----------------------------------- |
189
+ | **D1 retention** | % of day-1 users who return on day 2 | Mobile apps, early activation |
190
+ | **D7 retention** | % of week-1 users who return on day 8 | Apps requiring habit formation |
191
+ | **D30 retention** | % of month-1 users who return on day 31 | SaaS, subscription products |
192
+ | **DAU/MAU ratio** | % of monthly users who are also daily users | Engagement depth (40%+ = excellent) |
193
+ | **Session frequency** | Average sessions per user per week | Communication, utility apps |
194
+ | **Churn rate** | % of active users who stop using in a period | Subscription products |
195
+
196
+ Always tie mechanics to a specific metric. "Improve engagement" is not a goal; "increase D7 retention from 22% to 35%" is a goal.
197
+
198
+ ## Quality checklist
199
+
200
+ Before shipping a retention mechanic:
201
+
202
+ - [ ] Target metric is defined and baselined
203
+ - [ ] Psychological model is identified (Hook / Fogg / Habit Loop / SDT)
204
+ - [ ] Trigger is designed (external → internal over time)
205
+ - [ ] Friction in the action phase is minimized (Fogg's 6 simplicity factors)
206
+ - [ ] Reward is variable or surprising (not predictable)
207
+ - [ ] Investment layer designed (user leaves something behind that increases value)
208
+ - [ ] Ethical test passed ("Would users thank you for this?")
209
+ - [ ] Measurement plan exists (A/B test or cohort analysis)
210
+ - [ ] Feature does not exploit psychological vulnerabilities
211
+
212
+ ## Self-improving learnings
213
+
214
+ `_learnings/retention.yaml` records:
215
+
216
+ - Product type and primary retention metric in use
217
+ - Which psychological models the team has found most applicable
218
+ - Mechanic implementations that have been tried and their outcomes
219
+ - Team's ethical bar for retention mechanics
220
+
221
+ Apply on invocation; update on correction with confidence (high / medium / low).
222
+
223
+ ## Integration
224
+
225
+ - **agileflow-epic-planner** — a retention initiative becomes an epic with measurable success metrics (D1/D7/D30 retention, streak rate, notification CTR)
226
+ - **agileflow-story-writer** — individual retention mechanics become user stories with acceptance criteria tied to specific behavioural metrics
227
+ - **agileflow-pr-reviewer** — notifications, behavioural triggers, and urgency patterns get a second review to confirm they don't cross into dark patterns
228
+ - **agileflow-ideation** — use ideation before retention design to surface engagement feature opportunities; retention applies behavioural psychology to the top ideas
229
+ - **agileflow-research** — gather evidence-based engagement patterns, platform benchmark DAU/MAU ratios, and competitor onboarding flows before designing retention mechanics
230
+ - **agileflow-engineering** — delegate implementation of habit loops, notification systems, streak tracking, and progress visualisation
231
+ - **agileflow-ads** — align retention campaign strategy (win-back emails, re-engagement ads) with in-product retention mechanics for a coherent lifecycle
232
+ - **agileflow-planning** — use planning to prioritise retention initiatives against acquisition work; retention ROI (lower CAC payback) is a planning input
233
+ - **agileflow-council** — convene before designing controversial retention mechanics (social pressure, FOMO triggers) to evaluate ethical trade-offs
234
+
235
+ ## References
236
+
237
+ Load these files when you need deeper context:
238
+
239
+ | File | When to load |
240
+ | ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
241
+ | `references/psychology-models.md` | Understanding the theoretical foundation — Fogg B=MAP, Hook Model, Habit Loop, SDT — with citations and application guidance |
242
+ | `references/retention-patterns.md` | Specific mechanics with evidence: streaks, progress bars, variable rewards, social proof, endowed progress — each with study references and implementation steps |
243
+ | `references/competitor-analysis.md` | How high-retention products (Duolingo, LinkedIn, Slack, Strava, Spotify, Notion) implement these mechanics in practice |
244
+
245
+ ## Workflows
246
+
247
+ Follow these step-by-step when the user initiates the matching action:
248
+
249
+ | File | When to follow |
250
+ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
251
+ | `workflows/retention-audit.md` | User wants to audit their existing product for retention gaps — maps against Hook Model, Fogg, Habit Loop, and specific mechanics |
252
+ | `workflows/design-retention-feature.md` | User wants to design a new retention mechanic — from model selection through trigger design, reward structure, investment layer, and measurement |