# Codebase Conventions

## Resolve competing conventions

Use this evidence order in a legacy or mixed-style repository:

1. repository or directory instructions and architecture decisions;
2. formatter, linter, compiler, static analysis, and CI enforcement;
3. the maintained dominant pattern in the affected module;
4. nearby implementations of the same business case;
5. current language and framework conventions.

Recent modules, tests, and history can reveal the maintained convention; the most numerous old pattern is not automatically current.

Keep the change local. Do not reformat whole files, reorganize unrelated code, introduce a third pattern, or copy a legacy convention that conflicts with correctness or safety. Ask the user only when alternatives change public APIs, serialization, error semantics, directory architecture, or the scope of a broad refactor.

Following local style does not imply preserving or changing an old external contract. When the alternatives affect callers, historical data, or mixed versions, surface the contract impact rather than resolving it as a style preference.
