clean-code

Enforce clean-code discipline during writing, refactoring, and review.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you write, refactor, and review production code so it is readable, maintainable, and easier to change without introducing regressions.

Core Features & Use Cases

  • Naming and Structure: Enforces intent-revealing names, small functions, and one-level-at-a-time abstraction.
  • Refactoring Discipline: Encourages a two-pass workflow where code is first made to work, then cleaned and simplified.
  • Testing and Safety: Promotes test-first thinking, strong coverage, and fearless refactoring backed by reliable automated tests.
  • Code Review and Cleanup: Applies clean-code rules to comments, duplication, error handling, side effects, and architectural boundaries.
  • Use Case: A developer finishes a feature, then uses this Skill to remove duplication, split large functions, improve names, and ensure the codebase is cleaner than before.

Quick Start

Ask for a clean-code review of the changed files and rewrite the implementation to follow naming, size, testing, and refactoring best practices.

Frequently Asked Questions about clean-code

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

FAQPage Schema
How do I refactor code to improve readability and maintainability?

To improve code maintainability, refactoring enforces clean-code discipline by applying intent-revealing names, splitting large functions, and removing duplication. This preserves existing behavior while reducing complexity and technical debt.

What is the best way to review code for clean architecture and naming?

The best way to review code for clean architecture is to apply clean-code rules to naming, comments, side effects, and architectural boundaries. This ensures the implementation remains test-backed, readable, and free of unnecessary duplication.

How do you handle error handling and side effects during code review?

Handling error handling and side effects during code review involves checking architectural boundaries and enforcing clean-code discipline. This process isolates side effects and ensures error handling logic remains clean, readable, and maintainable.

Can I refactor production code safely without breaking existing behavior?

You can safely refactor production code by using a test-first approach with strong coverage. Reliable automated tests back fearless refactoring, ensuring you preserve behavior while reducing complexity and removing duplication.

What does a two-pass refactoring workflow involve for cleaning up code?

A two-pass refactoring workflow involves first making the code work, then cleaning and simplifying it. This enforces clean-code discipline by ensuring small functions and one-level-at-a-time abstraction are applied after functionality is established.