This file defines mandatory rules for all code generation and modifications. If any rule would be violated, stop and fix the solution to fully comply with these guidelines.
- TypeScript everywhere (backend + frontend).
- 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 (API URL, UI URL, PORT, etc.).- 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.
Required stack:
- NestJS framework
- MongoDB with Mongoose
- DTOs for all operations (create, update, queries, filters, etc.)
- Zod validation wherever it makes sense (request bodies, query params, config/env)
Project structure:
- Always split code into controller / service / utils layers.
- Controllers:
- routing
- DTO usage
- validation
- minimal orchestration only
- Business logic belongs in services.
- Shared helpers go into
utils.
Validation:
- Use Zod schemas alongside DTOs.
- Provide clear, developer-friendly error messages.
Swagger (OpenAPI):
- Generate Swagger documentation.
- Keep it up to date whenever endpoints or DTOs change.
- Ensure consistency between DTOs and Swagger definitions.
README (mandatory):
- Include a
README.mdthat lists features only, in short bullet points. - Always keep it updated when features or endpoints change.
Testing is forbidden:
- Do not create test folders or files.
- Remove any test files generated by NestJS templates (
*.spec.ts, etc.). - No CI test steps.
Required stack:
- Vue.js with Vite
- Tailwind CSS v3 (always use v3-compatible configuration)
- Pinia store
- Persistence: localStorage only
Folder structure (mandatory):
- All Vue components go into
src/components - Page-level components:
src/components/pages - Feature / UI components:
src/components/<feature-name>/...- Example:
src/components/auth/LoginForm.vuesrc/components/profile/ProfileCard.vue
Styling:
- Write as little custom CSS as possible.
- Prefer Tailwind utilities everywhere.
- Apply a global Tailwind theme for the entire project.
- Customize the theme if needed (colors, spacing, fonts), instead of scattered CSS.
Testing is forbidden:
- Do not generate Vitest/Jest/Cypress/Playwright configs or files.
- Remove any testing setup coming from starter templates.
- Always use
.envand.env.example. - Typical backend variables:
PORTMONGODB_URIUI_URL(for CORS if needed)
- Typical frontend variables:
VITE_API_URL
- Keep naming consistent and document required variables briefly in the README.
For every task:
- Describe in 3–7 bullet points what will be created or changed (files, modules, endpoints).
- If any decision point exists, stop and ask for clarification before implementation.
- After implementation:
- Remove all test-related artifacts.
- Update Swagger (backend).
- Update the README feature list.
- Verify folder structure (especially frontend components).