From abe1030c61a50e47076fa67edff0c9a708db114d Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 23 Jun 2025 11:11:22 -0400 Subject: [PATCH] First shot at a rules file (#119) Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> --- .roo/rules/rules.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .roo/rules/rules.md diff --git a/.roo/rules/rules.md b/.roo/rules/rules.md new file mode 100644 index 0000000000..91f19c1163 --- /dev/null +++ b/.roo/rules/rules.md @@ -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)