From david-skills
Diagnoses and refactors codebase entropy across structural, semantic, behavioral, and evolutionary dimensions. Guides safe incremental cleanup of tech debt, duplication, and inconsistency.
How this skill is triggered — by the user, by Claude, or both
Slash command
/david-skills:entropy-reductionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Systematically reduce codebase disorder without breaking existing behavior. Identify high-entropy areas and lower entropy through safe, incremental refactoring. Prioritize obviously high-entropy areas over minor style issues.
Systematically reduce codebase disorder without breaking existing behavior. Identify high-entropy areas and lower entropy through safe, incremental refactoring. Prioritize obviously high-entropy areas over minor style issues.
| Axis | What it means | Typical symptoms |
|---|---|---|
| Structural | Layering, dependencies, topology | Oversized files/functions, util black holes, circular deps, layer violations |
| Semantic | Naming, concepts, state representation | Same concept with multiple names, scattered state machines, ad-hoc data models |
| Behavioral | API contracts, error handling, boundary behavior | Inconsistent error responses, different status codes for the same error class, env-dependent behavior |
| Evolutionary | Change patterns, ownership, understandability | Giant mixed-purpose PRs, no clear module ownership, design intent buried in chat history |
When given a codebase scope (file, directory, module, or repo), follow these four phases:
Scan the target scope and identify high-entropy symptoms. For each finding, note:
Concrete things to look for:
Structural entropy
util/, common/, helpers/ directories that have become catch-all dumping grounds with business logic mixed inSemantic entropy
user / member / account / customer / profile all meaning the same thing)Behavioral entropy
Evolutionary entropy
Present findings as a concise list — developer-readable, no jargon overload.
Design an incremental entropy reduction plan:
Propose 1–3 small, safe changes that can be done immediately. For each:
Prioritize by: highest entropy reduction per unit of risk. Do the safe, high-impact changes first.
Flag anything that needs human input — if you're unsure about a naming convention, an architectural boundary, or whether a behavior change is acceptable, ask rather than guess.
Execute the planned changes:
After making changes:
These are hard rules — do not violate them:
user, don't introduce member or account as an alternative name for the same concept.Structure your output as:
Keep the diagnosis and plan sections concise. The code changes are the main deliverable.
npx claudepluginhub thedavidweng/skillsIdentifies code smells, assesses refactoring risk, and builds incremental execution plans with rollback strategies. Activates on refactoring, code cleanup, tech debt, or duplication reduction requests.
Performs a strict whole-codebase maintainability audit checking structural quality, file sprawl, thin wrappers, leaked logic, and dependency freshness via context7. Pushes code-judo simplification moves and auto-updates docs. For periodic audits alongside per-diff /review.
Refines code quality by analyzing duplication, algorithmic efficiency, clean code violations, architectural fit, anti-slop patterns, and error handling. Use after AI sprints, before releases, or for refactoring existing code.