Skip to main content

Code-quality and dotfiles policy

The SOP's coding rules are intentionally conservative: minimal edit scope, no unrequested compatibility, verification before completion, and internal time/effort estimates treated as non-constraints.

In this dotfiles repo, the same discipline is paired with chezmoi source-of-truth rules and documentation hygiene.

Mental model

RuleEffect
Cost/time disciplinenever shortcut because the correct path feels slow or costly
Local style matchingmatch surrounding structure, terms, and contract strength
Minimal edit scopeno unrelated cleanup or behavior removal
Semantic dedupepreserve intentional point-of-entry guardrails during refactors
Simplicity disciplineno abstractions/features beyond the ask
Artifact necessityprove a new file/config/dependency has a runtime/tooling consumer
Dead-code handlingremove only dead code introduced by the change unless asked
Type safetyavoid broad casts and success-shaped fallbacks

Using it

Style matching

Changes should read like they belong in the file they modify: same structure, terminology, formatting, level of detail, and contract strength.

Prefer the smallest in-style edit over a pasted standalone rule or helper from another surface.

Cost/time discipline

Agents must not use their internal sense of elapsed time, effort, or verification expense to decide how much rigor to apply. Quality, simplicity, robustness, scalability, and long-term maintainability outrank speed of completion.

Planning, implementation, review, and handoff stay evidence-driven: inspect load-bearing details from multiple angles, seek counterexamples, and stop only when success criteria are satisfied or remaining gaps are explicitly marked Unknown.

Refactor guardrails

When removing duplication, classify repeated checks, instructions, config, or workflow steps before deleting them. Some repetition is an intentional point-of-use guard.

Keep a local guard unless every entry path necessarily passes through the shared rule or helper.

If extracting, route every entry point through the shared helper/reference and verify each one.

Reference: dotfiles overlay

ConcernRule
Chezmoi source of truthresolve target → chezmoi source-path → edit home/** source
Read-only $HOME targetsinvestigate readonly_ source; never chmod deployed output
Validationrun make check then make fmt after repo changes
Docs hygienebehavior changes under home/, scripts/, or tools/ update docs and .mermaids
Shell scriptsshell stays glue; non-trivial logic goes under scripts/ helpers
~/bin commandscommand updates require fish completion and docs/catalog updates
~/lib command internalslarge command internals belong under home/exact_lib/exact_,<name>/, not repo-only scripts/