clean-code · davila7 — Claude Code skill: coding standards, install
Gives the agent a set of clean-code rules: small functions, intent-revealing names, no obvious comments, no needless abstraction. Useful when you want working code, not a tutorial.
npx claude-code-templates@latest --skill development/clean-codeWhat clean-code does
The skill lays out the rules the agent follows while writing and editing code. It ships as tables: core principles (single responsibility, DRY, KISS, YAGNI), naming conventions, limits on function size and nesting depth. A separate section lists anti-patterns — a comment on every line, a helper for a one-liner, a factory for two objects, a utils.ts holding a single function.
Before touching any file, the skill makes the agent check what imports it and which tests cover it, then edit the dependent files in the same task. When the work is done, there is a self-check: goal met, all files updated, lint and TypeScript pass. Anything that fails gets fixed before the agent reports back.
The skill also documents a set of verification scripts, but those belong to other skills in the same collection. Each agent runs only its own: ux_audit.py for frontend work, api_validator.py for backend. Without those skills installed the scripts are simply not there, and clean-code runs fine on its own. Tool access is limited to Read, Write and Edit.
What it helps with
- stop the agent from writing hundred-line functions
- strip the obvious comments the agent adds to every line
- rename variables like
nanddatainto something readable - check what imports a file before editing it
- remove abstractions like a factory built for two objects
Example prompts for the agent
- add a password change endpoint, follow clean-code
- fix the duplicate email bug, skip the explanation
- refactor
UserService.tsper clean-code and update the dependent files
How to install clean-code
1claude-code-templates
npx claude-code-templates@latest --skill development/clean-code2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill clean-code -a claude-code3Manually: put the files in place
~/.claude/skills/clean-code/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/clean-code/
Manually: put the files in place
.agents/skills/clean-code/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/clean-code/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates clean-code2Manually: put the files in place
.github/skills/clean-code/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/development/clean-codeManually: put the files in place
.devin/skills/clean-code/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about clean-code
How do I install clean-code in Claude?
With the templates CLI: npx claude-code-templates@latest --skill development/clean-code. Or via the skills CLI: npx skills add davila7/claude-code-templates --skill clean-code -a claude-code. The file lands at ~/.claude/skills/clean-code/SKILL.md.
What does the clean-code skill do?
It sets the coding rules the agent follows: one responsibility per function, clear names, guard clauses instead of deep nesting, no comments that restate the code. It also adds a self-check before the agent calls a task complete.
Does clean-code need Python or the other skills?
No. The verification scripts such as ux_audit.py and api_validator.py belong to other skills in the collection, and the matching agent is the one that runs them.
Similar skills
Everything for Code review and refactoring →clean-code by other authors comes first.