clean-code
Skill17 starsChanged 3 days agoMITView on GitHub
Diagnose excessive file splitting, proxies, and duplicate logic in a named package, then perform approved structural consolidation and deduplication. Not for general bug fixes, feature development, or cosmetic formatting.
108 other projects use a version of this.
Adopted by
Most recently taken up by
- nohemi20231/design-skillstheir own version, first seen Nov 8, 2026
- MammadovEshgin/clean-code-skilltheir own version, first seen Nov 8, 2026
- Mahesh-Bishnoi/skillstheir own version, first seen Nov 8, 2026
- Bruno-Cunha-Souza/ValarMindSkillstheir own version, first seen Nov 8, 2026
- kana-consultant/kana-best-practice-engineeringtheir own version, first seen Nov 8, 2026
- uwuclxdy/agenticattheir own version, first seen Nov 8, 2026
Used with
Projects with it also use intelligent-routing, nextjs-react-expert 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.
SKB3002Skillintelligent-routing
Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.
Also in 5 projects that use this
SKB3002Skillnextjs-react-expert
React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.
Also in 3 projects that use this
xfstudioSkillbash-pro
Master of defensive Bash scripting for production automation, CI/CD
Also in 4 projects that use this
xfstudioSkillcode-refactoring-tech-debt
You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti
Also in 4 projects that use this
flying-diceSkillclean-code-review
Multi-agent clean code audit — each principle gets its own agent
Also in 3 projects that use this
goca-seSkillbatch-operations
Apply a change safely across many files — refactors touching more than 5 files, library or API migrations, project-wide renames of symbols/imports/paths, or adding boilerplate to many files. Use when "do it all at once" risks context overflow or silent failures.
Also in 3 projects that use this
- +4 more from xfstudio
Other versions108 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 108
- superplanehq/superplane★ 9.1ksame name
- vudovn/ag-kit★ 8.2ksame name
- vudovn/antigravity-kit★ 8.2ksame name
- Openpanel-dev/openpanel★ 7.3ksame name
- ciembor/agent-rules-books★ 2.8ksame name
- wondelai/skills★ 2.6ksame name
- decebals/claude-code-java★ 763same name
- operately/operately★ 618same name
- liza-mas/liza★ 418same name
- Mindrally/skills★ 275same name
98 more not listed
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 repository13 other files it gives its agents.
- .changelog.d/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- ai-gateway-loop-optimizationSkill
- console-e2eSkill
- console-handoffSkill
- console-performanceSkill
- design-sweepSkill
- git-worktreeSkill
- learning-harvestSkill
- product-proposalSkill
- pr-workflowSkill
- rebase-on-canarySkill
- release-version-updateSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 2 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 101 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
After approval, work from dependencies outward: relocate → update imports → remove absorbed files → verify.
- Distinctive: line 32
Check the consolidated result against actual consumer paths:
- Distinctive: line 43
Run each package script explicitly per wave:
“Common” is measured: kept by at least 6 in 10 of the 101 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
Clean Code
Simplify structure around domain boundaries while preserving behavior and public APIs. File/line reductions are supporting evidence, not the objective.
Inputs and approval scope
<target_path> is required; resolve it from the request. Confirm optional <public_surface> through declared package exports/barrels and actual external consumers. A diagnosis-only request ends at the report.
Present structural consolidation and functional deduplication diagnoses separately; implement only the approved scope. Do not ask again for an already-approved exact transformation. Return new API or behavioral trade-offs to the user.
1. Structural diagnosis and consolidation
Inventory target files/sizes and trace real dependencies and external consumers. Read merge candidates and affected consumers rather than requiring a ceremonial read of unrelated packages.
These are candidate signals, not automatic deletion rules:
- Multiple tiny single-function/type files in one domain, duplicated types, simple re-export chains.
- Factory-to-singleton-to-forwarding-proxy layers unused by runtime callers.
- Module-level mutable state bypassing test isolation or explicit dependencies.
Present a domain-based before/after map, preserved exports, affected consumers, and checks. Files under roughly 50 lines or merges over 800 lines are investigation clues; do not remove barrels/boundaries solely by file count. Preserve create*(deps) test isolation and public export boundaries.
After approval, work from dependencies outward: relocate → update imports → remove absorbed files → verify. Up to two independent merge groups can form one batch; larger or intertwined changes use meaningful waves. Verify the current wave before continuing.
2. Functional deduplication
Check the consolidated result against actual consumer paths:
- Does repeated logic have identical semantics, literal-only differences, or necessary caller-specific exceptions?
- Does a reshape/forward wrapper own an API, permission, or lifecycle contract?
- Can parallel types/builders share a discriminant without erasing domain meaning?
- Is an apparently dead export public API or dynamically referenced?
Present the diagnosis, estimated savings, and preserved contracts; deduplicate only within approval. Place shared helpers at an allowed common dependency owner, never reaching back into hosts. Do not merge semantically different functions just to reduce lines.
Verification and completion
Run each package script explicitly per wave:
cd <absolute-worktree> && pnpm --filter <pkg> typecheck && pnpm --filter <pkg> test && pnpm --filter <pkg> buildDisclose missing scripts or blocked checks. Repair task-induced regressions and repeat verification.
Finish when approved consolidation/deduplication and relevant checks are complete. Do not expand into general refactoring. Report before/after, API preservation, changed files, checks/results (every count taken from output re-run after the last edit), and unverified scope. Deliver approved repository changes through pr-workflow under the root CLAUDE.md standing authorization, unless the request is local-only or otherwise narrows delivery.
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.

