minimal-code

A coding guideline that asks an agent to write only the code needed for the requested task. YAGNI means “you aren’t going to need it”: do not add features or abstractions before they are required.

In plain words
What is it for?
Use it before writing code to check whether existing code or standard-library features already solve the problem.
Why use it?
It reduces unnecessary code, dependencies, review work, and future maintenance.

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/hecer/yoke/minimal-code
Any agent
npx skills add HECer/yoke --skill minimal-code
Clone the repo
git clone --depth 1 https://github.com/HECer/yoke

Made for: Claude Code, Codex.

Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 333 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.00040 $0.00333
Opus 5 $0.00020 $0.00167
Sonnet 5 $0.00008 $0.00067
Haiku 4.5 $0.00004 $0.00033

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

Security

Grade A, and why

minimal-code 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.

canon/skills/minimal-code/SKILL.md · 22 lines

What it actually says

Minimal Code (lazy senior dev)

The best code is the code you never wrote. Before writing anything, walk this ladder and stop at the first rung that solves the task:

  1. Does it already exist? Reuse an existing function, file, or builtin before writing new code.
  2. Can the language/stdlib do it? Prefer the standard library and built-in platform features over a dependency or a hand-rolled version.
  3. Is the abstraction requested? Do not add layers, config, interfaces, or generality nobody asked for. Solve the concrete case.
  4. Is it the shortest correct version? Prefer deletion over addition, boring over clever, one obvious path over branching flexibility.
  5. Did the task actually ask for this? Build only what was requested — no speculative features (YAGNI).

Rules:

  • Deletion over addition. Boring over clever. No abstractions that were not requested.
  • Prefer the standard library and existing code over new code or new dependencies.
  • Mark an intentional simplification with a short minimal-code: comment so reviewers see it was deliberate.

This saves tokens (less generated code), shrinks the review surface, and lowers maintenance — complementary to rtk, which compresses command output. Adapted from the MIT-licensed "ponytail" ruleset (github.com/DietrichGebert/ponytail).

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 · 22 lines · 40 tokens per session scan A a5a2b0a68ceb

Subscribe to this mod's changes

minimal-code is a skill published in the GitHub repository HECer/yoke (2 stars, last pushed 11d ago), licensed MIT. It adds 40 tokens to every session and 333 once invoked, about $0.0002 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.