clean-code

Featured

Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments

Code & Development 27,681 stars 2854 forks Updated today MIT

Install

View on GitHub

Quality Score: 99/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Clean Code - Pragmatic AI Coding Standards > **CRITICAL SKILL** - Be **concise, direct, and solution-focused**. --- ## Core Principles | Principle | Rule | |-----------|------| | **SRP** | Single Responsibility - each function/class does ONE thing | | **DRY** | Don't Repeat Yourself - extract duplicates, reuse | | **KISS** | Keep It Simple - simplest solution that works | | **YAGNI** | You Aren't Gonna Need It - don't build unused features | | **Boy Scout** | Leave code cleaner than you found it | --- ## Naming Rules | Element | Convention | |---------|------------| | **Variables** | Reveal intent: `userCount` not `n` | | **Functions** | Verb + noun: `getUserById()` not `user()` | | **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` | | **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` | > **Rule:** If you need a comment to explain a name, rename it. --- ## Function Rules | Rule | Description | |------|-------------| | **Small** | Max 20 lines, ideally 5-10 | | **One Thing** | Does one thing, does it well | | **One Level** | One level of abstraction per function | | **Few Args** | Max 3 arguments, prefer 0-2 | | **No Side Effects** | Don't mutate inputs unexpectedly | --- ## Code Structure | Pattern | Apply | |---------|-------| | **Guard Clauses** | Early returns for edge cases | | **Flat > Nested** | Avoid deep nesting (max 2 levels) | | **Composition** | Small functions composed together | | **Colocation** | Keep related code close | ---...

Details

Author
davila7
Repository
davila7/claude-code-templates
Created
11 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

Code & Development Listed

principle-clean-code

Clean code, DRY, KISS, YAGNI, function length, naming, abstraction level, error handling, function argument count, Command-Query Separation, Boy Scout Rule, intent-revealing naming. Auto-load when writing functions, naming variables, reviewing code clarity, discussing comments, or debating whether to abstract.

2 Updated today
lugassawan
Code & Development Listed

clean-code

Clean Code principles (DRY, KISS, YAGNI), naming conventions, function design, and refactoring. Use when user says "clean this code", "refactor", "improve readability", or when reviewing code quality.

605 Updated 3 months ago
decebals
Code & Development Solid

clean-code

Write readable, maintainable code through disciplined naming, small functions, and clean error handling. Use when the user mentions "code review", "naming conventions", "function too long", "code smells", "readable code", "boy scout rule", "single responsibility", or "unit test quality". Also trigger when reviewing pull requests for readability, refactoring messy functions, debating comment styles, or improving error handling patterns. Covers SRP, comment discipline, formatting, and unit testing. For refactoring techniques, see refactoring-patterns. For architecture, see clean-architecture.

1,160 Updated 2 weeks ago
wondelai
Code & Development Solid

code-quality-principles

KISS, YAGNI, and SOLID code quality principles for clean code, reducing complexity and preventing over-engineering.

294 Updated today
athola
Code & Development Listed

devpilot-clean-code-principles

Use when writing, reviewing, or refactoring code and judging quality at the level of naming, function size, comments, error handling, class design, test quality, or code smells. Language-agnostic; defer to language-specific style skills (e.g. devpilot-google-go-style) when they conflict.

4 Updated yesterday
SiyuQian