writing-server-code
Installation
SKILL.md
Repository Orientation
The server repo contains:
src/Api— REST API endpointssrc/Identity— Authentication/identity servicesrc/Core— Business logic, commands, queries, servicessrc/Infrastructure— Data access, repositories
Architectural Rationale
Command Query Separation (CQS)
New features should use the CQS pattern — discrete action classes instead of large entity-focused services. See ADR-0008.
Why CQS matters at Bitwarden: The codebase historically grew around entity-focused services (e.g., CipherService) that accumulated hundreds of methods. CQS breaks these into single-responsibility classes (CreateCipherCommand, GetOrganizationApiKeyQuery), making code easier to test, reason about, and modify without unintended side effects.
Commands = write operations. Change state, may return result. Named after the action: RotateOrganizationApiKeyCommand.