clean-code

Apply clean-code principles to naming, structure, and testing.

1|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/dzackgarza/ai --skill clean-code-dzackgarza
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/dzackgarza/ai/tree/main/opencode/skills/clean-code
Command: npx skills add https://github.com/dzackgarza/ai --skill clean-code-dzackgarza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Clean code makes software easier to read, understand, and modify. It reduces bugs by clarifying intent, improving naming, structure, and testing practices.

Core Features & Use Cases

  • Expressive naming and intent-revealing identifiers that communicate purpose.
  • Small, cohesive functions and well-scoped classes aligned with the Single Responsibility Principle.
  • Clear error handling, minimal side effects, and guidance for safe refactoring and testing.

Quick Start

Refactor a small function to improve naming and reduce complexity, then add a focused unit test following the chapter guidance.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I apply clean code principles to refactor a function for better readability?

To apply clean code principles during refactoring, improve naming to be intent-revealing, reduce function complexity by keeping functions small and cohesive, and add focused unit tests. This clarifies purpose and reduces bugs by making code easier to understand and modify.

What is the Single Responsibility Principle and how does it improve code maintainability?

The Single Responsibility Principle (SRP) ensures classes and functions have one reason to change, keeping them small and well-scoped. Applying SRP during refactoring improves code maintainability by limiting side effects and clarifying structural intent.

How do I write meaningful names for variables and functions in software projects?

Writing meaningful names involves using expressive, intent-revealing identifiers that communicate purpose. This clean code practice makes software easier to read and modify by clarifying intent, which is especially useful during code reviews and onboarding.

Can I use clean code guidelines for projects of any size and during code reviews?

Yes, clean code guidelines are applicable to software projects of any size where code clarity matters. They enforce meaningful names, limited side effects, and domain-driven test coverage, making them highly effective during code reviews and onboarding.

What's the best way to structure unit tests using domain-driven naming conventions?

The best way to structure unit tests is by using clear, domain-driven test coverage that aligns with small functions and minimal side effects. This approach ensures tests are focused and maintainable, directly reflecting the business logic and intent-revealing names.

When should I not use aggressive refactoring to enforce clean code standards?

Aggressive refactoring to enforce clean code standards should be approached cautiously when it risks expanding side effects or breaking existing domain-driven test coverage. Limit changes to small, cohesive function modifications to ensure safe, maintainable evolution.