code-conventionslisted
Install: claude install-skill andresnator/agents-orchestrator
# Code Conventions
## Activation Contract
Load this skill whenever writing production code or tests, or when a plan prescribes how code and tests will be written (naming, asserts, constants, DTO placement, characterization tests).
Do not use for documentation, prose artifacts, or infrastructure config with no code.
## Precedence
These conventions are the default for new code and for repos without an established convention. When the target repo already follows a different convention consistently, the repo wins; note the deviation in the plan or summary instead of fighting it.
## Production Code
- **No magic literals**: extract hardcoded numbers and strings into named constants placed where tests can reuse them. Tests reuse constants for fixtures and setup; when the constant itself IS the behavior under test, assert against the expected literal value to avoid tautological tests.
- **Top-level DTOs**: DTOs and helper types are independent top-level classes/files — never inner or nested classes (Java), even when only one private method uses them. In TS, exported types in their own module following the repo layout.
- **Stepdown order (soft)**: code reads top-down like a page; private methods appear in the order they are called. A preference for new or already-touched code, never a reason to churn diffs.
- **Principles that carry weight**: Single Responsibility and Open-Closed. Introduce interfaces or dependency inversion only for real variation, test seams, or architectural