yagni

Eliminate speculative abstractions, dead code, and premature generalization from software design and implementation.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/MSC72m/DevForge --skill yagni-msc72m
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: yagni
Source: https://github.com/MSC72m/DevForge/tree/main/skills/yagni
Command: npx skills add https://github.com/MSC72m/DevForge --skill yagni-msc72m

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate speculative abstractions, unused configuration knobs, and dead flexibility built for hypothetical future requirements, which increases maintenance cost and obscures the actual logic. This Skill enforces the YAGNI (You Aren't Gonna Need It) principle so every change solves only today's concrete problem with minimum viable complexity. ## Core Features & Use Cases - Abstraction Auditing: Flags single-implementation interfaces, premature factory or builder patterns, and plugin systems created before a second consumer exists. - Speculative Configuration Removal: Identifies unused environment variables, configuration options, and parameters always passed the same constant value. - Dead Code Elimination: Directs immediate deletion of unused functions, branches, and return types, relying on git history for recovery. - Use Case: During a code review, an agent applies the YAGNI evaluation checklist to a pull request and removes a generic plugin architecture that has only one consumer, replacing it with a flat function. ## Quick Start Review this pull request with the yagni skill and remove any speculative abstractions or unused configuration options.

Frequently Asked Questions about yagni

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

FAQPage Schema
How do I apply the YAGNI principle to code reviews?▼

Apply the YAGNI evaluation checklist to each change: check whether any class, interface, or helper serves a hypothetical future requirement, whether all parameters are consumed by existing code, and whether deleting the abstraction breaks any current test. If no test fails, delete it.

What counts as a speculative abstraction in software design?▼

Speculative abstractions include interfaces with only one concrete implementation, generic factory or builder patterns for objects constructed in one place, and plugin or hook systems created before a second consumer exists. These add indirection without serving a current requirement.

When should I hardcode constants instead of adding configuration?▼

Hardcode constants until there is a proven operational requirement to change them without a code deployment. Adding configuration knobs or environment variable overrides just in case creates dead flexibility that must be maintained and tested without delivering value.

When should I not apply YAGNI strictly?▼

YAGNI should not override correctness or edge-case handling required by the current problem. The checklist explicitly asks whether simplification hurts correctness, so genuinely needed validation, error handling, and domain-driven structure should remain.

Does YAGNI mean avoiding all external dependencies?▼

YAGNI prefers native platform and standard library solutions first, avoiding external packages for problems solvable in five to ten lines of standard library code. It does not ban dependencies outright; it favors flat, boring functions over layered dependency trees.