First shot at a rules file (#119)

Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
This commit is contained in:
Matt Rubens 2025-06-23 11:11:22 -04:00 committed by GitHub
parent 84380bb436
commit abe1030c61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

31
.roo/rules/rules.md Normal file
View file

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