refactor-clean
Skill2 starsChanged 6 months agoMITView on GitHub
Remove dead code, duplication, and tech debt safely during the Maintain phase. Use after shipping, or when a codebase has accumulated cruft. Delegates to the harness-claude:refactor-cleaner agent. Behavior-preserving only.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- dzhng/skillstheir own version, first seen Oct 4, 2026
- dzhng/jevgreptheir own version, first seen Oct 2, 2026
- dzhng/duet-agenttheir own version, first seen Oct 2, 2026
- drvoss/everything-copilot-clitheir own version, first seen Aug 9, 2026
- PatriotAgenticLLC/better_claude_skillztheir own version, first seen Jul 1, 2026
- QuentinHsu/skillstheir own version, first seen May 10, 2026
Used with
Projects with it also use audit-choices, close-spec and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
dzhngSkillaudit-choices
Audit the choices an implementing agent made, not its diff — a pure decision audit that traces the session's history into a choices ledger, changes no code, and never blocks an unsupervised run. Working code still embeds architecture the user never chose; surface it because future work inherits it. Use when the user wants to review the decisions the AI made on their behalf, before merging or committing AI-implemented work, when integrating a delegated subagent's pass, or when a fix "works" but might be a point fix.
Also in 3 projects that use this
dzhngSkillclose-spec
When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).
Also in 3 projects that use this
LucasMatuszewskiSkillaudit-agents
Audit and maintain agent configuration files (.claude/agents, AGENTS.md, CLAUDE.md, agent-memory). Checks for duplicates, outdated info, naming conflicts, wrong technical facts, and files over 200 lines. Fixes all issues and commits.
Also in 3 projects that use this
Halcyon666Skillwrite-skills
Creates high-quality Agent Skills (SKILL.md files) that follow the open Agent Skills specification. Use when asked to create a skill, write a SKILL.md, package agent instructions, build a reusable capability, or turn a workflow into a shareable skill. Produces spec-compliant, concise, well-structured skills optimized for agent discovery and execution.
Also in 3 projects that use this
isLinXuSkilleval-skills
AI Agent Skill unit testing framework. A framework-agnostic toolkit for discovering, scaffolding, selecting, evaluating, and reporting on AI skills. Use this skill to assess skill quality before production, compare candidate skills on the same benchmark, enforce quality gates in CI/CD, and generate human-readable evaluation reports.
Also in 3 projects that use this
TrecekSkillaudit-tests
Audit the test suite for useless tests, consolidation opportunities, over-mocking, weak assertions, and other test quality issues. Use when user says "audit tests", "audit test suite", "review tests", or "test quality check". Generates an improvement plan in temp/ with explanations for each proposed change.
Also in 3 projects that use this
- +6 more from dzhng
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- dzhng/jevgrep★ 2.3ksame name
- dzhng/skills★ 978same name
- julianromli/ai-skills★ 192same name
- drvoss/everything-copilot-cli★ 47same name
- dzhng/duet-agent★ 46same name
- jiten-singh-shahi/salesforce-claude-code★ 17same name
- PatriotAgenticLLC/better_claude_skillz★ 3same name
- peopleforrester/claude-dotfiles★ 3same name
- QuentinHsu/skills★ 2same name
- TheKREATORS/my-claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- rules/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- architectSkill
- benchmarkSkill
- build-fixSkill
- deploySkill
- design-reviewSkill
- designSkill
- discoverSkill
- evalSkill
- extractSkill
- fixSkill
- harness-implementSkill
- harness-maintainSkill
- harness-planSkill
- harnessSkill
- harness-verifySkill
- healthSkill
- implementSkill
- lazySkill
- observeSkill
- onboardSkill
- operateSkill
- orchestrateSkill
- plan-checkSkill
- planSkill
- researchSkill
- resume-sessionSkill
- reviewSkill
- save-sessionSkill
- security-reviewSkill
- shipSkill
- specSkill
- testSkill
- verifySkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Confirm truly unused: before deleting — check all references, including dynamic usage.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/refactor-clean — safe cleanup
Goal: a leaner, more modular codebase without changing behavior.
Do this
- Delegate to
harness-claude:refactor-cleaner, or inline: - Find candidates with analyzers when present (knip/depcheck/ts-prune/ruff/vulture),
else
mgrep/graph (orGrep/Globif those are unavailable): unused exports/imports/files, dead branches, duplicated logic, stray debug code, oversized files (>800 lines). - Confirm truly unused before deleting — check all references, including dynamic usage. When unsure, leave it and report.
- Consolidate duplication into one well-named utility; split oversized files by responsibility. Small, reversible steps; run tests/build after each.
Constraints
Behavior-preserving. No feature/API changes unless asked. Keep diffs reviewable; if a
cleanup turns into a redesign, stop and route to /harness-claude:architect.
Exit criterion
Cruft removed with reference checks, tests/build still green, change documented.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

