skills/naming-refactor/SKILL.md
Refactor naming and repository structure exhaustively while preserving behavior and external contracts.
npx skillsauth add paulrberg/dot-agents naming-refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Make every name in the current repository communicate one coherent domain model, regardless of refactor cost.
Resolve scripts/naming-ledger.py relative to this SKILL.md and create its ledger outside the repository:
uv run "<skill-dir>/scripts/naming-ledger.py" init --root <repo> --ledger <scratch.json>
The helper maps every tracked and non-ignored untracked path and records pre-existing worktree state. Account for a path only after inspecting its name, relevant contents, and role:
uv run "<skill-dir>/scripts/naming-ledger.py" mark \
--ledger <scratch.json> --status <pending|retained|renamed|excluded|blocked> \
--path <path> [--path <path>...] [--reason <text>]
Use retained when the current name is justified, renamed when the path or its contents joined a verified rename,
excluded for generated, vendored, binary, or bulk artifacts validated through their source or invariant, and blocked
when behavior or contract safety cannot be established. excluded and blocked require reasons.
uv run "<skill-dir>/scripts/naming-ledger.py" pending --ledger <scratch.json> [--limit <n>]
uv run "<skill-dir>/scripts/naming-ledger.py" refresh --ledger <scratch.json>
uv run "<skill-dir>/scripts/naming-ledger.py" summary --ledger <scratch.json>
Refresh after path moves and before final validation. New paths become pending; removed paths remain in the ledger and must be accounted as renamed, excluded, or blocked. The run is complete only when the helper reports no pending or blocked paths.
Completion of this phase requires a recorded baseline, explicit contract boundaries, and a ledger covering the entire repository.
Inspect every ledger path and build an evidence-backed map before changing each coherent domain slice. Cover directories, files, packages, modules, namespaces, exports, types, classes, functions, methods, parameters, variables, booleans, constants, tests, fixtures, documentation, configuration, scripts, and CI.
Apply these rules together:
data, info, item, manager, process,
handle, and utils when a specific name is supported by evidence.For every rename group, record the old and new concept, rationale, contract classification, affected consumers, collision risks, dynamic string references, migration order, and proving checks. Resolve ambiguity through symbol and reference inspection before choosing a name. Never use blind global replacement for an overloaded term.
Completion of this phase requires every non-excluded path to be retained with a reasoned naming model, assigned to a validated rename group, or marked blocked with concrete evidence.
Apply rename groups in coherent dependency waves. Parallelize independent read-only analysis when useful, but serialize overlapping edits and shared manifests, exports, schemas, and entrypoints.
Continue until every planned rename is applied or blocked; refactor cost, diff size, and elapsed time are not stopping criteria.
Refresh the ledger, inspect every new path, and repeat the semantic naming pass until it finds no material naming issue. Search for stale old names and paths, including case variants and non-code literals. Run aggregate repository checks and compare them with baseline; no new unexplained failure is acceptable. Verify stable external contracts through available API snapshots, schemas, CLI help, import surfaces, or focused smoke tests.
Lead success with ### ✅ Naming refactor complete — <rename groups> groups · <accounted>/<mapped> paths accounted.
Report exact file and directory moves, every public or exported rename, compact local-identifier group counts,
baseline-versus-final checks, intentional retained external names, incidental bug fixes, and residual risks. Keep
commands, paths, names, diagnostics, and contract identifiers exact and undecorated.
If the ledger is incomplete, behavior parity is unproven, or an external contract would require unapproved breakage,
lead with ### ⛔ Naming refactor incomplete and report the blocking evidence and required decision. Do not describe
the run as complete while any path remains pending or blocked.
tools
Uses Chrome DevTools via MCP for efficient debugging, troubleshooting and browser automation. Use when debugging web pages, automating browser interactions, analyzing performance, or inspecting network requests. This skill does not apply to `--slim` mode (MCP configuration).
testing
Audit an entire repository with fresh eyes for correctness errors, bugs, omissions, duplication, inconsistencies, and other evidenced mistakes; fix every safe issue and verify the result.
development
Autonomous overnight codebase improvement with bounded runtime, evidence-gated changes, and verification.
tools
Use to build interactive single-file HTML playgrounds, explorers, or tools with visual controls, live preview, and prompt copy-out.