@@ -14,41 +14,55 @@
1414 ## Coding Guidelines
1515
1616 ### TypeScript
17+
1718 - Use strict typing - avoid `any`, prefer type inference where appropriate.
1819 - Export types/interfaces alongside implementations.
1920 - Use the types provided by dependencies when possible, avoid creating types for 3rd party code.
2021 - Use Drizzle ORM type inference: `typeof table.$inferSelect` and `typeof table.$inferInsert`.
2122
2223 ### Code Organization
24+
2325 - Use path aliases: `@/` for root imports (e.g., `@/src/components/...`).
2426 - Follow modular structure: `src/components/`, `src/hooks/`, `src/lib/`, `app/api/`.
2527 - Keep files focused - one main export per file when possible.
2628
2729 ### Documentation
30+
2831 - Add JSDoc comments for exported functions with `@param` and `@returns`.
2932 - Keep commenting to a minimum. We should only add comments when the code is not self-explanatory
3033
3134 ### Naming Conventions
35+
3236 - `camelCase` for functions, variables, and hooks (e.g., `useLocalStorage`, `handleSubmit`).
3337 - `PascalCase` for components, types, and interfaces (e.g., `MessageInput`, `MessageInputRef`).
3438 - `kebab-case` for file names (except React components which use PascalCase).
3539
3640 ### React Patterns
41+
3742 - Use functional components with hooks.
3843 - Use `forwardRef` when ref forwarding is needed.
3944 - Properly type component props and refs.
4045 - Handle loading and error states explicitly.
4146
4247 ### Error Handling
48+
4349 - Use try-catch blocks for async operations.
4450 - Return proper HTTP status codes in API routes (400, 404, 500).
4551 - Log errors using the `debug` utility from `@/src/lib/debug`.
4652
4753 ### Database
54+
4855 - Use Drizzle ORM query builder patterns.
4956 - Use `eq()`, `asc()`, `desc()` from `drizzle-orm` for queries.
5057
5158 ### Testing
59+
5260 - Write tests using Vitest for complex logic.
5361 - Keep tests in `src/tests/` mirroring the source structure.
5462
63+### Git Commit Messages
64+
65+- Use conventional commit format: `<type>: <description>`
66+- Types: `feat:` (new features), `fix:` (bug fixes), `refactor:` (code refactoring), `docs:` (documentation), `chore:` (maintenance/tooling)
67+- Example: `feat: add system and tool message display with visibility controls`
68+- Always use lowercase for the type and description