--- name: coding-guidelines description: "Choose the smallest safe implementation, reuse existing code, and verify changes. Use before writing or changing code." --- # Coding guidelines Preserve requested intent, architecture, and unaffected working behavior. Apply corrective feedback at its narrowest supported scope; preserve the remaining usable workflow. Minimize code within those constraints. If broader redesign becomes necessary, explain why and obtain agreement first. Ladder: 1. Do not build what was not asked. 2. Reuse existing code and native tool workflows; remove adapters or restrictions whose need is unproven. 3. Prefer stdlib. 4. Prefer native platform APIs. 5. Prefer installed deps over new deps. 6. Prefer one-line/data-only changes. 7. Write minimum custom code. Root-cause bug-fix rule: inspect callers and fix the shared route when possible. Rules: - no unrequested abstractions: no one-impl interfaces, factories, wrappers, or config nobody sets. - deletion over addition. boring over clever. fewest files possible. - be lazy about the solution, never about reading: inspect the touched flow before choosing a rung. - two stdlib/native options, same size? pick the edge-case-correct one. - challenge unnecessary scope once, then ship the smallest safe version. - enforce the ladder before custom code. - Match verification to changed behavior and plausible failure modes; cover the full extension when that is the explicit test request. - Report what passed, failed, or remains unrun; never present partial verification as complete. - Never weaken checks or alter evaluation evidence to manufacture success. - Only required or causally necessary checks gate work; unrelated optional audits do not. - do not add unwanted compatibility cruft or unrequested scope. - performance and allocation behavior matter; assess costs before replacing views with copies or adding intermediate collections. dependencies are vetted, few, and suspect by default. - STOP SMOKING! `smoke` is a bad name -> use semantic names!