These rules supplement the information in AGENTS.md and apply to all contributions.
- Use TypeScript for all new code.
- Indent with 2 spaces; avoid tabs.
- Keep imports ordered: external modules first, then internal paths.
- Run
pnpm lintbefore committing. - Group related changes in a single commit with a descriptive message.
- Ensure the app builds with
pnpm buildbefore opening a PR. - Verify new dependencies with
pnpm infoandpnpm auditbefore adding them.
-
Organize route folders under
app/<segment>with apage.tsxand optionallayout.tsx. -
Keep shared building blocks in
components/shared. -
Group feature components under
components/<feature>. For multi-file features, create:components/<feature>/<ComponentName>/ index.tsx -
Re-export components from
components/<feature>/index.tsfor concise import paths. -
Store helper functions in
utils/and shared types intypes/.
- Use Chakra UI components and styling system for all UI elements. Chakra UI is the primary styling framework for this project.
- Apply styling via Chakra UI props (e.g.,
bg,color,p,m,w,h) directly to components for consistency. - Never hardcode colors. Always use values from the Chakra theme (e.g.,
color="primary.500"orbg="background"). Define and reference all colors in thethemes/directory. - Leverage Chakra UI's theme system for colors, fonts, and spacing.
- Avoid custom CSS files whenever possible. Chakra UI's styling props should cover the vast majority of styling needs.
- Chakra UI is the primary styling system — use Chakra components (
Box,Text,Button, etc.) and their styling props. - Tailwind CSS provides basic utilities — only use for simple utilities that Chakra doesn't provide or for third-party component integration.
- When in doubt, use Chakra UI — it integrates with the theme system and provides consistent component behavior.
-
app/globals.cssshould primarily contain Tailwind imports for basic utilities and minimal global overrides. -
Use
globals.cssonly for extreme cases like:- Third-party component styling that cannot be controlled via props (e.g., Aioha modal customization)
- Global resets or animations that require global scope
- Scrollbar hiding and other browser-specific styles
- Use 2-space indentation and keep TypeScript
strictmode on. - UI components use Chakra UI; prefer existing patterns from
components/. - Avoid inline or hardcoded styles for colors or spacing — always use theme tokens.
- When adding new packages, update
pnpm-lock.yamlvia pnpm. - Commit clean code and ensure the project still builds with
pnpm build.
- Keep files small and focused; prefer multiple short modules over a single large file.
- Limit line length to around 100 characters for readability.
- Write clear comments for complex logic and keep stateful code in hooks or contexts.
- Ensure visual consistency across the app by always using theme-based tokens for colors, spacing, and fonts.
- Default to server components. Add
"use client"at the top of a file only when browser APIs or React state are required. - Export
metadatafrom eachpage.tsxto manage SEO tags and sharing cards. - Keep route directories under
app/with their ownpage.tsxand optionallayout.tsxfor nested layouts. - Place API handlers in
app/api/<route>/route.ts. - Use
next/dynamicto lazily load heavy client components.
- Use functional components with typed props.
- Extract reusable logic into hooks under
hooks/and prefix them withuse. - Store cross-cutting state in context providers under
contexts/. - Name components with
PascalCase; name hooks incamelCasewith auseprefix. - Clean up side effects in the return function of
useEffect.
- Always run
pnpm lintandpnpm buildbefore committing changes. - Use descriptive commit messages so history is easy to follow.
- Cursor, Copilot, Claude or other agents should follow these guidelines.
- Provide clear commit messages and keep related changes in a single commit.
- Run lint before committing.
- Do not hardcode any color values. Always reference the theme colors using Chakra’s
colorSchemeor token keys.