Prompts as code is the practice of keeping each prompt as a file in the repository, with its purpose, schedule, model and owner written down, so that it is versioned and reviewed like the rest of the code. The prompt then runs as written, on a schedule or in a pipeline, instead of being retyped from memory by whoever remembers to ask.
The prompt is a Markdown file with a short header and a body. I call it a registered prompt. The header declares an identifier, the type of routine, the cadence and its cron expression, the time zone, the model and the effort level, the audience, the sources it may read, where the output is written, where it is published, the contract that fixes its format and the person who owns it.
The body says what to measure, in what order and how to write. Two rules do most of the work. Measure, do not remember: every figure comes from a live system and states its time window, and a source that did not answer is reported as missing, never as zero. Write the note and stop: the prompt never publishes on its own, and a person reads the result first.
A scheduled task opens the file and runs it exactly as written. Each run produces a new file with the next version number. A published version is never edited. The next one replaces it.
Where it shows up in real work
My team runs an AI agent in production for a higher-education group, and we needed reports that could be compared week over week. We registered three: what is blocking the project, a cut of the work twice a week and a full status ready for Monday. Each one is published to a single page whose link never changes, with earlier versions archived under it. A small table, the routine registry, holds one row per routine, so a monitor can tell what should be running and what stopped quietly.
The agent itself follows the same idea. An agent is a model wrapped in prompts, tools and business rules, and changing any of them moves its behavior. So its test cases are versioned in the repository beside the code, and a change to behavior is reviewed together with the change to what is expected of it.
What it is not
It is not a library of clever phrases, and it is not prompt writing as a craft. The point is the registration: a file, an owner, a version and a review. It also does not mean that the prompt acts alone: a person still reads the output before it is published.
When you need it
You need it when the same question has to be asked the same way more than once, or when a prompt can change what a production system does. Start with one prompt. Run it by hand twice so the format settles. Then schedule it, and let the registry tell you when it stops.
My contribution: Built the evaluation harness, calibrated LLM judging, isolated case state and environment-specific evaluation gates.
What this supports: The public account describes golden cases as code, a calibrated LLM judge and the evaluation harness around them, on a Google Cloud agent stack.
What it does not establish: The figure of 700,000+ students describes the population served by the system. It does not measure simultaneous users, requests per second or personal ownership of the whole platform. Client code and data remain private.
Source reviewed:
Common questions
Which model should a scheduled prompt use?
Choose it by the kind of work the prompt does. In our practice a prompt that takes action, such as running tests, measuring live systems or publishing, runs on Opus at high or maximum effort. One that only documents or inspects runs on Sonnet at high effort, and complex, uncertain or urgent work gets the best model available.
How are the outputs of a registered prompt versioned?
Each run writes a new file with the next version number, and a published version is never edited. The report has one page with a stable link. Its header says which version it is, which window it covers, when it was updated and which prompt produced it, and earlier versions sit underneath as sub-pages.
How do you test a change to the prompt of an agent?
With cases that live in the repository next to the code. On the system I work on, a change to behavior and the change to its expectations arrive in the same pull request, and an evaluation gate runs in the pipeline. A smoke set runs on integration, and the full golden regression runs before QA promotes.
Does a registered prompt still need a person?
Yes. While the team has no machine that is always on, a person triggers the run and reviews the note. When that machine exists, the run and the publication become automatic and the review moves to comments on the published page. The prompt does not change, only who presses the button.