clean-code

Enforces pragmatic coding standards for concise, direct, and maintainable code.

1|Updated May 10, 2026
One-click install
npx skills add https://github.com/Tgoldi/claude-skills --skill clean-code-tgoldi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/Tgoldi/claude-skills/tree/main/clean-code
Command: npx skills add https://github.com/Tgoldi/claude-skills --skill clean-code-tgoldi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI-generated code often suffers from over-engineering, excessive comments, deep nesting, and bloated functions. This Skill enforces pragmatic coding standards so the AI writes concise, direct, solution-focused code without unnecessary abstractions or tutorials. ## Core Features & Use Cases - Coding Standards Enforcement: Applies SRP, DRY, KISS, YAGNI, and Boy Scout principles with concrete naming, function size, and structure rules. - Anti-Pattern Prevention: Blocks common AI mistakes like commenting every line, creating one-function utils files, and building factories for two objects. - Dependency-Aware Editing: Requires checking imports and dependents before editing any file, plus a mandatory self-check before marking tasks complete. - Use Case: When asking the AI to add a feature or fix a bug, it writes the code directly, updates all dependent files in the same task, and verifies lint and type checks pass before finishing. ## Quick Start Ask the AI to implement a feature or fix a bug and it will write clean, minimal code following these standards.

Frequently Asked Questions about clean-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop AI from over-engineering code?

Apply explicit constraints like YAGNI and KISS principles that forbid unused abstractions, factories for few objects, and single-function utility files. This Skill instructs the AI to write the simplest working solution and inline small helpers instead of creating extra files.

What coding standards should AI-generated code follow?

Core standards include SRP, DRY, KISS, YAGNI, and the Boy Scout rule. Functions should stay under 20 lines with at most 3 arguments, use intention-revealing names, avoid deep nesting beyond 2 levels, and rely on guard clauses instead of comments.

How to prevent AI from adding unnecessary code comments?

Instruct the AI that code should self-document through clear naming, and that any comment explaining a name means the name should be changed. Obvious line-by-line comments and narrative preambles like "First we import..." are explicitly banned.

Does this coding style work with any programming language?

Yes, the principles are language-agnostic since they cover naming conventions, function size, structure, and abstraction levels rather than syntax. Examples reference TypeScript-style files, but the rules apply to any codebase.

Why does AI code editing break other files?

Edits break dependents when the AI changes a file without checking what imports it. This Skill mandates checking importers, imported interfaces, and test coverage before editing, and updating all dependent files in the same task.