clean-code
Skill229 starsChanged 10 months agoMITView on GitHub
The Foundation Skill. LLM Firewall + 2025 Security + Cross-Skill Coordination. Use for ALL code output - prevents hallucinations, enforces security, ensures quality.
- Installs packages
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
- sbluemin/fleet-harnesstheir own version, first seen Oct 4, 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
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
- techygarg/lattice★ 197same name
- ratacat/claude-skills★ 56same name
- DGouron/review-flow★ 44same name
- kumaran-is/claude-code-onboarding★ 36same name
- VoDaiLocz/kilo-kit-mcp★ 27same 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 repository12 other files it gives its agents.
- maestroSkill
- backend-designSkill
- brainstormingSkill
- browser-extensionSkill
- debug-masterySkill
- frontend-designSkill
- git-worktreesSkill
- optimization-masterySkill
- planning-masterySkill
- ralph-wiggumSkill
- tdd-masterySkill
- verification-masterySkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 7 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 59 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Check npm audit / pip-audit: before adding new dependencies
- Distinctive: line 27
Never import AI "wrapper" libraries without verification
- Distinctive: line 62
Every function must be runnable
- Distinctive: line 63
If too complex, break into smaller complete functions
- Distinctive: line 100
If latest has Critical CVE → Rollback to last secure version
- Distinctive: line 114
Validate AI outputs: - Never trust raw LLM responses
- Distinctive: line 126
Before committing ANY code:
“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
<domain_overview>
🛡️ CLEAN CODE: THE FOUNDATION
Philosophy: This skill is the FOUNDATION - it applies to ALL other skills. Every piece of code must pass these gates. ALGORITHMIC ELEGANCE MANDATE (CRITICAL): Never prioritize "clever" code over readable, intent-revealing engineering. AI-generated code often fails by introducing unnecessary abstractions or using vague naming conventions that obscure logic. You MUST use intent-revealing names for every variable and function. Any implementation that increases cognitive complexity without a proportional gain in performance or scalability must be rejected. Avoid "Hype-Driven Development"—proven patterns trump trending but unstable frameworks. </domain_overview> <iron_laws>
🚨 IRON LAWS
1. NO HALLUCINATED PACKAGES - Verify before import
2. NO LAZY PLACEHOLDERS - Code must be runnable
3. NO SECURITY SHORTCUTS - Production-ready defaults
4. NO OVER-ENGINEERING - Simplest solution first</iron_laws> <security_protocols>
📦 PROTOCOL 1: SUPPLY CHAIN SECURITY
LLMs hallucinate packages that sound real but don't exist.
- Verify before import -
npm searchorpip showfor unfamiliar packages - Prefer battle-tested - lodash, date-fns, zod over obscure alternatives
- Check npm audit / pip-audit before adding new dependencies
- Pin versions in production - no
^or~for critical deps 2025 AI Package Risks:
- Never import AI "wrapper" libraries without verification
- LLM SDKs: Use official only (openai, anthropic, google-generativeai)
- Vector DBs: Stick to established (pinecone, weaviate, chromadb)
🔐 PROTOCOL 2: SECURITY-FIRST DEFAULTS
Frontend Security:
| Forbidden | Required |
dangerouslySetInnerHTML | DOMPurify sanitization |
| Inline event handlers | Event delegation |
eval(), new Function() | Static code only |
| Storing tokens in localStorage | httpOnly cookies |
| Backend Security: | |
| Forbidden | Required |
| ----------- | ---------- |
CORS: * | Explicit origin whitelist |
| Raw SQL strings | Parameterized queries |
chmod 777 | Principle of least privilege |
| Hardcoded secrets | Environment variables + validation |
| API Security (2025): |
- Rate limiting on ALL public endpoints
- Input validation at the gate (Zod/Pydantic)
- Output sanitization for AI-generated content
- PASETO > JWT for new projects </security_protocols> <modularity_and_placeholder_rules>
🏗️ PROTOCOL 3: NO LAZY PLACEHOLDERS
Forbidden Patterns:
// ❌ BANNED
// TODO: Implement this
// ... logic goes here
function placeholder() { }
throw new Error('Not implemented');Required:
- Every function must be runnable
- If too complex, break into smaller complete functions
- "Hurry" is not an excuse - write minimal viable implementation
📐 PROTOCOL 4: MODULARITY & STRUCTURE
The 50/300 Rule:
- Functions > 50 lines → Break down
- Files > 300 lines → Split into modules SOLID Principles: | Principle | Quick Check | |-----------|-------------| | Single Responsibility | Does this do ONE thing? | | Open/Closed | Can I extend without modifying? | | Liskov Substitution | Can subtypes replace parent? | | Interface Segregation | Are interfaces minimal? | | Dependency Inversion | Do I depend on abstractions? | </modularity_and_placeholder_rules> <complexity_and_dependencies>
🎯 PROTOCOL 5: COMPLEXITY CAP
Native First:
// ❌ Don't install is-odd
npm install is-odd
// ✅ Use native
const isOdd = n => n % 2 !== 0;Anti-Patterns:
- AbstractFactoryBuilderManager for simple functions
- 10 layers of abstraction for CRUD
- "Future-proofing" for requirements that don't exist YAGNI: You Aren't Gonna Need It. Build for today's requirements.
🔄 PROTOCOL 6: DEPENDENCY HYGIENE
Freshness Check:
npm outdated # Check for updates
npm audit # Check for vulnerabilitiesThe CVE Brake:
- "Latest" is not always "Safest"
- If latest has Critical CVE → Rollback to last secure version
- Security > New Features 2025 Recommended: | Category | Recommended | |----------|-------------| | Validation | zod, valibot | | HTTP | ky, ofetch | | State | zustand, jotai | | ORM | drizzle, prisma | | Auth | lucia, better-auth | </complexity_and_dependencies> <ai_era_protocols>
🤖 PROTOCOL 7: AI-ERA CONSIDERATIONS
When Building AI Features:
- Validate AI outputs - Never trust raw LLM responses
- Rate limit AI calls - Prevent cost explosions
- Sanitize before display - AI can generate malicious content
- Log AI interactions - For debugging and compliance When AI is Writing Code:
- Verify imports exist - AI hallucinates packages
- Check types are correct - AI guesses at APIs
- Test edge cases - AI misses boundary conditions
- Review security - AI takes shortcuts </ai_era_protocols> <audit_and_reference>
✅ QUICK AUDIT CHECKLIST
Before committing ANY code:
- No hallucinated imports (verified packages exist)
- No security shortcuts (CORS, eval, hardcoded secrets)
- No lazy placeholders (// TODO, empty functions)
- Functions < 50 lines, files < 300 lines
- Dependencies audited (
npm auditclean) - Types are strict (no
any)
🔗 CROSS-SKILL INTEGRATION
| When Using... | Clean Code Adds... |
@frontend-design | Security defaults, no eval, CSP awareness |
@backend-design | Input validation, no raw SQL, Zero Trust |
@tdd-mastery | No placeholders (tests enforce completeness) |
@planning-mastery | Modularity guides task breakdown |
@brainstorming | SOLID/YAGNI guide architecture decisions |
@debug-mastery | Logging standards, no silent failures |
| </audit_and_reference> |
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.

