clean-code
Pragmatic AI-assisted coding standards focused on clean code, simplicity, and maintainability. Enforces best practices like SRP, DRY, and KISS to prevent over-engineering.
Introduction
The Clean Code skill provides a framework for AI agents to write code that is concise, direct, and solution-focused. It is designed for software developers and AI-powered coding assistants who prioritize long-term maintainability and readability over rapid, messy development. By applying strict coding standards, this skill minimizes cognitive load, ensures codebases remain scalable, and reduces the frequency of technical debt. It guides the agent through systematic naming conventions, modular function design, and modern architectural patterns.
-
Encourages core principles including Single Responsibility Principle (SRP), Don't Repeat Yourself (DRY), Keep It Simple (KISS), and YAGNI (You Aren't Gonna Need It).
-
Mandates clean naming conventions for variables, functions, and constants to ensure code is self-documenting.
-
Limits function complexity by enforcing small size constraints, minimal argument counts, and avoidance of side effects.
-
Promotes the use of guard clauses and flat structures over deeply nested logic to improve readability and testability.
-
Implements rigorous pre-editing checks, requiring the agent to analyze dependencies, impacts, and test coverage before applying changes.
-
Best suited for projects using TypeScript, JavaScript, and other modern languages where maintaining architectural integrity is paramount.
-
Serves as a primary directive for agents to fix bugs without unnecessary explanation, keeping interaction concise and direct.
-
Integrates with verification scripts such as linting, type coverage, and specialized test runners to validate code quality automatically.
-
Constraints include a maximum nesting level of two and a soft limit of 20 lines per function to prevent 'God functions'.
-
Users should expect direct, functional code changes that prioritize clarity and minimal implementation overhead.
Repository Stats
- Stars
- 7,262
- Forks
- 1,432
- Open Issues
- 36
- Language
- TypeScript
- Default Branch
- main
- Sync Status
- Idle
- Last Synced
- Apr 30, 2026, 04:06 PM