clean-code
Skill17 starsChanged 57 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.
63 other projects use a version of this.
Adopted by
Most recently taken up by
- superplanehq/superplanetheir own version, first seen Oct 5, 2026
- JeffreyFerreiras/ai-skillstheir own version, first seen Oct 5, 2026
- jd-solanki/krutrimboxtheir own version, first seen Sep 27, 2026
- samirpatil2000/skillstheir own version, first seen Sep 26, 2026
- btseee/clean-code-skillstheir own version, first seen Sep 25, 2026
- renky1025/agent-skillstheir own version, first seen Sep 25, 2026
Used with
Projects with it also use 2d-games, 3d-games 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.
tiendatworkSkill2d-games
2D game development principles. Sprites, tilemaps, physics, camera.
Also in 3 projects that use this
tiendatworkSkill3d-games
3D game development principles. Rendering, shaders, physics, cameras.
Also in 3 projects that use this
MindrallySkillclean-architecture
Guidelines for implementing Clean Architecture patterns in Flutter and Go applications, with emphasis on separation of concerns, dependency rules, and testability.
Also in 7 projects that use this
ratacatSkilldesign-patterns
Use when designing software architecture, refactoring code structure, solving recurring design problems, or when code exhibits symptoms like tight coupling, rigid hierarchies, scattered responsibilities, or difficult-to-test components. Also use when choosing between architectural approaches or reviewing code for structural improvements.
Also in 5 projects that use this
kayamanSkillsolid-principles
Enforces SOLID principles (SRP, OCP, LSP, ISP, DIP) in object-oriented and multi-paradigm code. Use when designing classes and interfaces, evaluating responsibility assignment, reviewing code for coupling issues, applying dependency inversion, refactoring fat interfaces, or checking that subtypes are truly substitutable.
Also in 3 projects that use this
DIL8654Skilllogging-patterns
Keep logs structured, correlated, low-noise, and safe for production support. Use when adding operational logging, reviewing observability, or improving diagnostics in .NET services.
Also in 3 projects that use this
- +6 more from tiendatwork
Other versions63 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 63
- superplanehq/superplane★ 7.7ksame name
- ciembor/agent-rules-books★ 2.9ksame name
- wondelai/skills★ 2.3ksame name
- decebals/claude-code-java★ 747same name
- Mindrally/skills★ 266same name
- xenitV1/claude-code-maestro★ 229same name
- techygarg/lattice★ 197same name
- ratacat/claude-skills★ 56same name
- DGouron/review-flow★ 44same name
- kumaran-is/claude-code-onboarding★ 36same name
53 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 repository14 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
- wiki-historySkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 59 edited versions we read keep these.
3
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:
- Distinctive: line 49
Check affected consumer builds, residual imports/dead references to removed paths, public exports, and module-state ownership.
“Common” is measured: kept by at least 6 in 10 of the 59 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> buildCheck affected consumer builds, residual imports/dead references to removed paths, public exports, and module-state ownership. Disclose 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, and unverified scope. Commits/PRs require a separately requested or authorized lifecycle.
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.

