Receber por email
← Voltar para o catálogo

mk:clean-code

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).

15estrelas
Atualizado há 4 meses

Ver no GitHub ↗ Licença: MIT

Como adicionar

/plugin marketplace add ngocsangyem/MeowKit

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/mk-clean-code/svg)](https://www.skillteca.com.br/skills/mk-clean-code)
#ai

Skills relacionadas

Ver todas de DevOps e Infra →

Alerta por categoria

Receba novas skills de DevOps e Infra toda segunda

1 email curto, só com as skills novas de DevOps e Infra. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

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
Compartilhar X LinkedIn