@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,438 @@
|
|
|
1
|
+
# /how-to:customize-theme
|
|
2
|
+
|
|
3
|
+
Interactive guide to customize the visual design system in NextSpark.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Required Skills
|
|
8
|
+
|
|
9
|
+
Before executing, these skills provide deeper context:
|
|
10
|
+
- `.claude/skills/tailwind-theming/SKILL.md` - Tailwind CSS v4 theming
|
|
11
|
+
- `.claude/skills/shadcn-theming/SKILL.md` - shadcn/ui customization with tweakcn.com
|
|
12
|
+
- `.claude/skills/design-system/SKILL.md` - Token mapping
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Syntax
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
/how-to:customize-theme
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Key Concept: Single Source of Truth
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
28
|
+
│ NUEVA ARQUITECTURA: Theme es la ÚNICA fuente de verdad │
|
|
29
|
+
├─────────────────────────────────────────────────────────────────┤
|
|
30
|
+
│ │
|
|
31
|
+
│ ANTES (problemático): │
|
|
32
|
+
│ core/globals.css → theme/globals.css → app/globals.css │
|
|
33
|
+
│ (override confuso) │
|
|
34
|
+
│ │
|
|
35
|
+
│ AHORA (simple): │
|
|
36
|
+
│ theme/styles/globals.css → app/globals.css (solo @import) │
|
|
37
|
+
│ (TODO aquí) (no editar) │
|
|
38
|
+
│ │
|
|
39
|
+
│ BENEFICIOS: │
|
|
40
|
+
│ • UN solo archivo para editar │
|
|
41
|
+
│ • Hot reload inmediato │
|
|
42
|
+
│ • Sin build destructivo │
|
|
43
|
+
│ • Claude sabe exactamente qué editar │
|
|
44
|
+
│ │
|
|
45
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Behavior
|
|
51
|
+
|
|
52
|
+
1. **Initial Question**: Ask about color source
|
|
53
|
+
2. **Generate or Guide**: Based on source, generate or guide manual edit
|
|
54
|
+
3. **Validate**: Check theme CSS is complete
|
|
55
|
+
4. **Hot Reload**: Changes visible immediately (no build required)
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Initial Question
|
|
60
|
+
|
|
61
|
+
Before starting, Claude asks:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
65
|
+
📚 HOW TO: CUSTOMIZE THEME
|
|
66
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
67
|
+
|
|
68
|
+
Before we start, where are your design tokens coming from?
|
|
69
|
+
|
|
70
|
+
[1] tweakcn.com CSS export (Recommended)
|
|
71
|
+
→ I'll generate a complete globals.css from the exported CSS
|
|
72
|
+
|
|
73
|
+
[2] Design mock with Tailwind config (Stitch, UXPilot)
|
|
74
|
+
→ I'll extract tokens from the mock and generate globals.css
|
|
75
|
+
|
|
76
|
+
[3] Brand HEX colors only
|
|
77
|
+
→ Give me your primary color and I'll generate a full palette
|
|
78
|
+
|
|
79
|
+
[4] I want to learn manually first
|
|
80
|
+
→ I'll explain the structure step by step
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Option 1: From tweakcn.com (Recommended)
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
89
|
+
OPTION 1: Generate from tweakcn.com
|
|
90
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
91
|
+
|
|
92
|
+
STEP 1: Go to tweakcn.com
|
|
93
|
+
→ Customize your theme visually
|
|
94
|
+
→ Export the CSS
|
|
95
|
+
|
|
96
|
+
STEP 2: Paste the exported CSS here
|
|
97
|
+
|
|
98
|
+
I'll convert it to the NextSpark format and update your theme.
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Claude's Actions:**
|
|
102
|
+
1. Parse the tweakcn CSS
|
|
103
|
+
2. Convert to OKLCH if needed
|
|
104
|
+
3. Generate complete globals.css
|
|
105
|
+
4. Write to `contents/themes/{activeTheme}/styles/globals.css`
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Option 2: From Design Mock
|
|
110
|
+
|
|
111
|
+
```
|
|
112
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
113
|
+
OPTION 2: Generate from Design Mock
|
|
114
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
115
|
+
|
|
116
|
+
STEP 1: Provide the mock path
|
|
117
|
+
→ Path to HTML/CSS from Stitch, UXPilot, or similar
|
|
118
|
+
|
|
119
|
+
STEP 2: I'll analyze the mock
|
|
120
|
+
→ Extract colors from tailwind.config
|
|
121
|
+
→ Map to NextSpark semantic tokens
|
|
122
|
+
|
|
123
|
+
STEP 3: Generate globals.css
|
|
124
|
+
→ Complete with light mode, dark mode, and @theme mapping
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Claude's Actions:**
|
|
128
|
+
1. Read mock HTML/CSS
|
|
129
|
+
2. Extract Tailwind config
|
|
130
|
+
3. Create ds-mapping.json
|
|
131
|
+
4. Generate complete globals.css
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Option 3: From Brand Colors
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
139
|
+
OPTION 3: Generate from Brand Colors
|
|
140
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
141
|
+
|
|
142
|
+
Give me your brand color in HEX format:
|
|
143
|
+
|
|
144
|
+
Example: #3B82F6 (blue), #10B981 (green), #8B5CF6 (purple)
|
|
145
|
+
|
|
146
|
+
I'll generate:
|
|
147
|
+
• Light mode palette based on your color
|
|
148
|
+
• Dark mode with inverted lightness
|
|
149
|
+
• All semantic tokens (card, muted, accent, etc.)
|
|
150
|
+
• Complete @theme mapping for Tailwind v4
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**Claude's Actions:**
|
|
154
|
+
1. Convert HEX to OKLCH
|
|
155
|
+
2. Generate full palette using OKLCH manipulation
|
|
156
|
+
3. Create dark mode by inverting lightness
|
|
157
|
+
4. Write complete globals.css
|
|
158
|
+
|
|
159
|
+
---
|
|
160
|
+
|
|
161
|
+
## Option 4: Manual Tutorial
|
|
162
|
+
|
|
163
|
+
### Step 1: Understanding the Structure
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
167
|
+
STEP 1 OF 4: Understanding the Structure
|
|
168
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
169
|
+
|
|
170
|
+
📂 Single File to Edit:
|
|
171
|
+
|
|
172
|
+
contents/themes/{your-theme}/styles/globals.css
|
|
173
|
+
|
|
174
|
+
This file contains EVERYTHING:
|
|
175
|
+
├── @import "tailwindcss"
|
|
176
|
+
├── @import core utilities
|
|
177
|
+
├── :root (light mode variables)
|
|
178
|
+
├── .dark (dark mode variables)
|
|
179
|
+
├── @theme (Tailwind v4 mapping)
|
|
180
|
+
└── Base styles (* and body)
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**📋 File Structure:**
|
|
184
|
+
|
|
185
|
+
```css
|
|
186
|
+
/* contents/themes/{theme}/styles/globals.css */
|
|
187
|
+
|
|
188
|
+
/* =============================================
|
|
189
|
+
IMPORTS
|
|
190
|
+
============================================= */
|
|
191
|
+
@import "tailwindcss";
|
|
192
|
+
@import "@nextsparkjs/core/styles/utilities.css";
|
|
193
|
+
@import "@nextsparkjs/core/styles/docs.css";
|
|
194
|
+
@source "../../../**/*.{js,ts,jsx,tsx}";
|
|
195
|
+
|
|
196
|
+
/* =============================================
|
|
197
|
+
THEME VARIABLES - LIGHT MODE (OKLCH)
|
|
198
|
+
============================================= */
|
|
199
|
+
:root {
|
|
200
|
+
/* Surface Colors */
|
|
201
|
+
--background: oklch(1 0 0);
|
|
202
|
+
--foreground: oklch(0.145 0 0);
|
|
203
|
+
/* ... more variables ... */
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* =============================================
|
|
207
|
+
THEME VARIABLES - DARK MODE
|
|
208
|
+
============================================= */
|
|
209
|
+
.dark {
|
|
210
|
+
--background: oklch(0.145 0 0);
|
|
211
|
+
--foreground: oklch(0.985 0 0);
|
|
212
|
+
/* ... more variables ... */
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* =============================================
|
|
216
|
+
TAILWIND v4 THEME MAPPING
|
|
217
|
+
============================================= */
|
|
218
|
+
@theme {
|
|
219
|
+
--color-background: var(--background);
|
|
220
|
+
--color-foreground: var(--foreground);
|
|
221
|
+
/* ... more mappings ... */
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* =============================================
|
|
225
|
+
BASE STYLES
|
|
226
|
+
============================================= */
|
|
227
|
+
* {
|
|
228
|
+
border-color: var(--border);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
body {
|
|
232
|
+
background-color: var(--background);
|
|
233
|
+
color: var(--foreground);
|
|
234
|
+
}
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
### Step 2: Customize Colors
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
243
|
+
STEP 2 OF 4: Customize Colors
|
|
244
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
245
|
+
|
|
246
|
+
📋 OKLCH Color Format:
|
|
247
|
+
|
|
248
|
+
oklch(lightness chroma hue)
|
|
249
|
+
│ │ └── 0-360 (color wheel)
|
|
250
|
+
│ └── 0-0.4 (saturation)
|
|
251
|
+
└── 0-1 (black to white)
|
|
252
|
+
|
|
253
|
+
Examples:
|
|
254
|
+
• Pure white: oklch(1 0 0)
|
|
255
|
+
• Pure black: oklch(0 0 0)
|
|
256
|
+
• Vivid blue: oklch(0.5 0.2 250)
|
|
257
|
+
• Muted gray: oklch(0.5 0 0)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
**📋 Semantic Color Groups:**
|
|
261
|
+
|
|
262
|
+
```css
|
|
263
|
+
:root {
|
|
264
|
+
/* ========== SURFACE COLORS ========== */
|
|
265
|
+
--background: oklch(1 0 0); /* Page background */
|
|
266
|
+
--foreground: oklch(0.145 0 0); /* Main text */
|
|
267
|
+
--card: oklch(1 0 0); /* Card backgrounds */
|
|
268
|
+
--card-foreground: oklch(0.145 0 0); /* Card text */
|
|
269
|
+
--popover: oklch(1 0 0); /* Dropdown backgrounds */
|
|
270
|
+
--popover-foreground: oklch(0.145 0 0); /* Dropdown text */
|
|
271
|
+
|
|
272
|
+
/* ========== INTERACTIVE COLORS ========== */
|
|
273
|
+
--primary: oklch(0.5 0.2 250); /* Primary actions (buttons) */
|
|
274
|
+
--primary-foreground: oklch(0.985 0 0); /* Text on primary */
|
|
275
|
+
--secondary: oklch(0.97 0 0); /* Secondary actions */
|
|
276
|
+
--secondary-foreground: oklch(0.205 0 0);
|
|
277
|
+
--accent: oklch(0.97 0 0); /* Highlights */
|
|
278
|
+
--accent-foreground: oklch(0.205 0 0);
|
|
279
|
+
|
|
280
|
+
/* ========== STATE COLORS ========== */
|
|
281
|
+
--muted: oklch(0.97 0 0); /* Subtle backgrounds */
|
|
282
|
+
--muted-foreground: oklch(0.556 0 0); /* Secondary text */
|
|
283
|
+
--destructive: oklch(0.577 0.245 27); /* Errors, delete */
|
|
284
|
+
--destructive-foreground: oklch(0.985 0 0);
|
|
285
|
+
|
|
286
|
+
/* ========== STRUCTURE COLORS ========== */
|
|
287
|
+
--border: oklch(0.922 0 0); /* Borders */
|
|
288
|
+
--input: oklch(0.922 0 0); /* Input borders */
|
|
289
|
+
--ring: oklch(0.5 0.2 250); /* Focus rings */
|
|
290
|
+
}
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
### Step 3: Dark Mode
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
299
|
+
STEP 3 OF 4: Dark Mode
|
|
300
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
301
|
+
|
|
302
|
+
Dark mode inverts lightness but keeps hue and chroma.
|
|
303
|
+
|
|
304
|
+
OKLCH makes this easy:
|
|
305
|
+
• Light: oklch(0.9 0.02 250) → Dark: oklch(0.2 0.02 250)
|
|
306
|
+
• Just flip the first number!
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
**📋 Dark Mode Pattern:**
|
|
310
|
+
|
|
311
|
+
```css
|
|
312
|
+
.dark {
|
|
313
|
+
/* Backgrounds become dark */
|
|
314
|
+
--background: oklch(0.145 0 0);
|
|
315
|
+
--foreground: oklch(0.985 0 0);
|
|
316
|
+
|
|
317
|
+
/* Cards slightly lighter than background */
|
|
318
|
+
--card: oklch(0.205 0 0);
|
|
319
|
+
--card-foreground: oklch(0.985 0 0);
|
|
320
|
+
|
|
321
|
+
/* Primary often stays similar or becomes brighter */
|
|
322
|
+
--primary: oklch(0.6 0.2 250);
|
|
323
|
+
--primary-foreground: oklch(0.145 0 0);
|
|
324
|
+
|
|
325
|
+
/* Muted becomes darker gray */
|
|
326
|
+
--muted: oklch(0.269 0 0);
|
|
327
|
+
--muted-foreground: oklch(0.708 0 0);
|
|
328
|
+
|
|
329
|
+
/* Borders darker */
|
|
330
|
+
--border: oklch(0.269 0 0);
|
|
331
|
+
}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
### Step 4: Tailwind v4 Mapping
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
340
|
+
STEP 4 OF 4: Tailwind v4 Mapping
|
|
341
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
342
|
+
|
|
343
|
+
The @theme block connects CSS variables to Tailwind classes.
|
|
344
|
+
|
|
345
|
+
--color-primary → enables → bg-primary, text-primary, border-primary
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
**📋 Complete @theme Block:**
|
|
349
|
+
|
|
350
|
+
```css
|
|
351
|
+
@theme {
|
|
352
|
+
/* Main semantic colors */
|
|
353
|
+
--color-background: var(--background);
|
|
354
|
+
--color-foreground: var(--foreground);
|
|
355
|
+
--color-card: var(--card);
|
|
356
|
+
--color-card-foreground: var(--card-foreground);
|
|
357
|
+
--color-popover: var(--popover);
|
|
358
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
359
|
+
--color-primary: var(--primary);
|
|
360
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
361
|
+
--color-secondary: var(--secondary);
|
|
362
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
363
|
+
--color-muted: var(--muted);
|
|
364
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
365
|
+
--color-accent: var(--accent);
|
|
366
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
367
|
+
--color-destructive: var(--destructive);
|
|
368
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
369
|
+
--color-border: var(--border);
|
|
370
|
+
--color-input: var(--input);
|
|
371
|
+
--color-ring: var(--ring);
|
|
372
|
+
|
|
373
|
+
/* Chart colors */
|
|
374
|
+
--color-chart-1: var(--chart-1);
|
|
375
|
+
--color-chart-2: var(--chart-2);
|
|
376
|
+
--color-chart-3: var(--chart-3);
|
|
377
|
+
--color-chart-4: var(--chart-4);
|
|
378
|
+
--color-chart-5: var(--chart-5);
|
|
379
|
+
|
|
380
|
+
/* Sidebar colors */
|
|
381
|
+
--color-sidebar: var(--sidebar-background);
|
|
382
|
+
--color-sidebar-background: var(--sidebar-background);
|
|
383
|
+
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
384
|
+
--color-sidebar-primary: var(--sidebar-primary);
|
|
385
|
+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
386
|
+
--color-sidebar-accent: var(--sidebar-accent);
|
|
387
|
+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
388
|
+
--color-sidebar-border: var(--sidebar-border);
|
|
389
|
+
--color-sidebar-ring: var(--sidebar-ring);
|
|
390
|
+
}
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
---
|
|
394
|
+
|
|
395
|
+
## Completion
|
|
396
|
+
|
|
397
|
+
```
|
|
398
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
399
|
+
|
|
400
|
+
✅ TUTORIAL COMPLETE!
|
|
401
|
+
|
|
402
|
+
You've learned:
|
|
403
|
+
• Single source of truth architecture
|
|
404
|
+
• OKLCH color format
|
|
405
|
+
• Light and dark mode variables
|
|
406
|
+
• Tailwind v4 @theme mapping
|
|
407
|
+
|
|
408
|
+
📝 REMEMBER:
|
|
409
|
+
Edit ONE file: contents/themes/{theme}/styles/globals.css
|
|
410
|
+
Changes are visible immediately (no build required)
|
|
411
|
+
|
|
412
|
+
📚 Related tutorials:
|
|
413
|
+
• /how-to:customize-dashboard - Dashboard layout
|
|
414
|
+
• /how-to:create-block - Block styling
|
|
415
|
+
|
|
416
|
+
🔙 Back to menu: /how-to:start
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
421
|
+
## Claude Actions Summary
|
|
422
|
+
|
|
423
|
+
| Option | Claude Action |
|
|
424
|
+
|--------|---------------|
|
|
425
|
+
| tweakcn.com CSS | Parse, convert to OKLCH, write globals.css |
|
|
426
|
+
| Design Mock | Extract tokens, generate ds-mapping.json, write globals.css |
|
|
427
|
+
| Brand HEX | Convert to OKLCH, generate palette, write globals.css |
|
|
428
|
+
| Manual | Guide through structure, explain each section |
|
|
429
|
+
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
## Related Commands
|
|
433
|
+
|
|
434
|
+
| Command | Action |
|
|
435
|
+
|---------|--------|
|
|
436
|
+
| `/how-to:customize-dashboard` | Dashboard customization |
|
|
437
|
+
| `/how-to:create-block` | Create styled blocks |
|
|
438
|
+
| `/theme:design-system` | Initialize/update design system (if available) |
|