skills/clean-code/SKILL.md
Analyze and fix code using Robert C. Martin's Clean Code principles — naming, functions, SOLID, DRY, code smells. Usable in review mode (audit) or guide mode (during code writing).
npx skillsauth add devattom/.claude clean-codeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<prime_directive> READABILITY AND SIMPLICITY ALWAYS WIN.
Clean Code rules are tools, not dogma. If strictly applying a rule makes the code harder to understand, less simple, or more complex overall — DO NOT apply it.
Before applying any rule, ask: "Does this change make the code easier to understand for the next developer?" If the answer is NO or UNCERTAIN → skip the change, explain why.
Examples where NOT to apply Clean Code blindly:
url, id, i) to a verbose name → noise, not clarityThe goal is a codebase that any developer can read fluently. Rules serve that goal — not the other way around. </prime_directive>
<quick_start>
Audit existing code:
/clean-code src/features/auth
/clean-code src/services/user.service.ts
Auto mode (no confirmation):
/clean-code -a src/features/auth
Report only (no fixes applied):
/clean-code -r src/features/auth
Guide mode (during code writing):
/clean-code --guide
→ Loads principles into context to guide the current writing session.
</quick_start>
<parameters>| Flag | Description |
|------|-------------|
| -a | Auto mode: apply all fixes without confirmation |
| -e | Economy mode: no subagents, direct tools only |
| -r | Report only: produce the report without applying fixes |
| --guide | Guide mode: load principles to guide code writing |
Analyze existing code → identify violations → propose/apply fixes.
Workflow: step-01-analyze.md → step-02-fix.md
--guide)Load Clean Code principles into context to guide a code writing session. No multi-step workflow — act as an active reference while the agent writes.
In guide mode:
references/clean-code-principles.md<state_variables>
| Variable | Type | Description |
|----------|------|-------------|
| {target} | string | File, feature or folder to analyze |
| {auto_mode} | boolean | -a: apply without confirmation |
| {economy_mode} | boolean | -e: no subagents |
| {report_only} | boolean | -r: report only, no fixes |
| {guide_mode} | boolean | --guide: writing mode |
</state_variables>
<reference_files>
| File | When to load |
|------|--------------|
| references/clean-code-principles.md | Always — before any analysis or writing |
</reference_files>
<entry_point>
If --guide:
→ Load references/clean-code-principles.md + confirm guide mode. Done.
Otherwise:
→ Load steps/step-01-analyze.md
</entry_point>
<step_files>
| Step | File | Purpose |
|------|------|---------|
| 01 | steps/step-01-analyze.md | Read code, identify violations |
| 02 | steps/step-02-fix.md | Apply corrections |
</step_files>
<when_to_use>
Trigger this skill when:
/clean-code --guide before writing or review after/clean-code src/features/xxx/clean-code -a src/modulePrinciples covered:
</when_to_use>
<execution_rules>
references/clean-code-principles.md before analyzing or fixing-a)<success_criteria>
development
Use when you want to audit a project wiki for quality issues — stale version claims, contradictions between pages, orphan pages, broken wiki links, missing cross-references, or misalignment between wiki content and the actual codebase state.
development
Systematic error debugging with analysis, solution discovery, and verification
development
Structured adversarial debate between AI councillors using Agent Teams to evaluate ideas, plans, or decisions. ALWAYS use when the user says "council", "debate this", "evaluate this idea", "challenge my plan", "stress-test", "devil's advocate", "multiple perspectives", "évaluer cette idée", "débattre", "challenger mon plan", "tester cette décision", or when the user wants rigorous multi-perspective analysis of a proposal, architecture decision, or strategic choice. Each councillor (visionary, critic, pragmatist, innovator, ethicist, domain expert) represents a distinct perspective and they challenge each other through cross-examination and peer exchange, producing a nuanced verdict (PROCEED / PROCEED WITH CONDITIONS / RECONSIDER / DO NOT PROCEED). Do NOT use for divergent brainstorming or idea generation — use workflow-brainstorm instead.
testing
Automated CI/CD pipeline fixer - watches CI, fixes errors locally, commits, and loops until green. Use when CI is failing and you want to automatically fix and verify changes.