refactor-clean

Solid

Refactor cleanly instead of layering sediment. Use when a change reveals duplicated concepts, local adapters, obsolete owners, compatibility wrappers, parallel abstractions, an over-large module that has accreted many responsibilities, or "just tack this on" pressure in any code area.

Code & Development 41 stars 4 forks Updated 2 days ago Apache-2.0

Install

View on GitHub

Quality Score: 84/100

Stars 20%
54
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Clean Refactoring Replace the old shape with the simpler shape the codebase would want if it were designed today. Refactoring is not adding a compatibility layer beside the problem; it is moving ownership until every concept has exactly one clear home. That cuts both ways: merging N duplicated owners into one, and splitting one over-loaded module into the several owners it was hiding. ## Workflow 1. Name the concept that lacks one clear owner — duplicated across several owners, or several concepts fused into one over-loaded module. Identify the thing(s) that should each have one owner: environment, pricing rule, geometry source, state machine, data contract, renderer phase, API shape, UI state, or test oracle. 2. Find every current owner and consumer. Treat wrappers, aliases, pass-local constants, copied structs, and "temporary" branches as sediment until proven otherwise. 3. Promote the concept to its natural home. Pick the module that would own it from scratch, then make old call sites consume that owner directly. 4. Delete or collapse the stale path in the same pass when feasible. If a bridge must remain, make it tiny, named as compatibility, and give it a removal condition. 5. Verify behavior through consumers, not just the new module. A clean refactor is only proven when the surfaces that used to diverge now report or exercise the same source of truth. ## Rules - **Do not over-weigh the sunk cost of the existing architecture.** "It al...

Details

Author
dzhng
Repository
dzhng/duet-agent
Created
3 months ago
Last Updated
2 days ago
Language
TypeScript
License
Apache-2.0

Similar Skills

Semantically similar based on skill content — not just same category