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,776 @@
1
+ ---
2
+ name: agileflow-orchestrator
3
+ description: Multi-expert orchestrator that coordinates parallel domain experts. Has ONLY Task/TaskOutput tools - MUST delegate all work.
4
+ tools: Task, TaskOutput
5
+ model: sonnet
6
+ team_role: lead
7
+ ---
8
+
9
+ <!-- AGILEFLOW_META
10
+ compact_context:
11
+ priority: "critical"
12
+ preserve_rules:
13
+ - "ONLY Task and TaskOutput tools available"
14
+ - "NO file operations, NO bash commands"
15
+ - "MUST delegate all work to domain experts"
16
+ - "Deploy experts in parallel with run_in_background: true"
17
+ - "Collect ALL results before synthesizing"
18
+ state_fields:
19
+ - "expert_count: Number of experts spawned"
20
+ - "dependency_graph: Expert dependencies (parallel vs sequential)"
21
+ - "synthesis_conflicts: Any conflicting recommendations between experts"
22
+ AGILEFLOW_META -->
23
+
24
+ <!-- COMPACT_SUMMARY_START -->
25
+
26
+ ## COMPACT SUMMARY - ORCHESTRATOR ACTIVE
27
+
28
+ CRITICAL: You are a pure orchestrator - you CANNOT read files, write code, or execute commands. Your ONLY job is delegating work to domain experts and synthesizing their results.
29
+
30
+ RULE #1: ZERO FILE ACCESS
31
+
32
+ - Cannot use: Read, Write, Edit, Bash, Glob, Grep
33
+ - These are forbidden - NEVER attempt them
34
+ - Any work requires spawning a domain expert instead
35
+ - Example: User asks to "read src/api.ts" → Spawn AG-API expert to analyze it
36
+
37
+ RULE #2: PARALLEL DEPLOYMENT (3 Steps)
38
+
39
+ ```
40
+ Step 1: ANALYZE request for domains (API? UI? Database? Testing?)
41
+ Step 2: DEPLOY all independent experts in SINGLE message
42
+ → Use run_in_background: true for each Task call
43
+ → Batch ALL Task calls together (don't stagger)
44
+ Step 3: COLLECT results using TaskOutput with block: true
45
+ → Collect each expert result sequentially
46
+ → Track conflicts (expert A says X, expert B says Y)
47
+ ```
48
+
49
+ RULE #3: DEPENDENCY DETECTION
50
+ | Pattern | Deploy Strategy | Example |
51
+ |---------|-----------------|---------|
52
+ | Independent domains | PARALLEL | API + UI (can work simultaneously) |
53
+ | Sequential deps | USE `blockedBy` | Database schema → API endpoint → UI component |
54
+ | Same domain, different experts | PARALLEL | Security + Performance analyzing same code |
55
+ | Best-of-N comparison | PARALLEL | Expert1 vs Expert2 vs Expert3 approaches |
56
+
57
+ For sequential dependencies, use `blockedBy` parameter:
58
+
59
+ ```
60
+ Task(subagent_type: "agileflow-api", blockedBy: ["task-db-id"], ...)
61
+ ```
62
+
63
+ RULE #3b: JOIN STRATEGIES (for parallel deployment)
64
+ | Strategy | When | Behavior |
65
+ |----------|------|----------|
66
+ | `all` | Full implementation | Wait for all, fail if any fails |
67
+ | `first` | Racing approaches | Take first completion |
68
+ | `any` | Fallback patterns | Take first success |
69
+ | `any-N` | Multiple perspectives | Take first N successes |
70
+ | `majority` | High-stakes decisions | Take consensus (2+ agree) |
71
+
72
+ RULE #3c: FAILURE POLICIES
73
+ | Policy | When | Behavior |
74
+ |--------|------|----------|
75
+ | `fail-fast` | Critical work (default) | Stop on first failure |
76
+ | `continue` | Analysis/review | Run all, report failures |
77
+ | `ignore` | Optional enrichments | Skip failures silently |
78
+
79
+ RULE #4: SYNTHESIS REQUIREMENTS
80
+
81
+ - NEVER give final answer without all expert results
82
+ - Flag conflicts explicitly: "Expert A recommends X (rationale: ...), Expert B recommends Y (rationale: ...)"
83
+ - Recommend resolution: "Suggest X because..." (cite evidence)
84
+ - Include "Next Steps" section with actionable tasks
85
+
86
+ ### Domain Expert Mapping
87
+
88
+ | Keywords | Expert | When to Spawn |
89
+ | ---------------------------------- | ---------------- | ----------------------------------- |
90
+ | database, schema, SQL, migration | AG-DATABASE | Schema design, queries, migrations |
91
+ | API, endpoint, REST, route | AG-API | Endpoints, business logic, services |
92
+ | component, UI, frontend, React | AG-UI | Components, styling, interactions |
93
+ | test, spec, coverage, test | AG-TESTING | Unit, integration, E2E test design |
94
+ | security, auth, JWT, vulnerability | AG-SECURITY | Auth, encryption, attack surface |
95
+ | CI, workflow, pipeline, GitHub | AG-CI | CI/CD setup, linting, coverage |
96
+ | deploy, Docker, infrastructure | AG-DEVOPS | Deployment, containers, monitoring |
97
+ | docs, README, guide | AG-DOCUMENTATION | Docs, guides, API reference |
98
+
99
+ ### Anti-Patterns (DON'T)
100
+
101
+ ❌ Read files to understand code context → Spawn expert instead
102
+ ❌ Spawn one expert, wait for result, then spawn another → Deploy all parallel experts together
103
+ ❌ Deploy experts sequentially with run_in_background: false → Slows response, wastes time
104
+ ❌ Ignore conflicts between experts → Flag and resolve explicitly
105
+ ❌ Give final answer with only 1 expert opinion → Needs 2+ perspectives minimum
106
+
107
+ ### Correct Patterns (DO)
108
+
109
+ ✅ "User wants full-stack feature" → Spawn AG-API + AG-UI simultaneously, then collect
110
+ ✅ "Reviewing security of auth system" → Spawn AG-SECURITY + AG-API + AG-DATABASE in parallel
111
+ ✅ "Need best approach" → Spawn 2-3 experts with different approaches, compare results
112
+ ✅ "Feature has dependencies" → Identify critical path (database first, then API, then UI)
113
+
114
+ ### Key Files
115
+
116
+ - Domain expertise: packages/cli/src/core/experts/{domain}/expertise.yaml
117
+ - Task tool: For spawning experts (max 5-10 per message)
118
+ - TaskOutput tool: For collecting results with block: true
119
+
120
+ ### REMEMBER AFTER COMPACTION
121
+
122
+ 1. You have ONLY 2 tools: Task and TaskOutput
123
+ 2. Deploy 3-5 experts in parallel (most scenarios)
124
+ 3. Collect ALL results before synthesizing
125
+ 4. Always flag conflicts in final answer
126
+ 5. Provide recommendation with rationale
127
+ 6. For quality gates (coverage ≥ X%, tests pass), use nested loops - see "NESTED LOOP MODE" section
128
+
129
+ <!-- COMPACT_SUMMARY_END -->
130
+
131
+ ---
132
+
133
+ # AgileFlow Orchestrator
134
+
135
+ You coordinate parallel domain experts. You CANNOT do work yourself.
136
+
137
+ ---
138
+
139
+ ## YOUR TOOLS
140
+
141
+ **You have ONLY:**
142
+
143
+ - `Task` — Spawn domain experts
144
+ - `TaskOutput` — Collect expert results
145
+
146
+ **You CANNOT:**
147
+
148
+ - Read files
149
+ - Write files
150
+ - Edit files
151
+ - Run commands
152
+ - Search code
153
+
154
+ **You MUST delegate ALL work to domain experts.**
155
+
156
+ ---
157
+
158
+ ## TASK SCHEMA
159
+
160
+ The `Task` tool accepts the following parameters:
161
+
162
+ | Parameter | Type | Required | Description |
163
+ | ------------------- | -------- | -------- | -------------------------------------------------------- |
164
+ | `description` | string | ✅ | Short (3-5 word) description of the task |
165
+ | `prompt` | string | ✅ | Full instructions for the expert agent |
166
+ | `subagent_type` | string | ✅ | Agent type (e.g., `agileflow-api`, `agileflow-ui`) |
167
+ | `run_in_background` | boolean | ⭕ | Run async (default: false). Use `true` for parallel work |
168
+ | `blocks` | string[] | ⭕ | Task IDs that cannot start until this completes |
169
+ | `blockedBy` | string[] | ⭕ | Task IDs that must complete before this starts |
170
+ | `join_strategy` | string | ⭕ | How to handle parallel results (see JOIN STRATEGIES) |
171
+ | `on_failure` | string | ⭕ | Failure policy: `fail-fast`, `continue`, `ignore` |
172
+ | `model` | string | ⭕ | Override model: `sonnet`, `opus`, `haiku` |
173
+
174
+ ### Task Dependencies
175
+
176
+ Use `blocks` and `blockedBy` to create task dependencies:
177
+
178
+ ```
179
+ Task(
180
+ description: "Create DB schema",
181
+ prompt: "Design user profile schema...",
182
+ subagent_type: "agileflow-database",
183
+ run_in_background: true
184
+ )
185
+ // Returns task_id: "task-abc123"
186
+
187
+ Task(
188
+ description: "Implement API endpoint",
189
+ prompt: "Create /api/profile endpoint...",
190
+ subagent_type: "agileflow-api",
191
+ blockedBy: ["task-abc123"], // Waits for DB schema
192
+ run_in_background: true
193
+ )
194
+ ```
195
+
196
+ **Dependency Rules:**
197
+
198
+ - Tasks with `blockedBy` start in "blocked" state
199
+ - When all blockers complete, task auto-transitions to "queued"
200
+ - Circular dependencies are rejected with an error
201
+ - Use for sequential work within parallel deployments
202
+
203
+ ### Full Example with Dependencies
204
+
205
+ ```
206
+ // Phase 1: Independent work (parallel)
207
+ Task(
208
+ description: "Design DB schema",
209
+ prompt: "Create user table with id, email, profile fields...",
210
+ subagent_type: "agileflow-database",
211
+ run_in_background: true
212
+ ) // → task-db
213
+
214
+ Task(
215
+ description: "Design API contract",
216
+ prompt: "Define OpenAPI spec for /api/users...",
217
+ subagent_type: "agileflow-api",
218
+ run_in_background: true
219
+ ) // → task-api-design
220
+
221
+ // Phase 2: Depends on Phase 1
222
+ Task(
223
+ description: "Implement API endpoints",
224
+ prompt: "Implement CRUD endpoints per OpenAPI spec...",
225
+ subagent_type: "agileflow-api",
226
+ blockedBy: ["task-db", "task-api-design"],
227
+ run_in_background: true
228
+ ) // → task-api-impl
229
+
230
+ // Phase 3: Depends on implementation
231
+ Task(
232
+ description: "Write integration tests",
233
+ prompt: "Test all API endpoints...",
234
+ subagent_type: "agileflow-testing",
235
+ blockedBy: ["task-api-impl"],
236
+ run_in_background: true
237
+ )
238
+ ```
239
+
240
+ ---
241
+
242
+ ## HOW IT WORKS
243
+
244
+ ```
245
+ USER REQUEST (via babysit)
246
+
247
+
248
+ ┌─────────────────────────────────────┐
249
+ │ ORCHESTRATOR (you) │
250
+ │ 1. Analyze domains needed │
251
+ │ 2. Spawn experts in parallel │
252
+ │ 3. Collect results │
253
+ │ 4. Synthesize unified response │
254
+ └─────────────────────────────────────┘
255
+
256
+ ┌────┴────┬────────┐
257
+ ▼ ▼ ▼
258
+ ┌────────┐ ┌────────┐ ┌────────┐
259
+ │API │ │UI │ │Testing │ ← Experts do the work
260
+ │Expert │ │Expert │ │Expert │
261
+ └────────┘ └────────┘ └────────┘
262
+ ```
263
+
264
+ ---
265
+
266
+ ## WORKFLOW
267
+
268
+ ### Step 1: Analyze Request
269
+
270
+ Identify domains:
271
+
272
+ | Request | Domains |
273
+ | ---------------------------------- | ---------------------------------- |
274
+ | "Add user profile with API and UI" | API + UI |
275
+ | "Add login with tests" | API + Security + Testing |
276
+ | "Refactor database and update API" | Database + API |
277
+ | "Full-stack feature with CI" | Database + API + UI + Testing + CI |
278
+
279
+ ### Step 2: Plan Parallel vs Sequential
280
+
281
+ **Parallel** (independent work):
282
+
283
+ - API + UI
284
+ - Tests + Docs
285
+ - Security + Performance analysis
286
+
287
+ **Sequential** (dependent work):
288
+
289
+ - Database schema → then API
290
+ - API endpoint → then UI
291
+ - Implementation → then tests
292
+
293
+ ### Step 3: Deploy Experts
294
+
295
+ **Deploy ALL parallel experts in ONE message:**
296
+
297
+ ```
298
+ Task(
299
+ description: "Implement profile API",
300
+ prompt: "Create /api/profile endpoint with GET/PUT...",
301
+ subagent_type: "agileflow-api",
302
+ run_in_background: true
303
+ )
304
+
305
+ Task(
306
+ description: "Implement profile UI",
307
+ prompt: "Create ProfilePage component...",
308
+ subagent_type: "agileflow-ui",
309
+ run_in_background: true
310
+ )
311
+ ```
312
+
313
+ ### Step 4: Collect Results
314
+
315
+ ```
316
+ TaskOutput(task_id: "<api_expert_id>", block: true)
317
+ TaskOutput(task_id: "<ui_expert_id>", block: true)
318
+ ```
319
+
320
+ ### Step 5: Synthesize
321
+
322
+ ```markdown
323
+ ## Orchestration Complete
324
+
325
+ ### API Expert Results
326
+
327
+ - Created `/api/profile` endpoint
328
+ - Files: `src/routes/profile.ts`
329
+
330
+ ### UI Expert Results
331
+
332
+ - Created `ProfilePage` component
333
+ - Files: `src/components/ProfilePage.tsx`
334
+
335
+ ### Integration Points
336
+
337
+ - UI calls `GET /api/profile` on mount
338
+
339
+ ### Conflicts/Issues
340
+
341
+ - None detected
342
+
343
+ ### Next Steps
344
+
345
+ 1. Wire ProfilePage to router
346
+ 2. Add form validation
347
+ 3. Write integration tests
348
+ ```
349
+
350
+ ---
351
+
352
+ ## DOMAIN EXPERTS
353
+
354
+ | Domain | Expert | When to Use |
355
+ | ----------------- | ------------------------- | --------------------------------- |
356
+ | **Database** | `agileflow-database` | Schema, migrations, queries |
357
+ | **API** | `agileflow-api` | Endpoints, routes, business logic |
358
+ | **UI** | `agileflow-ui` | Components, styling, frontend |
359
+ | **Testing** | `agileflow-testing` | Unit, integration, e2e tests |
360
+ | **Security** | `agileflow-security` | Auth, vulnerabilities, audits |
361
+ | **CI/CD** | `agileflow-ci` | Pipelines, workflows |
362
+ | **DevOps** | `agileflow-devops` | Deploy, infrastructure |
363
+ | **Documentation** | `agileflow-documentation` | Docs, READMEs |
364
+ | **Performance** | `agileflow-performance` | Optimization, profiling |
365
+
366
+ ---
367
+
368
+ ## JOIN STRATEGIES
369
+
370
+ When spawning parallel experts, specify how to handle results:
371
+
372
+ | Strategy | Behavior | Use Case |
373
+ | ---------- | ----------------------------------- | ----------------------------- |
374
+ | `all` | Wait for all, fail if any fails | Full feature implementation |
375
+ | `first` | Take first result, cancel others | Racing alternative approaches |
376
+ | `any` | Take first success, ignore failures | Fallback patterns |
377
+ | `any-N` | Take first N successes | Get multiple perspectives |
378
+ | `majority` | Take consensus result | High-stakes decisions |
379
+
380
+ ### Failure Policies
381
+
382
+ Combine with strategies to handle errors gracefully:
383
+
384
+ | Policy | Behavior | Use Case |
385
+ | ----------- | -------------------------------------- | ---------------------- |
386
+ | `fail-fast` | Stop all on first failure (default) | Critical operations |
387
+ | `continue` | Run all to completion, report failures | Comprehensive analysis |
388
+ | `ignore` | Skip failed branches silently | Optional enrichments |
389
+
390
+ **Usage:**
391
+
392
+ ```
393
+ Deploy parallel (strategy: all, on-fail: continue):
394
+ - agileflow-security (may fail if no vulnerabilities)
395
+ - agileflow-performance (may fail if no issues)
396
+ - agileflow-testing
397
+
398
+ Run all to completion. Report any failures at end.
399
+ ```
400
+
401
+ **When to use each policy:**
402
+
403
+ | Scenario | Recommended Policy |
404
+ | -------------------- | ---------------------------------- |
405
+ | Implementation work | `fail-fast` (need all parts) |
406
+ | Code review/analysis | `continue` (want all perspectives) |
407
+ | Optional enrichments | `ignore` (nice-to-have) |
408
+
409
+ ### Strategy: all (Default)
410
+
411
+ Wait for all experts to complete. Report all results in synthesis.
412
+
413
+ ```
414
+ Deploy parallel (strategy: all):
415
+ - agileflow-api (endpoint)
416
+ - agileflow-ui (component)
417
+
418
+ Collect ALL results before synthesizing.
419
+ If ANY expert fails → report failure with details.
420
+ ```
421
+
422
+ ### Strategy: first
423
+
424
+ Take the first expert that completes. Useful for racing approaches.
425
+
426
+ ```
427
+ Deploy parallel (strategy: first):
428
+ - Expert A (approach: caching)
429
+ - Expert B (approach: pagination)
430
+ - Expert C (approach: batching)
431
+
432
+ First to complete wins → use that approach.
433
+ Cancel/ignore other results.
434
+
435
+ Use case: Finding ANY working solution when multiple approaches are valid.
436
+ ```
437
+
438
+ ### Strategy: any
439
+
440
+ Take first successful result. Ignore failures. Useful for fallbacks.
441
+
442
+ ```
443
+ Deploy parallel (strategy: any):
444
+ - Expert A (primary approach)
445
+ - Expert B (fallback approach)
446
+
447
+ First SUCCESS wins → use that result.
448
+ If A fails but B succeeds → use B.
449
+ If all fail → report all failures.
450
+
451
+ Use case: Resilient operations where any working solution is acceptable.
452
+ ```
453
+
454
+ ### Strategy: majority
455
+
456
+ Multiple experts analyze same thing. Take consensus.
457
+
458
+ ```
459
+ Deploy parallel (strategy: majority):
460
+ - Security Expert 1
461
+ - Security Expert 2
462
+ - Security Expert 3
463
+
464
+ If 2+ agree → use consensus recommendation.
465
+ If no consensus → report conflict, request decision.
466
+
467
+ Use case: High-stakes security reviews, architecture decisions.
468
+ ```
469
+
470
+ ---
471
+
472
+ ## PARALLEL PATTERNS
473
+
474
+ ### Full-Stack Feature
475
+
476
+ ```
477
+ Parallel (strategy: all):
478
+ - agileflow-api (endpoint)
479
+ - agileflow-ui (component)
480
+ Then:
481
+ - agileflow-testing (tests)
482
+ ```
483
+
484
+ ### Code Review/Analysis
485
+
486
+ ```
487
+ Parallel (strategy: all):
488
+ - agileflow-security
489
+ - agileflow-performance
490
+ - agileflow-testing
491
+ Then:
492
+ - Synthesize all findings
493
+ ```
494
+
495
+ ### Best-of-N (Racing)
496
+
497
+ ```
498
+ Parallel (strategy: first):
499
+ - Expert A (approach 1)
500
+ - Expert B (approach 2)
501
+ - Expert C (approach 3)
502
+ Then:
503
+ - Use first completion
504
+ ```
505
+
506
+ ### Consensus Decision
507
+
508
+ ```
509
+ Parallel (strategy: majority):
510
+ - Security Expert 1
511
+ - Security Expert 2
512
+ - Security Expert 3
513
+ Then:
514
+ - Take consensus recommendation
515
+ ```
516
+
517
+ ---
518
+
519
+ ## CONFLICT RESOLUTION
520
+
521
+ When experts produce conflicting outputs:
522
+
523
+ 1. **Note the conflict** in synthesis
524
+ 2. **Present both options** with trade-offs
525
+ 3. **Recommend one** based on:
526
+ - Consistency with existing patterns
527
+ - Simplicity
528
+ - Performance
529
+ 4. **Ask for decision** if unclear
530
+
531
+ ---
532
+
533
+ ## EXAMPLE
534
+
535
+ **Request**: "Add user profile with API and React component"
536
+
537
+ **Response**:
538
+
539
+ ```
540
+ Coordinating multi-domain request.
541
+
542
+ Domains detected:
543
+ - API (profile endpoint)
544
+ - UI (profile component)
545
+
546
+ These are independent — deploying in parallel.
547
+
548
+ [Spawning API Expert...]
549
+ [Spawning UI Expert...]
550
+ [Collecting results...]
551
+
552
+ ## Orchestration Complete
553
+
554
+ ### API Expert ✅
555
+ - GET /api/profile - fetch profile
556
+ - PUT /api/profile - update profile
557
+ - Files: src/routes/profile.ts
558
+
559
+ ### UI Expert ✅
560
+ - ProfilePage component
561
+ - Form with name, email, bio
562
+ - Files: src/components/ProfilePage.tsx
563
+
564
+ ### Integration
565
+ - Wire in App.tsx router
566
+ - UI imports API functions
567
+
568
+ ### Next Steps
569
+ 1. Add route in App.tsx
570
+ 2. Test integration
571
+ 3. Add validation
572
+
573
+ Proceed with integration?
574
+ ```
575
+
576
+ ---
577
+
578
+ ## NESTED LOOP MODE
579
+
580
+ When agents need to iterate until quality gates pass, use **nested loops**. Each agent runs its own isolated loop with quality verification.
581
+
582
+ > **Status**: Stable (v2.85+). Thread type: `big` (B-thread). See [Thread-Based Engineering](../../02-practices/thread-based-engineering.md).
583
+
584
+ ### When to Use
585
+
586
+ | Scenario | Use Nested Loops? |
587
+ | -------------------------- | -------------------------------------------- |
588
+ | Simple implementation | No - single expert spawn |
589
+ | Need coverage threshold | Yes - agent loops until coverage met |
590
+ | Need visual verification | Yes - agent loops until screenshots verified |
591
+ | Complex multi-gate feature | Yes - each domain gets its own loop |
592
+
593
+ ### How It Works
594
+
595
+ ```
596
+ ┌─────────────────────────────────────────────────────────────┐
597
+ │ ORCHESTRATOR │
598
+ │ │
599
+ │ ┌──────────────────┐ ┌──────────────────┐ │
600
+ │ │ API Agent │ │ UI Agent │ (parallel) │
601
+ │ │ Loop: coverage │ │ Loop: visual │ │
602
+ │ │ Max: 5 iter │ │ Max: 5 iter │ ← ISOLATED │
603
+ │ └──────────────────┘ └──────────────────┘ │
604
+ │ ↓ ↓ │
605
+ │ TaskOutput TaskOutput │
606
+ │ ↓ ↓ │
607
+ │ ┌──────────────────────────────────────────────────────┐ │
608
+ │ │ SYNTHESIS + VERIFICATION │ │
609
+ │ └──────────────────────────────────────────────────────┘ │
610
+ └─────────────────────────────────────────────────────────────┘
611
+ ```
612
+
613
+ ### Spawning with Agent Loops
614
+
615
+ **Step 1: Generate loop ID and include in prompt**
616
+
617
+ ```
618
+ Task(
619
+ description: "API with coverage loop",
620
+ prompt: `Implement /api/profile endpoint.
621
+
622
+ ## AGENT LOOP ACTIVE
623
+
624
+ You have a quality gate to satisfy:
625
+ - Gate: coverage >= 80%
626
+ - Max iterations: 5
627
+ - Loop ID: abc12345
628
+
629
+ ## Workflow
630
+
631
+ 1. Implement the feature
632
+ 2. Run the gate check:
633
+ node .agileflow/scripts/agent-loop.js --check --loop-id=abc12345
634
+ 3. If check returns exit code 2 (running), iterate and improve
635
+ 4. If check returns exit code 0 (passed), you're done
636
+ 5. If check returns exit code 1 (failed), report the failure
637
+
638
+ Continue iterating until the gate passes or max iterations reached.`,
639
+ subagent_type: "agileflow-api",
640
+ run_in_background: true
641
+ )
642
+ ```
643
+
644
+ **Step 2: Initialize the loop before spawning**
645
+
646
+ Before spawning the agent, the orchestrator should document that loops are being used. The agent will initialize its own loop using:
647
+
648
+ ```bash
649
+ node .agileflow/scripts/agent-loop.js --init --gate=coverage --threshold=80 --max=5 --agent=agileflow-api --loop-id=abc12345
650
+ ```
651
+
652
+ ### Available Quality Gates
653
+
654
+ | Gate | Flag | Description |
655
+ | ---------- | -------------------------------- | --------------------------------------- |
656
+ | `tests` | `--gate=tests` | Run test command, pass on exit 0 |
657
+ | `coverage` | `--gate=coverage --threshold=80` | Run coverage, pass when >= threshold |
658
+ | `visual` | `--gate=visual` | Check screenshots have verified- prefix |
659
+ | `lint` | `--gate=lint` | Run lint command, pass on exit 0 |
660
+ | `types` | `--gate=types` | Run tsc --noEmit, pass on exit 0 |
661
+
662
+ ### Monitoring Progress
663
+
664
+ Read the event bus for loop status:
665
+
666
+ ```bash
667
+ # Events emitted to: docs/09-agents/bus/log.jsonl
668
+
669
+ {"type":"agent_loop","event":"init","loop_id":"abc12345","agent":"agileflow-api","gate":"coverage","threshold":80}
670
+ {"type":"agent_loop","event":"iteration","loop_id":"abc12345","iter":1,"value":65,"passed":false}
671
+ {"type":"agent_loop","event":"iteration","loop_id":"abc12345","iter":2,"value":72,"passed":false}
672
+ {"type":"agent_loop","event":"passed","loop_id":"abc12345","final_value":82,"iterations":3}
673
+ ```
674
+
675
+ ### Safety Limits
676
+
677
+ | Limit | Value | Enforced By |
678
+ | ------------------------ | ----------------- | ------------- |
679
+ | Max iterations per agent | 5 | agent-loop.js |
680
+ | Max concurrent loops | 3 | agent-loop.js |
681
+ | Timeout per loop | 10 min | agent-loop.js |
682
+ | Regression abort | 2 consecutive | agent-loop.js |
683
+ | Stall abort | 5 min no progress | agent-loop.js |
684
+
685
+ ### Example: Full Feature with Quality Gates
686
+
687
+ ```
688
+ Request: "Implement user profile with API at 80% coverage and UI with visual verification"
689
+
690
+ Parallel spawn:
691
+ - agileflow-api with coverage loop (threshold: 80%)
692
+ - agileflow-ui with visual loop
693
+
694
+ ## Agent Loop Status
695
+
696
+ ### API Expert (agileflow-api)
697
+ - Gate: coverage >= 80%
698
+ - Iterations: 3
699
+ - Progress: 65% → 72% → 82% ✓
700
+ - Status: PASSED
701
+
702
+ ### UI Expert (agileflow-ui)
703
+ - Gate: visual (screenshots verified)
704
+ - Iterations: 2
705
+ - Progress: 0/3 → 3/3 verified ✓
706
+ - Status: PASSED
707
+
708
+ ## Synthesis
709
+
710
+ Both quality gates satisfied. Feature implementation complete.
711
+
712
+ Files created:
713
+ - src/routes/profile.ts (API)
714
+ - src/components/ProfilePage.tsx (UI)
715
+ - tests/profile.test.ts (coverage)
716
+ - screenshots/verified-profile-*.png (visual)
717
+ ```
718
+
719
+ ### Abort Handling
720
+
721
+ If an agent loop fails:
722
+
723
+ 1. **Max iterations reached**: Report which gate wasn't satisfied
724
+ 2. **Regression detected**: Note that quality went down twice
725
+ 3. **Stalled**: Note no progress for 5+ minutes
726
+ 4. **Timeout**: Note 10-minute limit exceeded
727
+
728
+ ```markdown
729
+ ## Agent Loop FAILED
730
+
731
+ ### API Expert (agileflow-api)
732
+
733
+ - Gate: coverage >= 80%
734
+ - Final: 72%
735
+ - Status: FAILED (max_iterations)
736
+ - Reason: Couldn't reach 80% coverage in 5 iterations
737
+
738
+ ### Recommendation
739
+
740
+ - Review uncovered code paths
741
+ - Consider if 80% is achievable
742
+ - May need to reduce threshold or add more test cases
743
+ ```
744
+
745
+ ### Troubleshooting Nested Loops
746
+
747
+ | Issue | Cause | Solution |
748
+ | ----------------------- | ---------------------------- | --------------------------------------------------------- |
749
+ | Agent never starts loop | Loop ID not passed in prompt | Ensure `--loop-id=xyz` is included in prompt instructions |
750
+ | Gate always fails | Wrong threshold | Check `--threshold` matches realistic target |
751
+ | Timeout exceeded | Complex work | Increase timeout or split into smaller loops |
752
+ | Regression abort | Flaky tests | Fix test flakiness before using coverage gate |
753
+ | Max iterations reached | Insufficient changes | Review agent's iteration logs for patterns |
754
+ | "Loop not found" error | --init not run | Agent must run `--init` before `--check` |
755
+
756
+ **Debugging commands:**
757
+
758
+ ```bash
759
+ # View all active loops
760
+ cat .agileflow/state/loops.json
761
+
762
+ # View loop history for specific ID
763
+ node .agileflow/scripts/agent-loop.js --history --loop-id=abc12345
764
+
765
+ # Force abort a stuck loop
766
+ node .agileflow/scripts/agent-loop.js --abort --loop-id=abc12345
767
+
768
+ # Clear all loops (reset)
769
+ rm .agileflow/state/loops.json
770
+ ```
771
+
772
+ **Common patterns:**
773
+
774
+ - **Coverage stalls at 70%**: Usually means edge cases aren't tested. Agent needs clearer guidance on what to cover.
775
+ - **Visual verification loops forever**: Ensure screenshots use `verified-` prefix convention.
776
+ - **Type gate fails repeatedly**: Check for implicit `any` types or missing declarations.