create-theme
Guide for creating new themes from preset template. CRITICAL: Includes MANDATORY dependency management rules for NPM distribution.
SKILL.md.claude/skills/create-theme/SKILL.md
GitHubCreate Project Template Skill
NextSpark no longer installs selectable theme packages into a running project.
The project root is the product source, and a template is copied there once by
create-nextspark-app --theme <name>.
Locations
- Catalog source:
packages/core/templates/projects/<template-name>/ - Extracted source: project-root directories such as
blocks/,components/,config/,entities/,messages/,migrations/,public/,styles/,templates/, andtests/ - Generated output:
src/app/and.nextspark/registries/(never edit)
Template payloads are not workspace packages and are never synchronized after
extraction. nextspark.config.ts may retain template.name and
template.version as provenance only.
If catalog metadata includes a package.json, keep its Next.js compatibility
explicit so validation checks it against the supported Next.js range (~16.4.2):
{
"peerDependencies": {
"next": "~16.4.2"
}
}
Required workflow
- Choose a lowercase, hyphenated template name.
- Copy the closest existing catalog template under
packages/core/templates/projects/. - Keep only root-first source directories. Do not add
contents/, a selectable theme directory, or an project environment variable. - Do not ship project-root reserved names from the payload:
app/,pages/,src/,middleware.*,proxy.*,instrumentation.*, ornext.config.*. Project request behavior belongs inconfig/hooks/proxy.tsand exports the namedproxyHookfunction. - Keep template-specific Jest/Cypress suites under
tests/. Suites must run from a clean extracted project root, not by selecting the template inapps/dev. - Update the CLI template choices and tests if the catalog name is new.
Verification
From the repository root:
# Confirm no legacy selectable-theme paths or environment selector were added.
rg -n 'contents/(themes|plugins)|NEXT_PUBLIC_ACTIVE_THEME' \
packages/core/templates/projects/<template-name>
# Exercise compiler discovery from a clean extracted project fixture.
pnpm build:registries
# Run any retained template-specific suite from that extracted root.
pnpm exec jest --config tests/jest/jest.config.cjs --watchman=false
pnpm exec cypress run --config-file tests/cypress.config.ts
Use pnpm only. Do not edit dependency versions or lockfiles while authoring a
template unless that change is separately requested.