clean-code

Enforce pragmatic clean code standards for AI agent coding tasks.

1|Updated Dec 21, 2024
One-click install
npx skills add https://github.com/SergeiGolos/wod-wiki --skill clean-code-sergeigolos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/SergeiGolos/wod-wiki/tree/main/.agent/skills/clean-code
Command: npx skills add https://github.com/SergeiGolos/wod-wiki --skill clean-code-sergeigolos

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill enforces pragmatic, clean code principles to ensure code is maintainable, efficient, and easy to understand, reducing technical debt and improving development velocity.

Core Features & Use Cases

  • Coding Standards Enforcement: Adheres to principles like SRP, DRY, KISS, YAGNI.
  • Best Practices: Guides on naming conventions, function design, and code structure.
  • AI Coding Style: Directs AI agents on how to interact with users for coding tasks (write directly, fix bugs, ask for clarification).
  • Self-Check & Validation: Mandates rigorous self-checks and script execution before task completion.
  • Use Case: When an AI agent is tasked with refactoring a complex module, it uses this Skill to ensure the refactored code is simple, well-named, and adheres to the Single Responsibility Principle, while also running automated linting and type coverage checks.

Quick Start

Apply the clean-code skill to refactor the provided UserService.ts file, ensuring it adheres to SRP and has clear naming conventions.

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 using AI for refactoring?

To enforce clean code standards during AI refactoring, apply pragmatic principles focusing on conciseness, directness, and avoiding over-engineering. This ensures refactored modules maintain readability and adhere to the Single Responsibility Principle while running automated linting checks.

What coding standards should I apply to reduce technical debt?

To reduce technical debt, apply coding standards like SRP, DRY, KISS, and YAGNI. These principles guide naming conventions, function design, and code structure to improve maintainability, readability, and overall development velocity.

How do I prevent over-engineering in AI-generated code?

Prevent over-engineering in AI-generated code by enforcing pragmatic principles that mandate directness and conciseness. This approach guides AI agents to write simple, well-named functions and avoid unnecessary complexity during module refactoring.

Does this approach work for validating code quality and type coverage?

Yes, this approach works for validating code quality by mandating rigorous self-checks and script executions before task completion. It ensures AI agents run automated linting and type coverage checks to validate maintainability and efficiency.

What is the best way to structure AI coding interactions for bug fixing?

The best way to structure AI coding interactions for bug fixing is to direct agents to write code directly, fix bugs immediately, and ask for clarification only when needed. This maximizes developer efficiency and productivity.

When should I use SRP and DRY principles for code maintainability?

Use SRP and DRY principles for code maintainability when refactoring complex modules to ensure the resulting code is simple, well-named, and structurally sound. This reduces technical debt and improves long-term development velocity.