@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,276 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mock-analysis
|
|
3
|
+
description: |
|
|
4
|
+
Patterns for analyzing HTML/CSS mocks from Stitch, Figma, or similar tools.
|
|
5
|
+
Covers section identification, component detection, and Tailwind config extraction.
|
|
6
|
+
Use this skill when parsing mocks for block conversion.
|
|
7
|
+
allowed-tools: Read, Glob, Grep, Bash
|
|
8
|
+
version: 1.0.0
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Mock Analysis Skill
|
|
12
|
+
|
|
13
|
+
Patterns for parsing and analyzing HTML/CSS mocks to prepare for block conversion.
|
|
14
|
+
|
|
15
|
+
## When to Use This Skill
|
|
16
|
+
|
|
17
|
+
- Analyzing Stitch exports (code.html + screen.png)
|
|
18
|
+
- Parsing Figma HTML exports
|
|
19
|
+
- Understanding mock structure before conversion
|
|
20
|
+
- Extracting design tokens from inline Tailwind config
|
|
21
|
+
|
|
22
|
+
## Mock File Structure
|
|
23
|
+
|
|
24
|
+
Standard export structure (flexible detection):
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
mock-folder/
|
|
28
|
+
├── code.html # Main HTML markup (or *.html)
|
|
29
|
+
├── screen.png # Visual screenshot (or *.png, *.jpg)
|
|
30
|
+
├── assets/ # Images, fonts (optional)
|
|
31
|
+
│ ├── images/
|
|
32
|
+
│ └── fonts/
|
|
33
|
+
└── tailwind.config.js # Sometimes included inline in HTML
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Flexible File Detection:**
|
|
37
|
+
|
|
38
|
+
| File Type | Detection Pattern | Required |
|
|
39
|
+
|-----------|-------------------|----------|
|
|
40
|
+
| HTML | `code.html`, `index.html`, `*.html` | Recommended |
|
|
41
|
+
| Screenshot | `screen.png`, `*.png`, `*.jpg`, `*.jpeg` | Required |
|
|
42
|
+
| Tailwind Config | `tailwind.config.js`, inline in HTML | Optional |
|
|
43
|
+
| Assets | `assets/`, `images/` | Optional |
|
|
44
|
+
| PDF | `*.pdf` (for Figma exports) | Alternative |
|
|
45
|
+
|
|
46
|
+
**Detection Priority:**
|
|
47
|
+
1. `code.html` → Primary HTML file
|
|
48
|
+
2. `index.html` → Alternative name
|
|
49
|
+
3. Any `*.html` → Fallback
|
|
50
|
+
4. `screen.png` → Primary screenshot
|
|
51
|
+
5. `screenshot.png`, `screen.jpg` → Alternatives
|
|
52
|
+
6. Any `*.png`, `*.jpg` → Fallback
|
|
53
|
+
|
|
54
|
+
**Workflow Integration:**
|
|
55
|
+
- BLOCKS: Mock is required
|
|
56
|
+
- TASK/STORY: Mock is optional
|
|
57
|
+
- Phase 0.6 runs mock-analyst when mock is selected
|
|
58
|
+
- Output files go to session's `mocks/` folder
|
|
59
|
+
|
|
60
|
+
## Section Identification Heuristics
|
|
61
|
+
|
|
62
|
+
### Hero Sections
|
|
63
|
+
```html
|
|
64
|
+
<!-- Indicators -->
|
|
65
|
+
<section class="...min-h-[500px]..."> <!-- Large min-height -->
|
|
66
|
+
<section class="...h-screen..."> <!-- Full viewport -->
|
|
67
|
+
<div class="...bg-cover..."> <!-- Background image -->
|
|
68
|
+
<h1>...</h1> <!-- Main heading -->
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Classification:** `type: "hero"`
|
|
72
|
+
|
|
73
|
+
### Navigation/Header
|
|
74
|
+
```html
|
|
75
|
+
<header>...</header>
|
|
76
|
+
<nav>...</nav>
|
|
77
|
+
<div class="...fixed...top-0...">
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Classification:** `type: "navigation"`
|
|
81
|
+
|
|
82
|
+
### Feature Grids
|
|
83
|
+
```html
|
|
84
|
+
<div class="...grid...grid-cols-3...">
|
|
85
|
+
<div>...</div> <!-- Repeated pattern -->
|
|
86
|
+
<div>...</div>
|
|
87
|
+
<div>...</div>
|
|
88
|
+
</div>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Classification:** `type: "features"`
|
|
92
|
+
|
|
93
|
+
### CTA Sections
|
|
94
|
+
```html
|
|
95
|
+
<section class="...text-center...py-16...">
|
|
96
|
+
<h2>...</h2>
|
|
97
|
+
<p>...</p>
|
|
98
|
+
<button>...</button> <!-- 1-2 buttons -->
|
|
99
|
+
</section>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Classification:** `type: "cta"`
|
|
103
|
+
|
|
104
|
+
### Footer
|
|
105
|
+
```html
|
|
106
|
+
<footer>...</footer>
|
|
107
|
+
<div class="...mt-auto..."> <!-- At bottom -->
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Classification:** `type: "footer"`
|
|
111
|
+
|
|
112
|
+
## Component Detection Patterns
|
|
113
|
+
|
|
114
|
+
### Buttons
|
|
115
|
+
```html
|
|
116
|
+
<button class="...">Text</button>
|
|
117
|
+
<a href="..." class="...btn...">Text</a>
|
|
118
|
+
<a href="..." class="...rounded...bg-...">Text</a>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Forms
|
|
122
|
+
```html
|
|
123
|
+
<form>...</form>
|
|
124
|
+
<input type="...">
|
|
125
|
+
<div class="...flex...gap-...">
|
|
126
|
+
<input>
|
|
127
|
+
<button>Submit</button>
|
|
128
|
+
</div>
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Cards
|
|
132
|
+
```html
|
|
133
|
+
<div class="...rounded...border...shadow...">
|
|
134
|
+
<img>
|
|
135
|
+
<h3>...</h3>
|
|
136
|
+
<p>...</p>
|
|
137
|
+
</div>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Icons
|
|
141
|
+
```html
|
|
142
|
+
<svg>...</svg>
|
|
143
|
+
<i class="...icon...">
|
|
144
|
+
<span class="...lucide-...">
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Tailwind Config Extraction
|
|
148
|
+
|
|
149
|
+
Look for inline config in HTML:
|
|
150
|
+
|
|
151
|
+
```html
|
|
152
|
+
<script>
|
|
153
|
+
tailwind.config = {
|
|
154
|
+
theme: {
|
|
155
|
+
extend: {
|
|
156
|
+
colors: {
|
|
157
|
+
primary: '#137fec',
|
|
158
|
+
'background-dark': '#101922',
|
|
159
|
+
},
|
|
160
|
+
fontFamily: {
|
|
161
|
+
sans: ['Inter', 'sans-serif'],
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
</script>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Extract:**
|
|
170
|
+
- `colors` → For ds-mapping
|
|
171
|
+
- `fontFamily` → For typography mapping
|
|
172
|
+
- `spacing` → If customized
|
|
173
|
+
- `borderRadius` → If customized
|
|
174
|
+
|
|
175
|
+
## Output Format: analysis.json
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"mockPath": "_tmp/mocks/stitch/landing-page",
|
|
180
|
+
"htmlFile": "code.html",
|
|
181
|
+
"screenshotFile": "screen.png",
|
|
182
|
+
"analyzedAt": "2025-01-09T12:00:00Z",
|
|
183
|
+
|
|
184
|
+
"tailwindConfig": {
|
|
185
|
+
"found": true,
|
|
186
|
+
"colors": {
|
|
187
|
+
"primary": "#137fec",
|
|
188
|
+
"background-dark": "#101922",
|
|
189
|
+
"accent": "#00d4ff"
|
|
190
|
+
},
|
|
191
|
+
"fonts": {
|
|
192
|
+
"sans": ["Inter", "sans-serif"],
|
|
193
|
+
"mono": ["JetBrains Mono", "monospace"]
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
|
|
197
|
+
"sections": [
|
|
198
|
+
{
|
|
199
|
+
"id": "section-1",
|
|
200
|
+
"type": "hero",
|
|
201
|
+
"selector": "section:first-of-type",
|
|
202
|
+
"htmlSnippet": "<section class=\"relative min-h-[600px]...\">",
|
|
203
|
+
"components": [
|
|
204
|
+
{"type": "heading", "level": 1, "text": "Build faster..."},
|
|
205
|
+
{"type": "paragraph", "text": "The complete..."},
|
|
206
|
+
{"type": "button", "text": "Get Started", "variant": "primary"},
|
|
207
|
+
{"type": "custom", "name": "terminal-animation"}
|
|
208
|
+
],
|
|
209
|
+
"layout": {
|
|
210
|
+
"type": "centered-flex",
|
|
211
|
+
"minHeight": "600px",
|
|
212
|
+
"hasBackground": true,
|
|
213
|
+
"backgroundType": "gradient"
|
|
214
|
+
},
|
|
215
|
+
"estimatedComplexity": "high",
|
|
216
|
+
"notes": "Contains animated terminal component"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"id": "section-2",
|
|
220
|
+
"type": "features",
|
|
221
|
+
"selector": "section:nth-of-type(2)",
|
|
222
|
+
"components": [
|
|
223
|
+
{"type": "heading", "level": 2},
|
|
224
|
+
{"type": "grid", "columns": 3, "items": 6}
|
|
225
|
+
],
|
|
226
|
+
"layout": {
|
|
227
|
+
"type": "grid",
|
|
228
|
+
"columns": "3",
|
|
229
|
+
"gap": "6"
|
|
230
|
+
},
|
|
231
|
+
"estimatedComplexity": "low"
|
|
232
|
+
}
|
|
233
|
+
],
|
|
234
|
+
|
|
235
|
+
"componentInventory": {
|
|
236
|
+
"headings": {"h1": 1, "h2": 4, "h3": 12},
|
|
237
|
+
"buttons": 8,
|
|
238
|
+
"links": 24,
|
|
239
|
+
"images": 6,
|
|
240
|
+
"icons": 18,
|
|
241
|
+
"forms": 1,
|
|
242
|
+
"customComponents": [
|
|
243
|
+
{"name": "terminal-animation", "section": "section-1"},
|
|
244
|
+
{"name": "tabs-preview", "section": "section-4"},
|
|
245
|
+
{"name": "chat-widget", "section": "section-5"}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
|
|
249
|
+
"summary": {
|
|
250
|
+
"totalSections": 7,
|
|
251
|
+
"complexity": "medium-high",
|
|
252
|
+
"customComponentsCount": 3,
|
|
253
|
+
"estimatedBlocks": {
|
|
254
|
+
"new": 3,
|
|
255
|
+
"existing": 4
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Analysis Protocol
|
|
262
|
+
|
|
263
|
+
1. **Validate mock folder** - Check required files exist
|
|
264
|
+
2. **Parse HTML** - Load and parse code.html
|
|
265
|
+
3. **Extract Tailwind config** - Find inline configuration
|
|
266
|
+
4. **Identify sections** - Segment by semantic sections
|
|
267
|
+
5. **Classify sections** - Apply heuristics for type
|
|
268
|
+
6. **Detect components** - Inventory all components per section
|
|
269
|
+
7. **Assess complexity** - Estimate block requirements
|
|
270
|
+
8. **Generate analysis.json** - Output structured analysis
|
|
271
|
+
|
|
272
|
+
## Related Skills
|
|
273
|
+
|
|
274
|
+
- `design-system` - For token mapping after analysis
|
|
275
|
+
- `page-builder-blocks` - For understanding target block structure
|
|
276
|
+
- `shadcn-components` - For component pattern matching
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# NextSpark Monorepo Architecture
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
NextSpark uses a pnpm monorepo with strict separation of concerns between packages.
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
repo/
|
|
11
|
+
├── packages/
|
|
12
|
+
│ ├── core/ # @nextsparkjs/core - Library only (no CLI)
|
|
13
|
+
│ ├── cli/ # @nextsparkjs/cli - All CLI commands, wizard
|
|
14
|
+
│ └── create-nextspark-app/ # Wrapper that installs CLI + runs init
|
|
15
|
+
├── themes/
|
|
16
|
+
│ ├── default/ # @nextsparkjs/theme-default
|
|
17
|
+
│ ├── blog/ # @nextsparkjs/theme-blog
|
|
18
|
+
│ ├── crm/ # @nextsparkjs/theme-crm
|
|
19
|
+
│ └── productivity/ # @nextsparkjs/theme-productivity
|
|
20
|
+
├── plugins/
|
|
21
|
+
│ ├── ai/ # @nextsparkjs/plugin-ai
|
|
22
|
+
│ ├── langchain/ # @nextsparkjs/plugin-langchain
|
|
23
|
+
│ └── ...
|
|
24
|
+
└── apps/
|
|
25
|
+
└── dev/ # Development app (monorepo only)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Package Relationships
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
32
|
+
│ User Project (npm install) │
|
|
33
|
+
│ └── @nextsparkjs/cli (has wizard, commands) │
|
|
34
|
+
│ └── @nextsparkjs/core (library, components, hooks) │
|
|
35
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
36
|
+
│ Themes depend on: @nextsparkjs/core (peerDependency) │
|
|
37
|
+
│ Plugins depend on: @nextsparkjs/core (peerDependency) │
|
|
38
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Dependency Management
|
|
42
|
+
|
|
43
|
+
### Decision Tree: dependencies vs peerDependencies
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
Is this dependency...?
|
|
47
|
+
│
|
|
48
|
+
├── Framework/platform shared by all (react, next, zod)?
|
|
49
|
+
│ └── YES → peerDependency
|
|
50
|
+
│
|
|
51
|
+
├── Core library that user's project controls (@nextsparkjs/core)?
|
|
52
|
+
│ └── YES → peerDependency (workspace:* in monorepo)
|
|
53
|
+
│
|
|
54
|
+
├── Something specific to this theme/plugin that users don't manage?
|
|
55
|
+
│ └── YES → dependencies (regular)
|
|
56
|
+
│
|
|
57
|
+
└── Already provided by core (next-themes, lucide-react, etc)?
|
|
58
|
+
└── YES → DO NOT ADD - import from core instead
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Examples
|
|
62
|
+
|
|
63
|
+
**CORRECT - Theme package.json:**
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"some-markdown-library": "^1.0.0" // Theme-specific, users don't care
|
|
68
|
+
},
|
|
69
|
+
"peerDependencies": {
|
|
70
|
+
"@nextsparkjs/core": "workspace:*", // Framework
|
|
71
|
+
"next": "^15.0.0", // Platform
|
|
72
|
+
"react": "^19.0.0", // Platform
|
|
73
|
+
"react-dom": "^19.0.0", // Platform
|
|
74
|
+
"zod": "^4.0.0" // Shared utility
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**INCORRECT:**
|
|
80
|
+
```json
|
|
81
|
+
{
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"next-themes": "^0.4.0" // WRONG! Core already has this
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Key Rules
|
|
89
|
+
|
|
90
|
+
1. **Never duplicate core's dependencies** - If core has it, use core's export
|
|
91
|
+
2. **peerDependencies are NOT auto-installed** - Consumer must provide them
|
|
92
|
+
3. **dependencies ARE auto-installed** - pnpm handles hoisting
|
|
93
|
+
4. **apps/dev should NOT duplicate theme/plugin deps** - pnpm resolves through workspace
|
|
94
|
+
|
|
95
|
+
## Build-Time Filtering
|
|
96
|
+
|
|
97
|
+
### NEXT_PUBLIC_ACTIVE_THEME
|
|
98
|
+
|
|
99
|
+
When set, the registry build filters to only include:
|
|
100
|
+
- The active theme
|
|
101
|
+
- Plugins required by that theme (from `requiredPlugins` in theme config)
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Only includes blog theme and its plugins
|
|
105
|
+
NEXT_PUBLIC_ACTIVE_THEME=blog pnpm build
|
|
106
|
+
|
|
107
|
+
# Without this, ALL themes/plugins are included (development mode)
|
|
108
|
+
pnpm build
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### How Filtering Works
|
|
112
|
+
|
|
113
|
+
1. `discoverThemes()` - Only discovers active theme when env is set
|
|
114
|
+
2. `discoverPlugins()` - Already scoped, but route-handlers filters further
|
|
115
|
+
3. `generateRouteHandlersRegistry()` - Filters based on theme's `plugins` array
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
// In route-handlers.mjs
|
|
119
|
+
if (config.activeTheme) {
|
|
120
|
+
filteredThemes = themes.filter(t => t.name === config.activeTheme)
|
|
121
|
+
// Get required plugins from theme's plugins array
|
|
122
|
+
const activeTheme = filteredThemes[0]
|
|
123
|
+
if (activeTheme?.plugins?.length > 0) {
|
|
124
|
+
requiredPluginNames = activeTheme.plugins.map(p =>
|
|
125
|
+
p.replace('@nextsparkjs/plugin-', '')
|
|
126
|
+
)
|
|
127
|
+
filteredPlugins = plugins.filter(p => requiredPluginNames.includes(p.name))
|
|
128
|
+
} else {
|
|
129
|
+
filteredPlugins = []
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Registry Generation
|
|
135
|
+
|
|
136
|
+
Before `next build`, registries must be regenerated:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Regenerate with active theme filtering
|
|
140
|
+
NEXT_PUBLIC_ACTIVE_THEME=blog node packages/core/scripts/build/registry.mjs
|
|
141
|
+
|
|
142
|
+
# Then build
|
|
143
|
+
NEXT_PUBLIC_ACTIVE_THEME=blog pnpm build
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
The registries are written to: `apps/dev/.nextspark/registries/`
|
|
147
|
+
|
|
148
|
+
## Version Management
|
|
149
|
+
|
|
150
|
+
| Package Type | Version Pattern | Notes |
|
|
151
|
+
|-------------|-----------------|-------|
|
|
152
|
+
| Core packages | 0.1.0-beta.X | Increment X for each release |
|
|
153
|
+
| Themes | 0.1.0-beta.1 | Start at beta.1, match when stable |
|
|
154
|
+
| Plugins | 0.1.0-beta.1 | Start at beta.1, match when stable |
|
|
155
|
+
|
|
156
|
+
## Common Mistakes to Avoid
|
|
157
|
+
|
|
158
|
+
1. **Adding deps to apps/dev for theme needs** - Theme deps should resolve through workspace
|
|
159
|
+
2. **Using peerDependencies for theme-specific libs** - Use regular dependencies
|
|
160
|
+
3. **Importing from npm when core provides it** - Always check core exports first
|
|
161
|
+
4. **Not regenerating registries after theme change** - Run registry script before build
|
|
162
|
+
5. **Hardcoding theme imports in shared code** - Use registry lookups
|