docs: adopt the ponytail decision ladder (#5787)

Founder-directed. From dietrichgebert/ponytail -- 'the laziest senior dev in
the room', 'the best code is the code you never wrote'. Encodes the ladder
verbatim rather than paraphrasing it:

  1. Does this need to exist?   -> Skip it
  2. Already in this codebase?  -> Reuse it
  3. Stdlib does it?            -> Use it
  4. Native platform feature?   -> Use it
  5. Installed dependency?      -> Use it
  6. One line?                  -> One line
  7. Only then: the minimum that works

Two parts of the source method matter as much as the rungs and are kept
explicit. The ladder runs *after* understanding the problem -- lazy about
solutions, never about reading the code first. And it never cuts
trust-boundary validation, data-loss handling, security, or accessibility.

Rung 2 is the one this repository keeps failing, so the section says so and
points at the existing model_*/ *_config / provider_* grep rule rather than
restating it. Two corollaries earned here are added because the ladder does
not cover them: an abstraction must delete caller code, and migrate the last
consumer or do not start.

Carries no counts. AGENTS.md's first line says to derive changing state from
the repository rather than from instructions, so the dead-code corollary
points at scripts/check-dead-code-budget.py instead of freezing a number.

CLAUDE.md gets a pointer, not a copy.

Signed-off-by: CodeWhale Bot <[email protected]>
Co-authored-by: CodeWhale Bot <[email protected]>
This commit is contained in:
Hunter BownandCodeWhale Bot authored and GitHub committed 2026-08-31 19:19:41 -07:00
1 parent ceb30eba60
commit e50a86e737
2 files changed
+41

No files matched your search

+37
View File
@@ -4,6 +4,43 @@ Keep this file durable. Derive changing release, provider, branch, and flake
state from the repository, tests, CI, and current issue tracker rather than from
instructions or memory. The nearest scoped `AGENTS.md` adds path-specific rules.
## The ponytail method
From [dietrichgebert/ponytail](https://github.com/dietrichgebert/ponytail) —
"the laziest senior dev in the room." *He says nothing. He writes one line. It
works.* The best code is the code you never wrote.
Before writing code, walk the decision ladder in order and stop at the first
rung that answers:
1. **Does this need to exist?** → Skip it.
2. **Already in this codebase?** → Reuse it.
3. **Stdlib does it?** → Use it.
4. **Native platform feature?** → Use it.
5. **Installed dependency?** → Use it.
6. **One line?** → One line.
7. **Only then:** the minimum that works.
The ladder runs *after* understanding the problem. Lazy about solutions, never
about reading the code first — a short diff written without reading the call
sites is not ponytail, it is a guess.
**Never cut, at any rung:** trust-boundary validation, data-loss handling,
security, accessibility. Brevity is not a reason to drop a guard.
Rung 2 is the one this repository keeps failing. The `model_*` / `*_config` /
`provider_*` grep rule below is rung 2 with a name; so is "one turn loop, one
base prompt". Two more corollaries earned here:
- **An abstraction must delete caller code.** If adopting it is pure
obligation — required methods, no default bodies that do work — it gets
built, adopted once, and abandoned.
- **Migrate the last consumer, or do not start.** Framework, one caller,
ticket the rest, silence the warning: that ships two systems and a comment
that is no longer true. If the migration will not fit, narrow the slice —
never the adoption. The standing `#[allow(dead_code)]` count is the running
receipt; `scripts/check-dead-code-budget.py` prints it.
## Working rules
- Inspect status and existing consumers before editing. Preserve unrelated,
+4
View File
@@ -5,3 +5,7 @@
The imported contract is authoritative. Do not invent stricter test or branch
rituals: follow its code-first evidence policy, one-way migration rule, clean
direct-main permission, and the current task's offline boundary.
Its ponytail decision ladder runs before you write code, every time. Read it
there — it is not restated here, because rung 2 is "already in this codebase?"
and a second copy of a rule is the thing the rule forbids.