Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 2.87 KB

style-guide.md

File metadata and controls

45 lines (38 loc) · 2.87 KB

Code review style guide

Code conventions are agent rules in .agents/rules/. Agents load each file when they touch matching paths; reviewers and CodeRabbit read the same files. This page explains the scheme and indexes the rule files.

Check locally. just check is the single gate: format, lint, and code rules, scoped to your changes against origin/main, with every finding printed as file:line [rule-id] and the command that fixes it. just check full adds tsc and clippy. Mechanically enforceable rules live in rules/ast-grep/.

IDs

Each rule has a stable ID: CS-## for the Rust backend, FE-## for frontend and shared TypeScript. Cite IDs in reviews ("see CS-30"). Never renumber or reuse an ID; deletions leave gaps and new rules take the next free number. A rule line reads <id> rule, optionally followed by how it is enforced.

Rule files

File IDs Applies to
config-and-service-urls.md CS 14–18 Everywhere
CODING.md CS 24, 26, 28, 29, 32–35, 71 Everywhere; read before writing code
observability.md Everywhere
rust/guardrails.md Backend: tests, migrations, crate boundaries
rust/db.md CS Migrations, SQL, DB clients, outbound adapters
rust/architecture.md CS Rust
rust/code.md CS Rust
rust/libraries.md CS 56–67 Rust and Cargo.toml
rust/security.md CS Rust
web/data.md FE apps/web, packages
web/solid.md FE apps/web, packages
web/architecture.md FE apps/web, packages
web/libraries.md FE 35–46 apps/web, packages
web/ui.md FE .tsx
web/mobile.md apps/web UI and CSS on touch and phones
web/ui-primitives.md apps/web/src/components/ui
web/startup-bundle.md apps/web/src
web/lexical-nodes.md Lexical nodes and decorators
infra/pulumi.md infra/, deploy config

To find a rule by ID: rg 'CS-30' .agents/rules. To add one, use the rule template; an ID-bearing rule goes in the file for its scope with the next free number.