One-click install
npx skills add https://github.com/danilomartinelli/cursor-kit --skill clean-code-danilomartinelli
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/danilomartinelli/cursor-kit/tree/main/skills/clean-code
Command: npx skills add https://github.com/danilomartinelli/cursor-kit --skill clean-code-danilomartinelli

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 concise, direct, and avoids over-engineering or unnecessary comments, leading to more maintainable and understandable software.

Core Features & Use Cases

  • Enforces SOLID principles: Promotes Single Responsibility, Don't Repeat Yourself, Keep It Simple, You Aren't Gonna Need It, and the Boy Scout Rule.
  • Standardizes Naming Conventions: Ensures clear and intent-revealing names for variables, functions, and constants.
  • Optimizes Function Design: Guides the creation of small, focused functions with minimal arguments and no side effects.
  • Promotes Clean Code Structure: Encourages guard clauses, flat code, and composition over deep nesting.
  • AI Coding Style Guidelines: Directs AI agents on how to respond to user requests, fix bugs, and handle unclear requirements.
  • Pre-computation Checks: Mandates thinking about dependencies and potential impacts before editing files.
  • Post-completion Verification: Requires self-checking for goal completion, code correctness, and error-free execution.
  • Script Execution & Reporting: Defines how validation scripts should be run, their output interpreted, and user confirmation sought for fixes.

Quick Start

Follow the clean code principles to refactor the provided user authentication module for better readability and maintainability.

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 when refactoring AI-generated code?

To enforce clean code standards when refactoring AI-generated code, apply pragmatic principles like SRP, DRY, and KISS to ensure conciseness and avoid over-engineering. This skill guides AI agents to perform pre-editing checks and post-completion verification for maintainable software.

What are the best coding standards for improving maintainability and developer productivity?

The best coding standards for maintainability enforce SOLID principles, standardize naming conventions, and optimize function design. This ensures code is concise, direct, and avoids unnecessary comments, leading to more understandable software and higher developer productivity.

Can this clean code skill validate function design and naming conventions automatically?

Yes, this clean code skill can validate function design and naming conventions automatically through included validation scripts. It defines how to run these scripts, interpret their output for adherence to guard clauses and minimal arguments, and seek user confirmation for fixes.

Does this refactoring approach work with existing modules that have deep nesting and side effects?

Yes, this refactoring approach works with existing modules by promoting clean code structure through guard clauses, flat code, and composition over deep nesting. It guides the creation of small, focused functions with no side effects to improve readability.

How do I handle unclear requirements when an AI agent is writing code?

To handle unclear requirements when an AI agent is writing code, this skill provides specific AI coding style guidelines directing agents on how to respond to user requests and fix bugs. It mandates self-checking for goal completion and error-free execution.