agileflow 4.0.0-alpha.2 → 4.0.0-alpha.6

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 (505) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/content/plugins/accessibility/plugin.yaml +15 -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/commands/ads/audit.md +464 -0
  19. package/content/plugins/ads/commands/ads/budget.md +100 -0
  20. package/content/plugins/ads/commands/ads/competitor.md +119 -0
  21. package/content/plugins/ads/commands/ads/creative.md +88 -0
  22. package/content/plugins/ads/commands/ads/generate.md +242 -0
  23. package/content/plugins/ads/commands/ads/google.md +115 -0
  24. package/content/plugins/ads/commands/ads/health.md +331 -0
  25. package/content/plugins/ads/commands/ads/landing.md +126 -0
  26. package/content/plugins/ads/commands/ads/linkedin.md +167 -0
  27. package/content/plugins/ads/commands/ads/meta.md +94 -0
  28. package/content/plugins/ads/commands/ads/microsoft.md +170 -0
  29. package/content/plugins/ads/commands/ads/plan.md +351 -0
  30. package/content/plugins/ads/commands/ads/test-plan.md +321 -0
  31. package/content/plugins/ads/commands/ads/tiktok.md +185 -0
  32. package/content/plugins/ads/commands/ads/track.md +303 -0
  33. package/content/plugins/ads/commands/ads/youtube.md +179 -0
  34. package/content/plugins/ads/commands/ads.md +143 -0
  35. package/content/plugins/ads/plugin.yaml +58 -4
  36. package/content/plugins/ads/skills/agileflow-ads/SKILL.md +218 -0
  37. package/content/plugins/ads/skills/agileflow-ads/references/ad-copy-formula-guide.md +131 -0
  38. package/content/plugins/ads/skills/agileflow-ads/references/audience-targeting-guide.md +137 -0
  39. package/content/plugins/ads/skills/agileflow-ads/references/bid-strategy-guide.md +115 -0
  40. package/content/plugins/ads/skills/agileflow-ads/references/platform-benchmarks.md +100 -0
  41. package/content/plugins/ads/skills/agileflow-ads/workflows/audit.md +64 -0
  42. package/content/plugins/ads/skills/agileflow-ads/workflows/generate.md +53 -0
  43. package/content/plugins/audit/agents/a11y-analyzer-aria.md +173 -0
  44. package/content/plugins/audit/agents/a11y-analyzer-forms.md +173 -0
  45. package/content/plugins/audit/agents/a11y-analyzer-keyboard.md +183 -0
  46. package/content/plugins/audit/agents/a11y-analyzer-semantic.md +169 -0
  47. package/content/plugins/audit/agents/a11y-analyzer-visual.md +172 -0
  48. package/content/plugins/audit/agents/a11y-consensus.md +249 -0
  49. package/content/plugins/audit/agents/accessibility.md +558 -0
  50. package/content/plugins/audit/agents/api-quality-analyzer-conventions.md +156 -0
  51. package/content/plugins/audit/agents/api-quality-analyzer-docs.md +184 -0
  52. package/content/plugins/audit/agents/api-quality-analyzer-errors.md +191 -0
  53. package/content/plugins/audit/agents/api-quality-analyzer-pagination.md +179 -0
  54. package/content/plugins/audit/agents/api-quality-analyzer-versioning.md +150 -0
  55. package/content/plugins/audit/agents/api-quality-consensus.md +217 -0
  56. package/content/plugins/audit/agents/api-validator.md +191 -0
  57. package/content/plugins/audit/agents/arch-analyzer-circular.md +156 -0
  58. package/content/plugins/audit/agents/arch-analyzer-complexity.md +193 -0
  59. package/content/plugins/audit/agents/arch-analyzer-coupling.md +152 -0
  60. package/content/plugins/audit/agents/arch-analyzer-layering.md +160 -0
  61. package/content/plugins/audit/agents/arch-analyzer-patterns.md +210 -0
  62. package/content/plugins/audit/agents/arch-consensus.md +228 -0
  63. package/content/plugins/audit/agents/browser-qa.md +342 -0
  64. package/content/plugins/audit/agents/code-reviewer.md +298 -0
  65. package/content/plugins/audit/agents/completeness-analyzer-api.md +199 -0
  66. package/content/plugins/audit/agents/completeness-analyzer-conditional.md +211 -0
  67. package/content/plugins/audit/agents/completeness-analyzer-handlers.md +166 -0
  68. package/content/plugins/audit/agents/completeness-analyzer-imports.md +165 -0
  69. package/content/plugins/audit/agents/completeness-analyzer-routes.md +190 -0
  70. package/content/plugins/audit/agents/completeness-analyzer-state.md +196 -0
  71. package/content/plugins/audit/agents/completeness-analyzer-stubs.md +206 -0
  72. package/content/plugins/audit/agents/completeness-consensus.md +295 -0
  73. package/content/plugins/audit/agents/error-analyzer.md +213 -0
  74. package/content/plugins/audit/agents/flow-analyzer-authorization.md +182 -0
  75. package/content/plugins/audit/agents/flow-analyzer-discovery.md +174 -0
  76. package/content/plugins/audit/agents/flow-analyzer-errors.md +186 -0
  77. package/content/plugins/audit/agents/flow-analyzer-feedback.md +185 -0
  78. package/content/plugins/audit/agents/flow-analyzer-navigation.md +177 -0
  79. package/content/plugins/audit/agents/flow-analyzer-persistence.md +193 -0
  80. package/content/plugins/audit/agents/flow-analyzer-wiring.md +169 -0
  81. package/content/plugins/audit/agents/flow-consensus.md +237 -0
  82. package/content/plugins/audit/agents/legal-analyzer-a11y.md +114 -0
  83. package/content/plugins/audit/agents/legal-analyzer-ai.md +121 -0
  84. package/content/plugins/audit/agents/legal-analyzer-consumer.md +114 -0
  85. package/content/plugins/audit/agents/legal-analyzer-content.md +117 -0
  86. package/content/plugins/audit/agents/legal-analyzer-international.md +119 -0
  87. package/content/plugins/audit/agents/legal-analyzer-licensing.md +119 -0
  88. package/content/plugins/audit/agents/legal-analyzer-privacy.md +112 -0
  89. package/content/plugins/audit/agents/legal-analyzer-security.md +116 -0
  90. package/content/plugins/audit/agents/legal-analyzer-terms.md +115 -0
  91. package/content/plugins/audit/agents/legal-consensus.md +250 -0
  92. package/content/plugins/audit/agents/logic-analyzer-edge.md +179 -0
  93. package/content/plugins/audit/agents/logic-analyzer-flow.md +264 -0
  94. package/content/plugins/audit/agents/logic-analyzer-invariant.md +215 -0
  95. package/content/plugins/audit/agents/logic-analyzer-race.md +280 -0
  96. package/content/plugins/audit/agents/logic-analyzer-type.md +227 -0
  97. package/content/plugins/audit/agents/logic-consensus.md +259 -0
  98. package/content/plugins/audit/agents/perf-analyzer-assets.md +182 -0
  99. package/content/plugins/audit/agents/perf-analyzer-bundle.md +173 -0
  100. package/content/plugins/audit/agents/perf-analyzer-caching.md +170 -0
  101. package/content/plugins/audit/agents/perf-analyzer-compute.md +173 -0
  102. package/content/plugins/audit/agents/perf-analyzer-memory.md +193 -0
  103. package/content/plugins/audit/agents/perf-analyzer-network.md +165 -0
  104. package/content/plugins/audit/agents/perf-analyzer-queries.md +162 -0
  105. package/content/plugins/audit/agents/perf-analyzer-rendering.md +168 -0
  106. package/content/plugins/audit/agents/perf-consensus.md +287 -0
  107. package/content/plugins/audit/agents/qa.md +820 -0
  108. package/content/plugins/audit/agents/quality-analyzer-comments.md +159 -0
  109. package/content/plugins/audit/agents/quality-analyzer-duplication.md +184 -0
  110. package/content/plugins/audit/agents/quality-analyzer-naming.md +160 -0
  111. package/content/plugins/audit/agents/quality-consensus.md +241 -0
  112. package/content/plugins/audit/agents/schema-validator.md +473 -0
  113. package/content/plugins/audit/agents/security-analyzer-api.md +210 -0
  114. package/content/plugins/audit/agents/security-analyzer-auth.md +169 -0
  115. package/content/plugins/audit/agents/security-analyzer-authz.md +180 -0
  116. package/content/plugins/audit/agents/security-analyzer-deps.md +153 -0
  117. package/content/plugins/audit/agents/security-analyzer-infra.md +184 -0
  118. package/content/plugins/audit/agents/security-analyzer-injection.md +155 -0
  119. package/content/plugins/audit/agents/security-analyzer-input.md +201 -0
  120. package/content/plugins/audit/agents/security-analyzer-secrets.md +183 -0
  121. package/content/plugins/audit/agents/security-consensus.md +283 -0
  122. package/content/plugins/audit/agents/test-analyzer-assertions.md +188 -0
  123. package/content/plugins/audit/agents/test-analyzer-coverage.md +189 -0
  124. package/content/plugins/audit/agents/test-analyzer-fragility.md +193 -0
  125. package/content/plugins/audit/agents/test-analyzer-integration.md +161 -0
  126. package/content/plugins/audit/agents/test-analyzer-maintenance.md +180 -0
  127. package/content/plugins/audit/agents/test-analyzer-mocking.md +188 -0
  128. package/content/plugins/audit/agents/test-analyzer-patterns.md +196 -0
  129. package/content/plugins/audit/agents/test-analyzer-structure.md +184 -0
  130. package/content/plugins/audit/agents/test-consensus.md +301 -0
  131. package/content/plugins/audit/agents/testing.md +561 -0
  132. package/content/plugins/audit/agents/ui-validator.md +344 -0
  133. package/content/plugins/audit/commands/audit.md +552 -0
  134. package/content/plugins/audit/commands/browser-qa.md +249 -0
  135. package/content/plugins/audit/commands/code/accessibility.md +430 -0
  136. package/content/plugins/audit/commands/code/api.md +380 -0
  137. package/content/plugins/audit/commands/code/architecture.md +380 -0
  138. package/content/plugins/audit/commands/code/completeness.md +589 -0
  139. package/content/plugins/audit/commands/code/flows.md +533 -0
  140. package/content/plugins/audit/commands/code/legal.md +581 -0
  141. package/content/plugins/audit/commands/code/logic.md +498 -0
  142. package/content/plugins/audit/commands/code/performance.md +577 -0
  143. package/content/plugins/audit/commands/code/quality.md +537 -0
  144. package/content/plugins/audit/commands/code/security.md +580 -0
  145. package/content/plugins/audit/commands/code/test.md +576 -0
  146. package/content/plugins/audit/commands/code.md +35 -0
  147. package/content/plugins/audit/commands/review.md +731 -0
  148. package/content/plugins/audit/commands/tdd-next.md +292 -0
  149. package/content/plugins/audit/commands/tdd.md +244 -0
  150. package/content/plugins/audit/commands/tests.md +769 -0
  151. package/content/plugins/audit/commands/verify.md +567 -0
  152. package/content/plugins/audit/plugin.yaml +225 -5
  153. package/content/plugins/audit/skills/agileflow-audit/SKILL.md +113 -0
  154. package/content/plugins/audit/skills/agileflow-audit/references/audit-depth-guide.md +151 -0
  155. package/content/plugins/audit/skills/agileflow-audit/references/dependency-risk-guide.md +139 -0
  156. package/content/plugins/audit/skills/agileflow-audit/references/owasp-top10.md +120 -0
  157. package/content/plugins/audit/skills/agileflow-audit/references/performance-budget-guide.md +143 -0
  158. package/content/plugins/audit/skills/agileflow-audit/references/wcag-criteria.md +117 -0
  159. package/content/plugins/audit/skills/agileflow-audit/workflows/run-audit.md +52 -0
  160. package/content/plugins/audit/skills/agileflow-audit/workflows/tdd.md +66 -0
  161. package/content/plugins/core/agents/adr-writer.md +521 -0
  162. package/content/plugins/core/agents/epic-planner.md +520 -0
  163. package/content/plugins/core/agents/mentor.md +709 -0
  164. package/content/plugins/core/agents/orchestrator.md +776 -0
  165. package/content/plugins/core/agents/team-coordinator.md +334 -0
  166. package/content/plugins/core/agents/team-lead.md +181 -0
  167. package/content/plugins/core/agents/workspace-orchestrator.md +146 -0
  168. package/content/plugins/core/commands/adr/list.md +199 -0
  169. package/content/plugins/core/commands/adr/update.md +264 -0
  170. package/content/plugins/core/commands/adr/view.md +284 -0
  171. package/content/plugins/core/commands/adr.md +407 -0
  172. package/content/plugins/core/commands/agent.md +264 -0
  173. package/content/plugins/core/commands/assign.md +393 -0
  174. package/content/plugins/core/commands/auto.md +598 -0
  175. package/content/plugins/core/commands/babysit.md +744 -0
  176. package/content/plugins/core/commands/baseline.md +778 -0
  177. package/content/plugins/core/commands/batch.md +566 -0
  178. package/content/plugins/core/commands/blockers.md +638 -0
  179. package/content/plugins/core/commands/board.md +555 -0
  180. package/content/plugins/core/commands/channels.md +129 -0
  181. package/content/plugins/core/commands/choose.md +444 -0
  182. package/content/plugins/core/commands/compact/search.md +42 -0
  183. package/content/plugins/core/commands/compress.md +442 -0
  184. package/content/plugins/core/commands/configure.md +1202 -0
  185. package/content/plugins/core/commands/context/export.md +316 -0
  186. package/content/plugins/core/commands/context/full.md +386 -0
  187. package/content/plugins/core/commands/context/note.md +389 -0
  188. package/content/plugins/core/commands/debt.md +536 -0
  189. package/content/plugins/core/commands/epic/edit.md +226 -0
  190. package/content/plugins/core/commands/epic/list.md +229 -0
  191. package/content/plugins/core/commands/epic/view.md +277 -0
  192. package/content/plugins/core/commands/epic.md +499 -0
  193. package/content/plugins/core/commands/handoff.md +406 -0
  194. package/content/plugins/core/commands/help.md +201 -0
  195. package/content/plugins/core/commands/install.md +541 -0
  196. package/content/plugins/core/commands/maintain.md +571 -0
  197. package/content/plugins/core/commands/retro.md +836 -0
  198. package/content/plugins/core/commands/session/cleanup.md +489 -0
  199. package/content/plugins/core/commands/session/end.md +911 -0
  200. package/content/plugins/core/commands/session/history.md +300 -0
  201. package/content/plugins/core/commands/session/init.md +219 -0
  202. package/content/plugins/core/commands/session/new.md +863 -0
  203. package/content/plugins/core/commands/session/resume.md +302 -0
  204. package/content/plugins/core/commands/session/spawn.md +211 -0
  205. package/content/plugins/core/commands/session/status.md +284 -0
  206. package/content/plugins/core/commands/status/undo.md +207 -0
  207. package/content/plugins/core/commands/status.md +450 -0
  208. package/content/plugins/core/commands/story/edit.md +217 -0
  209. package/content/plugins/core/commands/story/list.md +232 -0
  210. package/content/plugins/core/commands/story/view.md +321 -0
  211. package/content/plugins/core/commands/story-validate.md +517 -0
  212. package/content/plugins/core/commands/story.md +496 -0
  213. package/content/plugins/core/commands/team/guide.md +748 -0
  214. package/content/plugins/core/commands/team/list.md +61 -0
  215. package/content/plugins/core/commands/team/start.md +137 -0
  216. package/content/plugins/core/commands/team/status.md +68 -0
  217. package/content/plugins/core/commands/team/stop.md +80 -0
  218. package/content/plugins/core/commands/template.md +680 -0
  219. package/content/plugins/core/commands/update.md +640 -0
  220. package/content/plugins/core/commands/validate-expertise.md +326 -0
  221. package/content/plugins/core/commands/whats-new.md +206 -0
  222. package/content/plugins/core/commands/workflow.md +479 -0
  223. package/content/plugins/core/commands/workspace/init.md +114 -0
  224. package/content/plugins/core/commands/workspace/spawn.md +152 -0
  225. package/content/plugins/core/commands/workspace/status.md +101 -0
  226. package/content/plugins/core/commands/workspace.md +26 -0
  227. package/content/plugins/core/hooks/context-loader.js +31 -4
  228. package/content/plugins/core/hooks/damage-control-bash.js +10 -2
  229. package/content/plugins/core/hooks/damage-control-edit.js +4 -1
  230. package/content/plugins/core/hooks/damage-control-write.js +4 -1
  231. package/content/plugins/core/hooks/{pre-compact-state.js → post-compact-state.js} +25 -8
  232. package/content/plugins/core/hooks/preferences-injector.js +352 -0
  233. package/content/plugins/core/plugin.yaml +143 -28
  234. package/content/plugins/core/skills/agileflow-adr/SKILL.md +34 -8
  235. package/content/plugins/core/skills/agileflow-adr/references/madr-format-guide.md +86 -0
  236. package/content/plugins/core/skills/agileflow-adr/workflows/write-adr.md +57 -0
  237. package/content/plugins/core/skills/agileflow-babysit-mentor/SKILL.md +94 -27
  238. package/content/plugins/core/skills/agileflow-babysit-mentor/references/mentor-decision-guide.md +81 -0
  239. package/content/plugins/core/skills/agileflow-babysit-mentor/workflows/mentor-session.md +79 -0
  240. package/content/plugins/core/skills/agileflow-epic-planner/SKILL.md +37 -7
  241. package/content/plugins/core/skills/agileflow-epic-planner/references/epic-sizing-guide.md +81 -0
  242. package/content/plugins/core/skills/agileflow-epic-planner/workflows/plan-epic.md +55 -0
  243. package/content/plugins/core/skills/agileflow-status-updater/SKILL.md +36 -20
  244. package/content/plugins/core/skills/agileflow-status-updater/references/status-transitions.md +89 -0
  245. package/content/plugins/core/skills/agileflow-status-updater/workflows/update-status.md +56 -0
  246. package/content/plugins/core/skills/agileflow-story-writer/SKILL.md +39 -114
  247. package/content/plugins/core/skills/agileflow-story-writer/references/estimation-reference.md +36 -0
  248. package/content/plugins/core/skills/agileflow-story-writer/references/story-template.md +92 -0
  249. package/content/plugins/core/skills/agileflow-story-writer/workflows/write-story.md +138 -0
  250. package/content/plugins/council/agents/council-advocate.md +223 -0
  251. package/content/plugins/council/agents/council-analyst.md +278 -0
  252. package/content/plugins/council/agents/council-compounder.md +204 -0
  253. package/content/plugins/council/agents/council-contrarian.md +217 -0
  254. package/content/plugins/council/agents/council-moonshot.md +217 -0
  255. package/content/plugins/council/agents/council-optimist.md +185 -0
  256. package/content/plugins/council/agents/council-revenue.md +200 -0
  257. package/content/plugins/council/agents/council-technical.md +218 -0
  258. package/content/plugins/council/agents/multi-expert.md +334 -0
  259. package/content/plugins/council/commands/council.md +631 -0
  260. package/content/plugins/council/commands/multi-expert.md +465 -0
  261. package/content/plugins/council/plugin.yaml +28 -4
  262. package/content/plugins/council/skills/agileflow-council/SKILL.md +102 -0
  263. package/content/plugins/council/skills/agileflow-council/references/decision-log-template.md +109 -0
  264. package/content/plugins/council/skills/agileflow-council/references/perspective-guide.md +104 -0
  265. package/content/plugins/council/skills/agileflow-council/references/when-to-convene-guide.md +112 -0
  266. package/content/plugins/council/skills/agileflow-council/workflows/convene.md +73 -0
  267. package/content/plugins/council/skills/agileflow-council/workflows/multi-expert.md +75 -0
  268. package/content/plugins/database/plugin.yaml +15 -0
  269. package/content/plugins/database/skills/agileflow-database/SKILL.md +284 -0
  270. package/content/plugins/database/skills/agileflow-database/references/indexing-guide.md +313 -0
  271. package/content/plugins/database/skills/agileflow-database/references/migration-guide.md +328 -0
  272. package/content/plugins/database/skills/agileflow-database/references/schema-design-guide.md +467 -0
  273. package/content/plugins/database/skills/agileflow-database/workflows/design-schema.md +213 -0
  274. package/content/plugins/database/skills/agileflow-database/workflows/optimize-query.md +253 -0
  275. package/content/plugins/debugging/plugin.yaml +15 -0
  276. package/content/plugins/debugging/skills/agileflow-debug/SKILL.md +236 -0
  277. package/content/plugins/debugging/skills/agileflow-debug/references/common-patterns.md +350 -0
  278. package/content/plugins/debugging/skills/agileflow-debug/references/debugging-strategies.md +328 -0
  279. package/content/plugins/debugging/skills/agileflow-debug/workflows/debug-issue.md +187 -0
  280. package/content/plugins/debugging/skills/agileflow-debug/workflows/reproduce-bug.md +194 -0
  281. package/content/plugins/delivery/agents/ci.md +547 -0
  282. package/content/plugins/delivery/agents/devops.md +789 -0
  283. package/content/plugins/delivery/commands/changelog.md +634 -0
  284. package/content/plugins/delivery/commands/ci.md +344 -0
  285. package/content/plugins/delivery/commands/deploy.md +907 -0
  286. package/content/plugins/delivery/commands/deps.md +758 -0
  287. package/content/plugins/delivery/commands/packages.md +577 -0
  288. package/content/plugins/delivery/commands/pr.md +346 -0
  289. package/content/plugins/delivery/commands/sprint.md +739 -0
  290. package/content/plugins/delivery/plugin.yaml +34 -0
  291. package/content/plugins/delivery/skills/agileflow-delivery/SKILL.md +111 -0
  292. package/content/plugins/delivery/skills/agileflow-delivery/references/changelog-format-guide.md +133 -0
  293. package/content/plugins/delivery/skills/agileflow-delivery/references/ci-pipeline-guide.md +158 -0
  294. package/content/plugins/delivery/skills/agileflow-delivery/references/pr-checklist-guide.md +133 -0
  295. package/content/plugins/delivery/skills/agileflow-delivery/references/release-checklist.md +142 -0
  296. package/content/plugins/delivery/skills/agileflow-delivery/workflows/changelog.md +72 -0
  297. package/content/plugins/delivery/skills/agileflow-delivery/workflows/deploy.md +74 -0
  298. package/content/plugins/delivery/skills/agileflow-delivery/workflows/pr.md +75 -0
  299. package/content/plugins/docs/agents/documentation.md +544 -0
  300. package/content/plugins/docs/agents/readme-updater.md +640 -0
  301. package/content/plugins/docs/commands/docs.md +496 -0
  302. package/content/plugins/docs/commands/learn/explain.md +126 -0
  303. package/content/plugins/docs/commands/learn/glossary.md +140 -0
  304. package/content/plugins/docs/commands/learn/patterns.md +143 -0
  305. package/content/plugins/docs/commands/learn/tour.md +134 -0
  306. package/content/plugins/docs/commands/learn.md +28 -0
  307. package/content/plugins/docs/commands/readme-sync.md +347 -0
  308. package/content/plugins/docs/commands/skill/list.md +149 -0
  309. package/content/plugins/docs/commands/skill/recommend.md +226 -0
  310. package/content/plugins/docs/plugin.yaml +38 -0
  311. package/content/plugins/docs/skills/agileflow-docs/SKILL.md +106 -0
  312. package/content/plugins/docs/skills/agileflow-docs/references/api-doc-template.md +167 -0
  313. package/content/plugins/docs/skills/agileflow-docs/references/doc-types-guide.md +141 -0
  314. package/content/plugins/docs/skills/agileflow-docs/references/readme-template.md +156 -0
  315. package/content/plugins/docs/skills/agileflow-docs/workflows/readme-sync.md +57 -0
  316. package/content/plugins/docs/skills/agileflow-docs/workflows/sync.md +64 -0
  317. package/content/plugins/engineering/agents/api.md +718 -0
  318. package/content/plugins/engineering/agents/codebase-query.md +285 -0
  319. package/content/plugins/engineering/agents/compliance.md +559 -0
  320. package/content/plugins/engineering/agents/database.md +644 -0
  321. package/content/plugins/engineering/agents/integrations.md +644 -0
  322. package/content/plugins/engineering/agents/mobile.md +552 -0
  323. package/content/plugins/engineering/agents/monitoring.md +585 -0
  324. package/content/plugins/engineering/agents/performance.md +529 -0
  325. package/content/plugins/engineering/agents/refactor.md +592 -0
  326. package/content/plugins/engineering/agents/security.md +524 -0
  327. package/content/plugins/engineering/agents/ui.md +1336 -0
  328. package/content/plugins/engineering/plugin.yaml +38 -0
  329. package/content/plugins/engineering/skills/agileflow-engineering/SKILL.md +127 -0
  330. package/content/plugins/engineering/skills/agileflow-engineering/references/code-review-guide.md +126 -0
  331. package/content/plugins/engineering/skills/agileflow-engineering/references/domain-routing-guide.md +89 -0
  332. package/content/plugins/engineering/skills/agileflow-engineering/references/refactoring-guide.md +136 -0
  333. package/content/plugins/engineering/skills/agileflow-engineering/workflows/diagnose.md +63 -0
  334. package/content/plugins/engineering/skills/agileflow-engineering/workflows/impact.md +60 -0
  335. package/content/plugins/ideation/agents/brainstorm-analyzer-features.md +179 -0
  336. package/content/plugins/ideation/agents/brainstorm-analyzer-growth.md +169 -0
  337. package/content/plugins/ideation/agents/brainstorm-analyzer-integration.md +181 -0
  338. package/content/plugins/ideation/agents/brainstorm-analyzer-market.md +150 -0
  339. package/content/plugins/ideation/agents/brainstorm-analyzer-ux.md +180 -0
  340. package/content/plugins/ideation/agents/brainstorm-consensus.md +245 -0
  341. package/content/plugins/ideation/agents/design.md +568 -0
  342. package/content/plugins/ideation/agents/product.md +582 -0
  343. package/content/plugins/ideation/commands/ideate/brief.md +392 -0
  344. package/content/plugins/ideation/commands/ideate/discover.md +423 -0
  345. package/content/plugins/ideation/commands/ideate/features.md +509 -0
  346. package/content/plugins/ideation/commands/ideate/history.md +408 -0
  347. package/content/plugins/ideation/commands/ideate/new.md +940 -0
  348. package/content/plugins/ideation/commands/ideate.md +29 -0
  349. package/content/plugins/ideation/plugin.yaml +44 -0
  350. package/content/plugins/ideation/skills/agileflow-ideation/SKILL.md +109 -0
  351. package/content/plugins/ideation/skills/agileflow-ideation/references/brainstorm-techniques.md +138 -0
  352. package/content/plugins/ideation/skills/agileflow-ideation/references/competitive-analysis-template.md +148 -0
  353. package/content/plugins/ideation/skills/agileflow-ideation/references/feature-prioritization-guide.md +147 -0
  354. package/content/plugins/ideation/skills/agileflow-ideation/references/user-story-patterns.md +152 -0
  355. package/content/plugins/ideation/skills/agileflow-ideation/workflows/features.md +65 -0
  356. package/content/plugins/ideation/skills/agileflow-ideation/workflows/ideate.md +54 -0
  357. package/content/plugins/migration/agents/datamigration.md +757 -0
  358. package/content/plugins/migration/commands/migrate/codemods.md +154 -0
  359. package/content/plugins/migration/commands/migrate/plan.md +140 -0
  360. package/content/plugins/migration/commands/migrate/scan.md +121 -0
  361. package/content/plugins/migration/commands/migrate/validate.md +123 -0
  362. package/content/plugins/migration/commands/migrate.md +28 -0
  363. package/content/plugins/migration/plugin.yaml +28 -0
  364. package/content/plugins/migration/skills/agileflow-migration/SKILL.md +106 -0
  365. package/content/plugins/migration/skills/agileflow-migration/references/data-validation-checklist.md +154 -0
  366. package/content/plugins/migration/skills/agileflow-migration/references/migration-patterns.md +209 -0
  367. package/content/plugins/migration/skills/agileflow-migration/references/rollback-playbook.md +171 -0
  368. package/content/plugins/migration/skills/agileflow-migration/references/version-compatibility-matrix.md +155 -0
  369. package/content/plugins/migration/skills/agileflow-migration/workflows/plan.md +73 -0
  370. package/content/plugins/migration/skills/agileflow-migration/workflows/validate.md +71 -0
  371. package/content/plugins/performance/plugin.yaml +15 -0
  372. package/content/plugins/performance/skills/agileflow-performance/SKILL.md +224 -0
  373. package/content/plugins/performance/skills/agileflow-performance/references/optimization-patterns.md +554 -0
  374. package/content/plugins/performance/skills/agileflow-performance/references/profiling-guide.md +383 -0
  375. package/content/plugins/performance/skills/agileflow-performance/references/web-vitals-guide.md +360 -0
  376. package/content/plugins/performance/skills/agileflow-performance/workflows/improve-web-vitals.md +344 -0
  377. package/content/plugins/performance/skills/agileflow-performance/workflows/profile-and-fix.md +254 -0
  378. package/content/plugins/planning/agents/analytics.md +670 -0
  379. package/content/plugins/planning/agents/rlm-subcore.md +215 -0
  380. package/content/plugins/planning/commands/api.md +281 -0
  381. package/content/plugins/planning/commands/automate.md +432 -0
  382. package/content/plugins/planning/commands/diagnose.md +418 -0
  383. package/content/plugins/planning/commands/export.md +243 -0
  384. package/content/plugins/planning/commands/feedback.md +680 -0
  385. package/content/plugins/planning/commands/impact.md +443 -0
  386. package/content/plugins/planning/commands/metrics.md +891 -0
  387. package/content/plugins/planning/commands/rlm.md +461 -0
  388. package/content/plugins/planning/commands/roadmap/analyze.md +416 -0
  389. package/content/plugins/planning/commands/rpi.md +665 -0
  390. package/content/plugins/planning/commands/velocity.md +657 -0
  391. package/content/plugins/planning/plugin.yaml +42 -0
  392. package/content/plugins/planning/skills/agileflow-planning/SKILL.md +111 -0
  393. package/content/plugins/planning/skills/agileflow-planning/references/estimation-guide.md +114 -0
  394. package/content/plugins/planning/skills/agileflow-planning/references/rpi-workflow.md +119 -0
  395. package/content/plugins/planning/skills/agileflow-planning/references/sprint-planning-guide.md +145 -0
  396. package/content/plugins/planning/skills/agileflow-planning/workflows/impact.md +63 -0
  397. package/content/plugins/planning/skills/agileflow-planning/workflows/rpi.md +104 -0
  398. package/content/plugins/psychology/plugin.yaml +15 -0
  399. package/content/plugins/psychology/skills/agileflow-retention/SKILL.md +252 -0
  400. package/content/plugins/psychology/skills/agileflow-retention/references/competitor-analysis.md +240 -0
  401. package/content/plugins/psychology/skills/agileflow-retention/references/psychology-models.md +349 -0
  402. package/content/plugins/psychology/skills/agileflow-retention/references/retention-patterns.md +279 -0
  403. package/content/plugins/psychology/skills/agileflow-retention/workflows/design-retention-feature.md +287 -0
  404. package/content/plugins/psychology/skills/agileflow-retention/workflows/retention-audit.md +259 -0
  405. package/content/plugins/refactoring/plugin.yaml +15 -0
  406. package/content/plugins/refactoring/skills/agileflow-refactor/SKILL.md +235 -0
  407. package/content/plugins/refactoring/skills/agileflow-refactor/references/refactoring-patterns.md +405 -0
  408. package/content/plugins/refactoring/skills/agileflow-refactor/references/safety-checks.md +177 -0
  409. package/content/plugins/refactoring/skills/agileflow-refactor/workflows/extract-module.md +226 -0
  410. package/content/plugins/refactoring/skills/agileflow-refactor/workflows/safe-refactor.md +169 -0
  411. package/content/plugins/research/agents/research.md +503 -0
  412. package/content/plugins/research/commands/research/analyze.md +810 -0
  413. package/content/plugins/research/commands/research/ask.md +885 -0
  414. package/content/plugins/research/commands/research/import.md +1039 -0
  415. package/content/plugins/research/commands/research/list.md +272 -0
  416. package/content/plugins/research/commands/research/synthesize.md +943 -0
  417. package/content/plugins/research/commands/research/view.md +326 -0
  418. package/content/plugins/research/commands/skill/research.md +278 -0
  419. package/content/plugins/research/plugin.yaml +32 -0
  420. package/content/plugins/research/skills/agileflow-research/SKILL.md +110 -0
  421. package/content/plugins/research/skills/agileflow-research/references/knowledge-decay-guide.md +121 -0
  422. package/content/plugins/research/skills/agileflow-research/references/research-prompt-guide.md +141 -0
  423. package/content/plugins/research/skills/agileflow-research/references/synthesis-template.md +154 -0
  424. package/content/plugins/research/skills/agileflow-research/workflows/analyze.md +60 -0
  425. package/content/plugins/research/skills/agileflow-research/workflows/ask.md +64 -0
  426. package/content/plugins/research/skills/agileflow-research/workflows/import.md +66 -0
  427. package/content/plugins/research/skills/agileflow-research/workflows/synthesize.md +66 -0
  428. package/content/plugins/reviews/plugin.yaml +15 -0
  429. package/content/plugins/reviews/skills/agileflow-pr-reviewer/SKILL.md +241 -0
  430. package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/review-checklist.md +200 -0
  431. package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/security-patterns.md +328 -0
  432. package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/review-pr.md +153 -0
  433. package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/security-review.md +177 -0
  434. package/content/plugins/seo/agents/seo-analyzer-content.md +169 -0
  435. package/content/plugins/seo/agents/seo-analyzer-images.md +198 -0
  436. package/content/plugins/seo/agents/seo-analyzer-performance.md +217 -0
  437. package/content/plugins/seo/agents/seo-analyzer-schema.md +184 -0
  438. package/content/plugins/seo/agents/seo-analyzer-sitemap.md +177 -0
  439. package/content/plugins/seo/agents/seo-analyzer-technical.md +151 -0
  440. package/content/plugins/seo/agents/seo-consensus.md +304 -0
  441. package/content/plugins/seo/commands/seo/audit.md +454 -0
  442. package/content/plugins/seo/commands/seo/competitor.md +183 -0
  443. package/content/plugins/seo/commands/seo/content.md +127 -0
  444. package/content/plugins/seo/commands/seo/geo.md +236 -0
  445. package/content/plugins/seo/commands/seo/hreflang.md +144 -0
  446. package/content/plugins/seo/commands/seo/images.md +116 -0
  447. package/content/plugins/seo/commands/seo/page.md +206 -0
  448. package/content/plugins/seo/commands/seo/plan.md +176 -0
  449. package/content/plugins/seo/commands/seo/programmatic.md +135 -0
  450. package/content/plugins/seo/commands/seo/references/cwv-thresholds.md +64 -0
  451. package/content/plugins/seo/commands/seo/references/eeat-framework.md +110 -0
  452. package/content/plugins/seo/commands/seo/references/quality-gates.md +96 -0
  453. package/content/plugins/seo/commands/seo/references/schema-types.md +102 -0
  454. package/content/plugins/seo/commands/seo/schema.md +194 -0
  455. package/content/plugins/seo/commands/seo/sitemap.md +99 -0
  456. package/content/plugins/seo/commands/seo/technical.md +120 -0
  457. package/content/plugins/seo/commands/seo.md +109 -0
  458. package/content/plugins/seo/plugin.yaml +54 -4
  459. package/content/plugins/seo/skills/agileflow-seo/SKILL.md +188 -0
  460. package/content/plugins/seo/skills/agileflow-seo/references/cwv-thresholds.md +110 -0
  461. package/content/plugins/seo/skills/agileflow-seo/references/eeat-framework.md +144 -0
  462. package/content/plugins/seo/skills/agileflow-seo/references/keyword-research-guide.md +125 -0
  463. package/content/plugins/seo/skills/agileflow-seo/references/schema-types.md +139 -0
  464. package/content/plugins/seo/skills/agileflow-seo/references/technical-seo-checklist.md +139 -0
  465. package/content/plugins/seo/skills/agileflow-seo/workflows/audit.md +62 -0
  466. package/content/plugins/seo/skills/agileflow-seo/workflows/page.md +101 -0
  467. package/content/plugins/testing/plugin.yaml +17 -0
  468. package/content/plugins/testing/skills/agileflow-test-writer/SKILL.md +260 -0
  469. package/content/plugins/testing/skills/agileflow-test-writer/references/coverage-targets.md +239 -0
  470. package/content/plugins/testing/skills/agileflow-test-writer/references/test-patterns.md +420 -0
  471. package/content/plugins/testing/skills/agileflow-test-writer/workflows/add-coverage.md +154 -0
  472. package/content/plugins/testing/skills/agileflow-test-writer/workflows/write-tests-from-ac.md +225 -0
  473. package/package.json +3 -1
  474. package/src/cli/commands/doctor.js +177 -29
  475. package/src/cli/commands/hook.js +7 -7
  476. package/src/cli/commands/learn.js +134 -0
  477. package/src/cli/commands/plugins.js +109 -0
  478. package/src/cli/commands/setup.js +203 -44
  479. package/src/cli/commands/skills.js +308 -0
  480. package/src/cli/commands/status.js +8 -10
  481. package/src/cli/commands/update.js +50 -5
  482. package/src/cli/index.js +77 -26
  483. package/src/cli/wizard/babysit-mode-picker-clean.js +192 -0
  484. package/src/cli/wizard/babysit-mode-picker.js +219 -0
  485. package/src/cli/wizard/behaviors-picker-clean.js +127 -0
  486. package/src/cli/wizard/behaviors-picker.js +208 -54
  487. package/src/cli/wizard/ide-picker.js +40 -28
  488. package/src/cli/wizard/install-scope-picker.js +57 -0
  489. package/src/cli/wizard/learnings-picker.js +40 -0
  490. package/src/cli/wizard/plugin-picker.js +29 -11
  491. package/src/lib/brand.js +116 -0
  492. package/src/runtime/config/defaults.js +22 -17
  493. package/src/runtime/config/loader.js +77 -8
  494. package/src/runtime/config/schema.json +43 -16
  495. package/src/runtime/config/writer.js +3 -1
  496. package/src/runtime/ide/babysit-skill.js +202 -0
  497. package/src/runtime/ide/capabilities.js +84 -29
  498. package/src/runtime/ide/claude-code-content.js +177 -0
  499. package/src/runtime/ide/claude-code-settings.js +50 -26
  500. package/src/runtime/ide/claude-code-skills.js +47 -32
  501. package/src/runtime/ide/codex-config.js +296 -0
  502. package/src/runtime/installer/install.js +175 -24
  503. package/src/runtime/skills/learnings.js +306 -0
  504. package/content/plugins/core/hooks/babysit-mentor-injector.js +0 -55
  505. package/src/cli/wizard/personalization.js +0 -64
@@ -0,0 +1,344 @@
1
+ # Workflow: Improve Core Web Vitals
2
+
3
+ **Triggers:** "Lighthouse score is failing", "CWV is red in Search Console", "LCP is too slow", "CLS keeps shifting", "INP is failing", user pastes a Lighthouse report or CrUX data
4
+
5
+ **Goal:** Identify which Core Web Vital is failing, diagnose the root cause using attribution data, apply targeted fixes, and verify improvement in field data — not just lab scores.
6
+
7
+ ---
8
+
9
+ ## Inputs needed
10
+
11
+ | Input | Required | How to get it |
12
+ | ----------------------------------------- | --------- | ------------------------------------------------------------ |
13
+ | Which metric is failing (LCP / INP / CLS) | Yes | Lighthouse report, CrUX data, Search Console, or user report |
14
+ | Current metric value | Yes | From any of the above sources |
15
+ | URL or page type | Yes | The specific page (homepage, product page, checkout, etc.) |
16
+ | Tech stack | Preferred | Knowing React/Next.js vs plain HTML changes the fix approach |
17
+ | Lighthouse report (full JSON or HTML) | Preferred | Paste or share — provides the "Opportunities" section |
18
+
19
+ ---
20
+
21
+ ## Steps
22
+
23
+ ### Step 1: Run Lighthouse and record the baseline
24
+
25
+ If the user does not already have a report:
26
+
27
+ ```bash
28
+ # Run 3 times and take the median — Lighthouse has ±15% variance
29
+ npx lighthouse https://yoursite.com/page --output=json --output-path=report.json --chrome-flags="--headless"
30
+
31
+ # Or for a quick score check:
32
+ npx lighthouse https://yoursite.com/page --output=html --view
33
+ ```
34
+
35
+ **Record the baseline values for all three Core Web Vitals:**
36
+
37
+ ```
38
+ Baseline (date):
39
+ LCP: ___ s (good < 2.5 s)
40
+ INP: ___ ms (good < 200 ms)
41
+ CLS: ___ (good < 0.1)
42
+ TTFB: ___ ms
43
+ FCP: ___ s
44
+ ```
45
+
46
+ Note: Lighthouse INP is not reliable in lab mode — use Chrome DevTools Performance → "Interaction to Next Paint" or field data from CrUX/RUM for INP diagnosis.
47
+
48
+ ### Step 2: Identify the failing metric
49
+
50
+ **Triage by severity** — fix the worst metric first, but be aware that some fixes affect multiple metrics.
51
+
52
+ ```
53
+ Is LCP > 2.5 s? → Follow §LCP Diagnosis
54
+ Is INP > 200 ms? → Follow §INP Diagnosis
55
+ Is CLS > 0.1? → Follow §CLS Diagnosis
56
+ All three failing? → Start with LCP (loading is usually the root cause)
57
+ ```
58
+
59
+ ---
60
+
61
+ ### LCP Diagnosis
62
+
63
+ **Step LCP-1: Identify the LCP element**
64
+
65
+ In Chrome DevTools, look for the "LCP" marker in the Performance recording. Or run:
66
+
67
+ ```js
68
+ // Paste in DevTools console
69
+ new PerformanceObserver((list) => {
70
+ for (const entry of list.getEntries()) {
71
+ console.log("LCP element:", entry.element);
72
+ console.log("LCP time:", entry.startTime);
73
+ }
74
+ }).observe({ type: "largest-contentful-paint", buffered: true });
75
+ ```
76
+
77
+ **Step LCP-2: Decompose LCP time into phases**
78
+
79
+ ```js
80
+ import { onLCP } from "web-vitals/attribution";
81
+
82
+ onLCP(({ value, attribution }) => {
83
+ const {
84
+ timeToFirstByte,
85
+ resourceLoadDelay,
86
+ resourceLoadDuration,
87
+ elementRenderDelay,
88
+ } = attribution;
89
+ console.table({
90
+ timeToFirstByte,
91
+ resourceLoadDelay,
92
+ resourceLoadDuration,
93
+ elementRenderDelay,
94
+ });
95
+ });
96
+ ```
97
+
98
+ | Phase | High value means... | Fix |
99
+ | ---------------------- | ----------------------------------------------------------------------- | ----------------------------------------------- |
100
+ | `timeToFirstByte` | Server is slow; CDN is not being used; origin is far from user | CDN, edge caching, SSR optimization |
101
+ | `resourceLoadDelay` | LCP resource not discovered early; preload not set; lazy-load blocking | `<link rel="preload">`, remove `loading="lazy"` |
102
+ | `resourceLoadDuration` | Resource is too large; connection is slow | Image optimization, compression, CDN |
103
+ | `elementRenderDelay` | Render-blocking resource; JavaScript blocking paint; hydration blocking | Defer scripts, eliminate blocking resources |
104
+
105
+ **Step LCP-3: Apply the fix for the dominant phase**
106
+
107
+ See `references/web-vitals-guide.md` §LCP and `references/optimization-patterns.md` §Image optimization for implementation details.
108
+
109
+ **Most common LCP fixes (in order of impact):**
110
+
111
+ 1. Preload the LCP image: `<link rel="preload" as="image" href="..." fetchpriority="high">`
112
+ 2. Remove `loading="lazy"` from the LCP image
113
+ 3. Convert the LCP image to WebP/AVIF and compress it
114
+ 4. Move the LCP image to static HTML (out of JavaScript rendering)
115
+ 5. Add a CDN or improve TTFB if `timeToFirstByte` > 600 ms
116
+ 6. Eliminate render-blocking `<script>` and `<link>` tags above the LCP element
117
+
118
+ ---
119
+
120
+ ### INP Diagnosis
121
+
122
+ **Note on lab vs field:** Lighthouse lab INP is unreliable because it simulates a single interaction. Use field data (CrUX or your RUM `web-vitals` instrumentation) to confirm INP is actually a problem in production. In DevTools, use the INP overlay.
123
+
124
+ **Step INP-1: Find the slow interaction**
125
+
126
+ ```js
127
+ import { onINP } from "web-vitals/attribution";
128
+
129
+ onINP(({ value, attribution }) => {
130
+ const {
131
+ interactionTarget,
132
+ inputDelay,
133
+ processingDuration,
134
+ presentationDelay,
135
+ interactionType,
136
+ } = attribution;
137
+ console.log(`INP: ${value}ms`);
138
+ console.log(`Target: ${interactionTarget}`);
139
+ console.log(`Type: ${interactionType}`);
140
+ console.table({ inputDelay, processingDuration, presentationDelay });
141
+ });
142
+ ```
143
+
144
+ **Step INP-2: Identify which phase dominates**
145
+
146
+ | Phase | High value means... | Fix |
147
+ | -------------------- | ----------------------------------------------------------------- | ------------------------------------------------ |
148
+ | `inputDelay` | Another long task was running when the user interacted | Break up long tasks with `scheduler.yield()` |
149
+ | `processingDuration` | The event handler itself is slow | Optimize the handler; move work to a web worker |
150
+ | `presentationDelay` | The browser took a long time to paint after the handler completed | Reduce DOM size; avoid forced synchronous layout |
151
+
152
+ **Step INP-3: Profile the slow interaction**
153
+
154
+ 1. Open Chrome DevTools → Performance
155
+ 2. Click "Record", perform the slow interaction, stop
156
+ 3. Find the "Interaction" track — click the INP interaction bar
157
+ 4. In the Summary panel, note the three phases
158
+ 5. Find the longest task in "Main" during the processing phase
159
+ 6. Click into the flame chart to find the slow function
160
+
161
+ **Step INP-4: Apply the fix**
162
+
163
+ - Long task in `inputDelay`: find what was running before the interaction — use `scheduler.yield()` to break it up
164
+ - Long event handler: profile it with the flame chart; look for synchronous loops, heavy DOM manipulation, or synchronous network calls
165
+ - High `presentationDelay`: check DOM node count (> 1500 nodes is a warning sign); look for layout-triggering reads after writes
166
+
167
+ ---
168
+
169
+ ### CLS Diagnosis
170
+
171
+ **Step CLS-1: Identify what is shifting**
172
+
173
+ ```js
174
+ import { onCLS } from "web-vitals/attribution";
175
+
176
+ onCLS(({ value, attribution }) => {
177
+ console.log(`CLS: ${value}`);
178
+ if (attribution.largestShiftTarget) {
179
+ console.log("Largest shift target:", attribution.largestShiftTarget);
180
+ console.log("Largest shift value:", attribution.largestShiftEntry?.value);
181
+ console.log(
182
+ "Largest shift time:",
183
+ attribution.largestShiftEntry?.startTime,
184
+ );
185
+ }
186
+ });
187
+ ```
188
+
189
+ Or in Chrome DevTools:
190
+
191
+ 1. Open DevTools → Rendering tab → check "Layout Shift Regions" (highlights shifting elements with blue overlay)
192
+ 2. Reload the page and watch which elements flash blue
193
+
194
+ **Step CLS-2: Determine the cause of the shift**
195
+
196
+ | Observation | Cause | Fix |
197
+ | ----------------------------------------- | --------------------------------------- | ----------------------------------------------------------- |
198
+ | Shift happens immediately on load | Image without width/height | Add explicit `width` and `height` attributes |
199
+ | Shift happens 1–3 s after load | Ad or embed loading | Reserve space with `min-height` |
200
+ | Shift happens when user scrolls | Lazy-loaded image without dimensions | Add dimensions; or use `aspect-ratio` in CSS |
201
+ | Shift happens when content appears at top | Dynamic content injected above fold | Inject below existing content; use fixed/sticky positioning |
202
+ | Shift happens when font loads | Font swap (FOUT) | Use `font-display: optional` or size-adjust |
203
+ | Shift is triggered by a user interaction | Not counted in CLS — this is acceptable | No fix needed |
204
+
205
+ **Step CLS-3: Apply the fix**
206
+
207
+ See `references/web-vitals-guide.md` §CLS for implementation details.
208
+
209
+ **Most common CLS fixes:**
210
+
211
+ 1. Add `width` and `height` to all `<img>` tags (or `aspect-ratio` in CSS)
212
+ 2. Add `min-height` to ad slots and dynamic content containers
213
+ 3. Use `font-display: optional` for web fonts
214
+ 4. Switch layout animations from `margin`/`top`/`height` to `transform: translate()`
215
+ 5. Reserve space for late-loading embeds (Twitter, YouTube, maps)
216
+
217
+ ---
218
+
219
+ ### Step 3: Verify the fix in the lab
220
+
221
+ After applying the fix:
222
+
223
+ ```bash
224
+ # Run Lighthouse 3 times, take the median
225
+ npx lighthouse https://yoursite.com/page --output=json --chrome-flags="--headless"
226
+ ```
227
+
228
+ Record the after values:
229
+
230
+ ```
231
+ After fix (date):
232
+ LCP: ___ s (Δ: ___ s, ___%)
233
+ INP: ___ ms (Δ: ___ ms, ___%)
234
+ CLS: ___ (Δ: ___, ___%)
235
+ ```
236
+
237
+ If the metric did not improve by more than 10%, the fix did not address the root cause. Go back to Step 2.
238
+
239
+ ### Step 4: Verify in field data
240
+
241
+ Lab scores and field scores can diverge by 50% or more. **Do not declare the problem solved until field data confirms it.**
242
+
243
+ **How to check field data:**
244
+
245
+ 1. **Google Search Console** → Core Web Vitals report — shows pass/fail by URL group. Updates weekly with a 28-day rolling window.
246
+
247
+ 2. **PageSpeed Insights** (https://pagespeed.web.dev) — shows both lab (Lighthouse) and field (CrUX) data for any public URL.
248
+
249
+ 3. **CrUX Dashboard** in Looker Studio — month-by-month breakdown by form factor.
250
+
251
+ 4. **Your own RUM** using the `web-vitals` library:
252
+
253
+ ```js
254
+ import { onLCP, onINP, onCLS } from "web-vitals";
255
+
256
+ function sendToAnalytics(metric) {
257
+ navigator.sendBeacon(
258
+ "/analytics",
259
+ JSON.stringify({
260
+ name: metric.name,
261
+ value: metric.value,
262
+ rating: metric.rating, // 'good', 'needs-improvement', 'poor'
263
+ id: metric.id,
264
+ page: location.pathname,
265
+ }),
266
+ );
267
+ }
268
+
269
+ onLCP(sendToAnalytics);
270
+ onINP(sendToAnalytics);
271
+ onCLS(sendToAnalytics);
272
+ ```
273
+
274
+ **Timeline expectation:** CrUX field data has a 28-day rolling window. A fix deployed today will be fully reflected in CrUX in ~28 days. Your own RUM shows improvement immediately.
275
+
276
+ ### Step 5: Prevent regression
277
+
278
+ After a successful fix, add a performance budget to CI to catch regressions automatically:
279
+
280
+ **Lighthouse CI budget:**
281
+
282
+ ```json
283
+ // lighthouserc.json
284
+ {
285
+ "ci": {
286
+ "assert": {
287
+ "assertions": {
288
+ "largest-contentful-paint": ["error", { "maxNumericValue": 2500 }],
289
+ "cumulative-layout-shift": ["error", { "maxNumericValue": 0.1 }],
290
+ "total-blocking-time": ["warn", { "maxNumericValue": 200 }]
291
+ }
292
+ }
293
+ }
294
+ }
295
+ ```
296
+
297
+ ```yaml
298
+ # .github/workflows/lighthouse.yml
299
+ - name: Run Lighthouse CI
300
+ run: npx lhci autorun
301
+ env:
302
+ LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}
303
+ ```
304
+
305
+ ### Step 6: Next steps
306
+
307
+ ```xml
308
+ <invoke name="AskUserQuestion">
309
+ <parameter name="questions">[{
310
+ "question": "Lab metrics are improved. What would you like to do next?",
311
+ "header": "Next step",
312
+ "multiSelect": false,
313
+ "options": [
314
+ {"label": "Set up RUM to monitor field data (Recommended)", "description": "Add the web-vitals library to collect real user metrics and send them to your analytics backend"},
315
+ {"label": "Add Lighthouse CI to prevent regression", "description": "Configure @lhci/cli in GitHub Actions to fail PRs that regress performance"},
316
+ {"label": "Investigate another failing metric", "description": "I can walk through LCP, INP, or CLS diagnosis for a different page or metric"},
317
+ {"label": "Check field data now", "description": "I'll show you how to read PageSpeed Insights or your Search Console CWV report"},
318
+ {"label": "Done for now", "description": "Field data will update in CrUX over the next 28 days"}
319
+ ]
320
+ }]</parameter>
321
+ </invoke>
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Fallbacks
327
+
328
+ **If AskUserQuestion is unavailable:**
329
+
330
+ ```
331
+ Core Web Vitals investigation complete.
332
+
333
+ Failing metric identified: LCP = 4.2 s (target: < 2.5 s)
334
+ Root cause: Hero image not preloaded; browser discovers it 2.1 s into page load
335
+ Fix applied: Added <link rel="preload" as="image" fetchpriority="high">; removed loading="lazy"; converted to WebP
336
+ Lab result: LCP = 1.9 s (-55%)
337
+
338
+ Next steps:
339
+ 1. Verify in field data: check PageSpeed Insights or Search Console CWV (28-day lag)
340
+ 2. Prevent regression: add Lighthouse CI budget (maxNumericValue: 2500 for LCP)
341
+ 3. Set up web-vitals RUM for real-time field monitoring
342
+
343
+ Reply with a step number to continue, or describe the next issue.
344
+ ```
@@ -0,0 +1,254 @@
1
+ # Workflow: Profile and Fix
2
+
3
+ **Triggers:** "this is slow", "the API is timing out", "memory keeps growing", "the query takes forever", user describes lag or jank in any layer of the stack
4
+
5
+ **Goal:** Establish a measurable baseline, identify the actual bottleneck through profiling, apply a targeted fix, and verify the improvement with numbers.
6
+
7
+ ---
8
+
9
+ ## Inputs needed
10
+
11
+ | Input | Required | How to get it |
12
+ | ---------------------------------------------- | --------- | ----------------------------------------------------------------------- |
13
+ | Domain: frontend / backend / database / memory | Yes | Ask if not specified |
14
+ | Description of what is slow | Yes | User description or monitoring alert |
15
+ | Existing profiling data | No | Flame chart, APM trace, slow query log — paste or describe if available |
16
+ | Tech stack (language, framework, DB) | Yes | Read `package.json`, `go.mod`, `pyproject.toml`, or ask |
17
+ | Environment details | Preferred | Production vs staging; estimated traffic volume; hardware specs |
18
+
19
+ ---
20
+
21
+ ## Steps
22
+
23
+ ### Step 1: Establish a baseline
24
+
25
+ **Never skip this step.** Without a before number, you cannot confirm any fix helped.
26
+
27
+ Choose the measurement method for your domain:
28
+
29
+ | Domain | Measurement method |
30
+ | -------- | ------------------------------------------------------------------------------- |
31
+ | Frontend | Lighthouse CLI (3 runs, take median); Chrome DevTools Performance recording |
32
+ | Backend | `wrk` or `autocannon` benchmark against the endpoint; APM p50/p95 from traces |
33
+ | Database | `EXPLAIN (ANALYZE, BUFFERS)` output with actual timing; slow query log entry |
34
+ | Memory | Heap snapshot size at steady state; RSS trend in APM or `process.memoryUsage()` |
35
+
36
+ **Record the baseline:**
37
+
38
+ ```
39
+ Baseline (2026-05-08):
40
+ Metric: LCP / p95 latency / query time / heap size
41
+ Value: [before number]
42
+ Environment: [how measured]
43
+ URL / endpoint / query: [what was measured]
44
+ ```
45
+
46
+ If the user already has baseline data, skip to Step 3.
47
+
48
+ ### Step 2: Identify the bottleneck
49
+
50
+ Load `references/profiling-guide.md` for tool-specific guidance. Quick decision tree:
51
+
52
+ **Frontend — which sub-problem?**
53
+
54
+ ```
55
+ Is Lighthouse LCP > 2.5 s?
56
+ → Is TTFB > 600 ms? → Server / CDN problem (see Step 3 TTFB fixes)
57
+ → Is the LCP image lazy-loaded or discovered late? → Preload fix
58
+ → Is there a render-blocking script or CSS? → Deferral fix
59
+ → Is the LCP image too large? → Image optimization
60
+
61
+ Is INP > 200 ms?
62
+ → Open Chrome DevTools → Performance → record the slow interaction
63
+ → Look for long tasks (red triangles) during the interaction
64
+ → Find the widest bar in the event handler call stack
65
+
66
+ Is CLS > 0.1?
67
+ → Open DevTools → Performance → look for "Layout Shift" events
68
+ → Use web-vitals attribution to find the shifting element
69
+ ```
70
+
71
+ **Backend — which sub-problem?**
72
+
73
+ ```
74
+ Is the endpoint slow on every request?
75
+ → Profile with clinic flame / py-spy / pprof
76
+ → Is CPU high? → Hot function in flame chart → optimize the algorithm
77
+ → Is CPU low but still slow? → I/O wait → check DB queries, external HTTP calls
78
+
79
+ Is it slow only under load?
80
+ → Check connection pool exhaustion (pool size vs concurrent requests)
81
+ → Check event loop lag (clinic bubbleprof for Node.js)
82
+ → Check DB lock contention (pg_locks, SHOW PROCESSLIST for MySQL)
83
+ ```
84
+
85
+ **Database — which sub-problem?**
86
+
87
+ ```
88
+ Run EXPLAIN (ANALYZE, BUFFERS) on the slow query.
89
+ → "Seq Scan" on a large table? → Add an index
90
+ → Many small queries for same table? → N+1 pattern → batch or JOIN
91
+ → "Sort" with "external merge"? → Add index on sort column or increase work_mem
92
+ → Rows estimated vs actual differ wildly? → Run ANALYZE on the table
93
+ ```
94
+
95
+ **Memory — which sub-problem?**
96
+
97
+ ```
98
+ Is heap growing continuously?
99
+ → Take two heap snapshots (before and after the growth period)
100
+ → Compare in Chrome DevTools Memory → "Comparison" view
101
+ → Find the object type with the largest delta
102
+ → Use "Retainers" to find what is keeping it alive
103
+
104
+ Is heap growing only under specific actions?
105
+ → Use "Allocation instrumentation on timeline"
106
+ → Filter by the object type identified above
107
+ → Find the allocation call site in the flame chart
108
+ ```
109
+
110
+ ### Step 3: Form a hypothesis
111
+
112
+ Before changing anything, write down your hypothesis. This forces clarity and makes the result interpretable.
113
+
114
+ ```
115
+ Hypothesis: The LCP is slow because the hero image (620 KB JPEG) is not preloaded
116
+ and the browser discovers it late in the HTML parse.
117
+
118
+ Expected fix: Add <link rel="preload" as="image"> for the hero image.
119
+ Expected improvement: LCP should drop from 4.2 s → ~2.0 s by eliminating
120
+ the ~2 s resource load delay phase.
121
+ ```
122
+
123
+ If you cannot form a specific hypothesis, go back to Step 2 — the bottleneck is not yet identified.
124
+
125
+ ### Step 4: Apply ONE change
126
+
127
+ **Do not apply multiple changes at once.** You will not know which one helped (or hurt).
128
+
129
+ Make the single change implied by your hypothesis. Common targeted changes:
130
+
131
+ **Frontend:**
132
+
133
+ - Add `<link rel="preload" as="image">` for the LCP image
134
+ - Remove `loading="lazy"` from the LCP image
135
+ - Add `defer` to a synchronous `<script>` tag
136
+ - Split a large component into a lazy-loaded chunk
137
+ - Add explicit `width`/`height` to images causing CLS
138
+ - Break up a long task with `scheduler.yield()`
139
+
140
+ **Backend:**
141
+
142
+ - Add caching with Redis for a frequently-read endpoint
143
+ - Move synchronous CPU work to a worker thread
144
+ - Increase the database connection pool size
145
+ - Add `defer`/`async` to non-critical startup tasks
146
+
147
+ **Database:**
148
+
149
+ - Add a covering index on the filtered + selected columns
150
+ - Rewrite a correlated subquery as a JOIN
151
+ - Replace N separate queries with a single batch query
152
+ - Add `LIMIT` to a query that was fetching all rows
153
+
154
+ **Memory:**
155
+
156
+ - Add `removeEventListener` in a component cleanup function
157
+ - Add a TTL to a module-level cache Map
158
+ - Return a cleanup function from a `useEffect`
159
+ - Replace a `setInterval` with a `setTimeout` that reschedules itself with a guard
160
+
161
+ ### Step 5: Measure again
162
+
163
+ Repeat the exact same measurement from Step 1 in the same environment. Record the result.
164
+
165
+ ```
166
+ After fix (2026-05-08):
167
+ Metric: LCP
168
+ Value: [after number]
169
+ Change: [delta and % improvement]
170
+ Environment: [same as baseline]
171
+ ```
172
+
173
+ **Is the improvement real?**
174
+
175
+ - Run Lighthouse at least 3 times and take the median (lab results have ±15% variance)
176
+ - For backend benchmarks, run with the same concurrency and duration as the baseline
177
+ - For database queries, run `EXPLAIN ANALYZE` multiple times (first run may be cold-cache)
178
+
179
+ If the improvement is within noise (< 10%), the change did not help. Revert and re-investigate.
180
+
181
+ ### Step 6: Check for regressions
182
+
183
+ Verify that the fix did not introduce a problem in a related metric:
184
+
185
+ | If you optimized | Also check |
186
+ | ---------------- | --------------------------------------------------------------------------- |
187
+ | LCP | CLS (did preloading change layout?) and INP |
188
+ | INP | TBT and LCP (did breaking up tasks delay the paint?) |
189
+ | CLS | LCP (did reserving space affect element discovery timing?) |
190
+ | Bundle size | App functionality (did tree shaking remove a needed export?) |
191
+ | DB query | Application correctness (does the optimized query return the same results?) |
192
+ | Caching | Data freshness (is staleness now a problem?) |
193
+
194
+ Run the test suite after any code change. A fast but broken feature is not an improvement.
195
+
196
+ ### Step 7: Document the result
197
+
198
+ Add a note to `_learnings/performance.yaml` with the finding. If this was a significant architecture decision (adding Redis, redesigning a query pattern, adding a CDN), create an ADR with `/agileflow:adr`.
199
+
200
+ ```yaml
201
+ # _learnings/performance.yaml entry:
202
+ - date: 2026-05-08
203
+ metric: LCP
204
+ url: /
205
+ before: 4.2s
206
+ after: 1.9s
207
+ change: -55%
208
+ fix: "Preloaded hero image; removed lazy-load; converted to WebP"
209
+ tools_used: Lighthouse CLI
210
+ ```
211
+
212
+ ### Step 8: Present the result and next steps
213
+
214
+ ```xml
215
+ <invoke name="AskUserQuestion">
216
+ <parameter name="questions">[{
217
+ "question": "Fix applied and verified. LCP improved from 4.2 s → 1.9 s (-55%). What next?",
218
+ "header": "Next step",
219
+ "multiSelect": false,
220
+ "options": [
221
+ {"label": "Investigate the next bottleneck (Recommended)", "description": "Lighthouse still flags INP at 320 ms — I can guide you through fixing that next"},
222
+ {"label": "Verify in field data", "description": "I'll show you how to check CrUX or set up web-vitals RUM to confirm this improvement reflects in real user data"},
223
+ {"label": "Create an ADR for this optimization", "description": "Document the decision and rationale for future maintainers"},
224
+ {"label": "Write a benchmark test to lock in this gain", "description": "Add a Lighthouse budget or k6 threshold to CI so this regression is caught automatically"},
225
+ {"label": "Done for now", "description": "Close out the investigation"}
226
+ ]
227
+ }]</parameter>
228
+ </invoke>
229
+ ```
230
+
231
+ ---
232
+
233
+ ## Fallbacks
234
+
235
+ **If AskUserQuestion is unavailable:**
236
+
237
+ Present findings as a numbered summary:
238
+
239
+ ```
240
+ Profiling complete. Here is what was found and fixed:
241
+
242
+ Baseline: LCP = 4.2 s (measured with Lighthouse CLI, median of 3 runs)
243
+ Bottleneck: Hero image (620 KB JPEG) discovered late; no preload; lazy-load attribute present
244
+ Fix applied: Added <link rel="preload">, removed loading="lazy", converted to WebP (190 KB)
245
+ Result: LCP = 1.9 s (-55%)
246
+ No regressions: CLS unchanged at 0.02; INP unchanged at 180 ms; tests pass
247
+
248
+ Suggested next steps:
249
+ 1. Verify improvement in CrUX field data (updates monthly in Search Console)
250
+ 2. Investigate INP — Lighthouse shows 180 ms (passing) but p95 may be higher in the field
251
+ 3. Set up a Lighthouse budget in CI to prevent LCP regression
252
+
253
+ Reply with a number to continue, or describe the next issue to investigate.
254
+ ```