Writing

Skills are context compression

744 reads
Read as
practical, how to ship it

Every agent I dispatch gets a sermon before it gets a task.

The sermon covers how to ship: run the full test gate, merge only through the enforced merge script, deploy, then smoke the deployed thing. How to behave in a parallel lane: here is your ownership contract, these files are yours, touch nothing outside them, the shared file comes back to me. And the house rules: cream background, forest buttons, no shouty capitals, no em dashes. Yes, the AI has to be told about the em dashes. Especially the AI.

I have pasted some version of this sermon into more agent prompts than I can count. It runs one to two thousand tokens of protocol per agent, per dispatch, forever. Some days the task itself is fifty tokens and the protocol wrapped around it is fifteen hundred. I knew this was tedious. I had not yet noticed it was expensive.

The repo that named the pattern

Then I found Addy Osmani’s agent-skills repo, from the same person whose autonomy-levels writeup gave this series its ladder. It is a collection of about twenty-four SKILL.md files, each one a workflow, installable across the various agent harnesses.

The important word is workflow. These are not documentation an agent reads for background. They are procedures an agent follows: steps, order, verification, stop conditions. Closer to a checklist bolted to the tools than to a wiki page.

And my favourite detail: some of them ship with anti-rationalization tables. Pre-written rebuttals to the excuses agents invent for skipping steps. Somebody has clearly watched an agent think “the failing test is probably unrelated to my change” and decided the counterargument should be sitting in the file, waiting, before the excuse is ever made. Anyone who has run agents for more than a week will recognise every row of those tables. I did not know whether to laugh or take notes, so I did both.

Tidy was not the point

My first reading of the repo was “nice, a tidier place to keep my sermon.” That undersells it badly. The thing I eventually saw — and this is the part I want to plant a flag on — is that skills are not tidier prompts. They are compression. Two distinct mechanisms.

Progressive disclosure. A skill costs almost nothing until it is triggered. What an agent holds is the library’s table of contents: each skill’s name and a one-line description. The full protocol loads on demand, and only into the agent that actually needs it. Twenty-four installed skills is not twenty-four sermons held in working memory. It is twenty-four titles held, and one chapter opened when the moment comes.

Compression by reference. “Follow /ship-to-staging” is about five tokens. It stands in for roughly fifteen hundred tokens of pipeline protocol. And the compression ratio is not even the best part. A reference cannot drift. Every agent that invokes the skill gets the same bytes, from the same file, at the same version. My pasted boilerplate mutates constantly: I shorten it when I am tired, I reorder it from memory, two agents dispatched an hour apart get subtly different rules, and neither of them knows.

If that failure shape sounds familiar, it is the routes bug from earlier in this series wearing a different outfit. We once had /dashboard/rounds typed as a bare string in three separate files, and when the page moved, the strings just sat there pointing at nothing. The fix was a routes.ts of named constants and a lint rule banning the alternative. Pasted protocol is the same bug: scattered string literals, except the strings are instructions and the files are prompts. A skill is the named constant. This is the DRY principle applied to the AI’s own instructions.

The reason the compression matters is that context is the working memory an agent thinks in. Every token of protocol it holds is a token of my actual codebase it is not holding. Less sermon held means more code held. The window stops being a place where boilerplate squats and goes back to being the place where the work happens.

What we are codifying

This is now a ticket (PLAT-202), and the first four skills picked themselves, because they are the four protocols we have already proven in production the hard way:

  • ship-to-staging. Test gate, enforced merge script, deploy, post-deploy smoke. The pipeline from the expensive-tester post, as a procedure instead of a paragraph.
  • isolated-lane. How to work in a parallel worktree under an ownership contract without stepping on the other lanes. The rules that let five agents ship at once with zero file collisions.
  • walk-intake. The batch protocol from the robot-factory dress rehearsal: capture everything, transcribe, flag what is ambiguous, ask once, ticket in batches.
  • honest-data. The rules the lying query taught us: never present the stock as motion, never sum the raw counts, deltas or nothing.

Nothing new is being invented, which is precisely the appeal. These four already run our production life; they just run from prompt-memory and my typing fingers. Moving them into version-controlled SKILL.md files means they get reviewed like code, versioned like code, and improved in exactly one place, like code.

It also fixes a failure mode I have been quietly living with: the session reset. Today, an in-flight protocol lives partly in the working memory of whichever session is running it. When that session dies — and sessions die — the protocol dies with it, and the next session gets whatever version of the sermon I manage to retype. A protocol that lives in the repo cannot be wiped by a reset. The next agent picks up the same file, not my recollection of it.

The ladder of externalization

Looking back, this is the third rung of the same ladder.

First we moved bug-catching out of my eyes and into gates: the merge script, the permission snapshot, the lint rules, the canary. That freed founder attention.

Then we moved coordination out of my hands and into contracts: isolated worktrees, written ownership, parallel lanes. That freed wall-clock time.

Now we are moving protocol out of the AI’s working memory and into the repo. That frees the context window.

Source / discuss
Thoughts2
  • Priya2d

    The cap_drop note saved me an afternoon. Hadn’t thought about the TTY issue during build at all.

  • marcusw5d

    Curious whether you stuck with Ollama in the end, or went back to the Copilot model once the 403 cleared up?

Read next08

The machine that said no to my machine

A data-seeding agent hit half-rotated keys, tried to fetch replacements, and a second AI refused — twice. Why a denied request was the system working, and the guardrail I am glad I do not own.

5 min