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
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
# Workflow: Optimize Query
|
|
2
|
+
|
|
3
|
+
Follow this workflow when the user has a slow query or reports database performance problems. Diagnose before prescribing. Collect evidence, identify the bottleneck, apply the minimum effective fix, and verify the improvement.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Step 1: Capture the Slow Query
|
|
8
|
+
|
|
9
|
+
Ask the user to provide:
|
|
10
|
+
|
|
11
|
+
1. **The query** — exact SQL, including WHERE clauses, ORDER BY, LIMIT, JOINs
|
|
12
|
+
2. **EXPLAIN ANALYZE output** — run `EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) <query>;`
|
|
13
|
+
3. **Table row counts** — approximate sizes of the tables involved
|
|
14
|
+
4. **Context** — is this a background job, user-facing API endpoint, report? What latency is acceptable?
|
|
15
|
+
5. **How slow** — current execution time, target execution time
|
|
16
|
+
|
|
17
|
+
If EXPLAIN ANALYZE output is not available, ask why (read replica, permissions) and adapt.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Step 2: Read EXPLAIN ANALYZE
|
|
22
|
+
|
|
23
|
+
Parse the output from the bottom up (innermost nodes first). Identify:
|
|
24
|
+
|
|
25
|
+
**What to look for:**
|
|
26
|
+
|
|
27
|
+
| Signal | Meaning |
|
|
28
|
+
| ---------------------------------------------- | ---------------------------------------------------------------------- |
|
|
29
|
+
| `Seq Scan` on a large table | Missing index on a filter column |
|
|
30
|
+
| `actual rows` >> `rows` estimate (10x or more) | Stale statistics — `ANALYZE` needed |
|
|
31
|
+
| `Sort` node with high cost | Consider index to serve ORDER BY |
|
|
32
|
+
| `Hash Join` with `Batches: N > 1` | Hash doesn't fit in memory — increase `work_mem` or rewrite |
|
|
33
|
+
| `Nested Loop` with large outer rows | N×M iterations — may need different join type or index |
|
|
34
|
+
| High `shared read` buffers | Data not cached — cold cache or table too large for cache |
|
|
35
|
+
| `Filter: (...)` rows removed after index | Index chosen but lots of rows filtered post-scan — better index needed |
|
|
36
|
+
| `Index Scan` with high loops | Called repeatedly in a nested loop — may be N+1 |
|
|
37
|
+
|
|
38
|
+
**Cost anatomy:**
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
Seq Scan on orders (cost=0.00..58432.10 rows=2000000 width=128)
|
|
42
|
+
(actual time=0.012..820.341 rows=2000000 loops=1)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- `cost=0.00..58432.10`: startup cost..total cost (planner's estimate)
|
|
46
|
+
- `rows=2000000`: planner's row estimate
|
|
47
|
+
- `actual time=0.012..820.341`: real ms (startup..total)
|
|
48
|
+
- `actual rows=2000000`: real rows returned
|
|
49
|
+
- `loops=1`: how many times this node ran
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Step 3: Identify the Bottleneck
|
|
54
|
+
|
|
55
|
+
Categorize the problem before choosing a fix:
|
|
56
|
+
|
|
57
|
+
### Missing Index (most common)
|
|
58
|
+
|
|
59
|
+
**Signs:** `Seq Scan` on a large table with low selectivity filter, or `Filter` removing most rows after a scan.
|
|
60
|
+
|
|
61
|
+
**Fix:** Add an index on the filter column(s). Use the column order rules from `references/indexing-guide.md`.
|
|
62
|
+
|
|
63
|
+
```sql
|
|
64
|
+
-- Confirm the index would be used by checking with set enable_seqscan = off:
|
|
65
|
+
SET enable_seqscan = off;
|
|
66
|
+
EXPLAIN ANALYZE <your query>;
|
|
67
|
+
SET enable_seqscan = on;
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Wrong Index (planner chose incorrectly)
|
|
71
|
+
|
|
72
|
+
**Signs:** An index exists but isn't being used, or a different index is chosen than expected.
|
|
73
|
+
|
|
74
|
+
**Causes:**
|
|
75
|
+
|
|
76
|
+
- Stale statistics: planner row estimates are far off actual rows
|
|
77
|
+
- Index isn't selective enough for the data distribution
|
|
78
|
+
- Function applied to indexed column: `WHERE LOWER(email) = $1` won't use index on `email`
|
|
79
|
+
|
|
80
|
+
**Fix:**
|
|
81
|
+
|
|
82
|
+
```sql
|
|
83
|
+
-- Refresh stats
|
|
84
|
+
ANALYZE table_name;
|
|
85
|
+
|
|
86
|
+
-- For function on column, create functional index
|
|
87
|
+
CREATE INDEX idx_users_email_lower ON users (LOWER(email));
|
|
88
|
+
-- Query must match exactly:
|
|
89
|
+
SELECT * FROM users WHERE LOWER(email) = LOWER($1);
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### N+1 Query Pattern
|
|
93
|
+
|
|
94
|
+
**Signs:** A query node shows `loops=N` where N equals the number of parent rows. 1000 index lookups for 1000 parent rows.
|
|
95
|
+
|
|
96
|
+
**Fix:** Rewrite to use a JOIN or a `WHERE id = ANY($1)` batch fetch.
|
|
97
|
+
|
|
98
|
+
```sql
|
|
99
|
+
-- Bad pattern (application-level N+1):
|
|
100
|
+
-- SELECT * FROM orders WHERE user_id = $1 -- loop N times
|
|
101
|
+
|
|
102
|
+
-- Good: one query with JOIN
|
|
103
|
+
SELECT o.*, u.name, u.email
|
|
104
|
+
FROM orders o
|
|
105
|
+
JOIN users u ON u.id = o.user_id
|
|
106
|
+
WHERE o.status = 'pending'
|
|
107
|
+
AND o.created_at > NOW() - INTERVAL '7 days';
|
|
108
|
+
|
|
109
|
+
-- Or batch fetch with ANY
|
|
110
|
+
SELECT * FROM users WHERE id = ANY($1::BIGINT[]);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Slow Sort / ORDER BY
|
|
114
|
+
|
|
115
|
+
**Signs:** `Sort` node in EXPLAIN with high cost, or sort is the dominant time.
|
|
116
|
+
|
|
117
|
+
**Fix:** Create an index that serves the ORDER BY:
|
|
118
|
+
|
|
119
|
+
```sql
|
|
120
|
+
-- Query: WHERE status = 'active' ORDER BY created_at DESC
|
|
121
|
+
CREATE INDEX CONCURRENTLY idx_orders_status_created
|
|
122
|
+
ON orders (status, created_at DESC);
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The planner can use this index and return rows in sorted order without an explicit sort step.
|
|
126
|
+
|
|
127
|
+
### Inefficient JOIN
|
|
128
|
+
|
|
129
|
+
**Signs:** `Hash Join` batching to disk, `Nested Loop` with large row counts, `Merge Join` on unsorted input requiring expensive sort.
|
|
130
|
+
|
|
131
|
+
**Fix options:**
|
|
132
|
+
|
|
133
|
+
- Ensure FK columns are indexed
|
|
134
|
+
- Add a more selective filter to reduce the row count before the join
|
|
135
|
+
- Rewrite with a CTE to force evaluation order (use sparingly — can prevent optimization)
|
|
136
|
+
- Increase `work_mem` if hash join is batching: `SET work_mem = '256MB';`
|
|
137
|
+
|
|
138
|
+
### Stale Statistics
|
|
139
|
+
|
|
140
|
+
**Signs:** `rows=100` estimate but `actual rows=500000`, or vice versa.
|
|
141
|
+
|
|
142
|
+
**Fix:**
|
|
143
|
+
|
|
144
|
+
```sql
|
|
145
|
+
ANALYZE table_name;
|
|
146
|
+
|
|
147
|
+
-- After bulk loads, VACUUM ANALYZE to reclaim dead tuples and update stats
|
|
148
|
+
VACUUM ANALYZE table_name;
|
|
149
|
+
|
|
150
|
+
-- Check when last analyzed:
|
|
151
|
+
SELECT relname, last_analyze, last_autoanalyze, n_live_tup, n_dead_tup
|
|
152
|
+
FROM pg_stat_user_tables
|
|
153
|
+
WHERE relname = 'orders';
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Large Result Set (Missing LIMIT)
|
|
157
|
+
|
|
158
|
+
**Signs:** Query returns millions of rows when only a page is needed.
|
|
159
|
+
|
|
160
|
+
**Fix:** Add LIMIT/OFFSET pagination, or use cursor-based pagination:
|
|
161
|
+
|
|
162
|
+
```sql
|
|
163
|
+
-- Offset pagination (simple but slow for large offsets)
|
|
164
|
+
SELECT * FROM orders
|
|
165
|
+
WHERE user_id = $1
|
|
166
|
+
ORDER BY created_at DESC
|
|
167
|
+
LIMIT 20 OFFSET $2;
|
|
168
|
+
|
|
169
|
+
-- Cursor-based pagination (fast even on page 10000)
|
|
170
|
+
SELECT * FROM orders
|
|
171
|
+
WHERE user_id = $1
|
|
172
|
+
AND created_at < $last_cursor_value -- cursor = last seen created_at
|
|
173
|
+
ORDER BY created_at DESC
|
|
174
|
+
LIMIT 20;
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Step 4: Apply the Fix
|
|
180
|
+
|
|
181
|
+
Apply the minimum effective change:
|
|
182
|
+
|
|
183
|
+
1. **Index fix:** write the `CREATE INDEX CONCURRENTLY` statement
|
|
184
|
+
2. **Query rewrite:** rewrite the query, keeping semantics identical
|
|
185
|
+
3. **Stats fix:** `ANALYZE table_name`
|
|
186
|
+
4. **Schema change:** if a column type or missing column is the root cause, follow `workflows/design-schema.md` or `references/migration-guide.md`
|
|
187
|
+
|
|
188
|
+
Always implement index additions as a separate migration using `CREATE INDEX CONCURRENTLY`.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Step 5: Verify the Improvement
|
|
193
|
+
|
|
194
|
+
After applying the fix, run EXPLAIN ANALYZE again on the same query with the same parameters.
|
|
195
|
+
|
|
196
|
+
**What to confirm:**
|
|
197
|
+
|
|
198
|
+
- [ ] Seq Scan replaced by Index Scan or Index Only Scan
|
|
199
|
+
- [ ] `actual time` is within the target latency
|
|
200
|
+
- [ ] `actual rows` is close to `rows` estimate (planner is accurate now)
|
|
201
|
+
- [ ] No new bottleneck introduced elsewhere in the plan
|
|
202
|
+
- [ ] Query returns the same results as before
|
|
203
|
+
|
|
204
|
+
Compare before and after:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
Before: Seq Scan on orders actual time=820.341ms rows=2000000
|
|
208
|
+
After: Index Scan using idx_orders_user_id actual time=0.081ms rows=12
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Step 6: Document
|
|
214
|
+
|
|
215
|
+
For any significant change (new index, query rewrite, schema change):
|
|
216
|
+
|
|
217
|
+
- Add a comment to the migration explaining why the index was added
|
|
218
|
+
- Note the before/after execution time in the PR or commit message
|
|
219
|
+
- If the root cause was stale statistics, check autovacuum settings:
|
|
220
|
+
|
|
221
|
+
```sql
|
|
222
|
+
-- Check autovacuum settings for a specific table
|
|
223
|
+
SELECT relname, reloptions FROM pg_class WHERE relname = 'orders';
|
|
224
|
+
|
|
225
|
+
-- Check if autovacuum is running frequently enough
|
|
226
|
+
SELECT schemaname, relname, last_autovacuum, last_autoanalyze
|
|
227
|
+
FROM pg_stat_user_tables
|
|
228
|
+
ORDER BY last_autovacuum DESC NULLS LAST;
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
If autovacuum is too infrequent on a busy table, tune it:
|
|
232
|
+
|
|
233
|
+
```sql
|
|
234
|
+
ALTER TABLE orders SET (
|
|
235
|
+
autovacuum_vacuum_scale_factor = 0.01, -- trigger at 1% dead tuples (default 20%)
|
|
236
|
+
autovacuum_analyze_scale_factor = 0.005 -- trigger analyze at 0.5% changes
|
|
237
|
+
);
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Quick Diagnosis Reference
|
|
243
|
+
|
|
244
|
+
| Symptom | First thing to check |
|
|
245
|
+
| ------------------------------------- | --------------------------------------------------------------- |
|
|
246
|
+
| Query suddenly slow after data load | ANALYZE — statistics are stale |
|
|
247
|
+
| Slow on large table with WHERE clause | Missing index on filter column |
|
|
248
|
+
| Slow ORDER BY | Index that serves the ORDER BY clause |
|
|
249
|
+
| API endpoint slow under load | N+1 pattern — count queries in one request |
|
|
250
|
+
| Report query times out | Pagination, partial index, materialized view |
|
|
251
|
+
| Deadlock errors | Lock ordering inconsistency — acquire locks in same order |
|
|
252
|
+
| Connection pool exhausted | Long-running transactions, missing indexes causing slow queries |
|
|
253
|
+
| Replication lag spike | Large write operation or bulk update without batching |
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
id: debugging
|
|
2
|
+
name: Debugging
|
|
3
|
+
description: Hypothesis-driven debugging for systematic issue resolution.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
enabledByDefault: false
|
|
6
|
+
cannotDisable: false
|
|
7
|
+
depends: []
|
|
8
|
+
provides:
|
|
9
|
+
skills:
|
|
10
|
+
- id: agileflow-debug
|
|
11
|
+
dir: skills/agileflow-debug
|
|
12
|
+
agents: []
|
|
13
|
+
hooks: []
|
|
14
|
+
templates: []
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agileflow-debug
|
|
3
|
+
version: 1.0.0
|
|
4
|
+
category: agileflow/debugging
|
|
5
|
+
description: |
|
|
6
|
+
Use when the user reports a bug, error, unexpected behaviour, or
|
|
7
|
+
wants to understand why something isn't working. Applies the
|
|
8
|
+
scientific debugging method: form a hypothesis, reproduce the
|
|
9
|
+
issue, isolate the cause, verify the fix, and prevent regression.
|
|
10
|
+
triggers:
|
|
11
|
+
keywords:
|
|
12
|
+
- debug
|
|
13
|
+
- not working
|
|
14
|
+
- error
|
|
15
|
+
- bug
|
|
16
|
+
- broken
|
|
17
|
+
- why is this failing
|
|
18
|
+
- investigate
|
|
19
|
+
- something's wrong
|
|
20
|
+
- unexpected behaviour
|
|
21
|
+
- exception
|
|
22
|
+
- crash
|
|
23
|
+
- failing test
|
|
24
|
+
- stack trace
|
|
25
|
+
- cannot figure out
|
|
26
|
+
- help me understand why
|
|
27
|
+
priority: 50
|
|
28
|
+
exclude:
|
|
29
|
+
- debug mode (configuration context, not debugging a bug)
|
|
30
|
+
- bug report (filing a ticket, not debugging code)
|
|
31
|
+
provides:
|
|
32
|
+
agents: []
|
|
33
|
+
learns:
|
|
34
|
+
enabled: true
|
|
35
|
+
file: _learnings/debug.yaml
|
|
36
|
+
maxEntries: 50
|
|
37
|
+
depends:
|
|
38
|
+
skills: []
|
|
39
|
+
plugins: [core]
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
# AgileFlow Debug
|
|
43
|
+
|
|
44
|
+
Applies the scientific debugging method to any bug or error: reproduce → isolate → hypothesise → verify → fix → prevent regression.
|
|
45
|
+
|
|
46
|
+
## When this skill activates
|
|
47
|
+
|
|
48
|
+
- User reports something isn't working and wants help finding the cause
|
|
49
|
+
- User pastes an error message, stack trace, or logs and wants an explanation
|
|
50
|
+
- User describes unexpected behaviour ("this should return X but returns Y")
|
|
51
|
+
- A test is failing and the user isn't sure why
|
|
52
|
+
- User is stuck and wants a systematic approach to a hard bug
|
|
53
|
+
- User wants to know the root cause before applying a fix
|
|
54
|
+
|
|
55
|
+
## Opening discovery flow
|
|
56
|
+
|
|
57
|
+
**When invoked without enough context, ask once to gather what's needed.**
|
|
58
|
+
|
|
59
|
+
```xml
|
|
60
|
+
<invoke name="AskUserQuestion">
|
|
61
|
+
<parameter name="questions">[
|
|
62
|
+
{
|
|
63
|
+
"question": "What's happening?",
|
|
64
|
+
"header": "Bug description",
|
|
65
|
+
"multiSelect": false,
|
|
66
|
+
"options": [
|
|
67
|
+
{"label": "I have an error message or stack trace — I'll paste it", "description": "Share the full error and I'll analyse it, identify the root cause, and suggest a fix"},
|
|
68
|
+
{"label": "Something behaves wrong — not what I expect (Recommended)", "description": "Describe what you expect vs what actually happens — I'll form hypotheses and help isolate the cause"},
|
|
69
|
+
{"label": "A test is failing and I don't know why", "description": "Paste the failing test + error output and I'll trace through the failure"},
|
|
70
|
+
{"label": "The bug is intermittent / flaky", "description": "Intermittent bugs are usually race conditions, timing issues, or shared state — I'll help diagnose"},
|
|
71
|
+
{"label": "I know what's wrong but need help fixing it safely", "description": "Describe the root cause and I'll help you fix it without introducing new issues"}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]</parameter>
|
|
75
|
+
</invoke>
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## The scientific debugging method
|
|
79
|
+
|
|
80
|
+
Never guess at a fix. Always follow: **Reproduce → Isolate → Hypothesise → Test the hypothesis → Fix → Verify → Prevent regression.**
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
Reproduce
|
|
84
|
+
└─ Can you make it fail consistently?
|
|
85
|
+
├─ No → Gather more data (logs, conditions)
|
|
86
|
+
└─ Yes → Isolate
|
|
87
|
+
|
|
88
|
+
Isolate
|
|
89
|
+
└─ What is the smallest failing case?
|
|
90
|
+
└─ Binary-search the code path to find where good data goes bad
|
|
91
|
+
|
|
92
|
+
Hypothesise
|
|
93
|
+
└─ Form a specific, testable hypothesis:
|
|
94
|
+
"I believe X is causing Y because of Z"
|
|
95
|
+
|
|
96
|
+
Test
|
|
97
|
+
└─ Prove or disprove the hypothesis without changing production code
|
|
98
|
+
├─ Disproved → form the next hypothesis
|
|
99
|
+
└─ Proved → Fix
|
|
100
|
+
|
|
101
|
+
Fix
|
|
102
|
+
└─ Change the minimum code needed to fix the root cause
|
|
103
|
+
(not a workaround, not patching the symptom)
|
|
104
|
+
|
|
105
|
+
Verify
|
|
106
|
+
└─ Confirm the original issue is gone
|
|
107
|
+
└─ Confirm nothing else broke (run tests)
|
|
108
|
+
|
|
109
|
+
Prevent
|
|
110
|
+
└─ Add a test that would have caught this bug
|
|
111
|
+
└─ Ask: could this same class of bug exist elsewhere?
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Hypothesis formation
|
|
115
|
+
|
|
116
|
+
A good hypothesis is:
|
|
117
|
+
|
|
118
|
+
- **Specific**: not "something is wrong with the database" but "the query returns stale data because the Redis cache is not invalidated when a user updates their profile"
|
|
119
|
+
- **Testable**: you can prove or disprove it with a specific action
|
|
120
|
+
- **Falsifiable**: if X is the cause, then Y should be true; if Y is not true, X is not the cause
|
|
121
|
+
|
|
122
|
+
**Bad hypothesis:** "The API might be broken"
|
|
123
|
+
**Good hypothesis:** "The `getUser` function returns the wrong user because the session `userId` is not being updated after an email change"
|
|
124
|
+
|
|
125
|
+
Form 1–3 hypotheses in priority order. Test the most likely one first.
|
|
126
|
+
|
|
127
|
+
## Binary search debugging
|
|
128
|
+
|
|
129
|
+
When a bug is somewhere in a large code path, use binary search to find it:
|
|
130
|
+
|
|
131
|
+
1. Identify the start of the bad path (where input is definitely correct)
|
|
132
|
+
2. Identify the end (where output is definitely wrong)
|
|
133
|
+
3. Add a probe (log, assertion, breakpoint) at the midpoint
|
|
134
|
+
4. Is the data correct at the midpoint?
|
|
135
|
+
- Yes → bug is in the second half
|
|
136
|
+
- No → bug is in the first half
|
|
137
|
+
5. Repeat until the exact line is found
|
|
138
|
+
|
|
139
|
+
This is almost always faster than reading the code top-to-bottom trying to spot the bug.
|
|
140
|
+
|
|
141
|
+
## Error message analysis
|
|
142
|
+
|
|
143
|
+
When the user provides an error message or stack trace:
|
|
144
|
+
|
|
145
|
+
1. **Read the error type** — TypeError, NullPointerException, IndexError → tells you the category
|
|
146
|
+
2. **Find the first line that is in the application code** — ignore framework/library frames above it
|
|
147
|
+
3. **Read the message literally** — "Cannot read properties of undefined (reading 'email')" means a variable is undefined; ask what it should have been at that point
|
|
148
|
+
4. **Trace backward** — where was that variable set? What could make it undefined?
|
|
149
|
+
|
|
150
|
+
Common error → root cause translations:
|
|
151
|
+
|
|
152
|
+
| Error | Likely root cause |
|
|
153
|
+
| ------------------------------------- | ----------------------------------------------------------------- |
|
|
154
|
+
| `Cannot read properties of undefined` | Object that should have been fetched from DB is null/undefined |
|
|
155
|
+
| `ECONNREFUSED` | Service not running, wrong port, or firewall |
|
|
156
|
+
| `UNIQUE constraint failed` | Duplicate insert — race condition or missing check |
|
|
157
|
+
| `JWT expired` | Token expiry handling missing or clock skew |
|
|
158
|
+
| `TypeError: X is not a function` | Wrong import, wrong export type, or circular dependency |
|
|
159
|
+
| `Maximum call stack size exceeded` | Infinite recursion — function calls itself directly or indirectly |
|
|
160
|
+
| `Promise rejected with non-Error` | `.catch(err => ...)` where `err` is a string, not an Error object |
|
|
161
|
+
|
|
162
|
+
## Intermittent bug strategies
|
|
163
|
+
|
|
164
|
+
Flaky bugs are often:
|
|
165
|
+
|
|
166
|
+
| Category | Diagnosis approach |
|
|
167
|
+
| ----------------------------- | -------------------------------------------------------------------------------- |
|
|
168
|
+
| **Race condition** | Add logging around concurrent operations; use `--runInBand` to serialise tests |
|
|
169
|
+
| **Timer / clock dependency** | Check if code depends on `Date.now()` or `setTimeout` — use fake timers in tests |
|
|
170
|
+
| **Shared mutable state** | Check for module-level singletons, global variables, or test state leaking |
|
|
171
|
+
| **External service** | Add retry logging; confirm the external service is stable |
|
|
172
|
+
| **Order dependency in tests** | Run tests in reverse or random order to find the dependency |
|
|
173
|
+
|
|
174
|
+
## Logging strategy
|
|
175
|
+
|
|
176
|
+
When the root cause isn't obvious from reading the code:
|
|
177
|
+
|
|
178
|
+
1. **Log at the entry point** — log the inputs to the function where you think the bug is
|
|
179
|
+
2. **Log at the decision point** — log the value of the condition in every important `if` statement
|
|
180
|
+
3. **Log at the exit point** — log what the function returns
|
|
181
|
+
4. **Compare** — where does the actual data diverge from what you expected?
|
|
182
|
+
|
|
183
|
+
**Good log message:**
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
[getUser] id=42, cache_hit=false, db_result=null (user does not exist)
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Bad log message:**
|
|
190
|
+
|
|
191
|
+
```
|
|
192
|
+
error occurred
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## Fix strategy
|
|
196
|
+
|
|
197
|
+
After identifying the root cause:
|
|
198
|
+
|
|
199
|
+
1. **Fix the root cause** — not a workaround (removing the symptom without fixing the cause creates a new bug later)
|
|
200
|
+
2. **Fix the minimum code** — a large fix for a small bug often introduces new bugs
|
|
201
|
+
3. **Preserve the contract** — if fixing a function, don't change its inputs/outputs unless necessary
|
|
202
|
+
4. **Update tests** — if a test failed, update it to reflect correct behaviour; if no test caught the bug, add one
|
|
203
|
+
|
|
204
|
+
## Self-improving learnings
|
|
205
|
+
|
|
206
|
+
`_learnings/debug.yaml` records:
|
|
207
|
+
|
|
208
|
+
- Recurring bug patterns in this codebase
|
|
209
|
+
- Common root causes for this project's tech stack
|
|
210
|
+
- False leads to avoid (previous hypotheses that turned out to be wrong)
|
|
211
|
+
- Areas of the codebase that are frequently buggy
|
|
212
|
+
|
|
213
|
+
## Integration
|
|
214
|
+
|
|
215
|
+
- **agileflow-research** — when stuck after 2 attempts with different fixes, escalate to research before trying a third approach; craft a 200+ line prompt with full context
|
|
216
|
+
- **agileflow-test-writer** — after finding and fixing the root cause, spawn test-writer to add a regression test that prevents the bug from returning
|
|
217
|
+
- **agileflow-refactor** — if the bug was caused by structural problems (deep coupling, unclear state), suggest a refactor pass after the fix lands
|
|
218
|
+
- **agileflow-pr-reviewer** — invoke before merging a bug fix, especially for security-related bugs or fixes touching multiple modules
|
|
219
|
+
- **agileflow-engineering** — delegate the implementation of the fix when it's non-trivial or spans multiple domains
|
|
220
|
+
- **agileflow-audit** — if a bug suggests a systemic problem (repeated null checks, race conditions in multiple files), run an audit to find related issues
|
|
221
|
+
- **agileflow-performance** — hand off if the bug is a performance regression: slow queries, memory leaks, or blocking operations
|
|
222
|
+
- **agileflow-adr** — if fixing the bug requires a design change, document the new approach as an ADR before implementing it
|
|
223
|
+
|
|
224
|
+
## References
|
|
225
|
+
|
|
226
|
+
| File | When to load |
|
|
227
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------ |
|
|
228
|
+
| `references/debugging-strategies.md` | Choosing the right debugging strategy for the error type and environment |
|
|
229
|
+
| `references/common-patterns.md` | Common bug patterns by category — race conditions, null handling, async errors, etc. |
|
|
230
|
+
|
|
231
|
+
## Workflows
|
|
232
|
+
|
|
233
|
+
| File | When to follow |
|
|
234
|
+
| ---------------------------- | ------------------------------------------------------------------------------ |
|
|
235
|
+
| `workflows/debug-issue.md` | Systematic debugging flow from "something's wrong" to root cause and fix |
|
|
236
|
+
| `workflows/reproduce-bug.md` | Creating a minimal reproduction case for a hard-to-isolate or intermittent bug |
|