clean-code

Enforce pragmatic coding standards for AI agents across code structure and verification.

41|12|Updated Jan 16, 2026
One-click install
npx skills add https://github.com/nguyenphp/antigravity-marketing --skill clean-code-nguyenphp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/nguyenphp/antigravity-marketing/tree/main/templates/.agent/skills/clean-code
Command: npx skills add https://github.com/nguyenphp/antigravity-marketing --skill clean-code-nguyenphp

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, reducing technical debt and improving development velocity.

Core Features & Use Cases

  • Enforces Core Principles: Adheres to SRP, DRY, KISS, YAGNI, and the Boy Scout Rule.
  • Clear Naming Conventions: Guides variable, function, and constant naming for readability.
  • Function Best Practices: Promotes small, single-purpose functions with minimal arguments.
  • Code Structure Guidelines: Encourages guard clauses, flat structures, and composition.
  • AI Coding Etiquette: Defines how AI agents should interact with users regarding code requests and bug fixes.
  • Pre-Edit Checks: Mandates thinking about dependencies and impact before modifying files.
  • Post-Completion Verification: Requires self-checking for goal completion, code correctness, and error-free execution.
  • Script Output Handling: Standardizes how AI agents report and act upon validation script results.
  • Use Case: When asked to refactor a complex function, the AI will apply these principles to simplify it, rename variables for clarity, and ensure it performs only one task. When fixing a bug, the AI will ensure all dependent files are also updated in the same task.

Quick Start

Apply the clean-code skill to refactor the provided JavaScript function to adhere to the DRY principle.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I enforce coding standards when using AI agents for code generation?

To enforce coding standards with AI agents, apply pragmatic principles like SRP, DRY, KISS, and YAGNI to ensure the generated code is concise, maintainable, and avoids over-engineering. This includes pre-edit impact analysis and post-completion verification.

What is the best way to refactor complex functions to improve code maintainability?

The best way to refactor complex functions for maintainability is applying single responsibility and DRY principles, renaming variables for clarity, using guard clauses, and ensuring the function performs only one task with minimal arguments.

How do I prevent over-engineering and unnecessary complexity in my codebase?

Prevent over-engineering by adhering to KISS and YAGNI principles, which discourage adding unnecessary features. Enforcing small, single-purpose functions and flat code structures also reduces complexity and technical debt.

Can AI coding assistants automatically check for code quality and rule violations?

Yes, AI coding assistants can check code quality by running mandatory self-verification scripts upon task completion. They verify goal completion, code correctness, and error-free execution while standardizing validation script output handling.

Why should I run a pre-edit impact analysis before modifying existing code files?

Running a pre-edit impact analysis before modifying code files ensures you consider all dependencies. It requires the AI agent to check related files and update dependent modules within the same task to prevent broken references.

What naming and function rules should I follow to write concise, effective code?

To write concise, effective code, follow clear naming conventions for variables and constants, and apply function rules that promote small, single-purpose methods with minimal arguments and direct solution-orientation.