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.
- package/CHANGELOG.md +51 -0
- package/content/plugins/accessibility/plugin.yaml +14 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/SKILL.md +392 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/references/aria-patterns.md +528 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/references/testing-checklist.md +457 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/references/wcag-guide.md +683 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/workflows/audit-page.md +310 -0
- package/content/plugins/accessibility/skills/agileflow-accessibility/workflows/implement-accessible-component.md +479 -0
- package/content/plugins/ads/agents/ads-audit-budget.md +185 -0
- package/content/plugins/ads/agents/ads-audit-compliance.md +171 -0
- package/content/plugins/ads/agents/ads-audit-creative.md +168 -0
- package/content/plugins/ads/agents/ads-audit-google.md +227 -0
- package/content/plugins/ads/agents/ads-audit-meta.md +184 -0
- package/content/plugins/ads/agents/ads-audit-tracking.md +205 -0
- package/content/plugins/ads/agents/ads-consensus.md +410 -0
- package/content/plugins/ads/agents/ads-generate.md +152 -0
- package/content/plugins/ads/agents/ads-performance-tracker.md +212 -0
- package/content/plugins/ads/plugin.yaml +23 -4
- package/content/plugins/ads/skills/agileflow-ads/SKILL.md +218 -0
- package/content/plugins/ads/skills/agileflow-ads/references/ad-copy-formula-guide.md +131 -0
- package/content/plugins/ads/skills/agileflow-ads/references/audience-targeting-guide.md +137 -0
- package/content/plugins/ads/skills/agileflow-ads/references/bid-strategy-guide.md +115 -0
- package/content/plugins/ads/skills/agileflow-ads/references/platform-benchmarks.md +100 -0
- package/content/plugins/ads/skills/agileflow-ads/workflows/audit.md +118 -0
- package/content/plugins/ads/skills/agileflow-ads/workflows/generate.md +84 -0
- package/content/plugins/audit/agents/a11y-analyzer-aria.md +173 -0
- package/content/plugins/audit/agents/a11y-analyzer-forms.md +173 -0
- package/content/plugins/audit/agents/a11y-analyzer-keyboard.md +183 -0
- package/content/plugins/audit/agents/a11y-analyzer-semantic.md +169 -0
- package/content/plugins/audit/agents/a11y-analyzer-visual.md +172 -0
- package/content/plugins/audit/agents/a11y-consensus.md +249 -0
- package/content/plugins/audit/agents/accessibility.md +558 -0
- package/content/plugins/audit/agents/api-quality-analyzer-conventions.md +156 -0
- package/content/plugins/audit/agents/api-quality-analyzer-docs.md +184 -0
- package/content/plugins/audit/agents/api-quality-analyzer-errors.md +191 -0
- package/content/plugins/audit/agents/api-quality-analyzer-pagination.md +179 -0
- package/content/plugins/audit/agents/api-quality-analyzer-versioning.md +150 -0
- package/content/plugins/audit/agents/api-quality-consensus.md +217 -0
- package/content/plugins/audit/agents/api-validator.md +191 -0
- package/content/plugins/audit/agents/arch-analyzer-circular.md +156 -0
- package/content/plugins/audit/agents/arch-analyzer-complexity.md +193 -0
- package/content/plugins/audit/agents/arch-analyzer-coupling.md +152 -0
- package/content/plugins/audit/agents/arch-analyzer-layering.md +160 -0
- package/content/plugins/audit/agents/arch-analyzer-patterns.md +210 -0
- package/content/plugins/audit/agents/arch-consensus.md +228 -0
- package/content/plugins/audit/agents/browser-qa.md +342 -0
- package/content/plugins/audit/agents/code-reviewer.md +298 -0
- package/content/plugins/audit/agents/completeness-analyzer-api.md +199 -0
- package/content/plugins/audit/agents/completeness-analyzer-conditional.md +211 -0
- package/content/plugins/audit/agents/completeness-analyzer-handlers.md +166 -0
- package/content/plugins/audit/agents/completeness-analyzer-imports.md +165 -0
- package/content/plugins/audit/agents/completeness-analyzer-routes.md +190 -0
- package/content/plugins/audit/agents/completeness-analyzer-state.md +196 -0
- package/content/plugins/audit/agents/completeness-analyzer-stubs.md +206 -0
- package/content/plugins/audit/agents/completeness-consensus.md +295 -0
- package/content/plugins/audit/agents/error-analyzer.md +213 -0
- package/content/plugins/audit/agents/flow-analyzer-authorization.md +182 -0
- package/content/plugins/audit/agents/flow-analyzer-discovery.md +174 -0
- package/content/plugins/audit/agents/flow-analyzer-errors.md +186 -0
- package/content/plugins/audit/agents/flow-analyzer-feedback.md +185 -0
- package/content/plugins/audit/agents/flow-analyzer-navigation.md +177 -0
- package/content/plugins/audit/agents/flow-analyzer-persistence.md +193 -0
- package/content/plugins/audit/agents/flow-analyzer-wiring.md +169 -0
- package/content/plugins/audit/agents/flow-consensus.md +237 -0
- package/content/plugins/audit/agents/legal-analyzer-a11y.md +114 -0
- package/content/plugins/audit/agents/legal-analyzer-ai.md +121 -0
- package/content/plugins/audit/agents/legal-analyzer-consumer.md +114 -0
- package/content/plugins/audit/agents/legal-analyzer-content.md +117 -0
- package/content/plugins/audit/agents/legal-analyzer-international.md +119 -0
- package/content/plugins/audit/agents/legal-analyzer-licensing.md +119 -0
- package/content/plugins/audit/agents/legal-analyzer-privacy.md +112 -0
- package/content/plugins/audit/agents/legal-analyzer-security.md +116 -0
- package/content/plugins/audit/agents/legal-analyzer-terms.md +115 -0
- package/content/plugins/audit/agents/legal-consensus.md +250 -0
- package/content/plugins/audit/agents/logic-analyzer-edge.md +179 -0
- package/content/plugins/audit/agents/logic-analyzer-flow.md +264 -0
- package/content/plugins/audit/agents/logic-analyzer-invariant.md +215 -0
- package/content/plugins/audit/agents/logic-analyzer-race.md +280 -0
- package/content/plugins/audit/agents/logic-analyzer-type.md +227 -0
- package/content/plugins/audit/agents/logic-consensus.md +259 -0
- package/content/plugins/audit/agents/perf-analyzer-assets.md +182 -0
- package/content/plugins/audit/agents/perf-analyzer-bundle.md +173 -0
- package/content/plugins/audit/agents/perf-analyzer-caching.md +170 -0
- package/content/plugins/audit/agents/perf-analyzer-compute.md +173 -0
- package/content/plugins/audit/agents/perf-analyzer-memory.md +193 -0
- package/content/plugins/audit/agents/perf-analyzer-network.md +165 -0
- package/content/plugins/audit/agents/perf-analyzer-queries.md +162 -0
- package/content/plugins/audit/agents/perf-analyzer-rendering.md +168 -0
- package/content/plugins/audit/agents/perf-consensus.md +287 -0
- package/content/plugins/audit/agents/qa.md +820 -0
- package/content/plugins/audit/agents/quality-analyzer-comments.md +159 -0
- package/content/plugins/audit/agents/quality-analyzer-duplication.md +184 -0
- package/content/plugins/audit/agents/quality-analyzer-naming.md +160 -0
- package/content/plugins/audit/agents/quality-consensus.md +241 -0
- package/content/plugins/audit/agents/schema-validator.md +473 -0
- package/content/plugins/audit/agents/security-analyzer-api.md +210 -0
- package/content/plugins/audit/agents/security-analyzer-auth.md +169 -0
- package/content/plugins/audit/agents/security-analyzer-authz.md +180 -0
- package/content/plugins/audit/agents/security-analyzer-deps.md +153 -0
- package/content/plugins/audit/agents/security-analyzer-infra.md +184 -0
- package/content/plugins/audit/agents/security-analyzer-injection.md +155 -0
- package/content/plugins/audit/agents/security-analyzer-input.md +201 -0
- package/content/plugins/audit/agents/security-analyzer-secrets.md +183 -0
- package/content/plugins/audit/agents/security-consensus.md +283 -0
- package/content/plugins/audit/agents/test-analyzer-assertions.md +188 -0
- package/content/plugins/audit/agents/test-analyzer-coverage.md +189 -0
- package/content/plugins/audit/agents/test-analyzer-fragility.md +193 -0
- package/content/plugins/audit/agents/test-analyzer-integration.md +161 -0
- package/content/plugins/audit/agents/test-analyzer-maintenance.md +180 -0
- package/content/plugins/audit/agents/test-analyzer-mocking.md +188 -0
- package/content/plugins/audit/agents/test-analyzer-patterns.md +196 -0
- package/content/plugins/audit/agents/test-analyzer-structure.md +184 -0
- package/content/plugins/audit/agents/test-consensus.md +301 -0
- package/content/plugins/audit/agents/testing.md +561 -0
- package/content/plugins/audit/agents/ui-validator.md +344 -0
- package/content/plugins/audit/plugin.yaml +186 -5
- package/content/plugins/audit/skills/agileflow-audit/SKILL.md +113 -0
- package/content/plugins/audit/skills/agileflow-audit/references/audit-depth-guide.md +151 -0
- package/content/plugins/audit/skills/agileflow-audit/references/dependency-risk-guide.md +139 -0
- package/content/plugins/audit/skills/agileflow-audit/references/owasp-top10.md +120 -0
- package/content/plugins/audit/skills/agileflow-audit/references/performance-budget-guide.md +143 -0
- package/content/plugins/audit/skills/agileflow-audit/references/wcag-criteria.md +117 -0
- package/content/plugins/audit/skills/agileflow-audit/workflows/run-audit.md +52 -0
- package/content/plugins/audit/skills/agileflow-audit/workflows/tdd.md +66 -0
- package/content/plugins/core/agents/adr-writer.md +521 -0
- package/content/plugins/core/agents/epic-planner.md +520 -0
- package/content/plugins/core/agents/mentor.md +709 -0
- package/content/plugins/core/agents/orchestrator.md +776 -0
- package/content/plugins/core/agents/team-coordinator.md +334 -0
- package/content/plugins/core/agents/team-lead.md +181 -0
- package/content/plugins/core/agents/workspace-orchestrator.md +146 -0
- package/content/plugins/core/hooks/context-loader.js +31 -4
- package/content/plugins/core/hooks/damage-control-bash.js +10 -2
- package/content/plugins/core/hooks/damage-control-edit.js +4 -1
- package/content/plugins/core/hooks/damage-control-patterns.yaml +1 -1
- package/content/plugins/core/hooks/damage-control-write.js +4 -1
- package/content/plugins/core/hooks/{pre-compact-state.js → post-compact-state.js} +25 -8
- package/content/plugins/core/hooks/preferences-injector.js +352 -0
- package/content/plugins/core/plugin.yaml +24 -28
- package/content/plugins/core/skills/agileflow-adr/SKILL.md +34 -8
- package/content/plugins/core/skills/agileflow-adr/references/madr-format-guide.md +86 -0
- package/content/plugins/core/skills/agileflow-adr/workflows/write-adr.md +57 -0
- package/content/plugins/core/skills/agileflow-babysit-mentor/SKILL.md +94 -27
- package/content/plugins/core/skills/agileflow-babysit-mentor/references/mentor-decision-guide.md +81 -0
- package/content/plugins/core/skills/agileflow-babysit-mentor/workflows/mentor-session.md +79 -0
- package/content/plugins/core/skills/agileflow-epic-planner/SKILL.md +37 -7
- package/content/plugins/core/skills/agileflow-epic-planner/references/epic-sizing-guide.md +81 -0
- package/content/plugins/core/skills/agileflow-epic-planner/workflows/plan-epic.md +55 -0
- package/content/plugins/core/skills/agileflow-status-updater/SKILL.md +36 -20
- package/content/plugins/core/skills/agileflow-status-updater/references/status-transitions.md +89 -0
- package/content/plugins/core/skills/agileflow-status-updater/workflows/update-status.md +56 -0
- package/content/plugins/core/skills/agileflow-story-writer/SKILL.md +39 -114
- package/content/plugins/core/skills/agileflow-story-writer/references/estimation-reference.md +36 -0
- package/content/plugins/core/skills/agileflow-story-writer/references/story-template.md +92 -0
- package/content/plugins/core/skills/agileflow-story-writer/workflows/write-story.md +138 -0
- package/content/plugins/council/agents/council-advocate.md +223 -0
- package/content/plugins/council/agents/council-analyst.md +278 -0
- package/content/plugins/council/agents/council-compounder.md +204 -0
- package/content/plugins/council/agents/council-contrarian.md +217 -0
- package/content/plugins/council/agents/council-moonshot.md +217 -0
- package/content/plugins/council/agents/council-optimist.md +185 -0
- package/content/plugins/council/agents/council-revenue.md +200 -0
- package/content/plugins/council/agents/council-technical.md +218 -0
- package/content/plugins/council/agents/multi-expert.md +334 -0
- package/content/plugins/council/plugin.yaml +23 -4
- package/content/plugins/council/skills/agileflow-council/SKILL.md +102 -0
- package/content/plugins/council/skills/agileflow-council/references/decision-log-template.md +109 -0
- package/content/plugins/council/skills/agileflow-council/references/perspective-guide.md +104 -0
- package/content/plugins/council/skills/agileflow-council/references/when-to-convene-guide.md +112 -0
- package/content/plugins/council/skills/agileflow-council/workflows/convene.md +73 -0
- package/content/plugins/council/skills/agileflow-council/workflows/multi-expert.md +75 -0
- package/content/plugins/database/plugin.yaml +14 -0
- package/content/plugins/database/skills/agileflow-database/SKILL.md +284 -0
- package/content/plugins/database/skills/agileflow-database/references/indexing-guide.md +313 -0
- package/content/plugins/database/skills/agileflow-database/references/migration-guide.md +328 -0
- package/content/plugins/database/skills/agileflow-database/references/schema-design-guide.md +467 -0
- package/content/plugins/database/skills/agileflow-database/workflows/design-schema.md +213 -0
- package/content/plugins/database/skills/agileflow-database/workflows/optimize-query.md +253 -0
- package/content/plugins/debugging/plugin.yaml +14 -0
- package/content/plugins/debugging/skills/agileflow-debug/SKILL.md +236 -0
- package/content/plugins/debugging/skills/agileflow-debug/references/common-patterns.md +350 -0
- package/content/plugins/debugging/skills/agileflow-debug/references/debugging-strategies.md +328 -0
- package/content/plugins/debugging/skills/agileflow-debug/workflows/debug-issue.md +187 -0
- package/content/plugins/debugging/skills/agileflow-debug/workflows/reproduce-bug.md +194 -0
- package/content/plugins/delivery/agents/ci.md +547 -0
- package/content/plugins/delivery/agents/devops.md +789 -0
- package/content/plugins/delivery/plugin.yaml +19 -0
- package/content/plugins/delivery/skills/agileflow-delivery/SKILL.md +111 -0
- package/content/plugins/delivery/skills/agileflow-delivery/references/changelog-format-guide.md +133 -0
- package/content/plugins/delivery/skills/agileflow-delivery/references/ci-pipeline-guide.md +158 -0
- package/content/plugins/delivery/skills/agileflow-delivery/references/pr-checklist-guide.md +133 -0
- package/content/plugins/delivery/skills/agileflow-delivery/references/release-checklist.md +142 -0
- package/content/plugins/delivery/skills/agileflow-delivery/workflows/changelog.md +72 -0
- package/content/plugins/delivery/skills/agileflow-delivery/workflows/deploy.md +74 -0
- package/content/plugins/delivery/skills/agileflow-delivery/workflows/pr.md +75 -0
- package/content/plugins/docs/agents/documentation.md +544 -0
- package/content/plugins/docs/agents/readme-updater.md +640 -0
- package/content/plugins/docs/plugin.yaml +19 -0
- package/content/plugins/docs/skills/agileflow-docs/SKILL.md +106 -0
- package/content/plugins/docs/skills/agileflow-docs/references/api-doc-template.md +167 -0
- package/content/plugins/docs/skills/agileflow-docs/references/doc-types-guide.md +141 -0
- package/content/plugins/docs/skills/agileflow-docs/references/readme-template.md +156 -0
- package/content/plugins/docs/skills/agileflow-docs/workflows/readme-sync.md +57 -0
- package/content/plugins/docs/skills/agileflow-docs/workflows/sync.md +64 -0
- package/content/plugins/engineering/agents/api.md +718 -0
- package/content/plugins/engineering/agents/codebase-query.md +285 -0
- package/content/plugins/engineering/agents/compliance.md +559 -0
- package/content/plugins/engineering/agents/database.md +644 -0
- package/content/plugins/engineering/agents/integrations.md +644 -0
- package/content/plugins/engineering/agents/mobile.md +552 -0
- package/content/plugins/engineering/agents/monitoring.md +585 -0
- package/content/plugins/engineering/agents/performance.md +529 -0
- package/content/plugins/engineering/agents/refactor.md +592 -0
- package/content/plugins/engineering/agents/security.md +524 -0
- package/content/plugins/engineering/agents/ui.md +1336 -0
- package/content/plugins/engineering/plugin.yaml +37 -0
- package/content/plugins/engineering/skills/agileflow-engineering/SKILL.md +127 -0
- package/content/plugins/engineering/skills/agileflow-engineering/references/code-review-guide.md +126 -0
- package/content/plugins/engineering/skills/agileflow-engineering/references/domain-routing-guide.md +89 -0
- package/content/plugins/engineering/skills/agileflow-engineering/references/refactoring-guide.md +136 -0
- package/content/plugins/engineering/skills/agileflow-engineering/workflows/diagnose.md +63 -0
- package/content/plugins/engineering/skills/agileflow-engineering/workflows/impact.md +60 -0
- package/content/plugins/ideation/agents/brainstorm-analyzer-features.md +179 -0
- package/content/plugins/ideation/agents/brainstorm-analyzer-growth.md +169 -0
- package/content/plugins/ideation/agents/brainstorm-analyzer-integration.md +181 -0
- package/content/plugins/ideation/agents/brainstorm-analyzer-market.md +150 -0
- package/content/plugins/ideation/agents/brainstorm-analyzer-ux.md +180 -0
- package/content/plugins/ideation/agents/brainstorm-consensus.md +245 -0
- package/content/plugins/ideation/agents/design.md +568 -0
- package/content/plugins/ideation/agents/product.md +582 -0
- package/content/plugins/ideation/plugin.yaml +31 -0
- package/content/plugins/ideation/skills/agileflow-ideation/SKILL.md +109 -0
- package/content/plugins/ideation/skills/agileflow-ideation/references/brainstorm-techniques.md +138 -0
- package/content/plugins/ideation/skills/agileflow-ideation/references/competitive-analysis-template.md +148 -0
- package/content/plugins/ideation/skills/agileflow-ideation/references/feature-prioritization-guide.md +147 -0
- package/content/plugins/ideation/skills/agileflow-ideation/references/user-story-patterns.md +152 -0
- package/content/plugins/ideation/skills/agileflow-ideation/workflows/features.md +65 -0
- package/content/plugins/ideation/skills/agileflow-ideation/workflows/ideate.md +54 -0
- package/content/plugins/migration/agents/datamigration.md +757 -0
- package/content/plugins/migration/plugin.yaml +17 -0
- package/content/plugins/migration/skills/agileflow-migration/SKILL.md +106 -0
- package/content/plugins/migration/skills/agileflow-migration/references/data-validation-checklist.md +154 -0
- package/content/plugins/migration/skills/agileflow-migration/references/migration-patterns.md +209 -0
- package/content/plugins/migration/skills/agileflow-migration/references/rollback-playbook.md +171 -0
- package/content/plugins/migration/skills/agileflow-migration/references/version-compatibility-matrix.md +155 -0
- package/content/plugins/migration/skills/agileflow-migration/workflows/plan.md +73 -0
- package/content/plugins/migration/skills/agileflow-migration/workflows/validate.md +71 -0
- package/content/plugins/performance/plugin.yaml +14 -0
- package/content/plugins/performance/skills/agileflow-performance/SKILL.md +224 -0
- package/content/plugins/performance/skills/agileflow-performance/references/optimization-patterns.md +554 -0
- package/content/plugins/performance/skills/agileflow-performance/references/profiling-guide.md +383 -0
- package/content/plugins/performance/skills/agileflow-performance/references/web-vitals-guide.md +360 -0
- package/content/plugins/performance/skills/agileflow-performance/workflows/improve-web-vitals.md +344 -0
- package/content/plugins/performance/skills/agileflow-performance/workflows/profile-and-fix.md +254 -0
- package/content/plugins/planning/agents/analytics.md +670 -0
- package/content/plugins/planning/agents/rlm-subcore.md +215 -0
- package/content/plugins/planning/plugin.yaml +19 -0
- package/content/plugins/planning/skills/agileflow-planning/SKILL.md +111 -0
- package/content/plugins/planning/skills/agileflow-planning/references/estimation-guide.md +114 -0
- package/content/plugins/planning/skills/agileflow-planning/references/rpi-workflow.md +119 -0
- package/content/plugins/planning/skills/agileflow-planning/references/sprint-planning-guide.md +145 -0
- package/content/plugins/planning/skills/agileflow-planning/workflows/impact.md +63 -0
- package/content/plugins/planning/skills/agileflow-planning/workflows/rpi.md +104 -0
- package/content/plugins/psychology/plugin.yaml +14 -0
- package/content/plugins/psychology/skills/agileflow-retention/SKILL.md +252 -0
- package/content/plugins/psychology/skills/agileflow-retention/references/competitor-analysis.md +240 -0
- package/content/plugins/psychology/skills/agileflow-retention/references/psychology-models.md +349 -0
- package/content/plugins/psychology/skills/agileflow-retention/references/retention-patterns.md +279 -0
- package/content/plugins/psychology/skills/agileflow-retention/workflows/design-retention-feature.md +287 -0
- package/content/plugins/psychology/skills/agileflow-retention/workflows/retention-audit.md +259 -0
- package/content/plugins/refactoring/plugin.yaml +14 -0
- package/content/plugins/refactoring/skills/agileflow-refactor/SKILL.md +235 -0
- package/content/plugins/refactoring/skills/agileflow-refactor/references/refactoring-patterns.md +405 -0
- package/content/plugins/refactoring/skills/agileflow-refactor/references/safety-checks.md +177 -0
- package/content/plugins/refactoring/skills/agileflow-refactor/workflows/extract-module.md +226 -0
- package/content/plugins/refactoring/skills/agileflow-refactor/workflows/safe-refactor.md +169 -0
- package/content/plugins/research/agents/research.md +503 -0
- package/content/plugins/research/plugin.yaml +17 -0
- package/content/plugins/research/skills/agileflow-research/SKILL.md +110 -0
- package/content/plugins/research/skills/agileflow-research/references/knowledge-decay-guide.md +121 -0
- package/content/plugins/research/skills/agileflow-research/references/research-prompt-guide.md +141 -0
- package/content/plugins/research/skills/agileflow-research/references/synthesis-template.md +154 -0
- package/content/plugins/research/skills/agileflow-research/workflows/analyze.md +60 -0
- package/content/plugins/research/skills/agileflow-research/workflows/ask.md +64 -0
- package/content/plugins/research/skills/agileflow-research/workflows/import.md +66 -0
- package/content/plugins/research/skills/agileflow-research/workflows/synthesize.md +66 -0
- package/content/plugins/reviews/plugin.yaml +14 -0
- package/content/plugins/reviews/skills/agileflow-pr-reviewer/SKILL.md +241 -0
- package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/review-checklist.md +200 -0
- package/content/plugins/reviews/skills/agileflow-pr-reviewer/references/security-patterns.md +328 -0
- package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/review-pr.md +153 -0
- package/content/plugins/reviews/skills/agileflow-pr-reviewer/workflows/security-review.md +177 -0
- package/content/plugins/seo/agents/seo-analyzer-content.md +169 -0
- package/content/plugins/seo/agents/seo-analyzer-images.md +198 -0
- package/content/plugins/seo/agents/seo-analyzer-performance.md +217 -0
- package/content/plugins/seo/agents/seo-analyzer-schema.md +184 -0
- package/content/plugins/seo/agents/seo-analyzer-sitemap.md +177 -0
- package/content/plugins/seo/agents/seo-analyzer-technical.md +151 -0
- package/content/plugins/seo/agents/seo-consensus.md +304 -0
- package/content/plugins/seo/plugin.yaml +19 -4
- package/content/plugins/seo/skills/agileflow-seo/SKILL.md +188 -0
- package/content/plugins/seo/skills/agileflow-seo/references/cwv-thresholds.md +110 -0
- package/content/plugins/seo/skills/agileflow-seo/references/eeat-framework.md +144 -0
- package/content/plugins/seo/skills/agileflow-seo/references/keyword-research-guide.md +125 -0
- package/content/plugins/seo/skills/agileflow-seo/references/schema-types.md +139 -0
- package/content/plugins/seo/skills/agileflow-seo/references/technical-seo-checklist.md +139 -0
- package/content/plugins/seo/skills/agileflow-seo/workflows/audit.md +98 -0
- package/content/plugins/seo/skills/agileflow-seo/workflows/page.md +118 -0
- package/content/plugins/testing/plugin.yaml +16 -0
- package/content/plugins/testing/skills/agileflow-test-writer/SKILL.md +260 -0
- package/content/plugins/testing/skills/agileflow-test-writer/references/coverage-targets.md +239 -0
- package/content/plugins/testing/skills/agileflow-test-writer/references/test-patterns.md +420 -0
- package/content/plugins/testing/skills/agileflow-test-writer/workflows/add-coverage.md +154 -0
- package/content/plugins/testing/skills/agileflow-test-writer/workflows/write-tests-from-ac.md +225 -0
- package/package.json +2 -2
- package/src/cli/commands/doctor.js +818 -30
- package/src/cli/commands/hook.js +17 -14
- package/src/cli/commands/launch.js +1454 -0
- package/src/cli/commands/learn.js +149 -0
- package/src/cli/commands/plugins.js +113 -0
- package/src/cli/commands/setup.js +455 -110
- package/src/cli/commands/skills.js +324 -0
- package/src/cli/commands/status.js +8 -10
- package/src/cli/commands/update.js +76 -15
- package/src/cli/index.js +90 -26
- package/src/cli/wizard/babysit-mode-picker.js +192 -0
- package/src/cli/wizard/behaviors-picker.js +208 -54
- package/src/cli/wizard/ide-picker.js +40 -28
- package/src/cli/wizard/install-scope-picker.js +57 -0
- package/src/cli/wizard/launch-alias-picker.js +50 -0
- package/src/cli/wizard/launch-cli-picker.js +129 -0
- package/src/cli/wizard/launch-tmux-picker.js +133 -0
- package/src/cli/wizard/learnings-picker.js +40 -0
- package/src/cli/wizard/plugin-picker.js +47 -16
- package/src/lib/brand.js +116 -0
- package/src/lib/errors.js +120 -0
- package/src/lib/path-check.js +39 -0
- package/src/runtime/config/defaults.js +22 -17
- package/src/runtime/config/loader.js +77 -8
- package/src/runtime/config/schema.json +43 -16
- package/src/runtime/config/writer.js +3 -1
- package/src/runtime/ide/babysit-skill.js +202 -0
- package/src/runtime/ide/capabilities.js +84 -29
- package/src/runtime/ide/claude-code-content.js +177 -0
- package/src/runtime/ide/claude-code-settings.js +67 -29
- package/src/runtime/ide/claude-code-skills.js +47 -32
- package/src/runtime/ide/codex-config.js +295 -0
- package/src/runtime/installer/install.js +252 -24
- package/src/runtime/launch/alias-installer.js +191 -0
- package/src/runtime/launch/cli-resume.js +244 -0
- package/src/runtime/launch/closed-windows.js +338 -0
- package/src/runtime/launch/defaults.js +66 -0
- package/src/runtime/launch/detect-clis.js +69 -0
- package/src/runtime/launch/doctor.js +464 -0
- package/src/runtime/launch/exec-wrapper.js +114 -0
- package/src/runtime/launch/parallel-session.js +247 -0
- package/src/runtime/launch/prefs.js +211 -0
- package/src/runtime/launch/project-prefs.js +234 -0
- package/src/runtime/launch/resolve-cli.js +56 -0
- package/src/runtime/launch/restore.js +152 -0
- package/src/runtime/launch/schema.json +75 -0
- package/src/runtime/launch/session-lifecycle.js +313 -0
- package/src/runtime/launch/session-registry.js +401 -0
- package/src/runtime/launch/spawn.js +103 -0
- package/src/runtime/launch/tabs.js +350 -0
- package/src/runtime/launch/tmux.js +764 -0
- package/src/runtime/launch/worktree.js +260 -0
- package/src/runtime/plugins/registry.js +16 -11
- package/src/runtime/plugins/validator.js +57 -43
- package/src/runtime/skills/learnings.js +308 -0
- package/content/plugins/core/hooks/babysit-mentor-injector.js +0 -55
- package/src/cli/wizard/personalization.js +0 -64
package/content/plugins/performance/skills/agileflow-performance/workflows/improve-web-vitals.md
ADDED
|
@@ -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
|
+
```
|