
Clean code
Guides agents to write, review and refactor code with SOLID and clean architecture
Clean code is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- Python
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 26
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Clean code
This skill gives a coding agent a structured method for changing code in any language: it loads project context first, reads nearby code and framework conventions, places new files by their role, and then makes surgical edits with a verification step. It covers SOLID principles, design patterns, and the dependency rule, and it sets boundaries that are enforced only when a project declares its layers.
The workflow is organized around a set of commands such as init, audit, clean-up, new-project, plan and review, each pointing to its own reference file. Optional Python scripts can detect the stack, scan the repository, map folder structure and check layer boundaries, writing their output only to a local .clean/ folder and never touching the network. Their results are treated as evidence rather than verdicts.
The skill expects a project to be accessible from the agent's working directory and a Python 3.8+ interpreter if the optional scripts are used. Nothing else is required, since the guidance works with no tooling at all.
When your agent uses it
Use when writing, editing, reviewing, testing, planning, or refactoring code in any language or framework; creating files or deciding where code and folders belong; designing or changing module boundaries, layers, and dependencies; starting a new project; auditing or cleaning up an existing one; or compressing agent instruction files. Covers SOLID, design patterns, and the dependency rule.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs Python scripts(see the files on GitHub)
- No network calls found in its scripts(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 101 files (860 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the clean-code-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add btseee/clean-code-skills
/plugin install clean-code-skills@clean-code-skillsOr copy only this skill to ~/.claude/skills/clean-code:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/btseee/clean-code-skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/clean-code &&
cp -R "$tmp/skills/clean-code" ~/.claude/skills/clean-code &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/clean-code inside it instead.
Copy the skill folder to ~/.agents/skills/clean-code to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/btseee/clean-code-skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/clean-code &&
cp -R "$tmp/skills/clean-code" ~/.agents/skills/clean-code &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/clean-code inside it instead.
Copy the skill folder to ~/.cursor/skills/clean-code to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/btseee/clean-code-skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/clean-code &&
cp -R "$tmp/skills/clean-code" ~/.cursor/skills/clean-code &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/clean-code inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/btseee/clean-code-skills.git --path skills/clean-codeOr copy the folder to ~/.gemini/skills/clean-code yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/clean-code:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/btseee/clean-code-skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/clean-code &&
cp -R "$tmp/skills/clean-code" ~/.copilot/skills/clean-code &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/clean-code inside it instead.
Get the folder:
git clone --depth 1 https://github.com/btseee/clean-code-skills.gitThen copy clean-code-skills/skills/clean-code into your agent's skills folder as clean-code. Agents that support SKILL.md read one folder per skill.
What it does
- Context loading gate
- Reads stack details, recorded decisions and project instructions before any non-trivial edit.
- Dependency rule enforcement
- Keeps source dependencies pointing inward when a project declares its architectural layers.
- Review checklist
- Provides a diff review checklist and risk levels for judging the quality of a change.
- Project audit and cleanup
- Supports auditing an existing codebase and running a tracked refactoring campaign on request.
- Optional boundary scripts
- Includes Python helpers that map folder structure and check imports against declared layers.
- Compression of agent instructions
- Shortens agent instruction files while leaving managed blocks untouched.
Good for
- Refactor a messy module into smaller units with clear responsibilities
- Review a pull request for layering and naming problems
- Audit an existing project and propose a cleanup plan
- Plan a new feature before writing any code
- Set up a new project with a sensible folder structure
- Compress a long AGENTS.md or CLAUDE.md file
Clean code FAQ
Does Clean code need any tools installed?
No, it works with no tooling. The optional scripts need Python 3.8 or newer.
Does Clean code write files into my project?
Only the init, audit and new-project commands create a .clean/ folder, and the optional scripts write only to .clean/.
Does Clean code make network requests?
The scripts are stated never to use the network.
Which clients can use Clean code?
It is published as a Claude Code plugin marketplace entry and follows the shared SKILL.md format.
How do I install Clean code in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/clean-code to use it in all your projects, or to .claude/skills/clean-code in one project. Or install the clean-code-skills plugin, which includes it: /plugin marketplace add btseee/clean-code-skills, then /plugin install clean-code-skills@clean-code-skills.
Does Clean code run scripts?
Yes. It runs Python scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Clean code?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Clean code?
The closest alternatives to Clean code are Code review and quality, Code simplification, Review and refactor, Code simplifier and Code simplification.
Where this comes from
- Description: from the skill's own SKILL.md.




