You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Imports: Group imports: 1) React, 2) third-party, 3) local (@/*)
Naming: Use PascalCase for components, camelCase for functions/variables
Types: Use TypeScript strictly (strict: true), prefer explicit types
Components: Use functional components with React hooks
CSS: Use Tailwind with class-variance-authority for variants
Error handling: Use try/catch blocks with specific error messages
Formatting: Use double quotes for JSX, single quotes for regular strings
Paths: Use absolute imports with @/* aliases unless the module to import is the same directory
State: Prefer React hooks like useState, useReducer for state management
Comments: Don't comment on what the code does, make the code self-documenting and only use comments to explain why something is done a certain way. Document APIs, complex algorithms, and non-obvious side effects
Functions: Prefer functional approach over classes
Architecture
Next.js 15 app router
React 19
Tailwind CSS v4
Shadcn/UI - Radix UI components customized with Tailwind
All the user-facing content (labels, text, etc..) should be in Spanish
File Organization & Colocation
Principles
Colocate over centralize: Components used by a single page should live next to that page
Proximity-based: Group related files by feature/usage, not file type
Shared sparingly: Only truly reusable components go in central components/ directories
Flat lib structure: Keep single files in lib/ (e.g., storage.ts, utils.ts) unless logical grouping requires folders (e.g., db/)
Mixed file types: hooks, utils, and components can live together in the same folder until it becomes too large, only then create internal /hooks and /components directories
Use early returns whenever possible to make the code more readable.
Always try to use existing shadcn/ui components and tailwind for styling HTML elements; avoid using CSS or tags.
Use descriptive variable and function/const names. Also, event functions should be named with a “handle” prefix, like “handleClick” for onClick and “handleKeyDown” for onKeyDown.
Use consts instead of functions, for example, “const toggle = () =>”. Also, define a type if possible.