{"filename":"nextjs-supabase-shadcn-pwa-cursorrules-prompt-file.mdc","content":"---\ndescription: \"Cursor rules for Nextjs Supabase Shadcn Pwa.\"\nglobs: **/*\nalwaysApply: false\n---\n## Key Principles\n\n- **Code Quality & Style**\n\n  - Write concise, maintainable, and strongly typed code with accurate TypeScript implementations.\n  - Embrace functional, declarative programming. Avoid OOP and classes.\n  - Limit files to a maximum of 150 lines; refactor into smaller modules if exceeded.\n  - Prefer iteration and modularization over duplication.\n  - Use descriptive, semantic variable names with auxiliary verbs (e.g., `isLoading`, `hasError`).\n  - Use lowercase with dashes for directories and files (e.g., `components/auth-wizard`).\n  - Favor named exports for components.\n  - Adopt RORO (Receive an Object, Return an Object) for function parameters/returns.\n  - Always attain to use DRY (Don't Repeat Yourself) principles.\n  - Conduct regular code reviews and frequent refactoring sessions to ensure consistency and quality.\n  - Check and improve Web Vitals (LCP, CLS, FID) to maintain performance and user experience.\n\n- **Create 'Build Notes':**\n\n  - You must create a 'Build Notes' file for each task group to track the progress of the task group we work on.\n  - **Clarity & Brevity:** Keep notes concise, direct, and focused on the task at hand.\n  - **Logical Naming:** Use a consistent naming convention that ties each notes file to a specific task and date.\n  - **Incremental Updates:** Update notes as plans evolve or tasks are completed. Append rather than overwrite.\n  - **Traceability:** Ensure that each decision or change in approach is recorded and easy to follow.\n\n- **Review 'Project Contexts':**\n\n  - You must review the `projectContext.md` as we need to ensure that the project context is up to date and accurate.\n  - **Stability:** Treat context files as stable references, not daily scratchpads.\n  - **Selective Updates:** Update context files only when there are significant, approved changes to requirements or project scope.\n  - **Accessibility:** Make context files easily understandable and organized so future developers can quickly grasp the project’s core guidance.\n\n- **Stack and Framework Conventions**\n\n  - Target **Next.js 15+** and leverage the App Router, React Server Components (RSC), and SSR capabilities.\n  - Use Zustand for state management in client components when necessary.\n  - Maintain proper Shadcn UI management using `npx shadcn@latest add` for new components.\n  - Follow a mobile-first approach and responsive design patterns.\n  - Emphasize server-side logic, minimizing the usage of `use client` and other client-only APIs.\n  - Structure project as Progressive Web App (PWA) with offline capabilities, app-like experience, and installability across devices.\n\n- **Monorepo & Tooling**\n\n  - If using a monorepo structure, place shared code in a `packages/` directory and app-specific code in `app/`.\n  - Use `Taskfile.yml` commands for development, testing, and deployment tasks.\n  - Keep environment variables and sensitive data outside of code and access them through `.env` files or similar configuration.\n\nBelow is a structured guideline to provide to the AI development agent, incorporating key principles and detailed rules for maintaining the `/ProjectDocs/Build_Notes/` and `/ProjectDocs/contexts/` directories.\n\n---\n\n### Rules for Build Notes Files\n\n1. **Location & Naming:**\n\n   - Store all notes files in `/ProjectDocs/Build_Notes/`.\n   - Use a logical, descriptive naming convention, e.g., `build-title_phase-#_task-group-name.md`.\n   - Use the `<build-title>` to describe the build task.\n   - Use the `<phase-#>` to apply the Phase # to the build task.\n   - Use the `<task-group-name>` to describe the task group name.\n   - Example: `supabase-schema-standardization_phase-1_preparation-and-code-analysis.md`\n     - `supabase-schema-standardization` is the build title\n     - `phase-1` is the phase number\n     - `preparation-and-code-analysis` is the task group name\n\n2. **Content Structure:**\n\n   - Begin with a brief **Task Objective** that summarizes what you aim to achieve.\n   - Provide **Current State Assessment**: a short description of the current state of the project pertaining to the build tasks.\n   - Provide **Future State Goal**: a short description of the future state of the project pertaining to the build tasks.\n   - Follow with a **Implementation Plan**: a numbered list of **steps** containing checklist **tasks** to achieve the future state.\n   - Update the **Implementation Plan** as tasks are completed and line out not applicable tasks. NEVER DELETE TASKS FROM THE PLAN.\n   - If the plan changes or evolves, add new **steps** or **tasks**, rather than overwriting previous content.\n\n3. **When to Update:**\n\n   - **At Task Start:** Create or open the task-specific notes file and record the initial plan before coding.\n   - **During Task Execution:** Add updates when plans change, difficulties arise, or new insights emerge.\n   - **At Task Completion:** Append a summary of what was done and verify it aligns with the original objective.\n\n4. **Style & Tone:**\n\n   - Keep notes succinct, on-topic, and free of unrelated commentary.\n   - Maintain a logical sequence so that future readers can understand the decision-making process without confusion.\n\n5. **Completion of Build Notes:**\n\n   - Once the build notes are complete, move the file to the `/ProjectDocs/Build_Notes/completed/` directory.\n   - If build notes are deprecated and no longer needed, move the file to the `/ProjectDocs/Build_Notes/archived/` directory.\n\n---\n\n### Rules for Context Files\n\n1. **Master Project Context (`projectContext.md`):**\n\n   - Located in `/ProjectDocs/contexts/`.\n   - Provides the overarching project scope, requirements, and design principles.\n   - Only update this file if there are major changes to the project’s fundamental direction or scope.\n\n2. **Additional Context Files:**\n\n   - Supplementary files (e.g., `uiContext.md`, `featureAContext.md`) may be created for more detailed specifications on certain functionalities, designs, or areas of the application.\n   - Keep these files stable. Update them only when new, approved changes need to be documented.\n   - Reference these files frequently to ensure development aligns with established guidelines.\n\n3. **Change Management:**\n\n   - Record any changes to context files within the corresponding build notes file for that task.\n   - Maintain a clear rationale for context changes to preserve transparency and alignment with the core project goals.\n\n---\n\n## Project Structure\n\nAdopt a clear, modular directory structure:\n"}