mycosingle-source-of-truth-refactoringlisted
Install: claude install-skill goondocks-co/myco
# Single-Source-of-Truth Refactoring
The Myco codebase has a recurring architectural smell: logic, values, or transformations scattered across multiple files with no canonical owner. When two consumers independently compute or verify the same thing, they drift — silently. CI stays green while production ships divergent behavior. This skill documents five fix patterns and two violation classes discovered across six independent sessions of Myco development.
**Core discipline:** Name the thing, own it in one place, let consumers reference it.
## Prerequisites
- Identify the canonical home before touching code: is there already an obvious module that *should* own this value? (`the shared constants module` for named scalars, `the shared context-window module` for provider capability defaults, service state objects for related file paths, `daemon-scoping path helpers` for daemon-scoping decisions)
- Grep for all existing usages before extracting so no call site is missed:
```bash
grep -rn "the-pattern-or-literal" packages/
```
- Confirm tests cover the scattered behavior before deleting any duplicate path
## Procedure A: Detecting SSoT Violations During Code Review
Apply these two checks when reviewing any PR that touches shared infrastructure. The violations surface as runtime failures, not compile errors — catching them here saves production incidents.
### Check 1 — Re-computation of an already-available value
Flag any function that re-derives a value already availa