Agent skill

Elegant Code

by athola in athola/claude-night-market

Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

MITAuto-check passed

Install Elegant Code

skills CLI
$ npx skills add athola/claude-night-market --skill elegant-code -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install athola/claude-night-market elegant-code --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/athola/claude-night-market.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/conserve/skills/elegant-code .claude/skills/elegant-code && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
elegant-code
GitHub stars
342
Token cost
~2.1k tokens
SKILL.md length
1,079 words
Files
2 (incl. references)
Skills in repo
160
Repo updated
First seen
Licence
MIT

At a glance

Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

  • Works in 3 steps: A shared vocabulary (the rungs, the… → Consistency: the ladder is applied every… → A guard: the negligence floor below is…
  • Choosing a dependency
  • SKILL.md covers What this skill is (and is not), When To Use, When NOT To Use and The Decision Ladder, plus 6 more sections
  • Calls cargo

What it does

Elegant Code is an agent skill from athola/claude-night-market. Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage. Use when adding code, choosing a dependency, or auditing a diff.

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/sources.md`).

The repository describes itself as: 23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context… The licence is MIT.

When your agent uses it

  • Choosing a dependency
  • Auditing a diff

Example prompts

  • “/elegant-code”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. A shared vocabulary (the rungs, the floor) that review
  2. Consistency: the ladder is applied every time, not just
  3. A guard: the negligence floor below is never traded away

What it can do on your machine

Read from SKILL.md and the folder at commit 9f3eb00. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Elegant Code loads about 2.1k tokens when it runs, and up to ~3k if it reads all its reference files. Until then it costs about 43 tokens; SKILL.md has 1,079 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~43
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from athola/claude-night-market at commit 9f3eb00, republished under its MIT licence (© athola). 1,079 words, ~2,128 tokens.

Download SKILL.mdSave it as .claude/skills/elegant-code/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
elegant-code
description
Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage. Use when adding code, choosing a dependency, or auditing a diff.
alwaysApply
false
category
conservation
tags
minimalism, yagni, decision-ladder, dependency-discipline, additive-bias
complexity
low
model_hint
fast
estimated_tokens
900

Elegant Code

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.

What this skill is (and is not)

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:

  1. A shared vocabulary (the rungs, the floor) that review skills can point at, so "you skipped rung 2" is a concrete, auditable note.
  2. Consistency: the ladder is applied every time, not just when the model happens to think of it.
  3. A guard: the negligence floor below is never traded away for brevity.

It is the generative counterpart to the review-side contract in leyline:additive-bias-defense.

When To Use

  • Before adding a function, file, class, abstraction, or dependency.
  • When choosing between reuse and writing new code.
  • When auditing a diff for lines that can be deleted.

When NOT To Use

  • Throwaway scripts or one-time migrations where review cost is near zero.
  • Cases where the negligence floor (below) is in play: there, add the guard first and optimize length second.

The Decision Ladder

Walk the rungs in order. Climb down only when the current rung does not hold. Stop at the first rung that solves the problem.

#RungAskStop here whenExample
1Need-to-existDoes 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
2Builtin / stdlibCan a language builtin or the standard library do it?The stdlib covers it.str.zfill, f"{n:05d}", pathlib, itertools
3Native platformIs there a native platform or framework feature?The platform already ships it.URLSession retry, fetch, framework validators
4Installed dependencyIs an already-installed, audited dependency enough?A dep in the lockfile covers it.reuse requests/urllib3 backoff before adding tenacity
5A few linesCan it be one line or a small explicit block?A short, obvious block solves it.a 20-line retry loop over a retry framework

A new dependency is the last resort, below rung 5, not rung 4. 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).

What minimal must still cover

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.

Correctness and safety (the negligence floor)

Never cut for brevity. A review must never propose deleting these as "extra code":

  • Trust-boundary and input validation on untrusted data.
  • Authorization checks (permission gates, row-level security).
  • Data-loss handling (transactions, idempotency keys, retries that cannot double-charge).
  • Error handling on fallible I/O.
  • Security-relevant paths (authn, secrets, crypto).
  • Accessibility.

This floor is evidence-backed, not a slogan. 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.

Performance

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 what the known input size or a profiler justifies, not what feels fast.

Show full SKILL.md (431 more words)Show less
Edge and negative cases

The negative path is part of the spec, not extra code. 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.

Elegance, not terseness

Prefer the clearest expression a reader can verify, not 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.

Why minimal (stated honestly)

The case for less code rests on surfaces you can measure, not on a clean "fewer lines means fewer bugs" law. That 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:

  • Attack surface: fewer imports and branches are fewer places for a known failure mode (hallucinated import, unhandled path).
  • Review cost: a document, and a diff, costs the sum of its readers' time. Less code is less to review correctly.
  • Token and latency cost: shorter output is cheaper to generate and faster to run.
  • Iteration risk: additive self-refinement is not free. One study measured a +37.6% rise in critical vulnerabilities after five refinement rounds (arXiv 2506.11022). Bias the loop toward deletion, then stop.

Verification hooks

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.

bash
# 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.

How this composes

SkillRelationship
imbue:dependency-verificationRung 4/new-dep gate: confirm a package exists before adding it
leyline:additive-bias-defenseReview-side burden-of-proof contract this skill generates against
conserve:code-quality-principlesKISS/YAGNI principles this ladder operationalizes pre-code
conserve:unbloatWhole-codebase cleanup (this skill is per-change)
imbue:scope-guardFeature-level worthiness (this skill is line and dependency level)
pensive:hardenSecurity review that enforces the negligence floor

The /conserve:elegant-code-review command applies this ladder to the current working diff.

Exit Criteria

  • Each addition was walked down the ladder, and the chosen rung is stated (for example, "rung 2: stdlib zfill").
  • Any new dependency passed Skill(imbue:dependency-verification) and reuse of an installed dependency was ruled out first.
  • Every untrusted input has its negligence-floor guard present (validation, authorization, error handling).
  • A deletion tool was run, or its absence was noted, and no flagged candidate that is a guard was deleted.

© athola, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in plugins/conserve/skills/elegant-code of athola/claude-night-market.

  • SKILL.md
  • references/sources.md

Open the folder on GitHubat commit 9f3eb00

Compare with similar skills

Elegant Code next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Elegant Code compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Elegant Code this skillathola/claude-night-market342—~2.1kAutomated safety check: PassMIT
Minimalismsickn33/agentic-awesome-skills47k1 repos~2.2kAutomated safety check: PassMIT
Python Type Safetywshobson/agents40k—~1.4kAutomated safety check: PassMIT
Safety Guardaffaan-m/ECC274k2 repos~554Automated safety check: NotesMIT
Safety Guardaffaan-m/ECC274k—~323Automated safety check: NotesMIT
Safety Guardaffaan-m/ECC274k—~255Automated safety check: NotesMIT

Similar skills

  • Minimalism

    sickn33/agentic-awesome-skills

    Web and App implementation guide for the Minimalism design style.

    47k GitHub starsUsed in 1 repo~2.2k tokens
    MobileAuto-check passed
  • Python Type Safety

    wshobson/agents

    Python type safety with type hints, generics, protocols, and strict type checking.

    40k GitHub stars~1.4k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Safety Guard

    affaan-m/ECC

    Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard…

    274k GitHub starsUsed in 2 repos~554 tokens
    DevelopmentAuto-check: notes
  • Safety Guard

    affaan-m/ECC

    本番システムでの作業時や、エージェントを自律的に実行する際に破壊的な操作を防ぐためにこのスキルを使用してください. An agent skill from affaan-m/ECC.

    274k GitHub stars~323 tokensUpdated 2 days ago
    Auto-check: notes
  • Safety Guard

    affaan-m/ECC

    使用此技能可防止在生产系统上工作或自主运行代理时进行破坏性操作。

    274k GitHub stars~255 tokensUpdated 2 days ago
    Auto-check: notes
  • Use this plugin when the user wants a "Build Minimal Frame" HyperFrames motion video — Luxury-minimal whitespace hero — single word reveals letter by letter, warm-gold hairline, breathing indicators.

    100k GitHub stars~371 tokensUpdated today
    Media & CreativeAuto-check passed

More from athola/claude-night-market

All 160 skills in this repo
  • Night Market Diagnostics Toolkit

    athola/claude-night-market

    Run and interpret repo diagnostic scripts (ratchets, validators, token stats).

    342 GitHub stars~3.4k tokensUpdated yesterday
    Auto-check passed
  • Skills Eval

    athola/claude-night-market

    Evaluate Claude skill quality through auditing. An agent skill from athola/claude-night-market.

    342 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Agent Teams

    athola/claude-night-market

    Coordinates Claude agent teams via filesystem protocol. An agent skill from athola/claude-night-market.

    342 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Delegation Core

    athola/claude-night-market

    Delegates execution to eight CLIs (Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, Glimmer).

    342 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Skill Library Mission

    athola/claude-night-market

    Build a project skill library in .claude/skills/ via discovery, parallel authoring, and review.

    342 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed
  • Call Chain

    athola/claude-night-market

    Traces execution paths through the code graph with criticality scoring and Mermaid charts.

    342 GitHub starsUsed in 1 repo~820 tokens
    Auto-check passed

Questions about Elegant Code

What does Elegant Code do?

Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage. Elegant Code is an agent skill from athola/claude-night-market. Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

When should I use Elegant Code?

Elegant Code fits situations like: choosing a dependency; auditing a diff.

How do I install Elegant Code in Claude Code?

Run `npx skills add athola/claude-night-market --skill elegant-code -a claude-code`. Or copy the skill folder (plugins/conserve/skills/elegant-code in athola/claude-night-market) into .claude/skills/elegant-code in your project. Claude Code loads it when a task matches its description.

How do I install Elegant Code in Codex?

Run `npx skills add athola/claude-night-market --skill elegant-code -a codex`. Or copy the skill folder (plugins/conserve/skills/elegant-code in athola/claude-night-market) into .agents/skills/elegant-code in your project. Codex loads it when a task matches its description.

Can I use Elegant Code in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add athola/claude-night-market --skill elegant-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/elegant-code, .gemini/skills/elegant-code, .github/skills/elegant-code and .opencode/skills/elegant-code in your project.

What does Elegant Code need to run?

Going by SKILL.md and its folder, Elegant Code needs the command-line tools its instructions call (cargo).

Does Elegant Code access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Elegant Code safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Elegant Code use?

Elegant Code is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Elegant Code use?

About 2.1k tokens (SKILL.md is roughly 8.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 918 tokens, read only when the agent opens those files.

What are the alternatives to Elegant Code?

Skills that share tags, products or a category with Elegant Code: Minimalism (sickn33/agentic-awesome-skills, 47k stars), Python Type Safety (wshobson/agents, 40k stars), Safety Guard (affaan-m/ECC, 274k stars) and Safety Guard (affaan-m/ECC, 274k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Elegant Code?

athola (a GitHub user) maintains it in athola/claude-night-market, which has 342 GitHub stars. The repository holds 160 skills in this directory. The repository was last updated on October 6, 2026.

Source: athola/claude-night-market on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.