yagni

A minimal-code guideline based on the idea that you should build only what the current task needs. It favors simple code, few dependencies, and removing unused code.

In plain words
What is it for?
Use it before code changes to decide whether to add a helper or dependency, share duplicated code, simplify a design, or delete code that no longer affects behavior.
Why use it?
It helps prevent unnecessary abstractions, packages, and future-focused work that make a codebase harder to maintain.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/oleg494/coding-kit/yagni
Any agent
npx skills add oleg494/coding-kit --skill yagni
Clone the repo
git clone --depth 1 https://github.com/oleg494/coding-kit

Made for: Claude Code, Codex.

Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 489 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00058 $0.00489
Opus 5 $0.00029 $0.00244
Sonnet 5 $0.00012 $0.00098
Haiku 4.5 $0.00006 $0.00049

Measured 2d ago against content hash 981b34ebd6b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

yagni scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/yagni/SKILL.md · 44 lines

What it actually says

YAGNI — law of minimalism

Always-on skill. Apply before every code change.

Rules

  1. Abstraction with one consumer → inline. Extract only when a second one appears. Can you remove a layer — same behavior, less code? → remove it.

  2. New dependency → only if the pain is measurable. 30 lines of your own code beat 300KB of someone else's. Start with stdlib/native. moment.js for a single format = no.

  3. Code that can be removed without changing behavior → remove it. Dead code is not commented out forever.

  4. "For the future" is not a sufficient reason. Build for the current task, not a hypothetical one.

  5. Stop when the next abstraction doesn't pay rent this week. An abstraction must pay off now, not "someday".

Filter before every change

  • DRY — duplicated in 3+ places? → shared source. 2 places? → tolerate.
  • KISS — does the simpler option close the task? → take the simple one. Complexity is justified only when the simple one doesn't cut it.
  • YAGNI — is this needed NOW? → no → don't do it.

Antipatterns

  • Generic EventBus with a middleware pipeline for a single notification → just call the function.
  • Abstract factory for two similar components → two direct components.
  • Config-driven form builder for three forms → three form components.
  • "Might come in handy" → it won't.

Code review through a YAGNI lens

  • Can this abstraction be removed without changing behavior? → remove it.
  • Is this dependency actually needed? → check whether stdlib solves it.
  • Is this code used? → no → remove it.
  • Is this "for the future"? → remove it.

Quote

"Three similar lines of code is better than a premature abstraction. Implement the naive, obviously-correct version first. Optimize only after correctness is proven with tests."

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 44 lines · 58 tokens per session scan A 981b34ebd6b0

Subscribe to this mod's changes

yagni is a skill published in the GitHub repository oleg494/coding-kit (1 stars, last pushed 2d ago), licensed MIT. It adds 58 tokens to every session and 489 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

run

Execute a named agent role with optimized instructions. Explicit invocation only ($run). Never trigger implicitly.

mystilleef/spae-framework · 21 tokens

tip

Deliver a transformative life perspective shift and a productivity tip. Use when the user invokes /tip or wants non-technical inspiration or a fresh mental model.

mystilleef/spae-framework · 32 tokens

agentic-production-readiness

Prepare an AI agent system for production operation. Cover SHIELD controls, sandbox/canary/production rollout, OpenTelemetry observability with GenAI semantic conventions, Agent Card drafting, governance, and post-deploy monitoring. Use for production readiness checks, go-live checklists, agent monitoring, agent…

browoz/agentic-sdlc-skills · 97 tokens

agentic-security-review

Run a security and dependency audit for agent systems, tool-using AI apps, MCP/A2A integrations, or security-sensitive AI-generated code. Check slopsquatting risk, tool shadowing, rug pulls, memory/context poisoning, secrets, unsafe permissions, and common CWE patterns. Use when asked for security review, dependency…

browoz/agentic-sdlc-skills · 106 tokens

agentic-spec

Create a structured specification before agentic coding work. Assemble the six context types, scale rigor for prototype/internal/production tasks, produce SPEC.md, and configure focused AGENTS.md boundaries. Use when asked to write a spec, plan a feature, design an agent/system, define architecture, or create…

browoz/agentic-sdlc-skills · 91 tokens

agentic-evals

Design evaluation contracts and test plans for agentic systems. Create deterministic tests, trajectory evals, quality dimensions, gold-set criteria, and CI gates before or after implementation. Use when asked for tests first, an eval plan, success criteria, non-deterministic testing, LLM-as-judge setup, or…

browoz/agentic-sdlc-skills · 95 tokens