Clean Code Skills

Clean code and clean architecture for AI coding agents: one skill, rule packs for 21 languages and
27 frameworks, and a structure map that shows where every function and class lives and whether it
belongs there. Works with Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline,
and any tool that reads Agent Skills or AGENTS.md.
Why
Coding agents rarely fail at syntax. They fail by:
- putting code in the wrong place — a middleware inside an auth service, a helper at the
repository root;
- duplicating knowledge and mixing responsibilities until one file does five jobs;
- forgetting the project between sessions and guessing its conventions all over again.
This skill makes an agent load the project's context first, apply the rules of Clean Code and
Clean Architecture for its exact stack, and prove what it claims.
Install
Run inside your project. Linux, macOS, Git Bash:
curl -fsSL https://raw.githubusercontent.com/btseee/clean-code-skills/main/scripts/remote-install.sh | bash -s -- all
Windows PowerShell:
& ([scriptblock]::Create((irm https://raw.githubusercontent.com/btseee/clean-code-skills/main/scripts/remote-install.ps1))) all
Replace all with the agents you use, such as claude cursor copilot. As a Claude Code plugin:
/plugin marketplace add btseee/clean-code-skills, then
/plugin install clean-code-skills@clean-code-skills. The skill alone:
npx skills add btseee/clean-code-skills --skill clean-code. Every host, global installs, updating,
and uninstalling: docs/install.md.
Use
Agents pick the skill up by themselves when you ask for coding work. Seven commands cover the
rest — /clean-code <command> in Claude Code, or plain language anywhere:
| Command | What happens |
|---|
init | Detects your stack and its packs, asks a few questions, and maps the structure into .clean/. Run it once. |
audit | Reviews every file, fills .clean/, and reports findings first. Changes no code. |
clean-up | Works through the audit's findings in small, verified batches. |
new-project <description> | Designs a new project before any code is written. |
plan <task> | Writes a plan before touching code: what exists, what's verified, the risk level. Edits nothing. |
review [files] | Reviews the current change against the checklist and agent smells A1-A10. Edits nothing. |
compress [files] | Rewrites a project's instruction files tersely, with a backup and a loss check. |
Then just ask:
Add rate limiting to the login endpoint. Keep the change surgical and tell me what you did not run.
Where does this currency formatter belong? Follow the project's conventions.
Review my diff. Findings first, with smell IDs.
What You Get
- Rules at both scales. Names, functions, errors, tests, one job per unit, and file placement —
plus the Dependency Rule, SOLID, and the component principles, enforced strictly once you declare
layers.
- Packs for your stack. Languages: TypeScript, JavaScript, Python, Java, C#, C++, C, PHP, Go,
Rust, Swift, Kotlin, Ruby, Dart, Scala, R, Objective-C, Shell, PowerShell, CSS, Sass. Frameworks:
React, Next.js, Vue and Nuxt, Angular, Svelte and SvelteKit, Tailwind CSS, Django, Flask, FastAPI,
Express, NestJS, Spring, ASP.NET Core, Laravel, Symfony, Drupal, WordPress, Rails, Gin and Beego,
Strapi, Flutter, SwiftUI and UIKit, Jetpack Compose, Ktor, Unity, TensorFlow, PyTorch. An agent
loads only the packs its project uses.
- A structure map. Every file's functions and classes, its role and purpose, and what is
misplaced, mixed, duplicated, named badly, unreferenced, comment-heavy, or caught in a dependency
cycle — plus a folder holding no one concept, and the moves that would fix it — in one file.
- Memory between sessions.
.clean/ keeps the stack, the declared layers, past decisions, and
cleanup progress, so a new session resumes instead of guessing.
- A small footprint. The always-loaded rules are under 750 tokens, the skill under 1,500, and
each pack under 2,000.
The Structure Map
$ python .claude/skills/clean-code/scripts/map_structure.py --path src/services
Findings : misplaced 1, mixed 0, duplicates 0, name clashes 0, synonyms 1, cycles 0, names 0, families 0, junk drawers 0, flat folders 0, unreferenced 0, comment-heavy 0 (under src/services)