Link copied
Blog › The Best Code Is the Code You Never Wrote
AI Workflow

The Best Code Is the Code You Never Wrote

KG
Teh Kim GuanACMA · CGMA
2026-08-13 · 4 min read · Updated 2026-08-22
The Best Code Is the Code You Never Wrote

A seven-rung laziness ladder for coding agents cut generated code by half without dropping a single safety guard. The order of the rungs is the product.

Ask a coding agent for a date picker and you often get a library installed, a wrapper component, a stylesheet, and a discussion about timezones. The browser already ships a date input. One line would have done it. AI agents over-build by default, and over-built code is the expensive kind: more tokens to generate, more surface to maintain, more places for bugs to hide.

An open-source agent skill, Ponytail, with 65,000 stars, attacks this with a fixed decision ladder the agent must climb before writing anything. Stop at the first rung that holds:

  1. Does this need to exist at all? If not, skip it.
  2. Already in this codebase? Reuse it.
  3. Standard library does it? Use that.
  4. Native platform feature? Use that.
  5. An installed dependency does it? Use that.
  6. One line suffices? Write one line.
  7. Only then: the minimum that works.

Each rung is cheaper than the one below, so the agent exhausts the free options before it writes anything new. Two qualifiers keep this from being a gimmick. The ladder runs after the agent has read the code and understood the problem, never instead of it; the author's phrase is "lazy about the solution, never about reading". And four things are never on the chopping block: validation at trust boundaries, data-loss handling, security, accessibility. Lazy, not negligent.

The Benchmark That Earns the Claim

The seven-rung ladder: skip it, reuse the codebase, standard library, native platform, installed dependency, one line, then the minimum that works

The measurement is the credible part. Not single-shot generation counts, which the author concedes are gameable, but a real agent working twelve feature tickets on a genuine FastAPI-plus-React codebase, four runs each, scored on the diff it leaves behind.

vs no-skill baselineLines of codeTokensCostTimeSafety guards kept
The ladder skill-54%-22%-20%-27%100%
Naive "YAGNI, prefer one-liners" prompt-33%-14%-21%-30%95%

Read the second row carefully. The crude prompt gets similar cost savings and drops a safety guard. That five-point gap is the whole argument for the carve-out: telling an agent to write less code without telling it what never to cut will eventually cut the wrong thing. The effect profile is honest too. A date picker collapses from 404 lines to 23; code that is already minimal barely moves. A real effect is large where the trap is real and near zero where it is not. A marketing number is flat everywhere.

Constraint beats exhortation. A decision procedure with a safety floor outperforms a stern instruction, measurably, on every axis at once.

The engineering lesson underneath is portability: one canonical ruleset, mechanically fanned out to sixteen agent formats, with a CI check that fails the build if any copy drifts. Anyone maintaining standards across multiple AI tools has this exact problem, and that is the correct answer to it.


Part of the Operating Principles series from KG Consultancy.

About the Author
KG
Teh Kim Guan
Product Consultant · General Manager, PEPS Ventures

Strategy and technology are the same decision. Over 15 years in fintech (CTOS, D&B), prop-tech (PropertyGuru DataSense), and digital startups, I have built frameworks that help founders and executives make both moves at once. Based in Kuala Lumpur.

More from the blog
Frameworks
A Script Is Not an Owner
A decision assigned a weekly render to a script. The script worked, and four Fridays passed without it running, because nothing was scheduled to call it.
2026-08-28 · 6 min read
Frameworks
A Rule That Lives Only in Prose Does Not Fire
Four rules I believed were enforced were all written prose, and all four failed in one week. The four executable checks caught every error they were pointed at.
2026-09-11 · 6 min read
AI Workflow
The Wrong Note That Kept an Outage Alive for Eight Nights
A confident wrong note in my knowledge base turned a five-minute fix into eight failed nights. Judge a job by the state it changes, not by its exit code.
2026-09-18 · 6 min read
Work with KG

Working on a 0→1 product?

I help founders and operators go from idea to validated product. Let's talk about yours.

Get in touch →