This file defines mandatory rules for all code generation and modifications in this Nuxt codebase. If any rule would be violated, stop and fix the solution to fully comply with these guidelines.
-
if "create skeleton" is requested, create a new nuxt project with minimal setup: an home page with one text content, router with one route for home. IMPORTANT: keep as simple as possible, do NOT add any extra dependencies, code, or features. Try to solve the request with minimal code as quick as possible.
-
TypeScript everywhere.
- Nuxt:
lang="ts"in Vue SFC where applicable, typed composables, typed stores, typed server routes.
- Nuxt:
-
Prefer many small, short functions over a few large ones.
-
NO automated tests:
- Do NOT generate unit / integration / e2e tests.
- Do NOT keep any test-related scaffolding, configs, or dependencies.
- If a template generates them (e.g.
__tests__,*.spec.ts, Vitest/Jest configs, Playwright, Cypress), delete them.
-
Use
.envfiles for all environment variables.- Always provide
.env.example(no secrets, only placeholders). - Never commit secrets.
- Always provide
-
If any implementation decision or uncertainty arises, ASK BEFORE coding.
- Examples: auth strategy, endpoint contracts, data models, permissions, UI flows, error handling, pagination, realtime needs, SSR vs CSR.
Required stack:
- Nuxt 3
- Tailwind CSS (prefer latest stable; avoid custom CSS)
- Pinia store
- Persistence: localStorage only
- Validation: Zod wherever it makes sense (runtime validation for inputs and env)
Nuxt conventions:
- Prefer Nuxt-native primitives:
useFetch,useAsyncDatafor data loadinguseRuntimeConfigfor env accessserver/api/*for backend endpoints if needed
- Keep SSR/CSR behavior explicit:
- If a feature must be client-only (e.g. localStorage), wrap with
process.clientoronMounted. - Use
<ClientOnly>when necessary.
- If a feature must be client-only (e.g. localStorage), wrap with
- Reusable components go into:
components/ - Page-level components go into:
components/pages/ - Feature-based components:
components/<feature-name>/...- Example:
components/auth/LoginForm.vuecomponents/profile/ProfileCard.vue
- Routes are defined via
pages/(Nuxt file-based routing). - Keep
pages/thin:- page files should mostly compose page-level components + minimal orchestration.
- real logic goes into composables / services.
- Composables:
composables/(business + UI state, fetching orchestration) - Services:
services/(API client wrappers, pure data access layer) - Shared helpers:
utils/(pure utilities, formatting, mapping, etc.)
- If implementing API inside Nuxt:
server/api/**for endpointsserver/utils/**for shared server helpers- Keep handlers small; move business logic to
server/services/**if needed
- Write as little custom CSS as possible.
- Prefer Tailwind utilities everywhere.
- Apply a global Tailwind theme:
- adjust
tailwind.config.*for colors, spacing, fonts, etc. - avoid scattered CSS overrides in components.
- adjust
- If custom CSS is unavoidable:
- keep it local to the component
- keep it minimal and justified
- Use Pinia stores in
stores/. - Persist only via localStorage:
- Do NOT add external persistence libs unless explicitly requested.
- Ensure client-only access to localStorage (no SSR crashes).
- Store design:
- keep state minimal
- actions are small and focused
- any mapping/formatting goes to
utils/
- Use Zod for:
- validating form inputs before sending requests
- validating query params where applicable
- validating API responses if reliability is uncertain
- validating env/runtime config shape (where helpful)
- Error messages must be clear and developer-friendly.
- Always use
.envand.env.example. - Use
useRuntimeConfig()consistently. - Conventions:
- Public (client-exposed):
NUXT_PUBLIC_* - Private (server-only): non-public keys in runtimeConfig
- Public (client-exposed):
- Typical variables:
NUXT_PUBLIC_API_URLNUXT_PUBLIC_APP_URL- (optional)
API_BASE_URL(server-only) if proxying via server routes
- Include a
README.mdthat lists features only, in short bullet points. - Keep it updated whenever features, routes, or endpoints change.
- Document required env vars briefly (names only, no secrets).
For every task:
- Describe in 3–7 bullet points what will be created or changed
- files, routes, components, composables, stores, server endpoints
- If any decision point exists, stop and ask for clarification before implementation.
- After implementation:
- Remove all test-related artifacts.
- Verify folder structure (components/pages split, composables/services/utils separation).
- Update the README feature list.
- Verify
.env.examplecompleteness (placeholders only).
- Any testing frameworks/configs/files (Vitest/Jest/Cypress/Playwright).
- Random global CSS without Tailwind-first justification.
- Unstructured logic in pages/components (move to composables/services/utils).
- Secret values in repo files.
/.claude/settings.local.json