@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,946 @@
|
|
|
1
|
+
# React Composition Patterns
|
|
2
|
+
|
|
3
|
+
**Version 1.0.0**
|
|
4
|
+
Engineering
|
|
5
|
+
January 2026
|
|
6
|
+
|
|
7
|
+
> **Note:**
|
|
8
|
+
> This document is mainly for agents and LLMs to follow when maintaining,
|
|
9
|
+
> generating, or refactoring React codebases using composition. Humans
|
|
10
|
+
> may also find it useful, but guidance here is optimized for automation
|
|
11
|
+
> and consistency by AI-assisted workflows.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Abstract
|
|
16
|
+
|
|
17
|
+
Composition patterns for building flexible, maintainable React components. Avoid boolean prop proliferation by using compound components, lifting state, and composing internals. These patterns make codebases easier for both humans and AI agents to work with as they scale.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Table of Contents
|
|
22
|
+
|
|
23
|
+
1. [Component Architecture](#1-component-architecture) — **HIGH**
|
|
24
|
+
- 1.1 [Avoid Boolean Prop Proliferation](#11-avoid-boolean-prop-proliferation)
|
|
25
|
+
- 1.2 [Use Compound Components](#12-use-compound-components)
|
|
26
|
+
2. [State Management](#2-state-management) — **MEDIUM**
|
|
27
|
+
- 2.1 [Decouple State Management from UI](#21-decouple-state-management-from-ui)
|
|
28
|
+
- 2.2 [Define Generic Context Interfaces for Dependency Injection](#22-define-generic-context-interfaces-for-dependency-injection)
|
|
29
|
+
- 2.3 [Lift State into Provider Components](#23-lift-state-into-provider-components)
|
|
30
|
+
3. [Implementation Patterns](#3-implementation-patterns) — **MEDIUM**
|
|
31
|
+
- 3.1 [Create Explicit Component Variants](#31-create-explicit-component-variants)
|
|
32
|
+
- 3.2 [Prefer Composing Children Over Render Props](#32-prefer-composing-children-over-render-props)
|
|
33
|
+
4. [React 19 APIs](#4-react-19-apis) — **MEDIUM**
|
|
34
|
+
- 4.1 [React 19 API Changes](#41-react-19-api-changes)
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 1. Component Architecture
|
|
39
|
+
|
|
40
|
+
**Impact: HIGH**
|
|
41
|
+
|
|
42
|
+
Fundamental patterns for structuring components to avoid prop
|
|
43
|
+
proliferation and enable flexible composition.
|
|
44
|
+
|
|
45
|
+
### 1.1 Avoid Boolean Prop Proliferation
|
|
46
|
+
|
|
47
|
+
**Impact: CRITICAL (prevents unmaintainable component variants)**
|
|
48
|
+
|
|
49
|
+
Don't add boolean props like `isThread`, `isEditing`, `isDMThread` to customize
|
|
50
|
+
|
|
51
|
+
component behavior. Each boolean doubles possible states and creates
|
|
52
|
+
|
|
53
|
+
unmaintainable conditional logic. Use composition instead.
|
|
54
|
+
|
|
55
|
+
**Incorrect: boolean props create exponential complexity**
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
function Composer({
|
|
59
|
+
onSubmit,
|
|
60
|
+
isThread,
|
|
61
|
+
channelId,
|
|
62
|
+
isDMThread,
|
|
63
|
+
dmId,
|
|
64
|
+
isEditing,
|
|
65
|
+
isForwarding,
|
|
66
|
+
}: Props) {
|
|
67
|
+
return (
|
|
68
|
+
<form>
|
|
69
|
+
<Header />
|
|
70
|
+
<Input />
|
|
71
|
+
{isDMThread ? (
|
|
72
|
+
<AlsoSendToDMField id={dmId} />
|
|
73
|
+
) : isThread ? (
|
|
74
|
+
<AlsoSendToChannelField id={channelId} />
|
|
75
|
+
) : null}
|
|
76
|
+
{isEditing ? (
|
|
77
|
+
<EditActions />
|
|
78
|
+
) : isForwarding ? (
|
|
79
|
+
<ForwardActions />
|
|
80
|
+
) : (
|
|
81
|
+
<DefaultActions />
|
|
82
|
+
)}
|
|
83
|
+
<Footer onSubmit={onSubmit} />
|
|
84
|
+
</form>
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
**Correct: composition eliminates conditionals**
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
// Channel composer
|
|
93
|
+
function ChannelComposer() {
|
|
94
|
+
return (
|
|
95
|
+
<Composer.Frame>
|
|
96
|
+
<Composer.Header />
|
|
97
|
+
<Composer.Input />
|
|
98
|
+
<Composer.Footer>
|
|
99
|
+
<Composer.Attachments />
|
|
100
|
+
<Composer.Formatting />
|
|
101
|
+
<Composer.Emojis />
|
|
102
|
+
<Composer.Submit />
|
|
103
|
+
</Composer.Footer>
|
|
104
|
+
</Composer.Frame>
|
|
105
|
+
)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Thread composer - adds "also send to channel" field
|
|
109
|
+
function ThreadComposer({ channelId }: { channelId: string }) {
|
|
110
|
+
return (
|
|
111
|
+
<Composer.Frame>
|
|
112
|
+
<Composer.Header />
|
|
113
|
+
<Composer.Input />
|
|
114
|
+
<AlsoSendToChannelField id={channelId} />
|
|
115
|
+
<Composer.Footer>
|
|
116
|
+
<Composer.Formatting />
|
|
117
|
+
<Composer.Emojis />
|
|
118
|
+
<Composer.Submit />
|
|
119
|
+
</Composer.Footer>
|
|
120
|
+
</Composer.Frame>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Edit composer - different footer actions
|
|
125
|
+
function EditComposer() {
|
|
126
|
+
return (
|
|
127
|
+
<Composer.Frame>
|
|
128
|
+
<Composer.Input />
|
|
129
|
+
<Composer.Footer>
|
|
130
|
+
<Composer.Formatting />
|
|
131
|
+
<Composer.Emojis />
|
|
132
|
+
<Composer.CancelEdit />
|
|
133
|
+
<Composer.SaveEdit />
|
|
134
|
+
</Composer.Footer>
|
|
135
|
+
</Composer.Frame>
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Each variant is explicit about what it renders. We can share internals without
|
|
141
|
+
|
|
142
|
+
sharing a single monolithic parent.
|
|
143
|
+
|
|
144
|
+
### 1.2 Use Compound Components
|
|
145
|
+
|
|
146
|
+
**Impact: HIGH (enables flexible composition without prop drilling)**
|
|
147
|
+
|
|
148
|
+
Structure complex components as compound components with a shared context. Each
|
|
149
|
+
|
|
150
|
+
subcomponent accesses shared state via context, not props. Consumers compose the
|
|
151
|
+
|
|
152
|
+
pieces they need.
|
|
153
|
+
|
|
154
|
+
**Incorrect: monolithic component with render props**
|
|
155
|
+
|
|
156
|
+
```tsx
|
|
157
|
+
function Composer({
|
|
158
|
+
renderHeader,
|
|
159
|
+
renderFooter,
|
|
160
|
+
renderActions,
|
|
161
|
+
showAttachments,
|
|
162
|
+
showFormatting,
|
|
163
|
+
showEmojis,
|
|
164
|
+
}: Props) {
|
|
165
|
+
return (
|
|
166
|
+
<form>
|
|
167
|
+
{renderHeader?.()}
|
|
168
|
+
<Input />
|
|
169
|
+
{showAttachments && <Attachments />}
|
|
170
|
+
{renderFooter ? (
|
|
171
|
+
renderFooter()
|
|
172
|
+
) : (
|
|
173
|
+
<Footer>
|
|
174
|
+
{showFormatting && <Formatting />}
|
|
175
|
+
{showEmojis && <Emojis />}
|
|
176
|
+
{renderActions?.()}
|
|
177
|
+
</Footer>
|
|
178
|
+
)}
|
|
179
|
+
</form>
|
|
180
|
+
)
|
|
181
|
+
}
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Correct: compound components with shared context**
|
|
185
|
+
|
|
186
|
+
```tsx
|
|
187
|
+
const ComposerContext = createContext<ComposerContextValue | null>(null)
|
|
188
|
+
|
|
189
|
+
function ComposerProvider({ children, state, actions, meta }: ProviderProps) {
|
|
190
|
+
return (
|
|
191
|
+
<ComposerContext value={{ state, actions, meta }}>
|
|
192
|
+
{children}
|
|
193
|
+
</ComposerContext>
|
|
194
|
+
)
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
function ComposerFrame({ children }: { children: React.ReactNode }) {
|
|
198
|
+
return <form>{children}</form>
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function ComposerInput() {
|
|
202
|
+
const {
|
|
203
|
+
state,
|
|
204
|
+
actions: { update },
|
|
205
|
+
meta: { inputRef },
|
|
206
|
+
} = use(ComposerContext)
|
|
207
|
+
return (
|
|
208
|
+
<TextInput
|
|
209
|
+
ref={inputRef}
|
|
210
|
+
value={state.input}
|
|
211
|
+
onChangeText={(text) => update((s) => ({ ...s, input: text }))}
|
|
212
|
+
/>
|
|
213
|
+
)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function ComposerSubmit() {
|
|
217
|
+
const {
|
|
218
|
+
actions: { submit },
|
|
219
|
+
} = use(ComposerContext)
|
|
220
|
+
return <Button onPress={submit}>Send</Button>
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Export as compound component
|
|
224
|
+
const Composer = {
|
|
225
|
+
Provider: ComposerProvider,
|
|
226
|
+
Frame: ComposerFrame,
|
|
227
|
+
Input: ComposerInput,
|
|
228
|
+
Submit: ComposerSubmit,
|
|
229
|
+
Header: ComposerHeader,
|
|
230
|
+
Footer: ComposerFooter,
|
|
231
|
+
Attachments: ComposerAttachments,
|
|
232
|
+
Formatting: ComposerFormatting,
|
|
233
|
+
Emojis: ComposerEmojis,
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Usage:**
|
|
238
|
+
|
|
239
|
+
```tsx
|
|
240
|
+
<Composer.Provider state={state} actions={actions} meta={meta}>
|
|
241
|
+
<Composer.Frame>
|
|
242
|
+
<Composer.Header />
|
|
243
|
+
<Composer.Input />
|
|
244
|
+
<Composer.Footer>
|
|
245
|
+
<Composer.Formatting />
|
|
246
|
+
<Composer.Submit />
|
|
247
|
+
</Composer.Footer>
|
|
248
|
+
</Composer.Frame>
|
|
249
|
+
</Composer.Provider>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Consumers explicitly compose exactly what they need. No hidden conditionals. And the state, actions and meta are dependency-injected by a parent provider, allowing multiple usages of the same component structure.
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## 2. State Management
|
|
257
|
+
|
|
258
|
+
**Impact: MEDIUM**
|
|
259
|
+
|
|
260
|
+
Patterns for lifting state and managing shared context across
|
|
261
|
+
composed components.
|
|
262
|
+
|
|
263
|
+
### 2.1 Decouple State Management from UI
|
|
264
|
+
|
|
265
|
+
**Impact: MEDIUM (enables swapping state implementations without changing UI)**
|
|
266
|
+
|
|
267
|
+
The provider component should be the only place that knows how state is managed.
|
|
268
|
+
|
|
269
|
+
UI components consume the context interface—they don't know if state comes from
|
|
270
|
+
|
|
271
|
+
useState, Zustand, or a server sync.
|
|
272
|
+
|
|
273
|
+
**Incorrect: UI coupled to state implementation**
|
|
274
|
+
|
|
275
|
+
```tsx
|
|
276
|
+
function ChannelComposer({ channelId }: { channelId: string }) {
|
|
277
|
+
// UI component knows about global state implementation
|
|
278
|
+
const state = useGlobalChannelState(channelId)
|
|
279
|
+
const { submit, updateInput } = useChannelSync(channelId)
|
|
280
|
+
|
|
281
|
+
return (
|
|
282
|
+
<Composer.Frame>
|
|
283
|
+
<Composer.Input
|
|
284
|
+
value={state.input}
|
|
285
|
+
onChange={(text) => sync.updateInput(text)}
|
|
286
|
+
/>
|
|
287
|
+
<Composer.Submit onPress={() => sync.submit()} />
|
|
288
|
+
</Composer.Frame>
|
|
289
|
+
)
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
**Correct: state management isolated in provider**
|
|
294
|
+
|
|
295
|
+
```tsx
|
|
296
|
+
// Provider handles all state management details
|
|
297
|
+
function ChannelProvider({
|
|
298
|
+
channelId,
|
|
299
|
+
children,
|
|
300
|
+
}: {
|
|
301
|
+
channelId: string
|
|
302
|
+
children: React.ReactNode
|
|
303
|
+
}) {
|
|
304
|
+
const { state, update, submit } = useGlobalChannel(channelId)
|
|
305
|
+
const inputRef = useRef(null)
|
|
306
|
+
|
|
307
|
+
return (
|
|
308
|
+
<Composer.Provider
|
|
309
|
+
state={state}
|
|
310
|
+
actions={{ update, submit }}
|
|
311
|
+
meta={{ inputRef }}
|
|
312
|
+
>
|
|
313
|
+
{children}
|
|
314
|
+
</Composer.Provider>
|
|
315
|
+
)
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// UI component only knows about the context interface
|
|
319
|
+
function ChannelComposer() {
|
|
320
|
+
return (
|
|
321
|
+
<Composer.Frame>
|
|
322
|
+
<Composer.Header />
|
|
323
|
+
<Composer.Input />
|
|
324
|
+
<Composer.Footer>
|
|
325
|
+
<Composer.Submit />
|
|
326
|
+
</Composer.Footer>
|
|
327
|
+
</Composer.Frame>
|
|
328
|
+
)
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// Usage
|
|
332
|
+
function Channel({ channelId }: { channelId: string }) {
|
|
333
|
+
return (
|
|
334
|
+
<ChannelProvider channelId={channelId}>
|
|
335
|
+
<ChannelComposer />
|
|
336
|
+
</ChannelProvider>
|
|
337
|
+
)
|
|
338
|
+
}
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
**Different providers, same UI:**
|
|
342
|
+
|
|
343
|
+
```tsx
|
|
344
|
+
// Local state for ephemeral forms
|
|
345
|
+
function ForwardMessageProvider({ children }) {
|
|
346
|
+
const [state, setState] = useState(initialState)
|
|
347
|
+
const forwardMessage = useForwardMessage()
|
|
348
|
+
|
|
349
|
+
return (
|
|
350
|
+
<Composer.Provider
|
|
351
|
+
state={state}
|
|
352
|
+
actions={{ update: setState, submit: forwardMessage }}
|
|
353
|
+
>
|
|
354
|
+
{children}
|
|
355
|
+
</Composer.Provider>
|
|
356
|
+
)
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Global synced state for channels
|
|
360
|
+
function ChannelProvider({ channelId, children }) {
|
|
361
|
+
const { state, update, submit } = useGlobalChannel(channelId)
|
|
362
|
+
|
|
363
|
+
return (
|
|
364
|
+
<Composer.Provider state={state} actions={{ update, submit }}>
|
|
365
|
+
{children}
|
|
366
|
+
</Composer.Provider>
|
|
367
|
+
)
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
The same `Composer.Input` component works with both providers because it only
|
|
372
|
+
|
|
373
|
+
depends on the context interface, not the implementation.
|
|
374
|
+
|
|
375
|
+
### 2.2 Define Generic Context Interfaces for Dependency Injection
|
|
376
|
+
|
|
377
|
+
**Impact: HIGH (enables dependency-injectable state across use-cases)**
|
|
378
|
+
|
|
379
|
+
Define a **generic interface** for your component context with three parts:
|
|
380
|
+
|
|
381
|
+
`state`, `actions`, and `meta`. This interface is a contract that any provider
|
|
382
|
+
|
|
383
|
+
can implement—enabling the same UI components to work with completely different
|
|
384
|
+
|
|
385
|
+
state implementations.
|
|
386
|
+
|
|
387
|
+
**Core principle:** Lift state, compose internals, make state
|
|
388
|
+
|
|
389
|
+
dependency-injectable.
|
|
390
|
+
|
|
391
|
+
**Incorrect: UI coupled to specific state implementation**
|
|
392
|
+
|
|
393
|
+
```tsx
|
|
394
|
+
function ComposerInput() {
|
|
395
|
+
// Tightly coupled to a specific hook
|
|
396
|
+
const { input, setInput } = useChannelComposerState()
|
|
397
|
+
return <TextInput value={input} onChangeText={setInput} />
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Correct: generic interface enables dependency injection**
|
|
402
|
+
|
|
403
|
+
```tsx
|
|
404
|
+
// Define a GENERIC interface that any provider can implement
|
|
405
|
+
interface ComposerState {
|
|
406
|
+
input: string
|
|
407
|
+
attachments: Attachment[]
|
|
408
|
+
isSubmitting: boolean
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
interface ComposerActions {
|
|
412
|
+
update: (updater: (state: ComposerState) => ComposerState) => void
|
|
413
|
+
submit: () => void
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
interface ComposerMeta {
|
|
417
|
+
inputRef: React.RefObject<TextInput>
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
interface ComposerContextValue {
|
|
421
|
+
state: ComposerState
|
|
422
|
+
actions: ComposerActions
|
|
423
|
+
meta: ComposerMeta
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
const ComposerContext = createContext<ComposerContextValue | null>(null)
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
**UI components consume the interface, not the implementation:**
|
|
430
|
+
|
|
431
|
+
```tsx
|
|
432
|
+
function ComposerInput() {
|
|
433
|
+
const {
|
|
434
|
+
state,
|
|
435
|
+
actions: { update },
|
|
436
|
+
meta,
|
|
437
|
+
} = use(ComposerContext)
|
|
438
|
+
|
|
439
|
+
// This component works with ANY provider that implements the interface
|
|
440
|
+
return (
|
|
441
|
+
<TextInput
|
|
442
|
+
ref={meta.inputRef}
|
|
443
|
+
value={state.input}
|
|
444
|
+
onChangeText={(text) => update((s) => ({ ...s, input: text }))}
|
|
445
|
+
/>
|
|
446
|
+
)
|
|
447
|
+
}
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**Different providers implement the same interface:**
|
|
451
|
+
|
|
452
|
+
```tsx
|
|
453
|
+
// Provider A: Local state for ephemeral forms
|
|
454
|
+
function ForwardMessageProvider({ children }: { children: React.ReactNode }) {
|
|
455
|
+
const [state, setState] = useState(initialState)
|
|
456
|
+
const inputRef = useRef(null)
|
|
457
|
+
const submit = useForwardMessage()
|
|
458
|
+
|
|
459
|
+
return (
|
|
460
|
+
<ComposerContext
|
|
461
|
+
value={{
|
|
462
|
+
state,
|
|
463
|
+
actions: { update: setState, submit },
|
|
464
|
+
meta: { inputRef },
|
|
465
|
+
}}
|
|
466
|
+
>
|
|
467
|
+
{children}
|
|
468
|
+
</ComposerContext>
|
|
469
|
+
)
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Provider B: Global synced state for channels
|
|
473
|
+
function ChannelProvider({ channelId, children }: Props) {
|
|
474
|
+
const { state, update, submit } = useGlobalChannel(channelId)
|
|
475
|
+
const inputRef = useRef(null)
|
|
476
|
+
|
|
477
|
+
return (
|
|
478
|
+
<ComposerContext
|
|
479
|
+
value={{
|
|
480
|
+
state,
|
|
481
|
+
actions: { update, submit },
|
|
482
|
+
meta: { inputRef },
|
|
483
|
+
}}
|
|
484
|
+
>
|
|
485
|
+
{children}
|
|
486
|
+
</ComposerContext>
|
|
487
|
+
)
|
|
488
|
+
}
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
**The same composed UI works with both:**
|
|
492
|
+
|
|
493
|
+
```tsx
|
|
494
|
+
// Works with ForwardMessageProvider (local state)
|
|
495
|
+
<ForwardMessageProvider>
|
|
496
|
+
<Composer.Frame>
|
|
497
|
+
<Composer.Input />
|
|
498
|
+
<Composer.Submit />
|
|
499
|
+
</Composer.Frame>
|
|
500
|
+
</ForwardMessageProvider>
|
|
501
|
+
|
|
502
|
+
// Works with ChannelProvider (global synced state)
|
|
503
|
+
<ChannelProvider channelId="abc">
|
|
504
|
+
<Composer.Frame>
|
|
505
|
+
<Composer.Input />
|
|
506
|
+
<Composer.Submit />
|
|
507
|
+
</Composer.Frame>
|
|
508
|
+
</ChannelProvider>
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
**Custom UI outside the component can access state and actions:**
|
|
512
|
+
|
|
513
|
+
```tsx
|
|
514
|
+
function ForwardMessageDialog() {
|
|
515
|
+
return (
|
|
516
|
+
<ForwardMessageProvider>
|
|
517
|
+
<Dialog>
|
|
518
|
+
{/* The composer UI */}
|
|
519
|
+
<Composer.Frame>
|
|
520
|
+
<Composer.Input placeholder="Add a message, if you'd like." />
|
|
521
|
+
<Composer.Footer>
|
|
522
|
+
<Composer.Formatting />
|
|
523
|
+
<Composer.Emojis />
|
|
524
|
+
</Composer.Footer>
|
|
525
|
+
</Composer.Frame>
|
|
526
|
+
|
|
527
|
+
{/* Custom UI OUTSIDE the composer, but INSIDE the provider */}
|
|
528
|
+
<MessagePreview />
|
|
529
|
+
|
|
530
|
+
{/* Actions at the bottom of the dialog */}
|
|
531
|
+
<DialogActions>
|
|
532
|
+
<CancelButton />
|
|
533
|
+
<ForwardButton />
|
|
534
|
+
</DialogActions>
|
|
535
|
+
</Dialog>
|
|
536
|
+
</ForwardMessageProvider>
|
|
537
|
+
)
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
// This button lives OUTSIDE Composer.Frame but can still submit based on its context!
|
|
541
|
+
function ForwardButton() {
|
|
542
|
+
const {
|
|
543
|
+
actions: { submit },
|
|
544
|
+
} = use(ComposerContext)
|
|
545
|
+
return <Button onPress={submit}>Forward</Button>
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
// This preview lives OUTSIDE Composer.Frame but can read composer's state!
|
|
549
|
+
function MessagePreview() {
|
|
550
|
+
const { state } = use(ComposerContext)
|
|
551
|
+
return <Preview message={state.input} attachments={state.attachments} />
|
|
552
|
+
}
|
|
553
|
+
```
|
|
554
|
+
|
|
555
|
+
The provider boundary is what matters—not the visual nesting. Components that
|
|
556
|
+
|
|
557
|
+
need shared state don't have to be inside the `Composer.Frame`. They just need
|
|
558
|
+
|
|
559
|
+
to be within the provider.
|
|
560
|
+
|
|
561
|
+
The `ForwardButton` and `MessagePreview` are not visually inside the composer
|
|
562
|
+
|
|
563
|
+
box, but they can still access its state and actions. This is the power of
|
|
564
|
+
|
|
565
|
+
lifting state into providers.
|
|
566
|
+
|
|
567
|
+
The UI is reusable bits you compose together. The state is dependency-injected
|
|
568
|
+
|
|
569
|
+
by the provider. Swap the provider, keep the UI.
|
|
570
|
+
|
|
571
|
+
### 2.3 Lift State into Provider Components
|
|
572
|
+
|
|
573
|
+
**Impact: HIGH (enables state sharing outside component boundaries)**
|
|
574
|
+
|
|
575
|
+
Move state management into dedicated provider components. This allows sibling
|
|
576
|
+
|
|
577
|
+
components outside the main UI to access and modify state without prop drilling
|
|
578
|
+
|
|
579
|
+
or awkward refs.
|
|
580
|
+
|
|
581
|
+
**Incorrect: state trapped inside component**
|
|
582
|
+
|
|
583
|
+
```tsx
|
|
584
|
+
function ForwardMessageComposer() {
|
|
585
|
+
const [state, setState] = useState(initialState)
|
|
586
|
+
const forwardMessage = useForwardMessage()
|
|
587
|
+
|
|
588
|
+
return (
|
|
589
|
+
<Composer.Frame>
|
|
590
|
+
<Composer.Input />
|
|
591
|
+
<Composer.Footer />
|
|
592
|
+
</Composer.Frame>
|
|
593
|
+
)
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
// Problem: How does this button access composer state?
|
|
597
|
+
function ForwardMessageDialog() {
|
|
598
|
+
return (
|
|
599
|
+
<Dialog>
|
|
600
|
+
<ForwardMessageComposer />
|
|
601
|
+
<MessagePreview /> {/* Needs composer state */}
|
|
602
|
+
<DialogActions>
|
|
603
|
+
<CancelButton />
|
|
604
|
+
<ForwardButton /> {/* Needs to call submit */}
|
|
605
|
+
</DialogActions>
|
|
606
|
+
</Dialog>
|
|
607
|
+
)
|
|
608
|
+
}
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
**Incorrect: useEffect to sync state up**
|
|
612
|
+
|
|
613
|
+
```tsx
|
|
614
|
+
function ForwardMessageDialog() {
|
|
615
|
+
const [input, setInput] = useState('')
|
|
616
|
+
return (
|
|
617
|
+
<Dialog>
|
|
618
|
+
<ForwardMessageComposer onInputChange={setInput} />
|
|
619
|
+
<MessagePreview input={input} />
|
|
620
|
+
</Dialog>
|
|
621
|
+
)
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
function ForwardMessageComposer({ onInputChange }) {
|
|
625
|
+
const [state, setState] = useState(initialState)
|
|
626
|
+
useEffect(() => {
|
|
627
|
+
onInputChange(state.input) // Sync on every change 😬
|
|
628
|
+
}, [state.input])
|
|
629
|
+
}
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
**Incorrect: reading state from ref on submit**
|
|
633
|
+
|
|
634
|
+
```tsx
|
|
635
|
+
function ForwardMessageDialog() {
|
|
636
|
+
const stateRef = useRef(null)
|
|
637
|
+
return (
|
|
638
|
+
<Dialog>
|
|
639
|
+
<ForwardMessageComposer stateRef={stateRef} />
|
|
640
|
+
<ForwardButton onPress={() => submit(stateRef.current)} />
|
|
641
|
+
</Dialog>
|
|
642
|
+
)
|
|
643
|
+
}
|
|
644
|
+
```
|
|
645
|
+
|
|
646
|
+
**Correct: state lifted to provider**
|
|
647
|
+
|
|
648
|
+
```tsx
|
|
649
|
+
function ForwardMessageProvider({ children }: { children: React.ReactNode }) {
|
|
650
|
+
const [state, setState] = useState(initialState)
|
|
651
|
+
const forwardMessage = useForwardMessage()
|
|
652
|
+
const inputRef = useRef(null)
|
|
653
|
+
|
|
654
|
+
return (
|
|
655
|
+
<Composer.Provider
|
|
656
|
+
state={state}
|
|
657
|
+
actions={{ update: setState, submit: forwardMessage }}
|
|
658
|
+
meta={{ inputRef }}
|
|
659
|
+
>
|
|
660
|
+
{children}
|
|
661
|
+
</Composer.Provider>
|
|
662
|
+
)
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
function ForwardMessageDialog() {
|
|
666
|
+
return (
|
|
667
|
+
<ForwardMessageProvider>
|
|
668
|
+
<Dialog>
|
|
669
|
+
<ForwardMessageComposer />
|
|
670
|
+
<MessagePreview /> {/* Custom components can access state and actions */}
|
|
671
|
+
<DialogActions>
|
|
672
|
+
<CancelButton />
|
|
673
|
+
<ForwardButton /> {/* Custom components can access state and actions */}
|
|
674
|
+
</DialogActions>
|
|
675
|
+
</Dialog>
|
|
676
|
+
</ForwardMessageProvider>
|
|
677
|
+
)
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
function ForwardButton() {
|
|
681
|
+
const { actions } = use(Composer.Context)
|
|
682
|
+
return <Button onPress={actions.submit}>Forward</Button>
|
|
683
|
+
}
|
|
684
|
+
```
|
|
685
|
+
|
|
686
|
+
The ForwardButton lives outside the Composer.Frame but still has access to the
|
|
687
|
+
|
|
688
|
+
submit action because it's within the provider. Even though it's a one-off
|
|
689
|
+
|
|
690
|
+
component, it can still access the composer's state and actions from outside the
|
|
691
|
+
|
|
692
|
+
UI itself.
|
|
693
|
+
|
|
694
|
+
**Key insight:** Components that need shared state don't have to be visually
|
|
695
|
+
|
|
696
|
+
nested inside each other—they just need to be within the same provider.
|
|
697
|
+
|
|
698
|
+
---
|
|
699
|
+
|
|
700
|
+
## 3. Implementation Patterns
|
|
701
|
+
|
|
702
|
+
**Impact: MEDIUM**
|
|
703
|
+
|
|
704
|
+
Specific techniques for implementing compound components and
|
|
705
|
+
context providers.
|
|
706
|
+
|
|
707
|
+
### 3.1 Create Explicit Component Variants
|
|
708
|
+
|
|
709
|
+
**Impact: MEDIUM (self-documenting code, no hidden conditionals)**
|
|
710
|
+
|
|
711
|
+
Instead of one component with many boolean props, create explicit variant
|
|
712
|
+
|
|
713
|
+
components. Each variant composes the pieces it needs. The code documents
|
|
714
|
+
|
|
715
|
+
itself.
|
|
716
|
+
|
|
717
|
+
**Incorrect: one component, many modes**
|
|
718
|
+
|
|
719
|
+
```tsx
|
|
720
|
+
// What does this component actually render?
|
|
721
|
+
<Composer
|
|
722
|
+
isThread
|
|
723
|
+
isEditing={false}
|
|
724
|
+
channelId='abc'
|
|
725
|
+
showAttachments
|
|
726
|
+
showFormatting={false}
|
|
727
|
+
/>
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
**Correct: explicit variants**
|
|
731
|
+
|
|
732
|
+
```tsx
|
|
733
|
+
// Immediately clear what this renders
|
|
734
|
+
<ThreadComposer channelId="abc" />
|
|
735
|
+
|
|
736
|
+
// Or
|
|
737
|
+
<EditMessageComposer messageId="xyz" />
|
|
738
|
+
|
|
739
|
+
// Or
|
|
740
|
+
<ForwardMessageComposer messageId="123" />
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
Each implementation is unique, explicit and self-contained. Yet they can each
|
|
744
|
+
|
|
745
|
+
use shared parts.
|
|
746
|
+
|
|
747
|
+
**Implementation:**
|
|
748
|
+
|
|
749
|
+
```tsx
|
|
750
|
+
function ThreadComposer({ channelId }: { channelId: string }) {
|
|
751
|
+
return (
|
|
752
|
+
<ThreadProvider channelId={channelId}>
|
|
753
|
+
<Composer.Frame>
|
|
754
|
+
<Composer.Input />
|
|
755
|
+
<AlsoSendToChannelField channelId={channelId} />
|
|
756
|
+
<Composer.Footer>
|
|
757
|
+
<Composer.Formatting />
|
|
758
|
+
<Composer.Emojis />
|
|
759
|
+
<Composer.Submit />
|
|
760
|
+
</Composer.Footer>
|
|
761
|
+
</Composer.Frame>
|
|
762
|
+
</ThreadProvider>
|
|
763
|
+
)
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
function EditMessageComposer({ messageId }: { messageId: string }) {
|
|
767
|
+
return (
|
|
768
|
+
<EditMessageProvider messageId={messageId}>
|
|
769
|
+
<Composer.Frame>
|
|
770
|
+
<Composer.Input />
|
|
771
|
+
<Composer.Footer>
|
|
772
|
+
<Composer.Formatting />
|
|
773
|
+
<Composer.Emojis />
|
|
774
|
+
<Composer.CancelEdit />
|
|
775
|
+
<Composer.SaveEdit />
|
|
776
|
+
</Composer.Footer>
|
|
777
|
+
</Composer.Frame>
|
|
778
|
+
</EditMessageProvider>
|
|
779
|
+
)
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
function ForwardMessageComposer({ messageId }: { messageId: string }) {
|
|
783
|
+
return (
|
|
784
|
+
<ForwardMessageProvider messageId={messageId}>
|
|
785
|
+
<Composer.Frame>
|
|
786
|
+
<Composer.Input placeholder="Add a message, if you'd like." />
|
|
787
|
+
<Composer.Footer>
|
|
788
|
+
<Composer.Formatting />
|
|
789
|
+
<Composer.Emojis />
|
|
790
|
+
<Composer.Mentions />
|
|
791
|
+
</Composer.Footer>
|
|
792
|
+
</Composer.Frame>
|
|
793
|
+
</ForwardMessageProvider>
|
|
794
|
+
)
|
|
795
|
+
}
|
|
796
|
+
```
|
|
797
|
+
|
|
798
|
+
Each variant is explicit about:
|
|
799
|
+
|
|
800
|
+
- What provider/state it uses
|
|
801
|
+
|
|
802
|
+
- What UI elements it includes
|
|
803
|
+
|
|
804
|
+
- What actions are available
|
|
805
|
+
|
|
806
|
+
No boolean prop combinations to reason about. No impossible states.
|
|
807
|
+
|
|
808
|
+
### 3.2 Prefer Composing Children Over Render Props
|
|
809
|
+
|
|
810
|
+
**Impact: MEDIUM (cleaner composition, better readability)**
|
|
811
|
+
|
|
812
|
+
Use `children` for composition instead of `renderX` props. Children are more
|
|
813
|
+
|
|
814
|
+
readable, compose naturally, and don't require understanding callback
|
|
815
|
+
|
|
816
|
+
signatures.
|
|
817
|
+
|
|
818
|
+
**Incorrect: render props**
|
|
819
|
+
|
|
820
|
+
```tsx
|
|
821
|
+
function Composer({
|
|
822
|
+
renderHeader,
|
|
823
|
+
renderFooter,
|
|
824
|
+
renderActions,
|
|
825
|
+
}: {
|
|
826
|
+
renderHeader?: () => React.ReactNode
|
|
827
|
+
renderFooter?: () => React.ReactNode
|
|
828
|
+
renderActions?: () => React.ReactNode
|
|
829
|
+
}) {
|
|
830
|
+
return (
|
|
831
|
+
<form>
|
|
832
|
+
{renderHeader?.()}
|
|
833
|
+
<Input />
|
|
834
|
+
{renderFooter ? renderFooter() : <DefaultFooter />}
|
|
835
|
+
{renderActions?.()}
|
|
836
|
+
</form>
|
|
837
|
+
)
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// Usage is awkward and inflexible
|
|
841
|
+
return (
|
|
842
|
+
<Composer
|
|
843
|
+
renderHeader={() => <CustomHeader />}
|
|
844
|
+
renderFooter={() => (
|
|
845
|
+
<>
|
|
846
|
+
<Formatting />
|
|
847
|
+
<Emojis />
|
|
848
|
+
</>
|
|
849
|
+
)}
|
|
850
|
+
renderActions={() => <SubmitButton />}
|
|
851
|
+
/>
|
|
852
|
+
)
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
**Correct: compound components with children**
|
|
856
|
+
|
|
857
|
+
```tsx
|
|
858
|
+
function ComposerFrame({ children }: { children: React.ReactNode }) {
|
|
859
|
+
return <form>{children}</form>
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function ComposerFooter({ children }: { children: React.ReactNode }) {
|
|
863
|
+
return <footer className='flex'>{children}</footer>
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
// Usage is flexible
|
|
867
|
+
return (
|
|
868
|
+
<Composer.Frame>
|
|
869
|
+
<CustomHeader />
|
|
870
|
+
<Composer.Input />
|
|
871
|
+
<Composer.Footer>
|
|
872
|
+
<Composer.Formatting />
|
|
873
|
+
<Composer.Emojis />
|
|
874
|
+
<SubmitButton />
|
|
875
|
+
</Composer.Footer>
|
|
876
|
+
</Composer.Frame>
|
|
877
|
+
)
|
|
878
|
+
```
|
|
879
|
+
|
|
880
|
+
**When render props are appropriate:**
|
|
881
|
+
|
|
882
|
+
```tsx
|
|
883
|
+
// Render props work well when you need to pass data back
|
|
884
|
+
<List
|
|
885
|
+
data={items}
|
|
886
|
+
renderItem={({ item, index }) => <Item item={item} index={index} />}
|
|
887
|
+
/>
|
|
888
|
+
```
|
|
889
|
+
|
|
890
|
+
Use render props when the parent needs to provide data or state to the child.
|
|
891
|
+
|
|
892
|
+
Use children when composing static structure.
|
|
893
|
+
|
|
894
|
+
---
|
|
895
|
+
|
|
896
|
+
## 4. React 19 APIs
|
|
897
|
+
|
|
898
|
+
**Impact: MEDIUM**
|
|
899
|
+
|
|
900
|
+
React 19+ only. Don't use `forwardRef`; use `use()` instead of `useContext()`.
|
|
901
|
+
|
|
902
|
+
### 4.1 React 19 API Changes
|
|
903
|
+
|
|
904
|
+
**Impact: MEDIUM (cleaner component definitions and context usage)**
|
|
905
|
+
|
|
906
|
+
> **⚠️ React 19+ only.** Skip this if you're on React 18 or earlier.
|
|
907
|
+
|
|
908
|
+
In React 19, `ref` is now a regular prop (no `forwardRef` wrapper needed), and `use()` replaces `useContext()`.
|
|
909
|
+
|
|
910
|
+
**Incorrect: forwardRef in React 19**
|
|
911
|
+
|
|
912
|
+
```tsx
|
|
913
|
+
const ComposerInput = forwardRef<TextInput, Props>((props, ref) => {
|
|
914
|
+
return <TextInput ref={ref} {...props} />
|
|
915
|
+
})
|
|
916
|
+
```
|
|
917
|
+
|
|
918
|
+
**Correct: ref as a regular prop**
|
|
919
|
+
|
|
920
|
+
```tsx
|
|
921
|
+
function ComposerInput({ ref, ...props }: Props & { ref?: React.Ref<TextInput> }) {
|
|
922
|
+
return <TextInput ref={ref} {...props} />
|
|
923
|
+
}
|
|
924
|
+
```
|
|
925
|
+
|
|
926
|
+
**Incorrect: useContext in React 19**
|
|
927
|
+
|
|
928
|
+
```tsx
|
|
929
|
+
const value = useContext(MyContext)
|
|
930
|
+
```
|
|
931
|
+
|
|
932
|
+
**Correct: use instead of useContext**
|
|
933
|
+
|
|
934
|
+
```tsx
|
|
935
|
+
const value = use(MyContext)
|
|
936
|
+
```
|
|
937
|
+
|
|
938
|
+
`use()` can also be called conditionally, unlike `useContext()`.
|
|
939
|
+
|
|
940
|
+
---
|
|
941
|
+
|
|
942
|
+
## References
|
|
943
|
+
|
|
944
|
+
1. [https://react.dev](https://react.dev)
|
|
945
|
+
2. [https://react.dev/learn/passing-data-deeply-with-context](https://react.dev/learn/passing-data-deeply-with-context)
|
|
946
|
+
3. [https://react.dev/reference/react/use](https://react.dev/reference/react/use)
|