/conserve:elegant-codefrom conserve
Guides writing minimal code via a decision ladder that checks need-to-exist, reuse, stdlib, platform, installed deps, and small blocks. Use when adding code, choosing dependencies, or auditing diffs.
Ships in conserve. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Write the minimal, elegant code that fully solves the problem: its performance, its edge cases, and its failure cases. Minimal is not fewest lines. It is no incidental complexity, with nothing essential omitted.
This skill codifies a discipline that strong models already exhibit some of the time. Its value is not teaching a missing capability. Its value is three things:
It is the generative counterpart to the review-side contract in
leyline:additive-bias-defense.
Walk the rungs in order. Climb down only when the current rung does not hold. Stop at the first rung that solves the problem.
| # | Rung | Ask | Stop here when | Example |
|---|---|---|---|---|
| 1 | Need-to-exist | Does this need to exist at all? | The requirement is speculative or already met. Delete or defer. | "Config loader for a value used once" -> inline the value |
| 2 | Already in this repo | Does this codebase already do this somewhere? | A helper, module or convention here covers it. Reuse it. | an existing estimate_tokens before writing another |
| 3 | Builtin / stdlib | Can a language builtin or the standard library do it? | The stdlib covers it. | str.zfill, f"{n:05d}", pathlib, itertools |
| 4 | Native platform | Is there a native platform or framework feature? | The platform already ships it. | URLSession retry, fetch, framework validators |
| 5 | Installed dependency | Is an already-installed, audited dependency enough? | A dep in the lockfile covers it. | reuse requests/urllib3 backoff before adding tenacity |
| 6 | A few lines | Can it be one line or a small explicit block? | A short, obvious block solves it. | a 20-line retry loop over a retry framework |
Search before writing: rg for the function, the concept and its
likely names. Rung 2 sits above the stdlib because a second way of
doing something the codebase already does is a redundant model. Each
one is locally valid, and every later change must translate between
them. Measured agent adoption leaves complexity raised after the
velocity gain fades (docs/knowledge-corpus/decoherence.md).
1.10.1-rc1 below 1.10.0.A new dependency is the last resort, below rung 6.
Before adding one, verify it actually exists and is safe with
Skill(imbue:dependency-verification): generated code imports
non-existent packages at measurable rates, and recurring fake
names enable slopsquatting (arXiv 2406.10279, USENIX 2025).
Prefer reuse of an installed, audited dependency over both a new
dependency and a hand-rolled reinvention. Zero-dependency code is
not automatically cheaper: it relocates the maintenance and bug
surface into your own tree (see references/sources.md).
Minimal does not mean fewest lines. It means no incidental complexity, with nothing essential omitted. The decision ladder removes incidental code: reinvention, speculative abstraction, needless dependencies. Three things are essential and are never traded for brevity.
Never cut for brevity. A review must never propose deleting these as "extra code":
This floor is evidence-backed. The dangerous failure mode in generated code is omission: roughly 45% of AI-generated samples carry a security flaw, with a measured ~2.74x vulnerability rate versus human code, driven by missing validation, missing authorization, and missing error handling (Veracode 2025). CVE-2025-48757 is a concrete case: generated schemas shipped without row-level security policies. An absent guard is not zero bugs. It is one latent bug per untrusted input.
Handle the expected input size and the hot path: avoid accidental quadratic loops, N+1 queries, and unbounded memory growth. Do not micro-optimize speculatively. Premature, speculative optimization is itself incidental complexity, so YAGNI applies to performance too. Optimize only what the known input size or a profiler justifies.
The negative path is part of the spec. Cover
empty, None, and zero inputs; boundary values; malformed or
hostile input; partial failure and timeouts; and concurrency
where it applies. Code that handles only the happy path is not
minimal. It is unfinished.
Prefer the clearest expression a reader can verify over the cleverest or the shortest. Terseness and cleverness raise review cost and defect risk: dense one-liners hide edge cases, and correctness-only evaluation misses the maintainability they cost (arXiv 2407.11470). Elegance is minimal incidental complexity plus maximal clarity, which is not the same as minimal characters.
The case for less code depends on surfaces you can measure. The clean "fewer lines means fewer bugs" law is not empirically settled: studies find weak or absent correlation between complexity metrics and defect rate (arXiv 1912.01142, 1912.04014). Argue instead from:
After writing, cross-check deletability with real tools instead
of guessing from the diff. Gate each behind command -v and fall
back cleanly when absent.
# JS/TS: unused files, exports, dependencies
command -v knip >/dev/null && knip || echo "knip absent; skipping"
# Python: dead code
command -v vulture >/dev/null && vulture . || echo "vulture absent; skipping"
# Rust: unused dependencies (nightly)
command -v cargo-udeps >/dev/null && cargo +nightly udeps \
|| echo "cargo-udeps absent; skipping"
Treat tool output as candidates, not verdicts. Code reachable only via reflection, dynamic dispatch, or framework magic can be flagged as dead while being live. Cross-check against the negligence floor before deleting anything.
| Skill | Relationship |
|---|---|
imbue:dependency-verification | Rung 5/new-dep gate: confirm a package exists before adding it |
leyline:additive-bias-defense | Review-side burden-of-proof contract this skill generates against |
conserve:code-quality-principles | KISS/YAGNI principles this ladder operationalizes pre-code |
conserve:unbloat | Whole-codebase cleanup (this skill is per-change) |
imbue:scope-guard | Feature-level worthiness (this skill is line and dependency level) |
pensive:harden | Security review that enforces the negligence floor |
The /conserve:elegant-code-review command applies this ladder to
the current working diff.
zfill").Skill(imbue:dependency-verification)
and reuse of an installed dependency was ruled out first.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
minimalism, yagni, decision-ladder, dependency-discipline, additive-bias
npx claudepluginhub athola/claude-night-market --plugin conserve12 skills in this plugin
/action-first-outputShapes turns action-first: action leads, steps numbered, state restated. Use for ADHD-friendly output. Do not use to trim tokens; use response-compression./agent-expenditureTracks per-agent token usage and flags waste in parallel dispatch. Use when evaluating parallel agent efficiency or after a multi-agent run./bloat-detectorDetects codebase bloat via dead code, duplication, complexity, and doc bloat scans. Use when codebase feels large or before a release./clear-contextManages context overflow by handing off to a fresh subagent at 80% usage. Use when context pressure is critical and work must continue uninterrupted./code-quality-principlesApplies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering./context-optimizationOptimizes context window via MECW principles and memory tiering. Use when context exceeds 30% or before long multi-step tasks.Other plugins' skills for the same job