code-quality-heuristics

Apply DRY, KISS, and YAGNI heuristics to code change decisions.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/mechemsi/claude-template --skill code-quality-heuristics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality-heuristics
Source: https://github.com/mechemsi/claude-template/tree/main/skills/code-quality-heuristics
Command: npx skills add https://github.com/mechemsi/claude-template --skill code-quality-heuristics

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps developers avoid duplicating logic and over-engineering by applying the DRY, KISS, and YAGNI heuristics in real-world decisions.

Core Features & Use Cases

  • Guides when to extract abstractions to ensure changes reflect actual requirements.
  • Prevents premature generalization and unnecessary indirection that increases complexity.
  • Supports principled refactoring and decision-making in copy-paste or quick-change scenarios.

Quick Start

Describe a concrete code change and state whether to extract an abstraction, add indirection, or keep the implementation simple.

Frequently Asked Questions about code-quality-heuristics

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

FAQPage Schema
When should I extract an abstraction during refactoring instead of just copying code?

You should extract an abstraction during refactoring only when changes align with actual requirements, applying YAGNI to prevent premature generalization. It guides you to balance DRY against unnecessary indirection, ensuring clarity and safer modifications over forced deduplication.

How do I apply DRY and KISS principles without over-engineering software design?

To apply DRY and KISS without over-engineering, use practical guardrails that prioritize minimalism. Reduce duplication judiciously while avoiding premature generalization, ensuring changes reflect real requirements rather than speculative future needs.

What is the best way to decide between adding indirection or keeping the implementation simple?

The best way to decide between adding indirection or keeping it simple is evaluating if the change aligns with real requirements. Apply KISS and YAGNI heuristics to prioritize clarity and minimalism, preventing unnecessary complexity in quick-change scenarios.

Does applying the YAGNI principle help prevent premature generalization in code?

Yes, applying the YAGNI principle helps prevent premature generalization by ensuring you only build functionality for actual requirements. It stops unnecessary indirection and speculative abstractions, keeping software design minimal and aligned with current needs.

Why does strict adherence to DRY sometimes increase code complexity?

Strict adherence to DRY increases code complexity when it forces premature abstractions and unnecessary indirection. By applying YAGNI and KISS, you can avoid over-engineering and prioritize clarity over blindly eliminating every instance of duplicated logic.