@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,614 @@
|
|
|
1
|
+
# BLOCKS Workflow v1.0
|
|
2
|
+
|
|
3
|
+
**T-Shirt Size:** XS - S
|
|
4
|
+
**Session:** `blocks/`
|
|
5
|
+
**Subagents:** 2-3 (mock-analyst, block-developer, visual-comparator)
|
|
6
|
+
**Duration:** 15-60 minutes
|
|
7
|
+
**Token Estimate:** 30-80k
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
The BLOCKS workflow is a simplified, mock-driven workflow specifically designed for page builder block development. It requires a design mock and focuses on rapid block creation with visual validation.
|
|
14
|
+
|
|
15
|
+
**Key Characteristics:**
|
|
16
|
+
- Mock is **required** (not optional)
|
|
17
|
+
- No PM or Architecture phases
|
|
18
|
+
- Visual validation loop with retry
|
|
19
|
+
- 4 simple phases
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
### Criteria (ALL must apply)
|
|
26
|
+
|
|
27
|
+
| Criterion | Requirement |
|
|
28
|
+
|-----------|-------------|
|
|
29
|
+
| **Task type** | Page builder block development only |
|
|
30
|
+
| **Mock available** | Yes (required) |
|
|
31
|
+
| **Complexity** | Single block or simple variant |
|
|
32
|
+
| **Dependencies** | No database, no API changes |
|
|
33
|
+
| **Testing** | Visual comparison only |
|
|
34
|
+
|
|
35
|
+
### Examples
|
|
36
|
+
|
|
37
|
+
| Task | T-Shirt | Why BLOCKS |
|
|
38
|
+
|------|---------|------------|
|
|
39
|
+
| Hero block from Stitch mock | XS-S | Single block, mock-driven |
|
|
40
|
+
| Pricing table from Figma | S | Standard block with config |
|
|
41
|
+
| Feature grid from UXPilot | S | Repeating pattern block |
|
|
42
|
+
| CTA section variant | XS | Variant of existing block |
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## When NOT to Use
|
|
47
|
+
|
|
48
|
+
**Use TASK instead if:**
|
|
49
|
+
- No mock available
|
|
50
|
+
- Block needs API integration
|
|
51
|
+
- Block requires new entity data
|
|
52
|
+
- Multiple interconnected blocks
|
|
53
|
+
|
|
54
|
+
**Use STORY instead if:**
|
|
55
|
+
- Full landing page with multiple blocks
|
|
56
|
+
- Database changes required
|
|
57
|
+
- New entity needed for block data
|
|
58
|
+
- High business risk
|
|
59
|
+
|
|
60
|
+
**Use TWEAK instead if:**
|
|
61
|
+
- Simple fix to existing block
|
|
62
|
+
- Styling adjustments only
|
|
63
|
+
- No new functionality
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Initial Questions (BLOCKS-specific)
|
|
68
|
+
|
|
69
|
+
Before starting, Claude asks 7 questions for block development:
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
73
|
+
│ BLOCKS DISCOVERY (7 questions) │
|
|
74
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
75
|
+
│ │
|
|
76
|
+
│ 1. TASK MANAGER │
|
|
77
|
+
│ Is there an existing task in a project management system? │
|
|
78
|
+
│ [1] No │
|
|
79
|
+
│ [2] Yes, ClickUp (request task_id) │
|
|
80
|
+
│ [3] Yes, Jira (request task_id) │
|
|
81
|
+
│ [4] Yes, Linear (request task_id) │
|
|
82
|
+
│ [5] Yes, Asana (request task_id) │
|
|
83
|
+
│ │
|
|
84
|
+
│ 2. BLOCK TYPE │
|
|
85
|
+
│ What type of block is this? │
|
|
86
|
+
│ [1] Hero / Banner │
|
|
87
|
+
│ [2] Features / Grid │
|
|
88
|
+
│ [3] CTA / Call to Action │
|
|
89
|
+
│ [4] Testimonials / Reviews │
|
|
90
|
+
│ [5] Pricing / Plans │
|
|
91
|
+
│ [6] FAQ / Accordion │
|
|
92
|
+
│ [7] Footer / Header │
|
|
93
|
+
│ [8] Other (describe) │
|
|
94
|
+
│ │
|
|
95
|
+
│ 3. BLOCK DECISION │
|
|
96
|
+
│ Is this a new block or modification? │
|
|
97
|
+
│ [1] New block (create from scratch) │
|
|
98
|
+
│ [2] Variant of existing block (specify which) │
|
|
99
|
+
│ [3] Modification to existing block (specify which) │
|
|
100
|
+
│ │
|
|
101
|
+
│ 4. MOCK SOURCE │
|
|
102
|
+
│ Where was the mock created? │
|
|
103
|
+
│ [1] Stitch │
|
|
104
|
+
│ [2] UXPilot │
|
|
105
|
+
│ [3] Figma │
|
|
106
|
+
│ [4] Other │
|
|
107
|
+
│ │
|
|
108
|
+
│ 5. SPECIFIC REQUIREMENTS (optional) │
|
|
109
|
+
│ Any specific requirements? │
|
|
110
|
+
│ - Animation requirements │
|
|
111
|
+
│ - Responsive behavior │
|
|
112
|
+
│ - Accessibility needs │
|
|
113
|
+
│ │
|
|
114
|
+
│ 6. TESTING │
|
|
115
|
+
│ What testing is needed? │
|
|
116
|
+
│ [1] Visual validation only (default) │
|
|
117
|
+
│ [2] Add Cypress component test │
|
|
118
|
+
│ [3] Add unit tests for block logic │
|
|
119
|
+
│ │
|
|
120
|
+
│ 7. DOCUMENTATION │
|
|
121
|
+
│ What documentation is needed? │
|
|
122
|
+
│ [1] No documentation needed │
|
|
123
|
+
│ [2] Update block catalog │
|
|
124
|
+
│ [3] Create usage guide │
|
|
125
|
+
│ │
|
|
126
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Flow
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
135
|
+
│ BLOCKS WORKFLOW v1.0 │
|
|
136
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
137
|
+
│ │
|
|
138
|
+
│ Phase 0: DISCOVERY + MOCK UPLOAD │
|
|
139
|
+
│ ──────────────────────────────────── │
|
|
140
|
+
│ [MANDATORY] Claude asks 7 BLOCKS questions │
|
|
141
|
+
│ ├── Task Manager? (No/ClickUp/Jira/Linear/Asana) │
|
|
142
|
+
│ ├── Block type? (hero/features/cta/etc) │
|
|
143
|
+
│ ├── Block decision? (new/variant/modify) │
|
|
144
|
+
│ ├── Mock source? (Stitch/UXPilot/Figma/Other) │
|
|
145
|
+
│ ├── Specific requirements? (optional) │
|
|
146
|
+
│ ├── Testing? (visual only/Cypress/unit) │
|
|
147
|
+
│ └── Documentation? (none/catalog/guide) │
|
|
148
|
+
│ ↓ │
|
|
149
|
+
│ [MANDATORY] Create session folder │
|
|
150
|
+
│ ├── Create blocks/YYYY-MM-DD-block-name/ │
|
|
151
|
+
│ └── Create mocks/ subfolder │
|
|
152
|
+
│ ↓ │
|
|
153
|
+
│ [PAUSE] Ask user to upload mock files │
|
|
154
|
+
│ ├── Display upload instructions │
|
|
155
|
+
│ ├── Wait for user confirmation ("ready") │
|
|
156
|
+
│ └── Validate mock files exist │
|
|
157
|
+
│ ↓ │
|
|
158
|
+
│ Phase 1: MOCK ANALYSIS │
|
|
159
|
+
│ ──────────────────────────── │
|
|
160
|
+
│ [SUBAGENT] mock-analyst runs │
|
|
161
|
+
│ ├── Detect files (*.html, *.png, *.jpg, *.pdf) │
|
|
162
|
+
│ ├── Parse HTML structure (if available) │
|
|
163
|
+
│ ├── Extract Tailwind config tokens │
|
|
164
|
+
│ ├── Map to theme tokens (ds-mapping.json) │
|
|
165
|
+
│ ├── Generate analysis.json │
|
|
166
|
+
│ └── Generate block-plan.json (decision matrix) │
|
|
167
|
+
│ ↓ │
|
|
168
|
+
│ Phase 2: BLOCK DEVELOPMENT │
|
|
169
|
+
│ ──────────────────────────────── │
|
|
170
|
+
│ [SUBAGENT] block-developer runs │
|
|
171
|
+
│ ├── Read analysis.json + ds-mapping.json │
|
|
172
|
+
│ ├── Follow block-plan.json decision │
|
|
173
|
+
│ ├── Create/modify block files (5 files) │
|
|
174
|
+
│ │ ├── config.ts │
|
|
175
|
+
│ │ ├── schema.ts │
|
|
176
|
+
│ │ ├── fields.ts │
|
|
177
|
+
│ │ ├── component.tsx │
|
|
178
|
+
│ │ └── index.ts │
|
|
179
|
+
│ ├── Apply design tokens from ds-mapping │
|
|
180
|
+
│ └── Register block (rebuild registry) │
|
|
181
|
+
│ ↓ │
|
|
182
|
+
│ Phase 3: VISUAL VALIDATION │
|
|
183
|
+
│ ──────────────────────────────── │
|
|
184
|
+
│ [GATE] visual-comparator runs │
|
|
185
|
+
│ ├── Navigate to DevTools block preview │
|
|
186
|
+
│ ├── Take screenshot of rendered block │
|
|
187
|
+
│ ├── Compare with mock screenshot │
|
|
188
|
+
│ └── Return verdict: PASS / WARNING / FAIL │
|
|
189
|
+
│ │ │
|
|
190
|
+
│ ├── PASS → Complete, ready for commit │
|
|
191
|
+
│ │ │
|
|
192
|
+
│ ├── WARNING → Show differences, ask user │
|
|
193
|
+
│ │ └── User decides: Accept or Fix │
|
|
194
|
+
│ │ │
|
|
195
|
+
│ └── FAIL → Return to Phase 2 │
|
|
196
|
+
│ ├── Max 3 retries │
|
|
197
|
+
│ └── After 3 fails → Stop, report issues │
|
|
198
|
+
│ │
|
|
199
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
## Mock Upload Pause
|
|
205
|
+
|
|
206
|
+
After creating the session folder, Claude pauses and displays:
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
210
|
+
│ MOCK UPLOAD REQUIRED │
|
|
211
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
212
|
+
│ │
|
|
213
|
+
│ Session created at: │
|
|
214
|
+
│ .claude/sessions/blocks/YYYY-MM-DD-block-name/ │
|
|
215
|
+
│ │
|
|
216
|
+
│ Please upload your mock files to: │
|
|
217
|
+
│ .claude/sessions/blocks/YYYY-MM-DD-block-name/mocks/ │
|
|
218
|
+
│ │
|
|
219
|
+
│ Expected files (auto-detected): │
|
|
220
|
+
│ ├── HTML: code.html, index.html, or any *.html │
|
|
221
|
+
│ ├── Screenshot: screen.png, or any *.png, *.jpg │
|
|
222
|
+
│ └── Optional: assets/, tailwind.config.js │
|
|
223
|
+
│ │
|
|
224
|
+
│ Reply "ready" when files are uploaded. │
|
|
225
|
+
│ │
|
|
226
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Mock Validation
|
|
230
|
+
|
|
231
|
+
When user responds "ready", Claude validates:
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
Validation checks:
|
|
235
|
+
├── [REQUIRED] At least one image file (*.png, *.jpg, *.jpeg)
|
|
236
|
+
├── [RECOMMENDED] At least one HTML file (*.html)
|
|
237
|
+
├── [OPTIONAL] Tailwind config (tailwind.config.js)
|
|
238
|
+
└── [OPTIONAL] Assets folder (assets/)
|
|
239
|
+
|
|
240
|
+
If HTML missing:
|
|
241
|
+
├── WARNING: "No HTML file found. Analysis will be limited to visual comparison."
|
|
242
|
+
└── Continue with screenshot-only analysis
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## Session Files
|
|
248
|
+
|
|
249
|
+
### Directory Structure
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
.claude/sessions/blocks/YYYY-MM-DD-block-name/
|
|
253
|
+
├── mocks/ # User uploads here
|
|
254
|
+
│ ├── code.html # From Stitch/Figma export
|
|
255
|
+
│ ├── screen.png # Visual reference
|
|
256
|
+
│ └── assets/ # Images, fonts (optional)
|
|
257
|
+
│
|
|
258
|
+
├── analysis.json # Mock structure analysis
|
|
259
|
+
├── ds-mapping.json # Design token mapping
|
|
260
|
+
├── block-plan.json # Block decision (new/variant/existing)
|
|
261
|
+
└── progress.md # Status tracking
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### progress.md Template
|
|
265
|
+
|
|
266
|
+
```markdown
|
|
267
|
+
# Block: [Block Name]
|
|
268
|
+
|
|
269
|
+
**Status:** In Progress | Blocked | Done
|
|
270
|
+
**Workflow:** BLOCKS
|
|
271
|
+
**Created:** YYYY-MM-DD
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
## Discovery Answers
|
|
276
|
+
|
|
277
|
+
| Question | Answer |
|
|
278
|
+
|----------|--------|
|
|
279
|
+
| **Mock Source** | Stitch / UXPilot / Figma / Other |
|
|
280
|
+
| **Block Type** | Hero / Features / CTA / etc |
|
|
281
|
+
| **Block Decision** | New / Variant / Modification |
|
|
282
|
+
| **Requirements** | [Any specific requirements] |
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Mock Files
|
|
287
|
+
|
|
288
|
+
| File | Status |
|
|
289
|
+
|------|--------|
|
|
290
|
+
| code.html | Uploaded |
|
|
291
|
+
| screen.png | Uploaded |
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## Analysis Results
|
|
296
|
+
|
|
297
|
+
**Sections found:** [number]
|
|
298
|
+
**Design tokens:** [number mapped] / [number gaps]
|
|
299
|
+
**Block decision:** New block: [name] / Variant of: [existing] / Modify: [existing]
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## Development Progress
|
|
304
|
+
|
|
305
|
+
- [ ] Block config created
|
|
306
|
+
- [ ] Block schema defined
|
|
307
|
+
- [ ] Fields configured
|
|
308
|
+
- [ ] Component implemented
|
|
309
|
+
- [ ] Registry rebuilt
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
## Visual Validation
|
|
314
|
+
|
|
315
|
+
| Attempt | Result | Notes |
|
|
316
|
+
|---------|--------|-------|
|
|
317
|
+
| 1 | PASS/WARNING/FAIL | [Notes] |
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Checklist
|
|
322
|
+
|
|
323
|
+
- [ ] Mock uploaded
|
|
324
|
+
- [ ] Analysis complete
|
|
325
|
+
- [ ] Block created/modified
|
|
326
|
+
- [ ] Visual validation passed
|
|
327
|
+
- [ ] Ready for commit
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
---
|
|
331
|
+
|
|
332
|
+
## Phase Details
|
|
333
|
+
|
|
334
|
+
### Phase 0: Discovery + Mock Upload
|
|
335
|
+
|
|
336
|
+
**Duration:** 2-5 minutes
|
|
337
|
+
**Goal:** Gather context and receive mock files
|
|
338
|
+
|
|
339
|
+
```
|
|
340
|
+
Steps:
|
|
341
|
+
1. Ask BLOCKS discovery questions
|
|
342
|
+
2. Create session folder structure
|
|
343
|
+
3. Display mock upload instructions
|
|
344
|
+
4. Wait for user confirmation
|
|
345
|
+
5. Validate mock files
|
|
346
|
+
6. Initialize progress.md
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Phase 1: Mock Analysis
|
|
350
|
+
|
|
351
|
+
**Duration:** 2-5 minutes
|
|
352
|
+
**Goal:** Analyze mock and prepare for development
|
|
353
|
+
|
|
354
|
+
**Agent:** `mock-analyst`
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
Inputs:
|
|
358
|
+
├── mocks/ folder path
|
|
359
|
+
├── Mock source (from discovery)
|
|
360
|
+
└── Block type hint (from discovery)
|
|
361
|
+
|
|
362
|
+
Process:
|
|
363
|
+
├── Detect and catalog files
|
|
364
|
+
├── Parse HTML if available
|
|
365
|
+
├── Extract Tailwind tokens
|
|
366
|
+
├── Map to theme globals.css
|
|
367
|
+
├── Identify sections/components
|
|
368
|
+
└── Determine block decision
|
|
369
|
+
|
|
370
|
+
Outputs:
|
|
371
|
+
├── analysis.json
|
|
372
|
+
├── ds-mapping.json
|
|
373
|
+
└── block-plan.json
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Phase 2: Block Development
|
|
377
|
+
|
|
378
|
+
**Duration:** 10-40 minutes
|
|
379
|
+
**Goal:** Create or modify block files
|
|
380
|
+
|
|
381
|
+
**Agent:** `block-developer`
|
|
382
|
+
|
|
383
|
+
```
|
|
384
|
+
Inputs:
|
|
385
|
+
├── analysis.json
|
|
386
|
+
├── ds-mapping.json
|
|
387
|
+
├── block-plan.json
|
|
388
|
+
└── Block type from discovery
|
|
389
|
+
|
|
390
|
+
Process:
|
|
391
|
+
├── Read block decision from block-plan.json
|
|
392
|
+
├── If NEW: Create 5 block files
|
|
393
|
+
├── If VARIANT: Copy and modify existing
|
|
394
|
+
├── If MODIFY: Update existing block
|
|
395
|
+
├── Apply tokens from ds-mapping.json
|
|
396
|
+
└── Rebuild block registry
|
|
397
|
+
|
|
398
|
+
Outputs:
|
|
399
|
+
├── Block files (5 files)
|
|
400
|
+
├── Updated registry
|
|
401
|
+
└── Updated progress.md
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
### Phase 3: Visual Validation
|
|
405
|
+
|
|
406
|
+
**Duration:** 2-10 minutes (per attempt)
|
|
407
|
+
**Goal:** Verify visual match with mock
|
|
408
|
+
|
|
409
|
+
**Agent:** `visual-comparator`
|
|
410
|
+
|
|
411
|
+
```
|
|
412
|
+
Inputs:
|
|
413
|
+
├── Block name
|
|
414
|
+
├── mocks/screen.png (reference)
|
|
415
|
+
└── Theme and locale context
|
|
416
|
+
|
|
417
|
+
Process:
|
|
418
|
+
├── Start dev server (if not running)
|
|
419
|
+
├── Navigate to DevTools preview
|
|
420
|
+
├── Render block with sample data
|
|
421
|
+
├── Take screenshot
|
|
422
|
+
├── Compare with mock screenshot
|
|
423
|
+
└── Calculate similarity score
|
|
424
|
+
|
|
425
|
+
Outputs:
|
|
426
|
+
├── Comparison result (PASS/WARNING/FAIL)
|
|
427
|
+
├── Diff image (if differences found)
|
|
428
|
+
└── Specific issues list
|
|
429
|
+
|
|
430
|
+
Thresholds:
|
|
431
|
+
├── PASS: > 90% similarity
|
|
432
|
+
├── WARNING: 70-90% similarity
|
|
433
|
+
└── FAIL: < 70% similarity
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
---
|
|
437
|
+
|
|
438
|
+
## Visual Validation Loop
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
442
|
+
│ VISUAL VALIDATION LOOP │
|
|
443
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
444
|
+
│ │
|
|
445
|
+
│ Attempt 1: │
|
|
446
|
+
│ ├── visual-comparator runs │
|
|
447
|
+
│ └── Result: PASS → Done │
|
|
448
|
+
│ WARNING → Ask user (accept/fix) │
|
|
449
|
+
│ FAIL → Go to Attempt 2 │
|
|
450
|
+
│ │
|
|
451
|
+
│ Attempt 2 (if FAIL): │
|
|
452
|
+
│ ├── block-developer fixes identified issues │
|
|
453
|
+
│ ├── visual-comparator runs again │
|
|
454
|
+
│ └── Result: PASS → Done │
|
|
455
|
+
│ WARNING → Ask user (accept/fix) │
|
|
456
|
+
│ FAIL → Go to Attempt 3 │
|
|
457
|
+
│ │
|
|
458
|
+
│ Attempt 3 (if FAIL): │
|
|
459
|
+
│ ├── block-developer fixes identified issues │
|
|
460
|
+
│ ├── visual-comparator runs again │
|
|
461
|
+
│ └── Result: PASS → Done │
|
|
462
|
+
│ WARNING → Ask user (accept/fix) │
|
|
463
|
+
│ FAIL → STOP, report issues to user │
|
|
464
|
+
│ │
|
|
465
|
+
│ Max Retries: 3 │
|
|
466
|
+
│ After 3 fails: Manual intervention required │
|
|
467
|
+
│ │
|
|
468
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
## Commands
|
|
474
|
+
|
|
475
|
+
### Start BLOCKS workflow
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
# Explicit BLOCKS
|
|
479
|
+
/session:start:blocks Hero block from Stitch mock
|
|
480
|
+
|
|
481
|
+
# Auto-detection (if mock mentioned)
|
|
482
|
+
/start Create pricing block from this Figma design
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Key commands for BLOCKS
|
|
486
|
+
|
|
487
|
+
| Command | Phase | Purpose |
|
|
488
|
+
|---------|-------|---------|
|
|
489
|
+
| `/session:start:blocks` | 0 | Start BLOCKS workflow |
|
|
490
|
+
| `/session:status` | Any | Check progress |
|
|
491
|
+
| `/session:commit` | End | Prepare commit |
|
|
492
|
+
|
|
493
|
+
---
|
|
494
|
+
|
|
495
|
+
## Skills Reference
|
|
496
|
+
|
|
497
|
+
For BLOCKS workflow, consult these skills:
|
|
498
|
+
|
|
499
|
+
| Skill | Purpose |
|
|
500
|
+
|-------|---------|
|
|
501
|
+
| `page-builder-blocks` | Block file structure and patterns |
|
|
502
|
+
| `mock-analysis` | Mock parsing patterns |
|
|
503
|
+
| `design-system` | Token mapping |
|
|
504
|
+
| `tailwind-theming` | Theme CSS variables |
|
|
505
|
+
| `shadcn-components` | UI component patterns |
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Characteristics Summary
|
|
510
|
+
|
|
511
|
+
| Aspect | BLOCKS Workflow |
|
|
512
|
+
|--------|-----------------|
|
|
513
|
+
| **Initial questions** | 7 (block-specific) |
|
|
514
|
+
| **Session files** | 4 (progress.md + 3 analysis files) |
|
|
515
|
+
| **Mock requirement** | Required |
|
|
516
|
+
| **Subagents** | 2-3 (mock-analyst, block-developer, visual-comparator) |
|
|
517
|
+
| **Validation** | Visual comparison |
|
|
518
|
+
| **Retry loop** | Yes (max 3) |
|
|
519
|
+
| **Typical duration** | 15-60 minutes |
|
|
520
|
+
| **Token estimate** | 30-80k |
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## Comparison: BLOCKS vs TASK vs STORY
|
|
525
|
+
|
|
526
|
+
```
|
|
527
|
+
BLOCKS TASK STORY
|
|
528
|
+
────────────────────────────────────────────────────────────────────
|
|
529
|
+
Questions 7 block-specific 7 standard 7 standard
|
|
530
|
+
Mock required Yes No No
|
|
531
|
+
Phases 4 4 informal 15 formal
|
|
532
|
+
Session files 4 2 8+
|
|
533
|
+
Subagents 2-3 0-3 8-10
|
|
534
|
+
Validation Visual Self 4 gates
|
|
535
|
+
DB support No Limited Full
|
|
536
|
+
Duration 15-60 min 30-120 min 1-5 hours
|
|
537
|
+
Use case Block from mock Medium work Complex feature
|
|
538
|
+
```
|
|
539
|
+
|
|
540
|
+
---
|
|
541
|
+
|
|
542
|
+
## Anti-Patterns
|
|
543
|
+
|
|
544
|
+
### What BLOCKS is NOT for
|
|
545
|
+
|
|
546
|
+
| Anti-Pattern | Why It's Wrong |
|
|
547
|
+
|--------------|----------------|
|
|
548
|
+
| Block without mock | Use TASK instead |
|
|
549
|
+
| Multiple blocks at once | Use STORY or separate sessions |
|
|
550
|
+
| Block with API integration | Use TASK or STORY |
|
|
551
|
+
| Complex interactive block | May need STORY for proper testing |
|
|
552
|
+
| Block with database needs | Use STORY |
|
|
553
|
+
|
|
554
|
+
### Signs You're Using BLOCKS Wrong
|
|
555
|
+
|
|
556
|
+
1. **No mock uploaded** → Use TASK
|
|
557
|
+
2. **Need API calls** → Escalate to TASK
|
|
558
|
+
3. **Multiple blocks** → Create separate sessions
|
|
559
|
+
4. **Database changes** → Escalate to STORY
|
|
560
|
+
5. **Taking > 2 hours** → Wrong workflow
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
## Error Handling
|
|
565
|
+
|
|
566
|
+
### Mock Upload Issues
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
If mock folder is empty:
|
|
570
|
+
├── Error: "No files found in mocks/ folder"
|
|
571
|
+
└── Action: Wait for user to upload
|
|
572
|
+
|
|
573
|
+
If no image file:
|
|
574
|
+
├── Error: "No screenshot found (*.png, *.jpg)"
|
|
575
|
+
└── Action: Cannot proceed without visual reference
|
|
576
|
+
|
|
577
|
+
If HTML is malformed:
|
|
578
|
+
├── Warning: "Could not parse HTML structure"
|
|
579
|
+
└── Action: Continue with limited analysis
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
### Visual Validation Issues
|
|
583
|
+
|
|
584
|
+
```
|
|
585
|
+
If DevTools preview unavailable:
|
|
586
|
+
├── Error: "Cannot render block preview"
|
|
587
|
+
└── Action: Check dev server, verify block registration
|
|
588
|
+
|
|
589
|
+
If screenshot fails:
|
|
590
|
+
├── Error: "Could not capture screenshot"
|
|
591
|
+
└── Action: Retry or use manual verification
|
|
592
|
+
|
|
593
|
+
If comparison fails after 3 attempts:
|
|
594
|
+
├── Error: "Visual validation failed after 3 attempts"
|
|
595
|
+
└── Action: Report specific issues, request manual review
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
## Related Documentation
|
|
601
|
+
|
|
602
|
+
- `workflows/task.md` - For tasks without mock
|
|
603
|
+
- `workflows/story.md` - For complex features
|
|
604
|
+
- `skills/page-builder-blocks/SKILL.md` - Block patterns
|
|
605
|
+
- `skills/mock-analysis/SKILL.md` - Mock parsing
|
|
606
|
+
- `skills/design-system/SKILL.md` - Token mapping
|
|
607
|
+
|
|
608
|
+
---
|
|
609
|
+
|
|
610
|
+
## Version History
|
|
611
|
+
|
|
612
|
+
| Version | Changes |
|
|
613
|
+
|---------|---------|
|
|
614
|
+
| v1.0 | Initial version - Mock-driven block development workflow |
|