Coding Standards
Set the conventions once so every contributor — human or agent — writes code that reads like one author. The highest-leverage standard is shared vocabulary: name things from the domain, consistently, so the same concept is never two words.
When to use
- Starting a project, or when conventions have drifted and the code reads like several authors.
- Skip if the project already has clear standards that are actually followed.
Step 1: Fix the vocabulary and the patterns
Open assets/standards-template.md now. Each step fills its section.
- Approved
data-modelor domain contract exists → take its concepts and terms. Decide only representation, casing, abbreviations, drift enforcement. Never their meaning, never a rename. Dispute about what a concept is →data-model. - No contract → derive terms from the domain evidence you can see.
- Ban a generic label wherever a domain term exists. Keep the glossary current.
- Name the one way this project does each: error handling, validation, async, dependency injection, testing seams. One short example each.
- Write the hard nevers. Keep the list short.
Step 2: Assign enforcement
- Per rule: statically detectable → a formatter, linter, type or static check, or repository check that fails. Vocabulary, architecture, judgement → a named review rubric and a named owner.
- Set each check's strictness deliberately. Warning budget zero. Never leave a permissive default.
- Point to the exemplar. Run its checks and rubric now. Greenfield with none → name the first artifact and owner; adoption stays pending. Never fabricate a path.
- Name which project instruction wins on conflict and who approves an exception. Each exception: scope, reason, expiry, compensating check.
- Name the drift-review cadence or trigger and who updates the standard.
Step 3: Write and present
Write the immutable section to
.sdlc-skills/designs/{{YYYY-MM-DD}}-{{topic}}.mdor the project's standing conventions path, preserving approved sections around it.Present and end the turn:
Coding standards {{path}} — version {{identity}} Vocabulary: {{n}} terms Patterns: {{n}} Nevers: {{n}} Enforcement: {{n}} automated, {{n}} review Exemplar gate: {{result}} 1. Approve 2. Request changes 3. Reject 4. Cancel Recommendation: {{option}} — {{one sentence}}.Only option 1 hands off. Record lifecycle externally. Normative change → a successor with a per-ID
added / changed / removed / preserveddelta. Removal needs owning approval. Never edit an issued identity.Claim adoption only after enforcement and the exemplar gate run. Record
in force / suspended / supersededexternally with fresh evidence.
Common mistakes
- A long list of rules no one reads — keep it to what actually matters here.
- Standards told but never shown — point to a real exemplar file.
- Generic vocabulary that lets one concept drift into many names.
- “Reviewers will catch it” with no rubric, owner, or checked exemplar.