.claude/skills/create-theme/SKILL.md
Guide for creating new themes from preset template. CRITICAL: Includes MANDATORY dependency management rules for NPM distribution.
npx skillsauth add NextSpark-js/nextspark create-themeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Complete guide for scaffolding and configuring new themes from the preset template.
Si
@nextsparkjs/coretiene una dependencia, los themes DEBEN declararla comopeerDependency, NUNCA comodependency.
{
"name": "@nextsparkjs/theme-NOMBRE",
"version": "1.0.0",
"private": false,
"main": "./config/theme.config.ts",
"dependencies": {
// Plugins que el theme requiere
"@nextsparkjs/plugin-langchain": "workspace:*"
},
"peerDependencies": {
"@nextsparkjs/core": "workspace:*",
"next": "^15.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"zod": "^4.0.0"
// Agregar otras de core que el theme use directamente
}
}
| Package | Can Import From | |---------|-----------------| | Theme | Core (peer), plugins (dep/peer), itself (never other themes) |
pnpm create:theme <theme-name>core/templates/contents/themes/starter/themes/<theme-name>/Before creating ANY theme, collect:
Required Information:
1. Theme name (lowercase, hyphenated slug)
2. Display name (human-readable)
3. Description (purpose of the theme)
4. Author (team or individual)
5. Primary use case (SaaS type, industry, features)
6. Color preferences (optional - can use defaults)
pnpm create:theme <theme-name>
pnpm create:theme <theme-name> \
--description "Theme description" \
--author "Author Name" \
--display-name "Display Name"
pnpm create:theme project-manager \
--description "Project management SaaS application" \
--author "Development Team" \
--display-name "Project Manager"
contents/themes/<theme-name>/
├── config/
│ ├── theme.config.ts # Visual configuration
│ ├── app.config.ts # Application overrides
│ ├── dashboard.config.ts # Dashboard settings
│ └── permissions.config.ts # Permission overrides
├── about.md # Theme description
├── styles/
│ ├── globals.css # CSS variables
│ └── components.css # Component overrides
├── messages/
│ ├── en.json # English translations
│ └── es.json # Spanish translations
├── migrations/
│ ├── README.md # Migration docs
│ └── 001_example_schema.sql
├── docs/01-overview/
│ ├── 01-introduction.md
│ └── 02-customization.md
├── blocks/hero/ # Example hero block
├── entities/ # Data entities (optional)
│ └── [entity]/ # Each entity has 4 required files
│ ├── [entity].config.ts
│ ├── [entity].fields.ts
│ ├── [entity].types.ts
│ ├── [entity].service.ts
│ └── messages/
├── templates/ # Page overrides
├── public/brand/ # Brand assets
└── tests/ # Theme tests
colors: {
light: {
// Blue for corporate/professional
primary: 'oklch(0.55 0.2 250)',
// Green for productivity/growth
// primary: 'oklch(0.55 0.2 150)',
// Orange for creative/energy
// primary: 'oklch(0.65 0.2 50)',
// Purple for premium/luxury
// primary: 'oklch(0.55 0.2 300)',
}
}
// Enable required plugins
plugins: [
// 'plugin-analytics',
// 'plugin-payments',
]
| Use Case | Color | OKLCH Value |
|----------|-------|-------------|
| Corporate/Professional | Blue | oklch(0.55 0.2 250) |
| Productivity/Growth | Green | oklch(0.55 0.2 150) |
| Creative/Energy | Orange | oklch(0.65 0.2 50) |
| Premium/Luxury | Purple | oklch(0.55 0.2 300) |
| Healthcare/Trust | Teal | oklch(0.55 0.15 200) |
| Finance/Stability | Navy | oklch(0.45 0.15 260) |
| E-commerce/Action | Red | oklch(0.55 0.2 25) |
// Multi-tenant SaaS
teams: {
allowCreation: true,
maxTeamsPerUser: 5,
}
// Single-tenant Application
teams: {
allowCreation: false,
maxTeamsPerUser: 1,
}
// Features
features: {
enableDocs: true, // Documentation site
enableBlog: false, // Blog functionality
}
topbar: {
showSearch: true,
showNotifications: true,
showMessages: false,
}
sidebar: {
defaultCollapsed: false,
showEntityCounts: true,
}
entities: {
defaultPageSize: 25,
enableBulkActions: true,
}
# 1. Verify theme structure
ls -la contents/themes/<theme-name>/
# 2. Build registry to include new theme
node core/scripts/build/registry.mjs
# 3. Verify theme appears in registry
grep "<theme-name>" core/lib/registries/theme-registry.ts
# 4. Test theme activation (optional)
# Update .env.local: NEXT_PUBLIC_ACTIVE_THEME='<theme-name>'
# Run: pnpm dev
Each theme entity requires 4 files:
| File | Purpose |
|------|---------|
| [entity].config.ts | Entity configuration |
| [entity].fields.ts | Field definitions |
| [entity].types.ts | TypeScript types |
| [entity].service.ts | Data access service |
Reference: core/templates/contents/themes/starter/entities/tasks/
peerDependenciesdependenciesdependencies (workspace:*)package.json created with correct peerDependenciesnode core/scripts/build/registry.mjs# Verificar que no hay duplicados
pnpm ls zod
# Debe mostrar UNA sola versión
| Pattern | Why It's Wrong | Correct Approach |
|---------|----------------|------------------|
| Manual file creation | Missing files, wrong structure | Use pnpm create:theme |
| Skipping registry rebuild | Theme won't be recognized | Always run node core/scripts/build/registry.mjs |
| Modifying core files | Architecture violation | Only work in contents/themes/ |
| Implementing features | Scope creep | Hand off to backend/frontend agents |
After creating theme, document:
## Theme Created: <theme-name>
### Completed Setup:
- Theme scaffolded from preset
- Visual identity configured (primary color: X)
- Application settings configured
- Dashboard layout configured
### Ready for Development:
- Backend: Add custom entities, migrations, API endpoints
- Frontend: Customize UI components, add blocks
### Environment Setup:
NEXT_PUBLIC_ACTIVE_THEME='<theme-name>'
monorepo-architecture skill - CRITICAL: Package hierarchy and dependency management rulescore/docs/04-entities/core/docs/02-themes/core/docs/03-registry-system/development
Zod validation patterns for this Next.js application. Covers schema definition, API validation, form integration, error formatting, and type inference. Use this skill when implementing validation for APIs, forms, or entity schemas.
development
Review UI code for Web Interface Guidelines compliance. Use when asked to "review my UI", "check accessibility", "audit design", "review UX", or "check my site against best practices".
testing
Test coverage metrics and registry system for this Next.js application. Covers FEATURE_REGISTRY, FLOW_REGISTRY, TAGS_REGISTRY, and coverage metrics interpretation. Use this skill when evaluating test coverage, identifying gaps, or planning testing priorities.
development
TanStack Query (React Query) patterns for data fetching in this Next.js application. Covers useQuery, useMutation, optimistic updates, cache invalidation, and anti-patterns. Use this skill when implementing data fetching or state management with server data.