|
| 1 | +# Roo Code Cloud - Development Guidelines |
| 2 | + |
| 3 | +## Testing & Formatting |
| 4 | + |
| 5 | +- **Test**: `pnpm test` (runs all tests via Turbo) |
| 6 | +- **Test single file**: `pnpm test path/to/file.test.ts` |
| 7 | +- **Lint**: `pnpm lint` (ESLint with TypeScript support) |
| 8 | +- **Type check**: `pnpm check-types` |
| 9 | +- **Format**: Files are auto-formatted on commit via lint-staged |
| 10 | + |
| 11 | +## Database & Migrations |
| 12 | + |
| 13 | +- **Push schema**: `pnpm db:push` (applies schema directly, no migration files) |
| 14 | +- **Generate migration**: `pnpm --filter @roo-code-cloud/db db:generate` |
| 15 | +- **Run migrations**: `pnpm --filter @roo-code-cloud/db db:migrate` |
| 16 | +- **Reset DB**: `pnpm db:reset` (drops all data and recreates) |
| 17 | +- **Schema location**: `packages/db/src/schema.ts` |
| 18 | +- **Migration files**: `packages/db/drizzle/*.sql` |
| 19 | + |
| 20 | +## Code Style |
| 21 | + |
| 22 | +- **TypeScript**: Strict mode enabled, use explicit types |
| 23 | +- **Imports**: Use absolute imports with `@/` for src directory |
| 24 | +- **Async/Await**: Prefer over promises, use try-catch for error handling |
| 25 | +- **Naming**: camelCase for variables/functions, PascalCase for types/components |
| 26 | +- **Comments**: Use JSDoc for public APIs, inline comments for complex logic |
| 27 | +- **Error Handling**: Return discriminated unions `{ success: true; data: T } | { success: false; error: string }` for actions |
| 28 | +- **Database**: Use Drizzle ORM with type-safe queries |
| 29 | +- **Testing**: Vitest with globals, mock external dependencies |
| 30 | +- **React**: Functional components with hooks, server components by default |
| 31 | +- **Formatting**: Prettier with default settings (via lint-staged) |
0 commit comments