From 331b0a31f557f2530bac43bf73cedf5aff7f5c3a Mon Sep 17 00:00:00 2001 From: Oleh Omelchenko Date: Fri, 12 Jun 2026 19:46:38 +0300 Subject: [PATCH] Eng-council: alignment checks from sweep findings + metrics baseline --- .claude/skills/alignment/SKILL.md | 7 +++++++ docs/codebase-metrics.md | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 docs/codebase-metrics.md diff --git a/.claude/skills/alignment/SKILL.md b/.claude/skills/alignment/SKILL.md index 5988b70..30241db 100644 --- a/.claude/skills/alignment/SKILL.md +++ b/.claude/skills/alignment/SKILL.md @@ -40,6 +40,10 @@ Review all changes in scope. If changes span multiple patterns below, apply all over-engineering from iterative development — dead code, try/catch around internal calls that can't throw, abstraction layers wrapping a single implementation. Proceed with caution; ask if unsure. + - **Export hygiene**: a symbol is exported only if another module imports it. Symbols used + only within their module (including `as const` arrays that exist to derive a type) stay + unexported — `export type` the type, not its source array. Verify with Grep before + exporting "for future use"; the future caller can add the export. 5. **Styles and UI**: When altering CSS or layout, follow or generalize existing patterns (CSS Modules + design tokens in `styles/tokens.css`) rather than writing from scratch. Don't @@ -128,6 +132,9 @@ Update relevant docs if the feature is significant: If `package.json` changed: - Flag each new dependency; explain what it does and why it's needed. +- Every package imported directly in `src/` must be declared in `dependencies` — never rely + on a transitive install (it can vanish or drift on any lockfile churn). Declaring a package + the bundle already carries adds no weight. - Could a small custom implementation avoid it? Note the trade-off. - Prefer dependencies that solve genuinely hard problems (parsing, rendering) over those that save boilerplate. diff --git a/docs/codebase-metrics.md b/docs/codebase-metrics.md new file mode 100644 index 0000000..f71f80b --- /dev/null +++ b/docs/codebase-metrics.md @@ -0,0 +1,15 @@ +# Codebase Metrics + +One row per `/eng-council` sweep. The trend is the point: accretion becomes visible +instead of felt. Methodology: LOC excludes `*.test.*`; "dead exports" is `npx knip` +unused **runtime** exports (unused exported _types_ tracked in the sweep report, not +here); "dup %" is `npx jscpd src --min-tokens 50 --format "typescript,tsx"` (tests +included — they dominate the clones; non-test clones are itemized in the sweep report). + +| date | src files | src LOC | core LOC | app LOC | deps | knip dead exports | jscpd dup % | +| ---------- | --------- | ------- | -------- | ------- | ---- | ----------------- | ----------- | +| 2026-06-12 | 105 | 16876 | 4669 | 12130 | 12 | 0 | 2.69 | +| 2026-06-12 | 106 | 16695 | 4655 | 11963 | 12 | 0 | 2.03 | + +The second 2026-06-12 row is the same sweep after its structural proposals landed +(usePopover/useColResizeDrag extraction, modal-cycle break, dead service deletion).