feat(doctrine): architecture defaults move to lib/architecture-defaults.md, Web APIs to rules/rest-api.md
This commit is contained in:
1 parent
de6e51ce7a
commit
2fe5291a13
13 files changed
+92
-66
No files matched your search
@@ -1,23 +0,0 @@
|
||||
# Default language — Rust
|
||||
|
||||
Scope: a new project, a project from scratch, or a whole-project
|
||||
refactor or rewrite the user asks for. Not a module refactor or a feature
|
||||
inside an existing codebase: that keeps the codebase's language.
|
||||
|
||||
Rust is the default. Two candidates equal on features, security,
|
||||
performance, reliability and ease of use or maintenance → Rust wins.
|
||||
Where Rust can do the job, Rust does it.
|
||||
|
||||
Another language needs a demonstrated gain on one of those axes, stated
|
||||
at the choice: a browser frontend (TypeScript, Astro per the web rules),
|
||||
a platform that mandates its language (Swift, Kotlin), an ecosystem Rust
|
||||
lacks (ML research → Python), a throwaway script where Rust's build
|
||||
cycle costs more than it returns. "Rust is slower to write" alone is not
|
||||
a gain.
|
||||
|
||||
At brainstorming (`/init-project`, `/ship-feature` STEP 1, `/refactor`
|
||||
of a whole project): language not named → propose Rust, name the
|
||||
contraindication if you pick something else. Never silently default to
|
||||
Python, Node or Go. Mixed project: Rust for everything server-side,
|
||||
CLI, systems and tooling; the exception stays scoped to the part that
|
||||
earned it.
|
||||
+6
-2
@@ -31,7 +31,7 @@ wait, or 202 + status URL. Retention outlives the longest retry
|
||||
path, dead-letter replay included.
|
||||
|
||||
## Naming
|
||||
Plural nouns for endpoints (`/api/tasks`), no verbs. camelCase query
|
||||
Plural nouns for endpoints (`/api/v1/tasks`), no verbs. camelCase query
|
||||
params and response fields. UPPER_SNAKE enum values. Boolean fields
|
||||
prefixed is/has/can.
|
||||
|
||||
@@ -40,4 +40,8 @@ Every observable behavior — undocumented quirks, error text, timing —
|
||||
becomes a de facto contract once someone depends on it.
|
||||
|
||||
## Versioning
|
||||
CLAUDE.md § Web APIs — always versioned. Not repeated here.
|
||||
Every endpoint versioned from day one: `/api/v1/...`, no bare `/api/`; the
|
||||
router mirrors it (`api/v1/routes/`). Breaking change → `v2`, the old
|
||||
version keeps working and clients migrate at their pace; non-breaking
|
||||
additions → current version. Each version is a self-contained contract,
|
||||
never bent to match a newer one.
|
||||
Reference in new issue
Block a user