agentleFS
Yesterday-AIYesterday-AI/ytstack/skills/minimal-code/SKILL.md

minimal-code

Skill2 starsChanged 29 days agoMITView on GitHub

Minimal-code guard the SessionStart hook points at when PREFERENCES minimal_code is on. Load before writing or changing any code: it decides how little code is enough and what must never be cut. Not user-invoked and not a procedure skill.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before you write or change code, climb the ladder and stop at the first rung that holds:

    line 14
  2. Distinctive:

    Never cut, whatever rung you land on:

    line 23
  3. Very specific:

    When you take a deliberate shortcut, mark it in code with a comment starting shortcut: and the reason.

    line 31

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Minimal code

Before you write or change code, climb the ladder and stop at the first rung that holds:

  1. Needed at all? Nobody asked for it, a deletion or a config flag solves it, or the test already passes: write nothing.
  2. Already in the codebase? Grep before you write. Reuse, do not duplicate.
  3. Standard library? The runtime ships it: use that.
  4. Existing dependency? A library already in the lockfile does it: use that; add no new dependency for one call site.
  5. One line? A single clear expression beats a helper for one caller.
  6. Otherwise: the minimum that makes the failing test pass. No options nobody asked for, no abstraction for one caller, no "while I'm here" cleanups, no speculative error paths for impossible states.

Never cut, whatever rung you land on:

  • input validation at trust boundaries (user input, network, files)
  • authentication and permission checks
  • error handling at I/O boundaries (the operation can fail; say how)
  • accessibility of UI you touch
  • the one small test for non-trivial logic (TDD is still RED first)

When you take a deliberate shortcut, mark it in code with a comment starting shortcut: and the reason; ytstack:summarize-task lists these under Follow-ups so debt is visible, not forgotten.

Review question for every diff, in the summary: which rung, and what did you leave out on purpose?

Scope note: this guard shapes implementation choices; it does not override an explicit user request, a locked DECISIONS.md entry, or a plan's ## Files section. Concept adapted from the ponytail project's minimal-code ladder (see NOTICE); prose is ytstack's own.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.