@siliconoid/agentkit 0.1.0
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/LICENSE +21 -0
- package/README.md +247 -0
- package/bin/cli.mjs +134 -0
- package/lib/adapters/antigravity.mjs +70 -0
- package/lib/adapters/claude.mjs +85 -0
- package/lib/adapters/codex.mjs +60 -0
- package/lib/adapters/cursor.mjs +58 -0
- package/lib/adapters/gemini.mjs +69 -0
- package/lib/adapters/windsurf.mjs +65 -0
- package/lib/commands/add-platform.mjs +73 -0
- package/lib/commands/add-skill-pack.mjs +49 -0
- package/lib/commands/add-skill.mjs +78 -0
- package/lib/commands/diff.mjs +110 -0
- package/lib/commands/doctor.mjs +196 -0
- package/lib/commands/init.mjs +261 -0
- package/lib/commands/install.mjs +236 -0
- package/lib/commands/list.mjs +105 -0
- package/lib/commands/remove.mjs +126 -0
- package/lib/commands/sync.mjs +155 -0
- package/lib/commands/update.mjs +113 -0
- package/lib/index.mjs +233 -0
- package/lib/log.mjs +89 -0
- package/lib/prompts.mjs +348 -0
- package/lib/scaffold.mjs +385 -0
- package/lib/schema.mjs +135 -0
- package/lib/utils.mjs +296 -0
- package/package.json +57 -0
- package/templates/base/.ai/changelog/README.md +21 -0
- package/templates/base/.ai/decisions/README.md +34 -0
- package/templates/base/.ai/decisions/_template.md +29 -0
- package/templates/base/.ai/memory/debugging-patterns.md +5 -0
- package/templates/base/.ai/memory/known-issues.md +5 -0
- package/templates/base/.ai/memory/refactoring-log.md +5 -0
- package/templates/base/.ai/rules/01-project-overview.md +23 -0
- package/templates/base/.ai/rules/02-architecture.md +17 -0
- package/templates/base/.ai/rules/03-coding-conventions.md +26 -0
- package/templates/base/.ai/rules/04-directory-structure.md +20 -0
- package/templates/base/.ai/rules/05-environment.md +29 -0
- package/templates/base/.ai/rules/06-typescript.md +32 -0
- package/templates/base/.ai/rules/07-react.md +34 -0
- package/templates/base/.ai/rules/08-styling.md +38 -0
- package/templates/base/.ai/rules/09-naming.md +40 -0
- package/templates/base/.ai/rules/10-git-workflow.md +48 -0
- package/templates/base/.ai/rules/11-testing.md +19 -0
- package/templates/base/.ai/rules/12-forbidden-patterns.md +13 -0
- package/templates/base/.ai/rules/13-ai-agent.md +23 -0
- package/templates/base/.ai/scripts/sync-skills.mjs +15 -0
- package/templates/base/.ai/skills/adr/manifest.yaml +4 -0
- package/templates/base/.ai/skills/adr/skill.md +64 -0
- package/templates/base/.ai/skills/devlog/manifest.yaml +4 -0
- package/templates/base/.ai/skills/devlog/skill.md +63 -0
- package/templates/base/.ai/skills/wrap-up/manifest.yaml +4 -0
- package/templates/base/.ai/skills/wrap-up/skill.md +85 -0
- package/templates/base/.specs/README.md +37 -0
- package/templates/base/.specs/epics/.gitkeep +0 -0
- package/templates/base/.specs/stories/.gitkeep +0 -0
- package/templates/base/.specs/tasks/draft/.gitkeep +0 -0
- package/templates/bmad/_bmad/_config/agent-manifest.csv +11 -0
- package/templates/bmad/_bmad/_config/agents/bmm-analyst.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-architect.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-dev.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-pm.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-quick-flow-solo-dev.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-sm.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-tea.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-tech-writer.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/bmm-ux-designer.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/agents/core-bmad-master.customize.yaml +41 -0
- package/templates/bmad/_bmad/_config/files-manifest.csv +290 -0
- package/templates/bmad/_bmad/_config/ides/claude-code.yaml +6 -0
- package/templates/bmad/_bmad/_config/ides/codex.yaml +5 -0
- package/templates/bmad/_bmad/_config/manifest.yaml +8 -0
- package/templates/bmad/_bmad/_config/task-manifest.csv +5 -0
- package/templates/bmad/_bmad/_config/tool-manifest.csv +1 -0
- package/templates/bmad/_bmad/_config/workflow-manifest.csv +35 -0
- package/templates/bmad/_bmad/bmm/agents/analyst.md +76 -0
- package/templates/bmad/_bmad/bmm/agents/architect.md +68 -0
- package/templates/bmad/_bmad/bmm/agents/dev.md +70 -0
- package/templates/bmad/_bmad/bmm/agents/pm.md +72 -0
- package/templates/bmad/_bmad/bmm/agents/quick-flow-solo-dev.md +68 -0
- package/templates/bmad/_bmad/bmm/agents/sm.md +71 -0
- package/templates/bmad/_bmad/bmm/agents/tea.md +71 -0
- package/templates/bmad/_bmad/bmm/agents/tech-writer.md +72 -0
- package/templates/bmad/_bmad/bmm/agents/ux-designer.md +68 -0
- package/templates/bmad/_bmad/bmm/config.yaml +18 -0
- package/templates/bmad/_bmad/bmm/data/README.md +29 -0
- package/templates/bmad/_bmad/bmm/data/documentation-standards.md +262 -0
- package/templates/bmad/_bmad/bmm/data/project-context-template.md +40 -0
- package/templates/bmad/_bmad/bmm/teams/default-party.csv +21 -0
- package/templates/bmad/_bmad/bmm/teams/team-fullstack.yaml +12 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/api-request.md +442 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/api-testing-patterns.md +843 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/auth-session.md +552 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/burn-in.md +273 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/ci-burn-in.md +675 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/component-tdd.md +486 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/contract-testing.md +957 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/data-factories.md +500 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/email-auth.md +721 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/error-handling.md +725 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/feature-flags.md +750 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/file-utils.md +463 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/fixture-architecture.md +401 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/fixtures-composition.md +382 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/intercept-network-call.md +430 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/log.md +429 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/network-error-monitor.md +405 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/network-first.md +486 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/network-recorder.md +527 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/nfr-criteria.md +670 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/overview.md +286 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/playwright-config.md +730 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/probability-impact.md +601 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/recurse.md +421 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/risk-governance.md +615 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/selective-testing.md +732 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/selector-resilience.md +527 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/test-healing-patterns.md +644 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/test-levels-framework.md +473 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/test-priorities-matrix.md +373 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/test-quality.md +664 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/timing-debugging.md +372 -0
- package/templates/bmad/_bmad/bmm/testarch/knowledge/visual-debugging.md +524 -0
- package/templates/bmad/_bmad/bmm/testarch/tea-index.csv +34 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/product-brief.template.md +10 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01-init.md +177 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-01b-continue.md +161 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-02-vision.md +199 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-03-users.md +202 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-04-metrics.md +205 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-05-scope.md +219 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/steps/step-06-complete.md +194 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/create-product-brief/workflow.md +58 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-01-init.md +137 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-02-domain-analysis.md +229 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-03-competitive-landscape.md +238 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-04-regulatory-focus.md +206 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-05-technical-trends.md +234 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/domain-steps/step-06-research-synthesis.md +443 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-01-init.md +182 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-behavior.md +237 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-02-customer-insights.md +200 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-03-customer-pain-points.md +249 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-04-customer-decisions.md +259 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-05-competitive-analysis.md +177 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/market-steps/step-06-research-completion.md +475 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/research.template.md +29 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-01-init.md +137 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-02-technical-overview.md +239 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-03-integration-patterns.md +248 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-04-architectural-patterns.md +202 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-05-implementation-research.md +239 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/technical-steps/step-06-research-synthesis.md +486 -0
- package/templates/bmad/_bmad/bmm/workflows/1-analysis/research/workflow.md +173 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01-init.md +135 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-01b-continue.md +127 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-02-discovery.md +190 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-03-core-experience.md +216 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-04-emotional-response.md +219 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-05-inspiration.md +234 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-06-design-system.md +252 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-07-defining-experience.md +254 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-08-visual-foundation.md +224 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-09-design-directions.md +224 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-10-user-journeys.md +241 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-11-component-strategy.md +248 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-12-ux-patterns.md +237 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-13-responsive-accessibility.md +264 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/steps/step-14-complete.md +228 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/ux-design-template.md +13 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/create-ux-design/workflow.md +43 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/data/domain-complexity.csv +13 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/data/prd-purpose.md +197 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/data/project-types.csv +11 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01-init.md +191 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-01b-continue.md +153 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-02-discovery.md +224 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-03-success.md +226 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-04-journeys.md +213 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-05-domain.md +207 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-06-innovation.md +226 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-07-project-type.md +237 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-08-scoping.md +228 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-09-functional.md +231 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-10-nonfunctional.md +242 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-11-polish.md +217 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-c/step-12-complete.md +180 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01-discovery.md +247 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-01b-legacy-conversion.md +208 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-02-review.md +249 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-03-edit.md +253 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-e/step-e-04-complete.md +168 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-01-discovery.md +218 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02-format-detection.md +191 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-02b-parity-check.md +209 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-03-density-validation.md +174 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-04-brief-coverage-validation.md +214 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-05-measurability-validation.md +228 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-06-traceability-validation.md +217 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-07-implementation-leakage-validation.md +205 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-08-domain-compliance-validation.md +243 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-09-project-type-validation.md +263 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-10-smart-validation.md +209 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-11-holistic-quality-validation.md +264 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-12-completeness-validation.md +242 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/steps-v/step-v-13-report-complete.md +232 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/templates/prd-template.md +10 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/validation-report-prd-workflow.md +433 -0
- package/templates/bmad/_bmad/bmm/workflows/2-plan-workflows/prd/workflow.md +150 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-01-document-discovery.md +190 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-02-prd-analysis.md +178 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-03-epic-coverage-validation.md +179 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-04-ux-alignment.md +139 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-05-epic-quality-review.md +252 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/steps/step-06-final-assessment.md +133 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/templates/readiness-report-template.md +4 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/check-implementation-readiness/workflow.md +55 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/architecture-decision-template.md +12 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/data/domain-complexity.csv +11 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/data/project-types.csv +7 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01-init.md +153 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-01b-continue.md +164 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-02-context.md +224 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-03-starter.md +331 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-04-decisions.md +318 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-05-patterns.md +359 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-06-structure.md +379 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-07-validation.md +359 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/steps/step-08-complete.md +352 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-architecture/workflow.md +50 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-01-validate-prerequisites.md +259 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-02-design-epics.md +233 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-03-create-stories.md +272 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/steps/step-04-final-validation.md +145 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/templates/epics-template.md +57 -0
- package/templates/bmad/_bmad/bmm/workflows/3-solutioning/create-epics-and-stories/workflow.md +59 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/code-review/checklist.md +23 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/code-review/instructions.xml +227 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/code-review/workflow.yaml +50 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/correct-course/checklist.md +279 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/correct-course/instructions.md +206 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/correct-course/workflow.yaml +58 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/create-story/checklist.md +358 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/create-story/instructions.xml +345 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/create-story/template.md +49 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/create-story/workflow.yaml +59 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/dev-story/checklist.md +80 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/dev-story/instructions.xml +410 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/dev-story/workflow.yaml +25 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/retrospective/instructions.md +1443 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/retrospective/workflow.yaml +57 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-planning/checklist.md +33 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-planning/instructions.md +225 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-planning/sprint-status-template.yaml +55 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-planning/workflow.yaml +52 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-status/instructions.md +229 -0
- package/templates/bmad/_bmad/bmm/workflows/4-implementation/sprint-status/workflow.yaml +35 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-01-mode-detection.md +156 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-02-context-gathering.md +120 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-03-execute.md +113 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-04-self-check.md +113 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-05-adversarial-review.md +106 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/steps/step-06-resolve-findings.md +140 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-dev/workflow.md +52 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-01-understand.md +189 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-02-investigate.md +144 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-03-generate.md +128 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/steps/step-04-review.md +173 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/tech-spec-template.md +74 -0
- package/templates/bmad/_bmad/bmm/workflows/bmad-quick-flow/quick-spec/workflow.md +79 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/checklist.md +245 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/documentation-requirements.csv +12 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/instructions.md +221 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/templates/deep-dive-template.md +345 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/templates/index-template.md +169 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/templates/project-overview-template.md +103 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/templates/project-scan-report-schema.json +160 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/templates/source-tree-template.md +135 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/workflow.yaml +28 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/workflows/deep-dive-instructions.md +298 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/workflows/deep-dive.yaml +31 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/workflows/full-scan-instructions.md +1106 -0
- package/templates/bmad/_bmad/bmm/workflows/document-project/workflows/full-scan.yaml +31 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-library.json +90 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/_shared/excalidraw-templates.yaml +127 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/checklist.md +39 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/instructions.md +130 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-dataflow/workflow.yaml +26 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/checklist.md +43 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/instructions.md +141 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-diagram/workflow.yaml +26 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/checklist.md +49 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/instructions.md +241 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-flowchart/workflow.yaml +26 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/checklist.md +38 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/instructions.md +133 -0
- package/templates/bmad/_bmad/bmm/workflows/excalidraw-diagrams/create-wireframe/workflow.yaml +26 -0
- package/templates/bmad/_bmad/bmm/workflows/generate-project-context/project-context-template.md +21 -0
- package/templates/bmad/_bmad/bmm/workflows/generate-project-context/steps/step-01-discover.md +184 -0
- package/templates/bmad/_bmad/bmm/workflows/generate-project-context/steps/step-02-generate.md +318 -0
- package/templates/bmad/_bmad/bmm/workflows/generate-project-context/steps/step-03-complete.md +278 -0
- package/templates/bmad/_bmad/bmm/workflows/generate-project-context/workflow.md +49 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/atdd/atdd-checklist-template.md +364 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/atdd/checklist.md +374 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/atdd/instructions.md +806 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/atdd/workflow.yaml +45 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/automate/checklist.md +582 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/automate/instructions.md +1324 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/automate/workflow.yaml +52 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/ci/checklist.md +248 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/ci/github-actions-template.yaml +198 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/ci/gitlab-ci-template.yaml +149 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/ci/instructions.md +536 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/ci/workflow.yaml +45 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/framework/checklist.md +321 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/framework/instructions.md +481 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/framework/workflow.yaml +47 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/nfr-assess/checklist.md +407 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/nfr-assess/instructions.md +722 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/nfr-assess/nfr-report-template.md +445 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/nfr-assess/workflow.yaml +47 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-design/checklist.md +235 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-design/instructions.md +788 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-design/test-design-template.md +294 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-design/workflow.yaml +54 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-review/checklist.md +472 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-review/instructions.md +628 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-review/test-review-template.md +390 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/test-review/workflow.yaml +46 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/trace/checklist.md +655 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/trace/instructions.md +1047 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/trace/trace-template.md +675 -0
- package/templates/bmad/_bmad/bmm/workflows/testarch/trace/workflow.yaml +55 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/init/instructions.md +346 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/init/workflow.yaml +29 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/instructions.md +395 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/paths/enterprise-brownfield.yaml +103 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/paths/enterprise-greenfield.yaml +100 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/paths/method-brownfield.yaml +103 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/paths/method-greenfield.yaml +100 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/project-levels.yaml +59 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/workflow-status-template.yaml +24 -0
- package/templates/bmad/_bmad/bmm/workflows/workflow-status/workflow.yaml +30 -0
- package/templates/bmad/_bmad/config.yaml +7 -0
- package/templates/bmad/_bmad/core/agents/bmad-master.md +57 -0
- package/templates/bmad/_bmad/core/resources/excalidraw/README.md +160 -0
- package/templates/bmad/_bmad/core/resources/excalidraw/excalidraw-helpers.md +127 -0
- package/templates/bmad/_bmad/core/resources/excalidraw/library-loader.md +50 -0
- package/templates/bmad/_bmad/core/resources/excalidraw/validate-json-instructions.md +79 -0
- package/templates/bmad/_bmad/core/tasks/index-docs.xml +65 -0
- package/templates/bmad/_bmad/core/tasks/review-adversarial-general.xml +41 -0
- package/templates/bmad/_bmad/core/tasks/shard-doc.xml +109 -0
- package/templates/bmad/_bmad/core/tasks/workflow.xml +235 -0
- package/templates/bmad/_bmad/core/workflows/advanced-elicitation/methods.csv +51 -0
- package/templates/bmad/_bmad/core/workflows/advanced-elicitation/workflow.xml +117 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/brain-methods.csv +62 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-01-session-setup.md +197 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-01b-continue.md +122 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-02a-user-selected.md +225 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-02b-ai-recommended.md +237 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-02c-random-selection.md +209 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-02d-progressive-flow.md +264 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-03-technique-execution.md +399 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/steps/step-04-idea-organization.md +303 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/template.md +15 -0
- package/templates/bmad/_bmad/core/workflows/brainstorming/workflow.md +58 -0
- package/templates/bmad/_bmad/core/workflows/party-mode/steps/step-01-agent-loading.md +139 -0
- package/templates/bmad/_bmad/core/workflows/party-mode/steps/step-02-discussion-orchestration.md +204 -0
- package/templates/bmad/_bmad/core/workflows/party-mode/steps/step-03-graceful-exit.md +159 -0
- package/templates/bmad/_bmad/core/workflows/party-mode/workflow.md +206 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-analyst.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-architect.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-dev.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-pm.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-quick-flow-solo-dev.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-sm.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-tea.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-tech-writer.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-agents-ux-designer.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-check-implementation-readiness.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-code-review.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-correct-course.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-architecture.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-epics-and-stories.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-excalidraw-dataflow.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-excalidraw-diagram.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-excalidraw-flowchart.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-excalidraw-wireframe.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-product-brief.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-story.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-create-ux-design.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-dev-story.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-document-project.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-generate-project-context.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-prd.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-quick-dev.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-quick-spec.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-research.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-retrospective.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-sprint-planning.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-sprint-status.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-atdd.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-automate.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-ci.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-framework.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-nfr.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-test-design.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-test-review.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-testarch-trace.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-workflow-init.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-bmm-workflows-workflow-status.md +13 -0
- package/templates/bmad/agent/workflows_bmad/bmad-core-agents-bmad-master.md +14 -0
- package/templates/bmad/agent/workflows_bmad/bmad-core-workflows-brainstorming.md +5 -0
- package/templates/bmad/agent/workflows_bmad/bmad-core-workflows-party-mode.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/analyst.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/architect.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/dev.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/pm.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/quick-flow-solo-dev.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/sm.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/tea.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/tech-writer.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/agents/ux-designer.md +14 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/check-implementation-readiness.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/code-review.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/correct-course.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-architecture.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-epics-and-stories.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-excalidraw-dataflow.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-excalidraw-diagram.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-excalidraw-flowchart.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-excalidraw-wireframe.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-product-brief.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-story.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/create-ux-design.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/dev-story.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/document-project.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/generate-project-context.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/prd.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/quick-dev.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/quick-spec.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/research.md +5 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/retrospective.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/sprint-planning.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/sprint-status.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-atdd.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-automate.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-ci.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-framework.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-nfr.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-test-design.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-test-review.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/testarch-trace.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/workflow-init.md +13 -0
- package/templates/bmad/claude/commands_bmad/bmm/workflows/workflow-status.md +13 -0
- package/templates/bmad/claude/commands_bmad/core/agents/bmad-master.md +14 -0
- package/templates/bmad/claude/commands_bmad/core/tasks/index-docs.md +9 -0
- package/templates/bmad/claude/commands_bmad/core/tasks/shard-doc.md +9 -0
- package/templates/bmad/claude/commands_bmad/core/workflows/brainstorming.md +5 -0
- package/templates/bmad/claude/commands_bmad/core/workflows/party-mode.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/analyst.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/architect.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/dev.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/pm.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/quick-flow-solo-dev.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/sm.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/tea.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/tech-writer.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/agents/ux-designer.md +14 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/check-implementation-readiness.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/code-review.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/correct-course.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-architecture.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-epics-and-stories.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-excalidraw-dataflow.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-excalidraw-diagram.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-excalidraw-flowchart.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-excalidraw-wireframe.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-product-brief.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-story.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/create-ux-design.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/dev-story.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/document-project.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/generate-project-context.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/prd.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/quick-dev.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/quick-spec.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/research.md +5 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/retrospective.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/sprint-planning.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/sprint-status.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-atdd.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-automate.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-ci.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-framework.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-nfr.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-test-design.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-test-review.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/testarch-trace.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/workflow-init.md +13 -0
- package/templates/bmad/cursor/commands_bmad/bmm/workflows/workflow-status.md +13 -0
- package/templates/bmad/cursor/commands_bmad/core/agents/bmad-master.md +14 -0
- package/templates/bmad/cursor/commands_bmad/core/tasks/index-docs.md +9 -0
- package/templates/bmad/cursor/commands_bmad/core/tasks/shard-doc.md +9 -0
- package/templates/bmad/cursor/commands_bmad/core/workflows/brainstorming.md +5 -0
- package/templates/bmad/cursor/commands_bmad/core/workflows/party-mode.md +5 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-analyst.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-architect.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-dev.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-pm.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-quick-flow-solo-dev.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-sm.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-tea.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-tech-writer.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-bmm-ux-designer.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-agent-core-bmad-master.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-task-core-index-docs.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-task-core-review-adversarial-general.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-task-core-shard-doc.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-task-core-workflow.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-check-implementation-readiness.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-code-review.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-correct-course.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-architecture.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-epics-and-stories.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-excalidraw-dataflow.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-excalidraw-diagram.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-excalidraw-flowchart.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-excalidraw-wireframe.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-product-brief.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-story.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-create-ux-design.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-dev-story.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-document-project.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-generate-project-context.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-prd.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-quick-dev.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-quick-spec.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-research.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-retrospective.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-sprint-planning.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-sprint-status.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-atdd.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-automate.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-ci.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-framework.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-nfr.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-test-design.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-test-review.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-testarch-trace.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-workflow-init.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-bmm-workflow-status.toml +12 -0
- package/templates/bmad/gemini/commands/bmad-workflow-core-brainstorming.toml +4 -0
- package/templates/bmad/gemini/commands/bmad-workflow-core-party-mode.toml +4 -0
- package/templates/frameworks/nextjs-app/.ai/rules/01-project-overview.md +25 -0
- package/templates/frameworks/nextjs-app/.ai/rules/02-architecture.md +36 -0
- package/templates/frameworks/nextjs-app/.ai/rules/07-react.md +56 -0
- package/templates/frameworks/nextjs-pages/.ai/rules/01-project-overview.md +25 -0
- package/templates/frameworks/nextjs-pages/.ai/rules/02-architecture.md +30 -0
- package/templates/frameworks/nextjs-pages/.ai/rules/07-react.md +51 -0
- package/templates/frameworks/nodejs/.ai/rules/01-project-overview.md +20 -0
- package/templates/frameworks/nodejs/.ai/rules/02-architecture.md +21 -0
- package/templates/frameworks/nodejs/.ai/rules/07-react.md +26 -0
- package/templates/frameworks/react-spa/.ai/rules/01-project-overview.md +49 -0
- package/templates/frameworks/react-spa/.ai/rules/02-architecture.md +40 -0
- package/templates/frameworks/react-spa/.ai/rules/03-coding-conventions.md +26 -0
- package/templates/frameworks/react-spa/.ai/rules/06-typescript.md +30 -0
- package/templates/frameworks/react-spa/.ai/rules/07-react.md +60 -0
- package/templates/frameworks/react-spa/.ai/rules/08-styling.md +22 -0
- package/templates/frameworks/react-spa/.ai/rules/09-naming.md +25 -0
- package/templates/frameworks/react-spa/.ai/rules/10-git-workflow.md +7 -0
- package/templates/frameworks/react-spa/.ai/rules/11-testing.md +8 -0
- package/templates/frameworks/react-spa/.ai/rules/12-forbidden-patterns.md +16 -0
- package/templates/frameworks/vue/.ai/rules/01-project-overview.md +25 -0
- package/templates/frameworks/vue/.ai/rules/02-architecture.md +47 -0
- package/templates/frameworks/vue/.ai/rules/07-react.md +90 -0
- package/templates/skills/frontend-design/LICENSE.txt +177 -0
- package/templates/skills/frontend-design/SKILL.md +42 -0
- package/templates/skills/next-best-practices/SKILL.md +153 -0
- package/templates/skills/next-best-practices/async-patterns.md +87 -0
- package/templates/skills/next-best-practices/bundling.md +180 -0
- package/templates/skills/next-best-practices/data-patterns.md +297 -0
- package/templates/skills/next-best-practices/debug-tricks.md +105 -0
- package/templates/skills/next-best-practices/directives.md +73 -0
- package/templates/skills/next-best-practices/error-handling.md +227 -0
- package/templates/skills/next-best-practices/file-conventions.md +140 -0
- package/templates/skills/next-best-practices/font.md +245 -0
- package/templates/skills/next-best-practices/functions.md +108 -0
- package/templates/skills/next-best-practices/hydration-error.md +91 -0
- package/templates/skills/next-best-practices/image.md +173 -0
- package/templates/skills/next-best-practices/metadata.md +301 -0
- package/templates/skills/next-best-practices/parallel-routes.md +287 -0
- package/templates/skills/next-best-practices/route-handlers.md +146 -0
- package/templates/skills/next-best-practices/rsc-boundaries.md +159 -0
- package/templates/skills/next-best-practices/runtime-selection.md +39 -0
- package/templates/skills/next-best-practices/scripts.md +141 -0
- package/templates/skills/next-best-practices/self-hosting.md +371 -0
- package/templates/skills/next-best-practices/suspense-boundaries.md +67 -0
- package/templates/skills/security-best-practices/LICENSE.txt +201 -0
- package/templates/skills/security-best-practices/SKILL.md +86 -0
- package/templates/skills/security-best-practices/agents/openai.yaml +4 -0
- package/templates/skills/security-best-practices/references/golang-general-backend-security.md +826 -0
- package/templates/skills/security-best-practices/references/javascript-express-web-server-security.md +1158 -0
- package/templates/skills/security-best-practices/references/javascript-general-web-frontend-security.md +747 -0
- package/templates/skills/security-best-practices/references/javascript-jquery-web-frontend-security.md +678 -0
- package/templates/skills/security-best-practices/references/javascript-typescript-nextjs-web-server-security.md +1144 -0
- package/templates/skills/security-best-practices/references/javascript-typescript-react-web-frontend-security.md +990 -0
- package/templates/skills/security-best-practices/references/javascript-typescript-vue-web-frontend-security.md +791 -0
- package/templates/skills/security-best-practices/references/python-django-web-server-security.md +882 -0
- package/templates/skills/security-best-practices/references/python-fastapi-web-server-security.md +1036 -0
- package/templates/skills/security-best-practices/references/python-flask-web-server-security.md +705 -0
- package/templates/skills/vercel-composition-patterns/AGENTS.md +946 -0
- package/templates/skills/vercel-composition-patterns/SKILL.md +89 -0
- package/templates/skills/vercel-composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/templates/skills/vercel-composition-patterns/rules/architecture-compound-components.md +112 -0
- package/templates/skills/vercel-composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/templates/skills/vercel-composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/templates/skills/vercel-composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/templates/skills/vercel-composition-patterns/rules/state-context-interface.md +191 -0
- package/templates/skills/vercel-composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/templates/skills/vercel-composition-patterns/rules/state-lift-state.md +125 -0
- package/templates/skills/vercel-react-best-practices/AGENTS.md +2975 -0
- package/templates/skills/vercel-react-best-practices/SKILL.md +137 -0
- package/templates/skills/vercel-react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/templates/skills/vercel-react-best-practices/rules/advanced-init-once.md +42 -0
- package/templates/skills/vercel-react-best-practices/rules/advanced-use-latest.md +39 -0
- package/templates/skills/vercel-react-best-practices/rules/async-api-routes.md +38 -0
- package/templates/skills/vercel-react-best-practices/rules/async-defer-await.md +80 -0
- package/templates/skills/vercel-react-best-practices/rules/async-dependencies.md +51 -0
- package/templates/skills/vercel-react-best-practices/rules/async-parallel.md +28 -0
- package/templates/skills/vercel-react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/templates/skills/vercel-react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/templates/skills/vercel-react-best-practices/rules/bundle-conditional.md +31 -0
- package/templates/skills/vercel-react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/templates/skills/vercel-react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/templates/skills/vercel-react-best-practices/rules/bundle-preload.md +50 -0
- package/templates/skills/vercel-react-best-practices/rules/client-event-listeners.md +74 -0
- package/templates/skills/vercel-react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/templates/skills/vercel-react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/templates/skills/vercel-react-best-practices/rules/client-swr-dedup.md +56 -0
- package/templates/skills/vercel-react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/templates/skills/vercel-react-best-practices/rules/js-cache-function-results.md +80 -0
- package/templates/skills/vercel-react-best-practices/rules/js-cache-property-access.md +28 -0
- package/templates/skills/vercel-react-best-practices/rules/js-cache-storage.md +70 -0
- package/templates/skills/vercel-react-best-practices/rules/js-combine-iterations.md +32 -0
- package/templates/skills/vercel-react-best-practices/rules/js-early-exit.md +50 -0
- package/templates/skills/vercel-react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/templates/skills/vercel-react-best-practices/rules/js-index-maps.md +37 -0
- package/templates/skills/vercel-react-best-practices/rules/js-length-check-first.md +49 -0
- package/templates/skills/vercel-react-best-practices/rules/js-min-max-loop.md +82 -0
- package/templates/skills/vercel-react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/templates/skills/vercel-react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-activity.md +26 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/templates/skills/vercel-react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-dependencies.md +45 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-derived-state.md +29 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-memo.md +44 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-transitions.md +40 -0
- package/templates/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/templates/skills/vercel-react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/templates/skills/vercel-react-best-practices/rules/server-auth-actions.md +96 -0
- package/templates/skills/vercel-react-best-practices/rules/server-cache-lru.md +41 -0
- package/templates/skills/vercel-react-best-practices/rules/server-cache-react.md +76 -0
- package/templates/skills/vercel-react-best-practices/rules/server-dedup-props.md +65 -0
- package/templates/skills/vercel-react-best-practices/rules/server-hoist-static-io.md +142 -0
- package/templates/skills/vercel-react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/templates/skills/vercel-react-best-practices/rules/server-serialization.md +38 -0
- package/templates/skills/web-design-guidelines/SKILL.md +39 -0
- package/templates/superpowers-skills/LICENSE +21 -0
- package/templates/superpowers-skills/_agents/code-reviewer.md +48 -0
- package/templates/superpowers-skills/brainstorming/SKILL.md +147 -0
- package/templates/superpowers-skills/brainstorming/spec-document-reviewer-prompt.md +50 -0
- package/templates/superpowers-skills/brainstorming/visual-companion.md +260 -0
- package/templates/superpowers-skills/dispatching-parallel-agents/SKILL.md +180 -0
- package/templates/superpowers-skills/executing-plans/SKILL.md +70 -0
- package/templates/superpowers-skills/finishing-a-development-branch/SKILL.md +200 -0
- package/templates/superpowers-skills/receiving-code-review/SKILL.md +213 -0
- package/templates/superpowers-skills/requesting-code-review/SKILL.md +105 -0
- package/templates/superpowers-skills/requesting-code-review/code-reviewer.md +146 -0
- package/templates/superpowers-skills/subagent-driven-development/SKILL.md +275 -0
- package/templates/superpowers-skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/templates/superpowers-skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/templates/superpowers-skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/templates/superpowers-skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/templates/superpowers-skills/systematic-debugging/SKILL.md +296 -0
- package/templates/superpowers-skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/templates/superpowers-skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/templates/superpowers-skills/systematic-debugging/defense-in-depth.md +122 -0
- package/templates/superpowers-skills/systematic-debugging/find-polluter.sh +63 -0
- package/templates/superpowers-skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/templates/superpowers-skills/systematic-debugging/test-academic.md +14 -0
- package/templates/superpowers-skills/systematic-debugging/test-pressure-1.md +58 -0
- package/templates/superpowers-skills/systematic-debugging/test-pressure-2.md +68 -0
- package/templates/superpowers-skills/systematic-debugging/test-pressure-3.md +69 -0
- package/templates/superpowers-skills/test-driven-development/SKILL.md +371 -0
- package/templates/superpowers-skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/templates/superpowers-skills/using-git-worktrees/SKILL.md +218 -0
- package/templates/superpowers-skills/using-superpowers/SKILL.md +113 -0
- package/templates/superpowers-skills/using-superpowers/references/codex-tools.md +25 -0
- package/templates/superpowers-skills/verification-before-completion/SKILL.md +139 -0
- package/templates/superpowers-skills/writing-plans/SKILL.md +147 -0
- package/templates/superpowers-skills/writing-plans/plan-document-reviewer-prompt.md +52 -0
- package/templates/superpowers-skills/writing-skills/SKILL.md +655 -0
- package/templates/superpowers-skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/templates/superpowers-skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/templates/superpowers-skills/writing-skills/graphviz-conventions.dot +172 -0
- package/templates/superpowers-skills/writing-skills/persuasion-principles.md +187 -0
- package/templates/superpowers-skills/writing-skills/render-graphs.js +168 -0
- package/templates/superpowers-skills/writing-skills/testing-skills-with-subagents.md +384 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Optimize SVG Precision
|
|
3
|
+
impact: LOW
|
|
4
|
+
impactDescription: reduces file size
|
|
5
|
+
tags: rendering, svg, optimization, svgo
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Optimize SVG Precision
|
|
9
|
+
|
|
10
|
+
Reduce SVG coordinate precision to decrease file size. The optimal precision depends on the viewBox size, but in general reducing precision should be considered.
|
|
11
|
+
|
|
12
|
+
**Incorrect (excessive precision):**
|
|
13
|
+
|
|
14
|
+
```svg
|
|
15
|
+
<path d="M 10.293847 20.847362 L 30.938472 40.192837" />
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
**Correct (1 decimal place):**
|
|
19
|
+
|
|
20
|
+
```svg
|
|
21
|
+
<path d="M 10.3 20.8 L 30.9 40.2" />
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**Automate with SVGO:**
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx svgo --precision=1 --multipass icon.svg
|
|
28
|
+
```
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Use useTransition Over Manual Loading States
|
|
3
|
+
impact: LOW
|
|
4
|
+
impactDescription: reduces re-renders and improves code clarity
|
|
5
|
+
tags: rendering, transitions, useTransition, loading, state
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Use useTransition Over Manual Loading States
|
|
9
|
+
|
|
10
|
+
Use `useTransition` instead of manual `useState` for loading states. This provides built-in `isPending` state and automatically manages transitions.
|
|
11
|
+
|
|
12
|
+
**Incorrect (manual loading state):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function SearchResults() {
|
|
16
|
+
const [query, setQuery] = useState('')
|
|
17
|
+
const [results, setResults] = useState([])
|
|
18
|
+
const [isLoading, setIsLoading] = useState(false)
|
|
19
|
+
|
|
20
|
+
const handleSearch = async (value: string) => {
|
|
21
|
+
setIsLoading(true)
|
|
22
|
+
setQuery(value)
|
|
23
|
+
const data = await fetchResults(value)
|
|
24
|
+
setResults(data)
|
|
25
|
+
setIsLoading(false)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<input onChange={(e) => handleSearch(e.target.value)} />
|
|
31
|
+
{isLoading && <Spinner />}
|
|
32
|
+
<ResultsList results={results} />
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**Correct (useTransition with built-in pending state):**
|
|
39
|
+
|
|
40
|
+
```tsx
|
|
41
|
+
import { useTransition, useState } from 'react'
|
|
42
|
+
|
|
43
|
+
function SearchResults() {
|
|
44
|
+
const [query, setQuery] = useState('')
|
|
45
|
+
const [results, setResults] = useState([])
|
|
46
|
+
const [isPending, startTransition] = useTransition()
|
|
47
|
+
|
|
48
|
+
const handleSearch = (value: string) => {
|
|
49
|
+
setQuery(value) // Update input immediately
|
|
50
|
+
|
|
51
|
+
startTransition(async () => {
|
|
52
|
+
// Fetch and update results
|
|
53
|
+
const data = await fetchResults(value)
|
|
54
|
+
setResults(data)
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<>
|
|
60
|
+
<input onChange={(e) => handleSearch(e.target.value)} />
|
|
61
|
+
{isPending && <Spinner />}
|
|
62
|
+
<ResultsList results={results} />
|
|
63
|
+
</>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Benefits:**
|
|
69
|
+
|
|
70
|
+
- **Automatic pending state**: No need to manually manage `setIsLoading(true/false)`
|
|
71
|
+
- **Error resilience**: Pending state correctly resets even if the transition throws
|
|
72
|
+
- **Better responsiveness**: Keeps the UI responsive during updates
|
|
73
|
+
- **Interrupt handling**: New transitions automatically cancel pending ones
|
|
74
|
+
|
|
75
|
+
Reference: [useTransition](https://react.dev/reference/react/useTransition)
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Defer State Reads to Usage Point
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: avoids unnecessary subscriptions
|
|
5
|
+
tags: rerender, searchParams, localStorage, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Defer State Reads to Usage Point
|
|
9
|
+
|
|
10
|
+
Don't subscribe to dynamic state (searchParams, localStorage) if you only read it inside callbacks.
|
|
11
|
+
|
|
12
|
+
**Incorrect (subscribes to all searchParams changes):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function ShareButton({ chatId }: { chatId: string }) {
|
|
16
|
+
const searchParams = useSearchParams()
|
|
17
|
+
|
|
18
|
+
const handleShare = () => {
|
|
19
|
+
const ref = searchParams.get('ref')
|
|
20
|
+
shareChat(chatId, { ref })
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return <button onClick={handleShare}>Share</button>
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Correct (reads on demand, no subscription):**
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
function ShareButton({ chatId }: { chatId: string }) {
|
|
31
|
+
const handleShare = () => {
|
|
32
|
+
const params = new URLSearchParams(window.location.search)
|
|
33
|
+
const ref = params.get('ref')
|
|
34
|
+
shareChat(chatId, { ref })
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return <button onClick={handleShare}>Share</button>
|
|
38
|
+
}
|
|
39
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Narrow Effect Dependencies
|
|
3
|
+
impact: LOW
|
|
4
|
+
impactDescription: minimizes effect re-runs
|
|
5
|
+
tags: rerender, useEffect, dependencies, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Narrow Effect Dependencies
|
|
9
|
+
|
|
10
|
+
Specify primitive dependencies instead of objects to minimize effect re-runs.
|
|
11
|
+
|
|
12
|
+
**Incorrect (re-runs on any user field change):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
console.log(user.id)
|
|
17
|
+
}, [user])
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**Correct (re-runs only when id changes):**
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
console.log(user.id)
|
|
25
|
+
}, [user.id])
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**For derived state, compute outside effect:**
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
// Incorrect: runs on width=767, 766, 765...
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (width < 768) {
|
|
34
|
+
enableMobileMode()
|
|
35
|
+
}
|
|
36
|
+
}, [width])
|
|
37
|
+
|
|
38
|
+
// Correct: runs only on boolean transition
|
|
39
|
+
const isMobile = width < 768
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (isMobile) {
|
|
42
|
+
enableMobileMode()
|
|
43
|
+
}
|
|
44
|
+
}, [isMobile])
|
|
45
|
+
```
|
package/templates/skills/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Calculate Derived State During Rendering
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: avoids redundant renders and state drift
|
|
5
|
+
tags: rerender, derived-state, useEffect, state
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Calculate Derived State During Rendering
|
|
9
|
+
|
|
10
|
+
If a value can be computed from current props/state, do not store it in state or update it in an effect. Derive it during render to avoid extra renders and state drift. Do not set state in effects solely in response to prop changes; prefer derived values or keyed resets instead.
|
|
11
|
+
|
|
12
|
+
**Incorrect (redundant state and effect):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function Form() {
|
|
16
|
+
const [firstName, setFirstName] = useState('First')
|
|
17
|
+
const [lastName, setLastName] = useState('Last')
|
|
18
|
+
const [fullName, setFullName] = useState('')
|
|
19
|
+
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
setFullName(firstName + ' ' + lastName)
|
|
22
|
+
}, [firstName, lastName])
|
|
23
|
+
|
|
24
|
+
return <p>{fullName}</p>
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Correct (derive during render):**
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
function Form() {
|
|
32
|
+
const [firstName, setFirstName] = useState('First')
|
|
33
|
+
const [lastName, setLastName] = useState('Last')
|
|
34
|
+
const fullName = firstName + ' ' + lastName
|
|
35
|
+
|
|
36
|
+
return <p>{fullName}</p>
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
References: [You Might Not Need an Effect](https://react.dev/learn/you-might-not-need-an-effect)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Subscribe to Derived State
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: reduces re-render frequency
|
|
5
|
+
tags: rerender, derived-state, media-query, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Subscribe to Derived State
|
|
9
|
+
|
|
10
|
+
Subscribe to derived boolean state instead of continuous values to reduce re-render frequency.
|
|
11
|
+
|
|
12
|
+
**Incorrect (re-renders on every pixel change):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function Sidebar() {
|
|
16
|
+
const width = useWindowWidth() // updates continuously
|
|
17
|
+
const isMobile = width < 768
|
|
18
|
+
return <nav className={isMobile ? 'mobile' : 'desktop'} />
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Correct (re-renders only when boolean changes):**
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
function Sidebar() {
|
|
26
|
+
const isMobile = useMediaQuery('(max-width: 767px)')
|
|
27
|
+
return <nav className={isMobile ? 'mobile' : 'desktop'} />
|
|
28
|
+
}
|
|
29
|
+
```
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Use Functional setState Updates
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: prevents stale closures and unnecessary callback recreations
|
|
5
|
+
tags: react, hooks, useState, useCallback, callbacks, closures
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Use Functional setState Updates
|
|
9
|
+
|
|
10
|
+
When updating state based on the current state value, use the functional update form of setState instead of directly referencing the state variable. This prevents stale closures, eliminates unnecessary dependencies, and creates stable callback references.
|
|
11
|
+
|
|
12
|
+
**Incorrect (requires state as dependency):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function TodoList() {
|
|
16
|
+
const [items, setItems] = useState(initialItems)
|
|
17
|
+
|
|
18
|
+
// Callback must depend on items, recreated on every items change
|
|
19
|
+
const addItems = useCallback((newItems: Item[]) => {
|
|
20
|
+
setItems([...items, ...newItems])
|
|
21
|
+
}, [items]) // ❌ items dependency causes recreations
|
|
22
|
+
|
|
23
|
+
// Risk of stale closure if dependency is forgotten
|
|
24
|
+
const removeItem = useCallback((id: string) => {
|
|
25
|
+
setItems(items.filter(item => item.id !== id))
|
|
26
|
+
}, []) // ❌ Missing items dependency - will use stale items!
|
|
27
|
+
|
|
28
|
+
return <ItemsEditor items={items} onAdd={addItems} onRemove={removeItem} />
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The first callback is recreated every time `items` changes, which can cause child components to re-render unnecessarily. The second callback has a stale closure bug—it will always reference the initial `items` value.
|
|
33
|
+
|
|
34
|
+
**Correct (stable callbacks, no stale closures):**
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
function TodoList() {
|
|
38
|
+
const [items, setItems] = useState(initialItems)
|
|
39
|
+
|
|
40
|
+
// Stable callback, never recreated
|
|
41
|
+
const addItems = useCallback((newItems: Item[]) => {
|
|
42
|
+
setItems(curr => [...curr, ...newItems])
|
|
43
|
+
}, []) // ✅ No dependencies needed
|
|
44
|
+
|
|
45
|
+
// Always uses latest state, no stale closure risk
|
|
46
|
+
const removeItem = useCallback((id: string) => {
|
|
47
|
+
setItems(curr => curr.filter(item => item.id !== id))
|
|
48
|
+
}, []) // ✅ Safe and stable
|
|
49
|
+
|
|
50
|
+
return <ItemsEditor items={items} onAdd={addItems} onRemove={removeItem} />
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Benefits:**
|
|
55
|
+
|
|
56
|
+
1. **Stable callback references** - Callbacks don't need to be recreated when state changes
|
|
57
|
+
2. **No stale closures** - Always operates on the latest state value
|
|
58
|
+
3. **Fewer dependencies** - Simplifies dependency arrays and reduces memory leaks
|
|
59
|
+
4. **Prevents bugs** - Eliminates the most common source of React closure bugs
|
|
60
|
+
|
|
61
|
+
**When to use functional updates:**
|
|
62
|
+
|
|
63
|
+
- Any setState that depends on the current state value
|
|
64
|
+
- Inside useCallback/useMemo when state is needed
|
|
65
|
+
- Event handlers that reference state
|
|
66
|
+
- Async operations that update state
|
|
67
|
+
|
|
68
|
+
**When direct updates are fine:**
|
|
69
|
+
|
|
70
|
+
- Setting state to a static value: `setCount(0)`
|
|
71
|
+
- Setting state from props/arguments only: `setName(newName)`
|
|
72
|
+
- State doesn't depend on previous value
|
|
73
|
+
|
|
74
|
+
**Note:** If your project has [React Compiler](https://react.dev/learn/react-compiler) enabled, the compiler can automatically optimize some cases, but functional updates are still recommended for correctness and to prevent stale closure bugs.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Use Lazy State Initialization
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: wasted computation on every render
|
|
5
|
+
tags: react, hooks, useState, performance, initialization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Use Lazy State Initialization
|
|
9
|
+
|
|
10
|
+
Pass a function to `useState` for expensive initial values. Without the function form, the initializer runs on every render even though the value is only used once.
|
|
11
|
+
|
|
12
|
+
**Incorrect (runs on every render):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function FilteredList({ items }: { items: Item[] }) {
|
|
16
|
+
// buildSearchIndex() runs on EVERY render, even after initialization
|
|
17
|
+
const [searchIndex, setSearchIndex] = useState(buildSearchIndex(items))
|
|
18
|
+
const [query, setQuery] = useState('')
|
|
19
|
+
|
|
20
|
+
// When query changes, buildSearchIndex runs again unnecessarily
|
|
21
|
+
return <SearchResults index={searchIndex} query={query} />
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function UserProfile() {
|
|
25
|
+
// JSON.parse runs on every render
|
|
26
|
+
const [settings, setSettings] = useState(
|
|
27
|
+
JSON.parse(localStorage.getItem('settings') || '{}')
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
return <SettingsForm settings={settings} onChange={setSettings} />
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Correct (runs only once):**
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
function FilteredList({ items }: { items: Item[] }) {
|
|
38
|
+
// buildSearchIndex() runs ONLY on initial render
|
|
39
|
+
const [searchIndex, setSearchIndex] = useState(() => buildSearchIndex(items))
|
|
40
|
+
const [query, setQuery] = useState('')
|
|
41
|
+
|
|
42
|
+
return <SearchResults index={searchIndex} query={query} />
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function UserProfile() {
|
|
46
|
+
// JSON.parse runs only on initial render
|
|
47
|
+
const [settings, setSettings] = useState(() => {
|
|
48
|
+
const stored = localStorage.getItem('settings')
|
|
49
|
+
return stored ? JSON.parse(stored) : {}
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
return <SettingsForm settings={settings} onChange={setSettings} />
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Use lazy initialization when computing initial values from localStorage/sessionStorage, building data structures (indexes, maps), reading from the DOM, or performing heavy transformations.
|
|
57
|
+
|
|
58
|
+
For simple primitives (`useState(0)`), direct references (`useState(props.value)`), or cheap literals (`useState({})`), the function form is unnecessary.
|
package/templates/skills/vercel-react-best-practices/rules/rerender-memo-with-default-value.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
title: Extract Default Non-primitive Parameter Value from Memoized Component to Constant
|
|
4
|
+
impact: MEDIUM
|
|
5
|
+
impactDescription: restores memoization by using a constant for default value
|
|
6
|
+
tags: rerender, memo, optimization
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Extract Default Non-primitive Parameter Value from Memoized Component to Constant
|
|
11
|
+
|
|
12
|
+
When memoized component has a default value for some non-primitive optional parameter, such as an array, function, or object, calling the component without that parameter results in broken memoization. This is because new value instances are created on every rerender, and they do not pass strict equality comparison in `memo()`.
|
|
13
|
+
|
|
14
|
+
To address this issue, extract the default value into a constant.
|
|
15
|
+
|
|
16
|
+
**Incorrect (`onClick` has different values on every rerender):**
|
|
17
|
+
|
|
18
|
+
```tsx
|
|
19
|
+
const UserAvatar = memo(function UserAvatar({ onClick = () => {} }: { onClick?: () => void }) {
|
|
20
|
+
// ...
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
// Used without optional onClick
|
|
24
|
+
<UserAvatar />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Correct (stable default value):**
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
const NOOP = () => {};
|
|
31
|
+
|
|
32
|
+
const UserAvatar = memo(function UserAvatar({ onClick = NOOP }: { onClick?: () => void }) {
|
|
33
|
+
// ...
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
// Used without optional onClick
|
|
37
|
+
<UserAvatar />
|
|
38
|
+
```
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Extract to Memoized Components
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: enables early returns
|
|
5
|
+
tags: rerender, memo, useMemo, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Extract to Memoized Components
|
|
9
|
+
|
|
10
|
+
Extract expensive work into memoized components to enable early returns before computation.
|
|
11
|
+
|
|
12
|
+
**Incorrect (computes avatar even when loading):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function Profile({ user, loading }: Props) {
|
|
16
|
+
const avatar = useMemo(() => {
|
|
17
|
+
const id = computeAvatarId(user)
|
|
18
|
+
return <Avatar id={id} />
|
|
19
|
+
}, [user])
|
|
20
|
+
|
|
21
|
+
if (loading) return <Skeleton />
|
|
22
|
+
return <div>{avatar}</div>
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Correct (skips computation when loading):**
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
const UserAvatar = memo(function UserAvatar({ user }: { user: User }) {
|
|
30
|
+
const id = useMemo(() => computeAvatarId(user), [user])
|
|
31
|
+
return <Avatar id={id} />
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
function Profile({ user, loading }: Props) {
|
|
35
|
+
if (loading) return <Skeleton />
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<UserAvatar user={user} />
|
|
39
|
+
</div>
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Note:** If your project has [React Compiler](https://react.dev/learn/react-compiler) enabled, manual memoization with `memo()` and `useMemo()` is not necessary. The compiler automatically optimizes re-renders.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Put Interaction Logic in Event Handlers
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: avoids effect re-runs and duplicate side effects
|
|
5
|
+
tags: rerender, useEffect, events, side-effects, dependencies
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Put Interaction Logic in Event Handlers
|
|
9
|
+
|
|
10
|
+
If a side effect is triggered by a specific user action (submit, click, drag), run it in that event handler. Do not model the action as state + effect; it makes effects re-run on unrelated changes and can duplicate the action.
|
|
11
|
+
|
|
12
|
+
**Incorrect (event modeled as state + effect):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function Form() {
|
|
16
|
+
const [submitted, setSubmitted] = useState(false)
|
|
17
|
+
const theme = useContext(ThemeContext)
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (submitted) {
|
|
21
|
+
post('/api/register')
|
|
22
|
+
showToast('Registered', theme)
|
|
23
|
+
}
|
|
24
|
+
}, [submitted, theme])
|
|
25
|
+
|
|
26
|
+
return <button onClick={() => setSubmitted(true)}>Submit</button>
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**Correct (do it in the handler):**
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
function Form() {
|
|
34
|
+
const theme = useContext(ThemeContext)
|
|
35
|
+
|
|
36
|
+
function handleSubmit() {
|
|
37
|
+
post('/api/register')
|
|
38
|
+
showToast('Registered', theme)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return <button onClick={handleSubmit}>Submit</button>
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Reference: [Should this code move to an event handler?](https://react.dev/learn/removing-effect-dependencies#should-this-code-move-to-an-event-handler)
|
package/templates/skills/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Do not wrap a simple expression with a primitive result type in useMemo
|
|
3
|
+
impact: LOW-MEDIUM
|
|
4
|
+
impactDescription: wasted computation on every render
|
|
5
|
+
tags: rerender, useMemo, optimization
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Do not wrap a simple expression with a primitive result type in useMemo
|
|
9
|
+
|
|
10
|
+
When an expression is simple (few logical or arithmetical operators) and has a primitive result type (boolean, number, string), do not wrap it in `useMemo`.
|
|
11
|
+
Calling `useMemo` and comparing hook dependencies may consume more resources than the expression itself.
|
|
12
|
+
|
|
13
|
+
**Incorrect:**
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
function Header({ user, notifications }: Props) {
|
|
17
|
+
const isLoading = useMemo(() => {
|
|
18
|
+
return user.isLoading || notifications.isLoading
|
|
19
|
+
}, [user.isLoading, notifications.isLoading])
|
|
20
|
+
|
|
21
|
+
if (isLoading) return <Skeleton />
|
|
22
|
+
// return some markup
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**Correct:**
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
function Header({ user, notifications }: Props) {
|
|
30
|
+
const isLoading = user.isLoading || notifications.isLoading
|
|
31
|
+
|
|
32
|
+
if (isLoading) return <Skeleton />
|
|
33
|
+
// return some markup
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Use Transitions for Non-Urgent Updates
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: maintains UI responsiveness
|
|
5
|
+
tags: rerender, transitions, startTransition, performance
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Use Transitions for Non-Urgent Updates
|
|
9
|
+
|
|
10
|
+
Mark frequent, non-urgent state updates as transitions to maintain UI responsiveness.
|
|
11
|
+
|
|
12
|
+
**Incorrect (blocks UI on every scroll):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function ScrollTracker() {
|
|
16
|
+
const [scrollY, setScrollY] = useState(0)
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const handler = () => setScrollY(window.scrollY)
|
|
19
|
+
window.addEventListener('scroll', handler, { passive: true })
|
|
20
|
+
return () => window.removeEventListener('scroll', handler)
|
|
21
|
+
}, [])
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Correct (non-blocking updates):**
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { startTransition } from 'react'
|
|
29
|
+
|
|
30
|
+
function ScrollTracker() {
|
|
31
|
+
const [scrollY, setScrollY] = useState(0)
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
const handler = () => {
|
|
34
|
+
startTransition(() => setScrollY(window.scrollY))
|
|
35
|
+
}
|
|
36
|
+
window.addEventListener('scroll', handler, { passive: true })
|
|
37
|
+
return () => window.removeEventListener('scroll', handler)
|
|
38
|
+
}, [])
|
|
39
|
+
}
|
|
40
|
+
```
|
package/templates/skills/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Use useRef for Transient Values
|
|
3
|
+
impact: MEDIUM
|
|
4
|
+
impactDescription: avoids unnecessary re-renders on frequent updates
|
|
5
|
+
tags: rerender, useref, state, performance
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Use useRef for Transient Values
|
|
9
|
+
|
|
10
|
+
When a value changes frequently and you don't want a re-render on every update (e.g., mouse trackers, intervals, transient flags), store it in `useRef` instead of `useState`. Keep component state for UI; use refs for temporary DOM-adjacent values. Updating a ref does not trigger a re-render.
|
|
11
|
+
|
|
12
|
+
**Incorrect (renders every update):**
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
function Tracker() {
|
|
16
|
+
const [lastX, setLastX] = useState(0)
|
|
17
|
+
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const onMove = (e: MouseEvent) => setLastX(e.clientX)
|
|
20
|
+
window.addEventListener('mousemove', onMove)
|
|
21
|
+
return () => window.removeEventListener('mousemove', onMove)
|
|
22
|
+
}, [])
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div
|
|
26
|
+
style={{
|
|
27
|
+
position: 'fixed',
|
|
28
|
+
top: 0,
|
|
29
|
+
left: lastX,
|
|
30
|
+
width: 8,
|
|
31
|
+
height: 8,
|
|
32
|
+
background: 'black',
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Correct (no re-render for tracking):**
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
function Tracker() {
|
|
43
|
+
const lastXRef = useRef(0)
|
|
44
|
+
const dotRef = useRef<HTMLDivElement>(null)
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const onMove = (e: MouseEvent) => {
|
|
48
|
+
lastXRef.current = e.clientX
|
|
49
|
+
const node = dotRef.current
|
|
50
|
+
if (node) {
|
|
51
|
+
node.style.transform = `translateX(${e.clientX}px)`
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
window.addEventListener('mousemove', onMove)
|
|
55
|
+
return () => window.removeEventListener('mousemove', onMove)
|
|
56
|
+
}, [])
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<div
|
|
60
|
+
ref={dotRef}
|
|
61
|
+
style={{
|
|
62
|
+
position: 'fixed',
|
|
63
|
+
top: 0,
|
|
64
|
+
left: 0,
|
|
65
|
+
width: 8,
|
|
66
|
+
height: 8,
|
|
67
|
+
background: 'black',
|
|
68
|
+
transform: 'translateX(0px)',
|
|
69
|
+
}}
|
|
70
|
+
/>
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
```
|