code-frugality
Skill10 starsChanged todayMITView on GitHub
Code minimalism, radical YAGNI, and anti-bloat practices based on the 7-step decision ladder. Use when writing new code, refactoring, fixing bugs, or reviewing changes to keep diffs minimal, eliminate unnecessary abstractions and dependencies, and ensure tests cover risky logic.
In this repository44 other files it gives its agents.
- llms-full.txtllms.txt
- llms.txtllms.txt
- ai-prompt-engineering-safety-reviewSkill
- ast-codemapSkill
- ast-grepSkill
- autoharnessSkill
- autonomous-backlog-driverSkill
- claude-kimi-mcp-normalizationSkill
- cli-self-updaterSkill
- codemode-gatewaySkill
- codemode-typesSkill
- consequence-simulationSkill
- context-pruningSkill
- github-update-checkerSkill
- google-agents-cli-evalSkill
- google-agents-cli-scaffoldSkill
- history-searchSkill
- hook-gatingSkill
- hybrid-semantic-searchSkill
- kimi-code-agent-integrationSkill
- kimi-mcp-configurationSkill
- leann-vectorSkill
- log-summarizerSkill
- markdown-vagueSkill
- memory-reconciliationSkill
- mode-classificationSkill
- multiagent-orchestrationSkill
- output-compressionSkill
- prompt-injectionSkill
- python-anti-patternsSkill
- regression-sentinelSkill
- restart-trackingSkill
- rollback-guardSkill
- rust-call-graphSkill
- secrets-managementSkill
- security-best-practicesSkill
- session-compactorSkill
- sqlite-memorySkill
- swarm-barrierSkill
- swarm-dagSkill
- autoharnessSkill
- code-reliability-checksSkill
- skill-threat-rulesSkill
- autoharnessSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Use this skill whenever:
- Distinctive: line 23
Before adding new classes or functions, stop at the first rung that fully satisfies the task:
- Distinctive: line 24
Does it need to exist?: If a feature or parameter was not requested, omit it.
- Distinctive: line 25
Already in this codebase?: Search existing utilities, helpers, and patterns across the repository.
- Distinctive: line 26
Standard library or runtime native?: Check standard library modules and platform primitives.
- Very specific: line 28
Already installed dependency?: If standard library does not suffice, check existing dependencies in pyproject.toml or package.json.
- Distinctive: line 29
Can it be a clear single line?: If a straightforward, readable one-liner solves the problem, use it without extra helper wrappers.
- Distinctive: line 30
Minimum viable implementation: Write the smallest possible correct diff.
- Very specific: line 33
When an intentional simplification or ceiling is chosen, document it directly in code: # shortcut: <the limit/ceiling>, <when/trigger to …
- Distinctive: line 35
Never leave a shortcut without an explicit upgrade trigger (prevent silent rot).
- Distinctive: line 38
Never sacrifice the following for the sake of smaller diffs:
- Distinctive: line 45
Line Count & Lean Check: Run code review focusing on deletion over addition.
- Distinctive: line 46
No Unrequested Dependencies: Verify git diff contains no newly added package dependencies unless explicitly requested.
- Distinctive: line 47
Edge Case Test: Ensure any new non-trivial branch or parsing logic has a passing test that fails if the behavior is removed.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
code-frugality
When to use
Use this skill whenever:
- Designing or implementing any code change (feature, bugfix, refactoring).
- The temptation arises to introduce new dependencies, wrapper classes, generic abstractions, or speculative configuration options.
- Reviewing code for bloat, unnecessary complexity, or over-engineering.
- The user requests a "simple solution", "minimal change", "YAGNI", or complains about bloated diffs.
Steps
1. Pre-Implementation Scoping
- Inspect the callers, tests, fixtures, and configuration touched by the change before writing code.
- Understand the exact contract required by the task; identify what data or behaviors cannot be broken.
- Separate true scope from speculative additions: extra options, premature generalizations, and configurable flags nobody asked for are out of scope.
2. The 7-Step Resolution Ladder
Before adding new classes or functions, stop at the first rung that fully satisfies the task:
- Does it need to exist? If a feature or parameter was not requested, omit it. Vague requests get the simplest implementation fulfilling the core requirement.
- Already in this codebase? Search existing utilities, helpers, and patterns across the repository. Reuse existing code conventions and abstractions rather than inventing new ones.
- Standard library or runtime native? Check standard library modules and platform primitives. Standard library constructs beat external libraries.
- Platform/environment capability? Leverage native platform features (e.g. native browser controls, OS signals, standard stream piping).
- Already installed dependency? If standard library does not suffice, check existing dependencies in
pyproject.tomlorpackage.json. Never add a new dependency for a few lines of logic. - Can it be a clear single line? If a straightforward, readable one-liner solves the problem, use it without extra helper wrappers.
- Minimum viable implementation: Write the smallest possible correct diff. Non-trivial logic (branches, parsers, security, money) must leave at least one focused test or assertion.
3. Deliberate Compromises and Debt Marking
- When an intentional simplification or ceiling is chosen, document it directly in code:
# shortcut: <the limit/ceiling>, <when/trigger to upgrade> - Never leave a shortcut without an explicit upgrade trigger (prevent silent rot).
4. Non-Negotiable Invariants
Never sacrifice the following for the sake of smaller diffs:
- Validation at trust boundaries.
- Error handling that prevents data loss or silent failures.
- Security checks and cryptographic sanity.
- Accessibility standards.
How to verify
- Line Count & Lean Check: Run code review focusing on deletion over addition. Ask: Can any line in this diff be deleted without breaking tests or the spec?
- No Unrequested Dependencies: Verify
git diffcontains no newly added package dependencies unless explicitly requested. - Edge Case Test: Ensure any new non-trivial branch or parsing logic has a passing test that fails if the behavior is removed.
- Shortcut Verification: Scan for
# shortcut:comments and confirm every instance specifies both its operational ceiling and an upgrade condition.
Facts found here
- Ponytail benchmark evidence: applying the decision ladder reduces code volume by ~50% and output tokens by ~45% while increasing test coverage on risky logic to 98%.
- Python standard library (
pathlib,re,json,dataclasses,urllib) eliminates the need for 90% of auxiliary utility libraries in CLI tools.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

