clean-code

Enforce pragmatic coding standards for AI-generated code.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/afmdev/portfolio --skill clean-code-afmdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/afmdev/portfolio/tree/main/.claude/skills/clean-code
Command: npx skills add https://github.com/afmdev/portfolio --skill clean-code-afmdev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enforces pragmatic coding standards to ensure code is maintainable, efficient, and easy to understand, preventing over-engineering and unnecessary complexity.

Core Features & Use Cases

  • Enforces SOLID principles: Promotes Single Responsibility, Don't Repeat Yourself, and Keep It Simple.
  • Improves Naming Conventions: Guides on clear and intent-revealing names for variables, functions, and constants.
  • Optimizes Function Design: Encourages small, focused functions with minimal arguments and side effects.
  • Use Case: When refactoring a legacy system, apply these standards to make the codebase more robust and easier for new developers to onboard.

Quick Start

Apply the clean-code skill to refactor the provided Python function to be more concise and readable.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I enforce clean code standards for AI-generated code?

To enforce clean code standards for AI-generated code, apply pragmatic coding rules focusing on conciseness, directness, and solution-orientation. This ensures the output adheres to principles like SRP, DRY, KISS, and YAGNI, preventing unnecessary complexity and over-engineering.

What is the best way to refactor a legacy system for maintainability?

The best way to refactor a legacy system for maintainability is by applying coding standards that enforce SOLID principles, clear naming conventions, and optimized function design. This makes the codebase robust, efficient, and easier for new developers to onboard.

Can I use these coding standards to optimize function design and reduce side effects?

Yes, you can use these coding standards to optimize function design by encouraging small, focused functions with minimal arguments and side effects. This approach directly improves code maintainability and ensures the logic remains easy to understand.

Does this approach guide AI to write concise code or provide tutorials?

This approach guides AI to write concise code directly, fix bugs, and ask clarifying questions instead of providing explanations or tutorials. It enforces strict rules for naming, function design, and code structure to maximize developer productivity.

Why does AI-generated code often suffer from over-engineering?

AI-generated code often suffers from over-engineering because it lacks enforced pragmatic coding standards. By applying strict rules for code structure and mandatory self-checks, the AI is guided to write direct, solution-oriented code that prevents unnecessary complexity.

What are the limitations of using automated coding standards for refactoring?

When using automated coding standards for refactoring, limitations include the need for clarifying questions when intent is ambiguous. The AI focuses on direct solutions and bug fixes rather than explanations, requiring clear initial instructions for optimal results.