@nextsparkjs/ai-workflow 0.1.0-beta.100
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 +115 -0
- package/claude/_docs/workflows-optimizations.md +359 -0
- package/claude/agents/api-tester.md +634 -0
- package/claude/agents/architecture-supervisor.md +1351 -0
- package/claude/agents/backend-developer.md +997 -0
- package/claude/agents/backend-validator.md +417 -0
- package/claude/agents/bdd-docs-writer.md +737 -0
- package/claude/agents/block-developer.md +677 -0
- package/claude/agents/code-reviewer.md +1432 -0
- package/claude/agents/db-developer.md +721 -0
- package/claude/agents/db-validator.md +407 -0
- package/claude/agents/demo-video-generator.md +493 -0
- package/claude/agents/documentation-writer.md +1268 -0
- package/claude/agents/frontend-developer.md +1234 -0
- package/claude/agents/frontend-validator.md +777 -0
- package/claude/agents/functional-validator.md +630 -0
- package/claude/agents/mock-analyst.md +387 -0
- package/claude/agents/product-manager.md +963 -0
- package/claude/agents/qa-automation.md +1762 -0
- package/claude/agents/release-manager.md +634 -0
- package/claude/agents/selectors-translator.md +262 -0
- package/claude/agents/unit-test-writer.md +785 -0
- package/claude/agents/visual-comparator.md +329 -0
- package/claude/agents/workflow-maintainer.md +352 -0
- package/claude/commands/do/README.md +88 -0
- package/claude/commands/do/create-api.md +64 -0
- package/claude/commands/do/create-entity.md +66 -0
- package/claude/commands/do/create-migration.md +64 -0
- package/claude/commands/do/create-plugin.md +56 -0
- package/claude/commands/do/create-theme.md +70 -0
- package/claude/commands/do/mock-data.md +67 -0
- package/claude/commands/do/reset-db.md +71 -0
- package/claude/commands/do/setup-scheduled-action.md +75 -0
- package/claude/commands/do/sync-code-review.md +117 -0
- package/claude/commands/do/update-selectors.md +112 -0
- package/claude/commands/do/use-skills.md +90 -0
- package/claude/commands/do/validate-blocks.md +69 -0
- package/claude/commands/how-to/README.md +261 -0
- package/claude/commands/how-to/add-metadata.md +692 -0
- package/claude/commands/how-to/add-taxonomies.md +806 -0
- package/claude/commands/how-to/add-translations.md +571 -0
- package/claude/commands/how-to/create-api.md +577 -0
- package/claude/commands/how-to/create-block.md +575 -0
- package/claude/commands/how-to/create-child-entities.md +771 -0
- package/claude/commands/how-to/create-entity.md +597 -0
- package/claude/commands/how-to/create-migrations.md +605 -0
- package/claude/commands/how-to/create-plugin.md +654 -0
- package/claude/commands/how-to/customize-app.md +481 -0
- package/claude/commands/how-to/customize-dashboard.md +553 -0
- package/claude/commands/how-to/customize-theme.md +438 -0
- package/claude/commands/how-to/define-features-flows.md +632 -0
- package/claude/commands/how-to/deploy.md +507 -0
- package/claude/commands/how-to/handle-file-uploads.md +746 -0
- package/claude/commands/how-to/implement-search.md +1001 -0
- package/claude/commands/how-to/install-plugins.md +352 -0
- package/claude/commands/how-to/manage-test-coverage.md +984 -0
- package/claude/commands/how-to/run-tests.md +400 -0
- package/claude/commands/how-to/set-app-languages.md +601 -0
- package/claude/commands/how-to/set-plans-and-permissions.md +575 -0
- package/claude/commands/how-to/set-scheduled-actions.md +527 -0
- package/claude/commands/how-to/set-user-roles-and-permissions.md +550 -0
- package/claude/commands/how-to/setup-authentication.md +388 -0
- package/claude/commands/how-to/setup-claude-code.md +440 -0
- package/claude/commands/how-to/setup-database.md +274 -0
- package/claude/commands/how-to/setup-email-providers.md +598 -0
- package/claude/commands/how-to/setup-mobile-dev.md +627 -0
- package/claude/commands/how-to/start.md +500 -0
- package/claude/commands/how-to/use-devtools.md +639 -0
- package/claude/commands/how-to/use-superadmin.md +622 -0
- package/claude/commands/session/README.md +193 -0
- package/claude/commands/session/block-create.md +190 -0
- package/claude/commands/session/block-list.md +203 -0
- package/claude/commands/session/block-update.md +192 -0
- package/claude/commands/session/block-validate.md +218 -0
- package/claude/commands/session/changelog.md +115 -0
- package/claude/commands/session/close.md +225 -0
- package/claude/commands/session/commit.md +174 -0
- package/claude/commands/session/db-entity.md +206 -0
- package/claude/commands/session/db-fix.md +212 -0
- package/claude/commands/session/db-sample.md +206 -0
- package/claude/commands/session/demo.md +178 -0
- package/claude/commands/session/doc-bdd.md +207 -0
- package/claude/commands/session/doc-feature.md +218 -0
- package/claude/commands/session/doc-read.md +225 -0
- package/claude/commands/session/execute.md +204 -0
- package/claude/commands/session/explain.md +202 -0
- package/claude/commands/session/fix-bug.md +210 -0
- package/claude/commands/session/fix-build.md +182 -0
- package/claude/commands/session/fix-test.md +189 -0
- package/claude/commands/session/pending.md +232 -0
- package/claude/commands/session/refine.md +188 -0
- package/claude/commands/session/resume.md +192 -0
- package/claude/commands/session/review.md +192 -0
- package/claude/commands/session/scope-change.md +181 -0
- package/claude/commands/session/start-blocks.md +347 -0
- package/claude/commands/session/start.md +604 -0
- package/claude/commands/session/status.md +169 -0
- package/claude/commands/session/test-fix.md +221 -0
- package/claude/commands/session/test-run.md +203 -0
- package/claude/commands/session/test-write.md +242 -0
- package/claude/commands/session/validate.md +162 -0
- package/claude/config/context.json +40 -0
- package/claude/config/github.json +69 -0
- package/claude/config/github.schema.json +106 -0
- package/claude/config/team.json +46 -0
- package/claude/config/team.schema.json +106 -0
- package/claude/config/workspace.json +43 -0
- package/claude/config/workspace.schema.json +75 -0
- package/claude/skills/README.md +228 -0
- package/claude/skills/accessibility/SKILL.md +573 -0
- package/claude/skills/api-bypass-layers/SKILL.md +550 -0
- package/claude/skills/asana-integration/SKILL.md +499 -0
- package/claude/skills/better-auth/SKILL.md +666 -0
- package/claude/skills/billing-subscriptions/SKILL.md +660 -0
- package/claude/skills/block-decision-matrix/SKILL.md +359 -0
- package/claude/skills/clickup-integration/SKILL.md +434 -0
- package/claude/skills/core-theme-responsibilities/SKILL.md +485 -0
- package/claude/skills/create-plugin/SKILL.md +425 -0
- package/claude/skills/create-theme/SKILL.md +331 -0
- package/claude/skills/cypress-api/SKILL.md +511 -0
- package/claude/skills/cypress-api/scripts/generate-api-controller.py +329 -0
- package/claude/skills/cypress-api/scripts/generate-api-test.py +930 -0
- package/claude/skills/cypress-e2e/SKILL.md +526 -0
- package/claude/skills/cypress-e2e/scripts/extract-selectors.py +383 -0
- package/claude/skills/cypress-e2e/scripts/generate-uat-test.py +788 -0
- package/claude/skills/cypress-selectors/SKILL.md +309 -0
- package/claude/skills/cypress-selectors/scripts/extract-missing.py +243 -0
- package/claude/skills/cypress-selectors/scripts/generate-block-selectors.py +283 -0
- package/claude/skills/cypress-selectors/scripts/validate-selectors.py +145 -0
- package/claude/skills/database-migrations/SKILL.md +335 -0
- package/claude/skills/database-migrations/scripts/generate-sample-data.py +284 -0
- package/claude/skills/database-migrations/scripts/validate-migration.py +323 -0
- package/claude/skills/design-system/SKILL.md +682 -0
- package/claude/skills/documentation/SKILL.md +540 -0
- package/claude/skills/entity-api/SKILL.md +482 -0
- package/claude/skills/entity-system/SKILL.md +635 -0
- package/claude/skills/entity-system/scripts/generate-child-migration.py +298 -0
- package/claude/skills/entity-system/scripts/generate-metas-migration.py +233 -0
- package/claude/skills/entity-system/scripts/generate-migration.py +382 -0
- package/claude/skills/entity-system/scripts/generate-sample-data.py +418 -0
- package/claude/skills/entity-system/scripts/scaffold-entity.py +661 -0
- package/claude/skills/github/SKILL.md +467 -0
- package/claude/skills/i18n-nextintl/SKILL.md +302 -0
- package/claude/skills/i18n-nextintl/scripts/add-translation.py +243 -0
- package/claude/skills/i18n-nextintl/scripts/extract-hardcoded.py +246 -0
- package/claude/skills/i18n-nextintl/scripts/validate-translations.py +260 -0
- package/claude/skills/impact-analysis/SKILL.md +203 -0
- package/claude/skills/jest-unit/SKILL.md +306 -0
- package/claude/skills/jest-unit/references/component-testing.md +371 -0
- package/claude/skills/jest-unit/references/mocking-patterns.md +380 -0
- package/claude/skills/jest-unit/references/service-hook-testing.md +454 -0
- package/claude/skills/jira-integration/SKILL.md +539 -0
- package/claude/skills/media-library/SKILL.md +743 -0
- package/claude/skills/mock-analysis/SKILL.md +276 -0
- package/claude/skills/monorepo-architecture/SKILL.md +162 -0
- package/claude/skills/nextjs-api-development/SKILL.md +364 -0
- package/claude/skills/nextjs-api-development/scripts/generate-crud-tests.py +456 -0
- package/claude/skills/nextjs-api-development/scripts/scaffold-endpoint.py +481 -0
- package/claude/skills/nextjs-api-development/scripts/validate-api.py +283 -0
- package/claude/skills/notion-integration/SKILL.md +641 -0
- package/claude/skills/npm-development-workflow/SKILL.md +480 -0
- package/claude/skills/page-builder-blocks/SKILL.md +530 -0
- package/claude/skills/page-builder-blocks/scripts/scaffold-block.py +444 -0
- package/claude/skills/permissions-system/SKILL.md +619 -0
- package/claude/skills/plugins/SKILL.md +340 -0
- package/claude/skills/plugins/references/plugin-templates.md +414 -0
- package/claude/skills/plugins/references/plugin-testing.md +353 -0
- package/claude/skills/plugins/references/plugin-types.md +198 -0
- package/claude/skills/plugins/scripts/scaffold-plugin.py +443 -0
- package/claude/skills/pom-patterns/SKILL.md +452 -0
- package/claude/skills/pom-patterns/scripts/generate-pom.py +392 -0
- package/claude/skills/rate-limiting/SKILL.md +342 -0
- package/claude/skills/react-best-practices/AGENTS.md +2410 -0
- package/claude/skills/react-best-practices/README.md +123 -0
- package/claude/skills/react-best-practices/SKILL.md +125 -0
- package/claude/skills/react-best-practices/metadata.json +15 -0
- package/claude/skills/react-best-practices/rules/_sections.md +46 -0
- package/claude/skills/react-best-practices/rules/_template.md +28 -0
- package/claude/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/claude/skills/react-best-practices/rules/advanced-use-latest.md +49 -0
- package/claude/skills/react-best-practices/rules/async-api-routes.md +38 -0
- package/claude/skills/react-best-practices/rules/async-defer-await.md +80 -0
- package/claude/skills/react-best-practices/rules/async-dependencies.md +36 -0
- package/claude/skills/react-best-practices/rules/async-parallel.md +28 -0
- package/claude/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/claude/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/claude/skills/react-best-practices/rules/bundle-conditional.md +31 -0
- package/claude/skills/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/claude/skills/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/claude/skills/react-best-practices/rules/bundle-preload.md +50 -0
- package/claude/skills/react-best-practices/rules/client-event-listeners.md +74 -0
- package/claude/skills/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/claude/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/claude/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/claude/skills/react-best-practices/rules/js-batch-dom-css.md +82 -0
- package/claude/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/claude/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/claude/skills/react-best-practices/rules/js-cache-storage.md +70 -0
- package/claude/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/claude/skills/react-best-practices/rules/js-early-exit.md +50 -0
- package/claude/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/claude/skills/react-best-practices/rules/js-index-maps.md +37 -0
- package/claude/skills/react-best-practices/rules/js-length-check-first.md +49 -0
- package/claude/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/claude/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/claude/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/claude/skills/react-best-practices/rules/rendering-activity.md +26 -0
- package/claude/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/claude/skills/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/claude/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/claude/skills/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/claude/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/claude/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/claude/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/claude/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/claude/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/claude/skills/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/claude/skills/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/claude/skills/react-best-practices/rules/rerender-memo.md +44 -0
- package/claude/skills/react-best-practices/rules/rerender-transitions.md +40 -0
- package/claude/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/claude/skills/react-best-practices/rules/server-cache-lru.md +41 -0
- package/claude/skills/react-best-practices/rules/server-cache-react.md +76 -0
- package/claude/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/claude/skills/react-best-practices/rules/server-serialization.md +38 -0
- package/claude/skills/react-patterns/SKILL.md +688 -0
- package/claude/skills/registry-system/SKILL.md +331 -0
- package/claude/skills/scheduled-actions/SKILL.md +671 -0
- package/claude/skills/scope-enforcement/SKILL.md +542 -0
- package/claude/skills/scope-enforcement/scripts/validate-scope.py +357 -0
- package/claude/skills/server-actions/SKILL.md +493 -0
- package/claude/skills/service-layer/SKILL.md +587 -0
- package/claude/skills/session-management/SKILL.md +266 -0
- package/claude/skills/session-management/scripts/create-session.py +166 -0
- package/claude/skills/session-management/scripts/iteration-close.sh +105 -0
- package/claude/skills/session-management/scripts/iteration-init.sh +180 -0
- package/claude/skills/session-management/scripts/session-archive.sh +87 -0
- package/claude/skills/session-management/scripts/session-close.sh +133 -0
- package/claude/skills/session-management/scripts/session-init.sh +225 -0
- package/claude/skills/session-management/scripts/session-list.sh +163 -0
- package/claude/skills/session-management/scripts/split-plan.sh +116 -0
- package/claude/skills/shadcn-components/SKILL.md +586 -0
- package/claude/skills/shadcn-theming/SKILL.md +446 -0
- package/claude/skills/suspense-loading/SKILL.md +280 -0
- package/claude/skills/tailwind-theming/SKILL.md +507 -0
- package/claude/skills/tanstack-query/SKILL.md +608 -0
- package/claude/skills/test-coverage/SKILL.md +239 -0
- package/claude/skills/web-design-guidelines/SKILL.md +39 -0
- package/claude/skills/zod-validation/SKILL.md +537 -0
- package/claude/templates/blocks/progress.md +86 -0
- package/claude/templates/iteration/changes.md +61 -0
- package/claude/templates/iteration/progress.md +55 -0
- package/claude/templates/log.md +31 -0
- package/claude/templates/story/context.md +77 -0
- package/claude/templates/story/pendings.md +37 -0
- package/claude/templates/story/plan.md +299 -0
- package/claude/templates/story/requirements.md +109 -0
- package/claude/templates/story/scope.json +10 -0
- package/claude/templates/story/tests.md +91 -0
- package/claude/templates/task/progress.md +58 -0
- package/claude/templates/task/requirements.md +54 -0
- package/claude/workflows/README.md +154 -0
- package/claude/workflows/blocks.md +614 -0
- package/claude/workflows/story.md +1207 -0
- package/claude/workflows/task.md +927 -0
- package/claude/workflows/tweak.md +527 -0
- package/cursor/.gitkeep +0 -0
- package/package.json +35 -0
- package/scripts/postinstall.mjs +198 -0
- package/scripts/setup.mjs +282 -0
- package/scripts/sync.mjs +209 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: block-decision-matrix
|
|
3
|
+
description: |
|
|
4
|
+
Decision framework for determining new block vs variant vs existing.
|
|
5
|
+
Covers decision criteria, edge cases, and anti-patterns.
|
|
6
|
+
Use this skill when planning block conversion from mocks.
|
|
7
|
+
allowed-tools: Read, Glob, Grep
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Block Decision Matrix Skill
|
|
12
|
+
|
|
13
|
+
Framework for deciding whether a mock section should use an existing block,
|
|
14
|
+
create a variant, or require a completely new block.
|
|
15
|
+
|
|
16
|
+
## Decision Flowchart
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Mock Section Analysis
|
|
20
|
+
│
|
|
21
|
+
▼
|
|
22
|
+
┌───────────────────────────────┐
|
|
23
|
+
│ Find semantically similar │
|
|
24
|
+
│ existing block │
|
|
25
|
+
└───────────────┬───────────────┘
|
|
26
|
+
│
|
|
27
|
+
┌─────────────┴─────────────┐
|
|
28
|
+
│ │
|
|
29
|
+
▼ ▼
|
|
30
|
+
FOUND MATCH NO MATCH
|
|
31
|
+
│ │
|
|
32
|
+
▼ ▼
|
|
33
|
+
┌─────────────────────┐ ┌─────────────────┐
|
|
34
|
+
│ Structure match │ │ NEW_BLOCK │
|
|
35
|
+
│ >= 80%? │ │ (definitely) │
|
|
36
|
+
└──────────┬──────────┘ └─────────────────┘
|
|
37
|
+
│
|
|
38
|
+
┌─────────┴─────────┐
|
|
39
|
+
│ │
|
|
40
|
+
▼ ▼
|
|
41
|
+
YES NO
|
|
42
|
+
│ │
|
|
43
|
+
▼ ▼
|
|
44
|
+
┌─────────────┐ ┌─────────────────────┐
|
|
45
|
+
│ How many │ │ Can existing block │
|
|
46
|
+
│ new props │ │ be extended? │
|
|
47
|
+
│ needed? │ └──────────┬──────────┘
|
|
48
|
+
└──────┬──────┘ │
|
|
49
|
+
│ ┌──────┴──────┐
|
|
50
|
+
│ │ │
|
|
51
|
+
▼ ▼ ▼
|
|
52
|
+
┌────────┐ YES NO
|
|
53
|
+
│ 0-1 │ │ │
|
|
54
|
+
│ props │ ▼ ▼
|
|
55
|
+
└───┬────┘ ┌─────────┐ ┌─────────┐
|
|
56
|
+
│ │ 2-3 │ │NEW_BLOCK│
|
|
57
|
+
▼ │ props? │ └─────────┘
|
|
58
|
+
┌───────────┐ └────┬────┘
|
|
59
|
+
│USE_EXISTING│ │
|
|
60
|
+
└───────────┘ ┌────┴────┐
|
|
61
|
+
│ │
|
|
62
|
+
▼ ▼
|
|
63
|
+
YES NO (4+)
|
|
64
|
+
│ │
|
|
65
|
+
▼ ▼
|
|
66
|
+
┌─────────┐ ┌─────────┐
|
|
67
|
+
│ VARIANT │ │NEW_BLOCK│
|
|
68
|
+
└─────────┘ └─────────┘
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Decision Criteria
|
|
72
|
+
|
|
73
|
+
### USE_EXISTING - When to Reuse
|
|
74
|
+
|
|
75
|
+
Use existing block when:
|
|
76
|
+
|
|
77
|
+
| Criterion | Required |
|
|
78
|
+
|-----------|----------|
|
|
79
|
+
| Same semantic purpose | Yes |
|
|
80
|
+
| Same HTML structure | Yes (>80%) |
|
|
81
|
+
| Differences only in styling | Yes |
|
|
82
|
+
| No new fields needed | 0-1 max |
|
|
83
|
+
| No new interaction patterns | Yes |
|
|
84
|
+
|
|
85
|
+
**Example scenarios:**
|
|
86
|
+
- Hero with different background color → Use `hero`, change `backgroundColor`
|
|
87
|
+
- Features grid with 4 columns instead of 3 → Use `features-grid`, change `columns`
|
|
88
|
+
- CTA with different button text → Use `cta-section`, change content props
|
|
89
|
+
|
|
90
|
+
### NEW_VARIANT - When to Extend
|
|
91
|
+
|
|
92
|
+
Create variant when:
|
|
93
|
+
|
|
94
|
+
| Criterion | Required |
|
|
95
|
+
|-----------|----------|
|
|
96
|
+
| Same semantic purpose | Yes |
|
|
97
|
+
| Similar structure (60-80%) | Yes |
|
|
98
|
+
| 2-3 new fields needed | Yes |
|
|
99
|
+
| No structural changes | Yes |
|
|
100
|
+
| Enhancement, not transformation | Yes |
|
|
101
|
+
|
|
102
|
+
**Example scenarios:**
|
|
103
|
+
- Hero with badge → Variant with `badge` field
|
|
104
|
+
- Features grid with animations → Variant with `animateOnScroll` field
|
|
105
|
+
- CTA with countdown → Variant with `countdown` field
|
|
106
|
+
|
|
107
|
+
### NEW_BLOCK - When to Create New
|
|
108
|
+
|
|
109
|
+
Create new block when:
|
|
110
|
+
|
|
111
|
+
| Criterion | Trigger |
|
|
112
|
+
|-----------|---------|
|
|
113
|
+
| Different semantic purpose | Automatic |
|
|
114
|
+
| 4+ new custom fields | Strong indicator |
|
|
115
|
+
| Different HTML structure | Strong indicator |
|
|
116
|
+
| Unique interaction patterns | Strong indicator |
|
|
117
|
+
| Would require >3 conditionals | Strong indicator |
|
|
118
|
+
|
|
119
|
+
**Example scenarios:**
|
|
120
|
+
- Hero with terminal animation → `hero-terminal` (unique component)
|
|
121
|
+
- Features as comparison table → `features-comparison` (different structure)
|
|
122
|
+
- CTA with lead form → `cta-with-form` (different interaction)
|
|
123
|
+
|
|
124
|
+
## Complexity Thresholds
|
|
125
|
+
|
|
126
|
+
### By Custom Props Count
|
|
127
|
+
|
|
128
|
+
| Custom Props | Decision | Confidence |
|
|
129
|
+
|--------------|----------|------------|
|
|
130
|
+
| 0 | USE_EXISTING | 100% |
|
|
131
|
+
| 1 | USE_EXISTING | 95% |
|
|
132
|
+
| 2 | Consider VARIANT | 70% |
|
|
133
|
+
| 3 | VARIANT likely | 60% |
|
|
134
|
+
| 4 | NEW_BLOCK likely | 70% |
|
|
135
|
+
| 5+ | NEW_BLOCK | 90% |
|
|
136
|
+
|
|
137
|
+
### By Conditionals Required
|
|
138
|
+
|
|
139
|
+
| Conditionals | Decision | Rationale |
|
|
140
|
+
|--------------|----------|-----------|
|
|
141
|
+
| 0-1 | Acceptable | Normal branching |
|
|
142
|
+
| 2 | Review | May be overloading |
|
|
143
|
+
| 3 | Concern | Likely should split |
|
|
144
|
+
| 4+ | Split required | Anti-pattern territory |
|
|
145
|
+
|
|
146
|
+
## Edge Case Examples
|
|
147
|
+
|
|
148
|
+
### Edge Case 1: Hero with Terminal Animation
|
|
149
|
+
|
|
150
|
+
**Initial assessment:** Variant of hero
|
|
151
|
+
**Final decision:** NEW_BLOCK → `hero-terminal`
|
|
152
|
+
|
|
153
|
+
**Analysis:**
|
|
154
|
+
```
|
|
155
|
+
Existing hero structure:
|
|
156
|
+
- title (string)
|
|
157
|
+
- content (string)
|
|
158
|
+
- cta (object)
|
|
159
|
+
- backgroundImage (string)
|
|
160
|
+
- textColor (enum)
|
|
161
|
+
|
|
162
|
+
Terminal requires:
|
|
163
|
+
- terminalLines (array of {command, output, delay})
|
|
164
|
+
- typingSpeed (number)
|
|
165
|
+
- cursorStyle (enum)
|
|
166
|
+
- promptSymbol (string)
|
|
167
|
+
- showLineNumbers (boolean)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Why NEW_BLOCK:**
|
|
171
|
+
- 5 new custom fields
|
|
172
|
+
- Completely different HTML structure (animated `<pre>` blocks)
|
|
173
|
+
- JavaScript animation state management
|
|
174
|
+
- Would require 50+ lines of conditional code
|
|
175
|
+
|
|
176
|
+
### Edge Case 2: Features Grid with Comparison Table
|
|
177
|
+
|
|
178
|
+
**Initial assessment:** Variant of features-grid
|
|
179
|
+
**Final decision:** NEW_BLOCK → `features-comparison`
|
|
180
|
+
|
|
181
|
+
**Analysis:**
|
|
182
|
+
```
|
|
183
|
+
Existing features-grid:
|
|
184
|
+
- Grid of cards
|
|
185
|
+
- Each card: icon, title, description
|
|
186
|
+
|
|
187
|
+
Comparison table needs:
|
|
188
|
+
- Table headers (feature names)
|
|
189
|
+
- Row groups (categories)
|
|
190
|
+
- Check/X marks per plan
|
|
191
|
+
- Sticky header on scroll
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Why NEW_BLOCK:**
|
|
195
|
+
- Fundamentally different structure (table vs grid)
|
|
196
|
+
- Different semantic meaning (comparison vs showcase)
|
|
197
|
+
- Would corrupt features-grid's simplicity
|
|
198
|
+
|
|
199
|
+
### Edge Case 3: Stats with Animated Counters
|
|
200
|
+
|
|
201
|
+
**Initial assessment:** NEW_BLOCK
|
|
202
|
+
**Final decision:** VARIANT → `stats-counter` with `animateOnScroll`
|
|
203
|
+
|
|
204
|
+
**Analysis:**
|
|
205
|
+
```
|
|
206
|
+
Existing stats-counter:
|
|
207
|
+
- Array of {value, label, prefix, suffix}
|
|
208
|
+
- Grid layout options
|
|
209
|
+
|
|
210
|
+
Animation needs:
|
|
211
|
+
- animateOnScroll (boolean)
|
|
212
|
+
- animationDuration (number)
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Why VARIANT:**
|
|
216
|
+
- Same semantic purpose (show statistics)
|
|
217
|
+
- Same structure (grid of stat items)
|
|
218
|
+
- Only 2 new props
|
|
219
|
+
- Animation is enhancement, not transformation
|
|
220
|
+
|
|
221
|
+
### Edge Case 4: CTA with Email Form
|
|
222
|
+
|
|
223
|
+
**Initial assessment:** Variant of cta-section
|
|
224
|
+
**Final decision:** NEW_BLOCK → `cta-with-form`
|
|
225
|
+
|
|
226
|
+
**Analysis:**
|
|
227
|
+
```
|
|
228
|
+
Existing cta-section:
|
|
229
|
+
- title, content
|
|
230
|
+
- primary button
|
|
231
|
+
- secondary button (optional)
|
|
232
|
+
|
|
233
|
+
Form needs:
|
|
234
|
+
- Form fields configuration
|
|
235
|
+
- Validation rules
|
|
236
|
+
- Success/error states
|
|
237
|
+
- Integration settings (API endpoint)
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Why NEW_BLOCK:**
|
|
241
|
+
- Different interaction pattern (form submission vs navigation)
|
|
242
|
+
- State management requirements
|
|
243
|
+
- 5+ new props (formFields, submitEndpoint, successMessage, etc.)
|
|
244
|
+
- Server action integration
|
|
245
|
+
|
|
246
|
+
## Anti-Patterns
|
|
247
|
+
|
|
248
|
+
### The Frankenstein Block
|
|
249
|
+
|
|
250
|
+
When conditionals accumulate:
|
|
251
|
+
|
|
252
|
+
```tsx
|
|
253
|
+
// BAD - Over-engineered block
|
|
254
|
+
function HeroBlock(props) {
|
|
255
|
+
return (
|
|
256
|
+
<section>
|
|
257
|
+
{props.variant === 'terminal' && <TerminalAnimation {...} />}
|
|
258
|
+
{props.variant === 'video' && <VideoPlayer {...} />}
|
|
259
|
+
{props.variant === 'form' && <LeadForm {...} />}
|
|
260
|
+
{props.variant === 'slider' && <ImageSlider {...} />}
|
|
261
|
+
{props.variant === 'basic' && <BasicHero {...} />}
|
|
262
|
+
</section>
|
|
263
|
+
)
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
**Problems:**
|
|
268
|
+
- Massive bundle size (all variants loaded)
|
|
269
|
+
- Testing nightmare
|
|
270
|
+
- Props explosion
|
|
271
|
+
- Maintenance burden
|
|
272
|
+
|
|
273
|
+
**Solution:** Split into focused blocks:
|
|
274
|
+
- `hero` (basic)
|
|
275
|
+
- `hero-terminal`
|
|
276
|
+
- `hero-video`
|
|
277
|
+
- `hero-with-form`
|
|
278
|
+
- `hero-slider`
|
|
279
|
+
|
|
280
|
+
### The Kitchen Sink
|
|
281
|
+
|
|
282
|
+
Adding fields "just in case":
|
|
283
|
+
|
|
284
|
+
```tsx
|
|
285
|
+
// BAD - Too many optional fields
|
|
286
|
+
interface HeroProps {
|
|
287
|
+
title?: string
|
|
288
|
+
subtitle?: string
|
|
289
|
+
subtitle2?: string
|
|
290
|
+
subtitle3?: string
|
|
291
|
+
badge?: string
|
|
292
|
+
badgeColor?: string
|
|
293
|
+
badgeIcon?: string
|
|
294
|
+
badgePosition?: string
|
|
295
|
+
video?: string
|
|
296
|
+
videoAutoplay?: boolean
|
|
297
|
+
videoMuted?: boolean
|
|
298
|
+
videoLoop?: boolean
|
|
299
|
+
// ... 30 more optional fields
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
**Problems:**
|
|
304
|
+
- Confusing admin UI (too many fields)
|
|
305
|
+
- Most fields never used
|
|
306
|
+
- Performance impact
|
|
307
|
+
- Documentation burden
|
|
308
|
+
|
|
309
|
+
**Solution:** Create specific variants for specific needs.
|
|
310
|
+
|
|
311
|
+
### The God Component
|
|
312
|
+
|
|
313
|
+
One block trying to do everything:
|
|
314
|
+
|
|
315
|
+
```tsx
|
|
316
|
+
// BAD - One block for all content sections
|
|
317
|
+
function ContentBlock(props) {
|
|
318
|
+
switch (props.layout) {
|
|
319
|
+
case 'hero': return <HeroLayout {...} />
|
|
320
|
+
case 'features': return <FeaturesLayout {...} />
|
|
321
|
+
case 'cta': return <CTALayout {...} />
|
|
322
|
+
case 'testimonials': return <TestimonialsLayout {...} />
|
|
323
|
+
// ... 20 more layouts
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Problems:**
|
|
329
|
+
- Breaks block categorization
|
|
330
|
+
- Impossible to validate properly
|
|
331
|
+
- Schema becomes meaningless
|
|
332
|
+
- Registry bloat
|
|
333
|
+
|
|
334
|
+
**Solution:** Separate blocks per semantic purpose.
|
|
335
|
+
|
|
336
|
+
## Decision Checklist
|
|
337
|
+
|
|
338
|
+
Before finalizing decision:
|
|
339
|
+
|
|
340
|
+
- [ ] Have I identified the semantic purpose?
|
|
341
|
+
- [ ] Have I counted required custom fields?
|
|
342
|
+
- [ ] Have I checked existing blocks in theme?
|
|
343
|
+
- [ ] Have I considered future variants?
|
|
344
|
+
- [ ] Would new fields benefit existing block users?
|
|
345
|
+
- [ ] Would conditionals be manageable (<3)?
|
|
346
|
+
- [ ] Is the HTML structure similar (>80%)?
|
|
347
|
+
|
|
348
|
+
## Quick Reference Card
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
REUSE: Same purpose + Same structure + 0-1 props
|
|
352
|
+
VARIANT: Same purpose + Similar structure + 2-3 props
|
|
353
|
+
NEW: Different purpose OR 4+ props OR Different structure
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## Related Skills
|
|
357
|
+
|
|
358
|
+
- `page-builder-blocks` - Block structure and patterns
|
|
359
|
+
- `mock-analysis` - For understanding mock requirements
|