Rules
Markdown files that define hard constraints Cora applies to every interaction, without exception.
Last updated
~/.config/Code/User/globalStorage/codemateai.codemate-agent/settings/rules/your-project/.cora/rules/# Security rules
Every Prisma query that accesses tenant-owned data must include a
`where: { orgId }` clause. No exceptions, including admin endpoints.
API keys must never be stored in plaintext. Always hash with bcrypt
before writing to the database. Store the first 8 characters in a
separate `prefix` field for UI display.
The ingestion API must never accept JWT authentication.
API key auth via X-Api-Key header only.
Every Express route handler must validate the request body with a
Zod schema before reading any properties from req.body.
Never log full API keys, JWTs, or password hashes. Log the key
prefix or a redacted placeholder instead.# Naming conventions
Database models: PascalCase singular — User, Organization, ApiKey.
Service files: camelCase — userService.ts, apiKeyService.ts.
Route files: kebab-case matching the resource — api-keys.ts.
React components: PascalCase. Filename matches the component exactly.
Zod schemas: Schema suffix — CreateUserSchema, UpdateOrgSchema.
Environment variables: SCREAMING_SNAKE_CASE with service prefix —
DASHBOARD_DATABASE_URL, INGESTION_REDIS_URL.# Edit a global rule
code ~/.config/Code/User/globalStorage/codemateai.codemate-agent/settings/rules/security.md
# Edit a project rule
code .cora/rules/security.md