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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill enforces pragmatic coding standards for AI, ensuring code is concise, direct, and avoids unnecessary complexity or comments, leading to more maintainable and efficient AI-generated code.

Core Features & Use Cases

  • Pragmatic Principles: Adheres to SRP, DRY, KISS, YAGNI, and the Scout Rule.
  • Clear Naming Conventions: Guides on naming variables, functions, and constants for better readability.
  • Function Best Practices: Defines rules for function size, single responsibility, and argument limits.
  • Code Structure: Promotes guard clauses, shallow nesting, and composition.
  • AI Coding Style: Provides specific directives for how AI should handle user requests, bugs, and unclear requirements.
  • Anti-Pattern Avoidance: Lists common pitfalls and their correct alternatives.
  • Pre-Edit Verification: Mandates a thinking process before modifying any file to prevent breaking changes.
  • Final Verification: Ensures all checks (objective, functionality, errors, edge cases) are passed before task completion.
  • Script Execution & Output Handling: Defines how AI should run validation scripts and report their results.

Quick Start

Use the clean-code skill to refactor the provided UserService.ts file according to pragmatic coding standards.

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

To enforce clean code standards in AI-generated code, apply pragmatic coding principles like SRP, DRY, KISS, and YAGNI. This ensures the generated code remains concise, direct, and avoids unnecessary complexity or comments for better maintainability.

What is the best way to refactor code to avoid over-engineering?

The best way to refactor code to avoid over-engineering is to follow pragmatic principles like KISS and YAGNI. This approach focuses on directness, clear naming conventions, and guard clauses to reduce unnecessary complexity and improve code structure.

How do I verify code quality before completing a refactoring task?

To verify code quality before completing a refactoring task, run pre-edit verification checks and execute validation scripts. This process ensures the objective is met, functionality is intact, and edge cases or errors are resolved before finalizing.

Does this clean code skill apply to specific programming languages or frameworks?

This clean code skill applies across programming languages by enforcing universal pragmatic coding standards rather than framework-specific rules. It guides AI agents on general function design, naming conventions, and code structure to ensure quality.

Why does AI-generated code often include unnecessary comments and complexity?

AI-generated code often includes unnecessary comments and complexity due to a lack of enforced pragmatic coding standards. By applying directives for conciseness, directness, and anti-pattern avoidance, AI agents can produce more maintainable and efficient code.

What are the limitations of using automated coding standards for AI code generation?

A limitation of using automated coding standards is that the AI must still perform pre-edit verification to prevent breaking changes. While standards guide naming and structure, manual final checks and script execution are required to ensure true functionality.