Skip to content
Back to skills

Clean Code

ASecurity

Enforces KISS/DRY/YAGNI during authoring and ad-hoc quality reviews. Pragmatic standards: concise, direct, no unnecessary comments. NOT for post-hoc diff/PR review (see mk:review); NOT for behavior-preserving simplification passes (see mk:simplify).

  • 14 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added May 29, 2026
ai-agentsrustgo

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned May 29, 2026

npx -y skills add ngocsangyem/MeowKit --skill clean-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ngocsangyem-clean-code/badge)](https://www.skillsdirectory.com/skills/ngocsangyem-clean-code)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mk:clean-code
description: "Enforces KISS/DRY/YAGNI during authoring and ad-hoc quality reviews. Pragmatic standards: concise, direct, no unnecessary comments. NOT for post-hoc diff/PR review (see mk:review); NOT for behavior-preserving simplification passes (see mk:simplify)."
allowed-tools: Read, Write, Edit
version: 2.0
priority: CRITICAL
phase: on-demand
trust_level: third-party
injection_risk: low
source: antigravity-kit
keywords: [clean-code, kiss, dry, yagni, authoring-quality, ad-hoc-review]
when_to_use: "Use during authoring or ad-hoc quality reviews — KISS/DRY/YAGNI enforcement. NOT for post-hoc diff/PR review (see mk:review) or behavior-preserving simplification (see mk:simplify)."
user-invocable: true
---

# Clean Code — Pragmatic AI Coding Standards

> Be **concise, direct, and solution-focused**.

> For post-implementation complexity reduction within the current diff (Phase 3.5 workflow), use `mk:simplify`. `mk:clean-code` is for broader quality-standards enforcement at any phase.

## Core Principles

| Principle     | Rule                                                       |
| ------------- | ---------------------------------------------------------- |
| **SRP**       | Single Responsibility — each function/class does ONE thing |
| **DRY**       | Don't Repeat Yourself — extract duplicates, reuse          |
| **KISS**      | Keep It Simple — simplest solution that works              |
| **YAGNI**     | You Aren't Gonna Need It — don't build unused features     |
| **Boy Scout** | Leave code cleaner than you found it                       |

## Process

1. **Read existing code** — understand structure before changing
2. **Check dependencies** — what imports this file? what tests cover it?
3. **Apply coding standards** — load `references/coding-standards.md` for detailed rules
4. **Self-check** — goal met? all files edited? code works? no errors? nothing forgotten?
5. **Run verification** — execute agent-appropriate scripts from references

## References

| Reference                                                   | When to load                | Content                                                           |
| ----------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------- |
| **[coding-standards.md](./references/coding-standards.md)** | Step 3 — applying standards | Naming, functions, structure, anti-patterns, verification scripts |

## Summary

| Do                     | Don't                     |
| ---------------------- | ------------------------- |
| Write code directly    | Write tutorials           |
| Let code self-document | Add obvious comments      |
| Fix bugs immediately   | Explain the fix first     |
| Inline small things    | Create unnecessary files  |
| Name things clearly    | Use abbreviations         |
| Keep functions small   | Write 100+ line functions |

> The user wants working code, not a programming lesson.

## Gotchas

- **Over-abstracting simple code**: Creating helpers for one-time operations violates YAGNI → Three similar lines are better than a premature abstraction
- **Removing error handling deemed unnecessary**: Stripping try-catch from system boundaries loses resilience → Only remove error handling for internal calls with guaranteed contracts

Files in this skill

  • SKILL.md3.3 KB
  • references/coding-standards.md3.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.