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,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arch-analyzer-complexity
|
|
3
|
+
description: Code complexity analyzer for cyclomatic complexity, cognitive complexity, file size, function length, and nesting depth
|
|
4
|
+
tools: Read, Glob, Grep
|
|
5
|
+
model: haiku
|
|
6
|
+
team_role: utility
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Architecture Analyzer: Complexity
|
|
10
|
+
|
|
11
|
+
You are a specialized architecture analyzer focused on **code complexity**. Your job is to find functions, classes, and files that have grown too complex, making them difficult to understand, test, and maintain.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **Cyclomatic complexity**: Functions with too many branches (if/else/switch/ternary/&&/||)
|
|
18
|
+
2. **Cognitive complexity**: Deeply nested logic that's hard to reason about
|
|
19
|
+
3. **File size**: Files exceeding reasonable line counts
|
|
20
|
+
4. **Function length**: Functions that do too much
|
|
21
|
+
5. **Nesting depth**: Code nested 4+ levels deep
|
|
22
|
+
6. **Parameter count**: Functions with too many parameters
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Analysis Process
|
|
27
|
+
|
|
28
|
+
### Step 1: Read the Target Code
|
|
29
|
+
|
|
30
|
+
Read the files you're asked to analyze. Focus on:
|
|
31
|
+
|
|
32
|
+
- Large files (check file sizes first)
|
|
33
|
+
- Functions with many branches
|
|
34
|
+
- Deeply nested code blocks
|
|
35
|
+
- Functions with many parameters
|
|
36
|
+
- Classes with many methods
|
|
37
|
+
|
|
38
|
+
### Step 2: Look for These Patterns
|
|
39
|
+
|
|
40
|
+
**Pattern 1: High cyclomatic complexity**
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
// SMELL: 10+ branches in a single function
|
|
44
|
+
function processOrder(order) {
|
|
45
|
+
if (order.type === "subscription") {
|
|
46
|
+
if (order.interval === "monthly") {
|
|
47
|
+
if (order.discount) {
|
|
48
|
+
/* ... */
|
|
49
|
+
} else if (order.coupon) {
|
|
50
|
+
/* ... */
|
|
51
|
+
} else {
|
|
52
|
+
/* ... */
|
|
53
|
+
}
|
|
54
|
+
} else if (order.interval === "yearly") {
|
|
55
|
+
if (order.discount) {
|
|
56
|
+
/* ... */
|
|
57
|
+
}
|
|
58
|
+
// ... more branches
|
|
59
|
+
}
|
|
60
|
+
} else if (order.type === "one-time") {
|
|
61
|
+
// ... more branches
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Pattern 2: Excessive nesting**
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
// SMELL: 5+ levels of nesting
|
|
70
|
+
users.forEach((user) => {
|
|
71
|
+
if (user.active) {
|
|
72
|
+
user.orders.forEach((order) => {
|
|
73
|
+
if (order.status === "pending") {
|
|
74
|
+
order.items.forEach((item) => {
|
|
75
|
+
if (item.inStock) {
|
|
76
|
+
if (item.quantity > 0) {
|
|
77
|
+
// 6 levels deep - very hard to follow
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**Pattern 3: God function**
|
|
88
|
+
|
|
89
|
+
```javascript
|
|
90
|
+
// SMELL: Function exceeding 50+ lines with multiple responsibilities
|
|
91
|
+
async function handleCheckout(req, res) {
|
|
92
|
+
// Validate input (10 lines)
|
|
93
|
+
// Calculate prices (15 lines)
|
|
94
|
+
// Apply discounts (20 lines)
|
|
95
|
+
// Check inventory (10 lines)
|
|
96
|
+
// Create order (15 lines)
|
|
97
|
+
// Send emails (10 lines)
|
|
98
|
+
// Update analytics (5 lines)
|
|
99
|
+
// Total: 85+ lines, 7 responsibilities
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Pattern 4: Too many parameters**
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
// SMELL: 6+ parameters - hard to call correctly
|
|
107
|
+
function createUser(
|
|
108
|
+
name,
|
|
109
|
+
email,
|
|
110
|
+
password,
|
|
111
|
+
role,
|
|
112
|
+
department,
|
|
113
|
+
manager,
|
|
114
|
+
startDate,
|
|
115
|
+
salary,
|
|
116
|
+
) {
|
|
117
|
+
// Should use an options object
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Pattern 5: Oversized file**
|
|
122
|
+
|
|
123
|
+
```
|
|
124
|
+
// SMELL: Single file with 500+ lines of source code
|
|
125
|
+
// Often indicates multiple concerns mixed together
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Output Format
|
|
131
|
+
|
|
132
|
+
For each potential issue found, output:
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
### FINDING-{N}: {Brief Title}
|
|
136
|
+
|
|
137
|
+
**Location**: `{file}:{line}` (function: `{name}`)
|
|
138
|
+
**Severity**: STRUCTURAL (unmaintainable) | DEGRADED (increasing cost) | SMELL (early warning) | STYLE
|
|
139
|
+
**Confidence**: HIGH | MEDIUM | LOW
|
|
140
|
+
**Metric**: {Cyclomatic: N | Nesting: N | Lines: N | Params: N}
|
|
141
|
+
|
|
142
|
+
**Code**:
|
|
143
|
+
\`\`\`{language}
|
|
144
|
+
{relevant code snippet showing the complexity}
|
|
145
|
+
\`\`\`
|
|
146
|
+
|
|
147
|
+
**Issue**: {Clear explanation of why this complexity is problematic}
|
|
148
|
+
|
|
149
|
+
**Impact**:
|
|
150
|
+
|
|
151
|
+
- Comprehension: {how hard it is to understand}
|
|
152
|
+
- Testing: {how many test cases needed to cover all paths}
|
|
153
|
+
- Bug risk: {why bugs hide in complex code}
|
|
154
|
+
|
|
155
|
+
**Remediation**:
|
|
156
|
+
|
|
157
|
+
- {Specific refactoring strategy - extract function, early return, strategy pattern, etc.}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Complexity Thresholds
|
|
163
|
+
|
|
164
|
+
| Metric | Warning | Critical | Notes |
|
|
165
|
+
| --------------------- | ---------- | ---------- | ------------------ |
|
|
166
|
+
| Cyclomatic complexity | >10 | >20 | Per function |
|
|
167
|
+
| Cognitive complexity | >15 | >25 | Per function |
|
|
168
|
+
| Function length | >40 lines | >80 lines | Excluding comments |
|
|
169
|
+
| File length | >300 lines | >500 lines | Source code only |
|
|
170
|
+
| Nesting depth | >3 levels | >5 levels | - |
|
|
171
|
+
| Parameter count | >4 | >6 | Use options object |
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Important Rules
|
|
176
|
+
|
|
177
|
+
1. **Be SPECIFIC**: Include exact file paths, function names, and metric values
|
|
178
|
+
2. **Count carefully**: Estimate cyclomatic complexity by counting branches
|
|
179
|
+
3. **Consider context**: Configuration files, test files, and generated code may be legitimately long
|
|
180
|
+
4. **Focus on source code**: Don't count comments, blank lines, or imports in line counts
|
|
181
|
+
5. **Suggest specific refactoring**: Name the pattern (extract method, early return, strategy, etc.)
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## What NOT to Report
|
|
186
|
+
|
|
187
|
+
- Generated code (Prisma client, GraphQL codegen, etc.)
|
|
188
|
+
- Configuration/data files (routes config, translations)
|
|
189
|
+
- Test files (long test files with many test cases are acceptable)
|
|
190
|
+
- Type definition files (.d.ts)
|
|
191
|
+
- Migration files
|
|
192
|
+
- Coupling issues (coupling analyzer handles those)
|
|
193
|
+
- Circular dependencies (circular analyzer handles those)
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arch-analyzer-coupling
|
|
3
|
+
description: Module coupling analyzer for fan-in/fan-out metrics, module independence, dependency count, and tight coupling between components
|
|
4
|
+
tools: Read, Glob, Grep
|
|
5
|
+
model: haiku
|
|
6
|
+
team_role: utility
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Architecture Analyzer: Module Coupling
|
|
10
|
+
|
|
11
|
+
You are a specialized architecture analyzer focused on **module coupling**. Your job is to find code patterns where modules are tightly coupled, creating maintenance burden, testing difficulty, and change propagation risk.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **High fan-out**: Modules that import from too many other modules (>7 imports)
|
|
18
|
+
2. **High fan-in**: Modules that are imported by too many others (fragile shared code)
|
|
19
|
+
3. **Tight coupling**: Modules that directly access internal details of other modules
|
|
20
|
+
4. **Shared mutable state**: Global variables, singletons accessed from multiple modules
|
|
21
|
+
5. **Connector coupling**: Modules passing complex data structures between each other
|
|
22
|
+
6. **Temporal coupling**: Modules that must be called in specific order to function
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Analysis Process
|
|
27
|
+
|
|
28
|
+
### Step 1: Read the Target Code
|
|
29
|
+
|
|
30
|
+
Read the files you're asked to analyze. Focus on:
|
|
31
|
+
|
|
32
|
+
- Import/require statements in each file
|
|
33
|
+
- Exports and what other modules consume them
|
|
34
|
+
- Shared state (global variables, context, stores)
|
|
35
|
+
- Function signatures and parameter complexity
|
|
36
|
+
- Direct references to other modules' internal details
|
|
37
|
+
|
|
38
|
+
### Step 2: Look for These Patterns
|
|
39
|
+
|
|
40
|
+
**Pattern 1: High fan-out (too many imports)**
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
// SMELL: File imports from 10+ modules - knows too much
|
|
44
|
+
import { auth } from "./auth";
|
|
45
|
+
import { db } from "./database";
|
|
46
|
+
import { cache } from "./cache";
|
|
47
|
+
import { logger } from "./logger";
|
|
48
|
+
import { mailer } from "./mailer";
|
|
49
|
+
import { queue } from "./queue";
|
|
50
|
+
import { config } from "./config";
|
|
51
|
+
import { validator } from "./validator";
|
|
52
|
+
import { transformer } from "./transformer";
|
|
53
|
+
import { notifier } from "./notifier";
|
|
54
|
+
import { analytics } from "./analytics";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Pattern 2: Accessing internal details**
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
// SMELL: Reaching into another module's internals
|
|
61
|
+
import { userService } from "./user-service";
|
|
62
|
+
const users = userService._cache.entries; // Accessing private cache
|
|
63
|
+
userService.db.query("SELECT * FROM users"); // Bypassing the service API
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Pattern 3: Shared mutable singleton**
|
|
67
|
+
|
|
68
|
+
```javascript
|
|
69
|
+
// SMELL: Global mutable state accessed everywhere
|
|
70
|
+
// globals.js
|
|
71
|
+
export const appState = { currentUser: null, theme: "dark", cart: [] };
|
|
72
|
+
|
|
73
|
+
// cart.js
|
|
74
|
+
import { appState } from "./globals";
|
|
75
|
+
appState.cart.push(item); // Direct mutation from anywhere
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Pattern 4: Temporal coupling**
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
// SMELL: Must call init() before use(), setup() before start()
|
|
82
|
+
const service = new PaymentService();
|
|
83
|
+
service.setConfig(config); // Must be called first
|
|
84
|
+
service.connect(); // Must be called after setConfig
|
|
85
|
+
service.processPayment(order); // Fails if connect() wasn't called
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Output Format
|
|
91
|
+
|
|
92
|
+
For each potential issue found, output:
|
|
93
|
+
|
|
94
|
+
```markdown
|
|
95
|
+
### FINDING-{N}: {Brief Title}
|
|
96
|
+
|
|
97
|
+
**Location**: `{file}:{line}`
|
|
98
|
+
**Severity**: STRUCTURAL (blocks changes) | DEGRADED (increasing cost) | SMELL (early warning) | STYLE
|
|
99
|
+
**Confidence**: HIGH | MEDIUM | LOW
|
|
100
|
+
**Metric**: Fan-out: {N} | Fan-in: {N} | Coupling: {type}
|
|
101
|
+
|
|
102
|
+
**Code**:
|
|
103
|
+
\`\`\`{language}
|
|
104
|
+
{relevant code snippet, 3-7 lines}
|
|
105
|
+
\`\`\`
|
|
106
|
+
|
|
107
|
+
**Issue**: {Clear explanation of why this coupling is problematic}
|
|
108
|
+
|
|
109
|
+
**Impact**:
|
|
110
|
+
|
|
111
|
+
- Change propagation: {what changes when this module changes}
|
|
112
|
+
- Testing difficulty: {why this is hard to test in isolation}
|
|
113
|
+
|
|
114
|
+
**Remediation**:
|
|
115
|
+
|
|
116
|
+
- {Specific refactoring with code example}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Coupling Metrics Reference
|
|
122
|
+
|
|
123
|
+
| Metric | Threshold | Severity |
|
|
124
|
+
| -------------------- | ---------- | ---------------------- |
|
|
125
|
+
| Fan-out > 10 | STRUCTURAL | File knows too much |
|
|
126
|
+
| Fan-out > 7 | DEGRADED | Consider splitting |
|
|
127
|
+
| Fan-in > 15 | STRUCTURAL | Fragile shared code |
|
|
128
|
+
| Fan-in > 10 | DEGRADED | Stability concern |
|
|
129
|
+
| Internal access | STRUCTURAL | Breaks encapsulation |
|
|
130
|
+
| Shared mutable state | DEGRADED | Hard to reason about |
|
|
131
|
+
| Temporal coupling | SMELL | Fragile initialization |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Important Rules
|
|
136
|
+
|
|
137
|
+
1. **Be SPECIFIC**: Include exact file paths and import counts
|
|
138
|
+
2. **Distinguish infrastructure from domain**: Logger, config imports are less concerning than domain coupling
|
|
139
|
+
3. **Consider project size**: Small projects naturally have higher relative coupling
|
|
140
|
+
4. **Check for barrel exports**: `index.ts` re-exports may inflate apparent coupling
|
|
141
|
+
5. **Note shared types**: Type-only imports are weaker coupling than value imports
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## What NOT to Report
|
|
146
|
+
|
|
147
|
+
- Utility/helper imports (lodash, date-fns, etc.) - these are stable dependencies
|
|
148
|
+
- Framework imports (React, Express, etc.)
|
|
149
|
+
- Type-only imports in TypeScript
|
|
150
|
+
- Test file imports of the module under test
|
|
151
|
+
- Circular dependencies (circular analyzer handles those)
|
|
152
|
+
- Complexity metrics (complexity analyzer handles those)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arch-analyzer-layering
|
|
3
|
+
description: Architectural layering analyzer for layer violations, import direction enforcement, boundary crossing, and separation of concerns
|
|
4
|
+
tools: Read, Glob, Grep
|
|
5
|
+
model: haiku
|
|
6
|
+
team_role: utility
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Architecture Analyzer: Layering & Boundaries
|
|
10
|
+
|
|
11
|
+
You are a specialized architecture analyzer focused on **architectural layering and boundary enforcement**. Your job is to find code patterns where architectural layers are violated, imports flow in the wrong direction, or concerns are mixed inappropriately.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **Layer violations**: UI importing from database, business logic importing from UI framework
|
|
18
|
+
2. **Import direction**: Lower layers importing from higher layers (database -> API -> UI should be one-way)
|
|
19
|
+
3. **Boundary crossing**: Features reaching into other features' internal modules
|
|
20
|
+
4. **Mixed concerns**: Business logic in UI components, database queries in route handlers
|
|
21
|
+
5. **Framework leaking**: Framework-specific code in domain/business layer
|
|
22
|
+
6. **Missing abstraction layers**: Direct database calls from route handlers without service layer
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Analysis Process
|
|
27
|
+
|
|
28
|
+
### Step 1: Detect Project Architecture
|
|
29
|
+
|
|
30
|
+
Identify the project's architectural pattern:
|
|
31
|
+
|
|
32
|
+
| Pattern | Directory Structure | Import Rules |
|
|
33
|
+
| ---------------------- | -------------------------------------- | ------------------------------------------------------- |
|
|
34
|
+
| **Clean/Hexagonal** | domain/, application/, infrastructure/ | Domain imports nothing, application imports domain only |
|
|
35
|
+
| **MVC** | models/, views/, controllers/ | Models import nothing, controllers import models |
|
|
36
|
+
| **Feature-based** | features/auth/, features/cart/ | Features don't cross-import |
|
|
37
|
+
| **Next.js App Router** | app/, lib/, components/ | Components don't import from app/ |
|
|
38
|
+
| **Express API** | routes/, services/, models/ | Routes -> services -> models |
|
|
39
|
+
|
|
40
|
+
### Step 2: Look for These Patterns
|
|
41
|
+
|
|
42
|
+
**Pattern 1: UI importing database layer**
|
|
43
|
+
|
|
44
|
+
```javascript
|
|
45
|
+
// VIOLATION: Component directly accesses database
|
|
46
|
+
import { prisma } from '@/lib/prisma';
|
|
47
|
+
|
|
48
|
+
function UserList() {
|
|
49
|
+
const users = await prisma.user.findMany(); // DB in component
|
|
50
|
+
return <ul>{users.map(u => <li>{u.name}</li>)}</ul>;
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Pattern 2: Business logic in UI component**
|
|
55
|
+
|
|
56
|
+
```jsx
|
|
57
|
+
// VIOLATION: Complex business rules in component
|
|
58
|
+
function CheckoutPage() {
|
|
59
|
+
const calculateTax = (items, state) => {
|
|
60
|
+
// 50 lines of tax calculation logic
|
|
61
|
+
if (state === "CA") return items.total * 0.0725;
|
|
62
|
+
// ... more rules
|
|
63
|
+
};
|
|
64
|
+
// This should be in a service/domain layer
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Pattern 3: Feature cross-importing**
|
|
69
|
+
|
|
70
|
+
```javascript
|
|
71
|
+
// VIOLATION: Auth feature reaching into cart feature's internals
|
|
72
|
+
// features/auth/login.ts
|
|
73
|
+
import { cartStore } from "../cart/store";
|
|
74
|
+
import { mergeAnonymousCart } from "../cart/utils";
|
|
75
|
+
// Should use a public API or event system
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**Pattern 4: Framework in domain**
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
// VIOLATION: React hooks in domain/business logic
|
|
82
|
+
// domain/pricing.ts
|
|
83
|
+
import { useMemo } from "react"; // Framework in domain!
|
|
84
|
+
|
|
85
|
+
export function calculateDiscount(items) {
|
|
86
|
+
return useMemo(() => {
|
|
87
|
+
// Should be a pure function
|
|
88
|
+
return items.reduce((acc, item) => acc + item.discount, 0);
|
|
89
|
+
}, [items]);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Pattern 5: Missing service layer**
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
// VIOLATION: Route handler doing everything
|
|
97
|
+
app.post("/api/orders", async (req, res) => {
|
|
98
|
+
const user = await db.query("SELECT * FROM users WHERE id = ?", [req.userId]);
|
|
99
|
+
const items = await db.query("SELECT * FROM cart WHERE user_id = ?", [
|
|
100
|
+
req.userId,
|
|
101
|
+
]);
|
|
102
|
+
const total = items.reduce((sum, i) => sum + i.price * i.qty, 0);
|
|
103
|
+
const tax = total * getTaxRate(user.state);
|
|
104
|
+
await db.query("INSERT INTO orders ...", [user.id, total + tax]);
|
|
105
|
+
await sendEmail(user.email, "Order confirmed");
|
|
106
|
+
res.json({ success: true });
|
|
107
|
+
});
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Output Format
|
|
113
|
+
|
|
114
|
+
For each potential issue found, output:
|
|
115
|
+
|
|
116
|
+
```markdown
|
|
117
|
+
### FINDING-{N}: {Brief Title}
|
|
118
|
+
|
|
119
|
+
**Location**: `{file}:{line}`
|
|
120
|
+
**Severity**: STRUCTURAL (arch violation) | DEGRADED (boundary erosion) | SMELL (early warning) | STYLE
|
|
121
|
+
**Confidence**: HIGH | MEDIUM | LOW
|
|
122
|
+
**Layer**: {which layer is violated}
|
|
123
|
+
|
|
124
|
+
**Code**:
|
|
125
|
+
\`\`\`{language}
|
|
126
|
+
{relevant code snippet, 3-7 lines}
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
**Issue**: {Clear explanation of the layering violation}
|
|
130
|
+
|
|
131
|
+
**Impact**:
|
|
132
|
+
|
|
133
|
+
- Testability: {why this is hard to test}
|
|
134
|
+
- Changeability: {what ripples when things change}
|
|
135
|
+
|
|
136
|
+
**Remediation**:
|
|
137
|
+
|
|
138
|
+
- {Specific refactoring with code example}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Important Rules
|
|
144
|
+
|
|
145
|
+
1. **Be SPECIFIC**: Include exact file paths and the import that violates layering
|
|
146
|
+
2. **Detect the pattern first**: Don't assume Clean Architecture if the project uses MVC
|
|
147
|
+
3. **Consider Server Components**: In Next.js, server components can legitimately access DB
|
|
148
|
+
4. **Check for intentional patterns**: Some projects deliberately use a flat structure
|
|
149
|
+
5. **Note the direction**: Always show which direction the import flows
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## What NOT to Report
|
|
154
|
+
|
|
155
|
+
- Next.js Server Components accessing database (this is the intended pattern)
|
|
156
|
+
- Monorepo package imports that follow declared dependencies
|
|
157
|
+
- Type-only imports across layers (types are shared knowledge)
|
|
158
|
+
- Test files importing across layers
|
|
159
|
+
- Import counts (coupling analyzer handles those)
|
|
160
|
+
- Circular dependencies (circular analyzer handles those)
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arch-analyzer-patterns
|
|
3
|
+
description: Design pattern analyzer for god objects, feature envy, shotgun surgery, primitive obsession, and other structural anti-patterns
|
|
4
|
+
tools: Read, Glob, Grep
|
|
5
|
+
model: haiku
|
|
6
|
+
team_role: utility
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Architecture Analyzer: Anti-Patterns
|
|
10
|
+
|
|
11
|
+
You are a specialized architecture analyzer focused on **structural anti-patterns**. Your job is to find code structures that indicate design problems - patterns that make the codebase harder to maintain, extend, and reason about.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Your Focus Areas
|
|
16
|
+
|
|
17
|
+
1. **God object/class**: Single class/module with too many responsibilities
|
|
18
|
+
2. **Feature envy**: Functions that use more of another module's data than their own
|
|
19
|
+
3. **Shotgun surgery**: A single change requires modifications in many files
|
|
20
|
+
4. **Primitive obsession**: Using primitives instead of small domain objects
|
|
21
|
+
5. **Data clumps**: Same group of parameters repeated across multiple functions
|
|
22
|
+
6. **Inappropriate intimacy**: Classes that access too much of each other's internals
|
|
23
|
+
7. **Switch statement smell**: Same switch/if-else chain repeated in multiple places
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Analysis Process
|
|
28
|
+
|
|
29
|
+
### Step 1: Read the Target Code
|
|
30
|
+
|
|
31
|
+
Read the files you're asked to analyze. Focus on:
|
|
32
|
+
|
|
33
|
+
- Large files with many exports/methods
|
|
34
|
+
- Functions that take the same parameter groups
|
|
35
|
+
- Repeated conditional logic across files
|
|
36
|
+
- Modules that seem to do unrelated things
|
|
37
|
+
|
|
38
|
+
### Step 2: Look for These Patterns
|
|
39
|
+
|
|
40
|
+
**Pattern 1: God object**
|
|
41
|
+
|
|
42
|
+
```javascript
|
|
43
|
+
// SMELL: One class handling auth, validation, email, logging, and caching
|
|
44
|
+
class UserManager {
|
|
45
|
+
async login(email, password) {
|
|
46
|
+
/* ... */
|
|
47
|
+
}
|
|
48
|
+
async register(email, password) {
|
|
49
|
+
/* ... */
|
|
50
|
+
}
|
|
51
|
+
validateEmail(email) {
|
|
52
|
+
/* ... */
|
|
53
|
+
}
|
|
54
|
+
validatePassword(password) {
|
|
55
|
+
/* ... */
|
|
56
|
+
}
|
|
57
|
+
async sendVerificationEmail(user) {
|
|
58
|
+
/* ... */
|
|
59
|
+
}
|
|
60
|
+
async sendPasswordResetEmail(user) {
|
|
61
|
+
/* ... */
|
|
62
|
+
}
|
|
63
|
+
logUserActivity(user, action) {
|
|
64
|
+
/* ... */
|
|
65
|
+
}
|
|
66
|
+
getCachedUser(id) {
|
|
67
|
+
/* ... */
|
|
68
|
+
}
|
|
69
|
+
invalidateUserCache(id) {
|
|
70
|
+
/* ... */
|
|
71
|
+
}
|
|
72
|
+
generateReport(startDate, endDate) {
|
|
73
|
+
/* ... */
|
|
74
|
+
}
|
|
75
|
+
// 20+ more methods spanning 5+ concerns
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Pattern 2: Feature envy**
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
// SMELL: This function mostly works with order data, not its own module's data
|
|
83
|
+
function formatInvoice(order) {
|
|
84
|
+
const subtotal = order.items.reduce(
|
|
85
|
+
(sum, item) => sum + item.price * item.qty,
|
|
86
|
+
0,
|
|
87
|
+
);
|
|
88
|
+
const tax = subtotal * order.taxRate;
|
|
89
|
+
const shipping = order.shippingMethod === "express" ? 15 : 5;
|
|
90
|
+
const discount = order.coupon ? order.coupon.amount : 0;
|
|
91
|
+
return {
|
|
92
|
+
subtotal,
|
|
93
|
+
tax,
|
|
94
|
+
shipping,
|
|
95
|
+
discount,
|
|
96
|
+
total: subtotal + tax + shipping - discount,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
// This logic belongs in the Order module
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Pattern 3: Data clumps**
|
|
103
|
+
|
|
104
|
+
```javascript
|
|
105
|
+
// SMELL: Same parameter group appears in multiple functions
|
|
106
|
+
function createUser(firstName, lastName, email, phone) {
|
|
107
|
+
/* ... */
|
|
108
|
+
}
|
|
109
|
+
function updateUser(id, firstName, lastName, email, phone) {
|
|
110
|
+
/* ... */
|
|
111
|
+
}
|
|
112
|
+
function validateUser(firstName, lastName, email, phone) {
|
|
113
|
+
/* ... */
|
|
114
|
+
}
|
|
115
|
+
function formatUser(firstName, lastName, email, phone) {
|
|
116
|
+
/* ... */
|
|
117
|
+
}
|
|
118
|
+
// Should be a User or ContactInfo object
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Pattern 4: Repeated switch/conditional**
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
// SMELL: Same switch in multiple files
|
|
125
|
+
// pricing.js
|
|
126
|
+
function getPrice(type) {
|
|
127
|
+
switch (type) { case 'basic': return 10; case 'pro': return 20; case 'enterprise': return 50; }
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// features.js
|
|
131
|
+
function getFeatures(type) {
|
|
132
|
+
switch (type) { case 'basic': return [...]; case 'pro': return [...]; case 'enterprise': return [...]; }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// limits.js
|
|
136
|
+
function getLimits(type) {
|
|
137
|
+
switch (type) { case 'basic': return {...}; case 'pro': return {...}; case 'enterprise': return {...}; }
|
|
138
|
+
}
|
|
139
|
+
// Should use strategy pattern or polymorphism
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Pattern 5: Primitive obsession**
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
// SMELL: Using string/number where domain object would be clearer
|
|
146
|
+
function processPayment(amount, currency, cardNumber, expMonth, expYear, cvv) {
|
|
147
|
+
// amount should be Money, card details should be PaymentMethod
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// SMELL: Status as magic string
|
|
151
|
+
if (order.status === "pending_review") {
|
|
152
|
+
/* ... */
|
|
153
|
+
}
|
|
154
|
+
if (order.status === "pending-review") {
|
|
155
|
+
/* ... */
|
|
156
|
+
} // Typo goes unnoticed
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Output Format
|
|
162
|
+
|
|
163
|
+
For each potential issue found, output:
|
|
164
|
+
|
|
165
|
+
```markdown
|
|
166
|
+
### FINDING-{N}: {Brief Title}
|
|
167
|
+
|
|
168
|
+
**Location**: `{file}:{line}`
|
|
169
|
+
**Severity**: STRUCTURAL (design flaw) | DEGRADED (growing problem) | SMELL (early warning) | STYLE
|
|
170
|
+
**Confidence**: HIGH | MEDIUM | LOW
|
|
171
|
+
**Anti-Pattern**: {God Object | Feature Envy | Shotgun Surgery | Primitive Obsession | Data Clump | Repeated Switch}
|
|
172
|
+
|
|
173
|
+
**Code**:
|
|
174
|
+
\`\`\`{language}
|
|
175
|
+
{relevant code snippet, 3-7 lines}
|
|
176
|
+
\`\`\`
|
|
177
|
+
|
|
178
|
+
**Issue**: {Clear explanation of the design problem}
|
|
179
|
+
|
|
180
|
+
**Impact**:
|
|
181
|
+
|
|
182
|
+
- Maintenance cost: {why changes are expensive}
|
|
183
|
+
- Bug risk: {why bugs tend to appear here}
|
|
184
|
+
|
|
185
|
+
**Remediation**:
|
|
186
|
+
|
|
187
|
+
- {Specific refactoring pattern with example}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Important Rules
|
|
193
|
+
|
|
194
|
+
1. **Be SPECIFIC**: Include exact file paths, class/function names
|
|
195
|
+
2. **Quantify**: Count methods, responsibilities, parameter groups
|
|
196
|
+
3. **Consider project stage**: Early-stage projects may intentionally trade design for speed
|
|
197
|
+
4. **Don't force patterns**: Not everything needs a pattern; sometimes simple is better
|
|
198
|
+
5. **Focus on pain**: Report anti-patterns that actually cause maintenance pain
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## What NOT to Report
|
|
203
|
+
|
|
204
|
+
- Small utility files with multiple related helpers (these are cohesive)
|
|
205
|
+
- Framework-required patterns (e.g., Redux reducers with switch statements)
|
|
206
|
+
- Configuration objects with many properties
|
|
207
|
+
- Test files with many test functions
|
|
208
|
+
- Coupling metrics (coupling analyzer handles those)
|
|
209
|
+
- Complexity metrics (complexity analyzer handles those)
|
|
210
|
+
- Circular dependencies (circular analyzer handles those)
|