- Build:
npm run build(tsc + vite) - Typecheck:
npm run typecheck - Lint:
npm run lint - Test all:
npm run test - Test single file:
npx vitest run path/to/file.test.ts - Test watch:
npm run test:watch - Dev servers:
npm run dev(frontend),npm run dev:worker(backend)
- No
anytype - find or create proper types - Types: Frontend imports from
@/api-types(single source of truth) - Formatting: Prettier with single quotes, tabs (see package.json)
- Naming: React components
PascalCase.tsx, utilities/hookskebab-case.ts, backend servicesPascalCase.ts - Comments: Explain purpose, not narration. No verbose AI-like comments. No emojis.
- DRY: Search for existing code before creating new. Never copy-paste.
- Imports: Frontend APIs in
src/lib/api-client.ts, types insrc/api-types.ts
- Backend services return
null/booleanon error, never throw in RPC methods - Use existing error classes from
worker/utils/ErrorHandling.ts
- Add API endpoint: types in
src/api-types.ts->src/lib/api-client.ts-> service inworker/database/services/-> controller inworker/api/controllers/-> route inworker/api/routes/ - Add LLM tool: create in
worker/agents/tools/toolkit/-> register inworker/agents/tools/customTools.ts