Agentic framework · Product spec · 2026

One source of truth for product decisions

Product decisions live in copies: the design file, the test plan, the code, the prompt. When one changes, the others drift, and AI agents fill each gap with a guess. A product spec is the one place where they are written and kept in sync, so a decision changed once reaches ideation, definition, testing and development.

Role
Product designer and builder, alone
For
Anyone who works on a product, from research to QA, and the agents they work with
What I did
  • Product specs
  • Agent workflow
  • Checks
The product spec in the centre: the context every agent reads. Its product level says who the users are, the rules and what the team decided; its feature level says what each screen does, in every state. Six readers around it: build with the design system, review by a synthetic user, QA of every eval on the screen, change the spec first, handoff tests for the backend, and answer by searching for an ID. Under it, guardrails: checks on every change

01

Why a product spec

Every product runs on decisions: who it is for, which rules it follows, what the team chose and why, what each screen does in each situation. They are made in workshops, calls, tickets and design files, and each person keeps a copy: the designer in Figma, the tester in a test plan, the developer in the code, the AI tool in its prompt. When a decision changes, some copies change and some do not, and the copies drift.

AI agents make the drift faster. An agent builds from what is in its context and fills every gap with a guess: it can follow a design system to the pixel and still decide on its own when a request is overdue, or which button goes away once it is answered. Each screen guesses a little differently, and the code it leaves does not say why one behaviour was chosen over another.

A product spec is the single source of truth for those decisions: what was decided, why, and what each screen does. It lives in the repository, written for people and agents alike. In AI terms, it is the context every agent is grounded in, and the spec of spec-driven development, kept for the whole product rather than for one task.

It is one of three frameworks: the synthetic user reviews it and walks the product it describes, and the design system is where agents build its screens. All three kits are public and use the same made-up product, an inbox where a shop's privacy lead answers people's requests about their personal data. Every example below comes from it.

02

What the spec holds

One spec per product: a folder of short text files in the product's repository, in two levels. The product level holds what the whole product shares: users, rules and decisions. The feature level holds what each feature does.

AGENTS.md               what an agent reads first, and the order of the work
spec/                   the product spec
  roles.md              who uses the product, and what each role may do
  personas/             one persona sheet per role, from interviews
  goals.md              what each role comes to get done
  sources/              the external rules, each with its source
  decisions.md          decisions about the whole product: why, who, when, where
  decisions-replaced.md decisions no longer true, and what replaced each
  rules.md              what the product does, citing its rules and decisions
  questions.md          what is not decided yet, and what happens meanwhile
  glossary.md           what each word means today
  flows/                one file per task: its steps, its decisions, its evals
  screens/              one file per screen: its states and its evals

The first nine entries under spec/ are the product level, the last two folders the feature level. A new feature adds a flow and a screen; it changes the product level only when it makes a new decision.

Every item gets an ID: a short label that names one item and never changes, even when its wording does. The letters say what kind of item it is, the number which one. BR-03 is the third business rule. Each item below links to its file in the example spec.

PRODUCT LEVELFEATURE LEVELROLE, R-01who actsGOAL, G-01what a role comes to doPRODUCT DECISION, D-02the team's choiceBUSINESS RULE, BR-03cites rule and decisionGLOSSARYwhat each word meansFLOW STEP, F-01who acts, the state itlands onSCREEN STATE, ST-03what the screen shows,such as overdueEVAL, E-11one exact situationit must passwhere they meet
Product level on the left, one feature on the right. Each line is a place where the feature cites a product item by its ID.

The product level

  • Role: what a kind of user does in the product, with a persona sheet built from what the people in that role said in interviews.
  • Goal: what a role comes to the product to get done.
  • External rule: a rule from outside the team, such as a law, a contract, a platform's policy or an accessibility standard. The team cannot change it.
  • Product decision: a choice the team made, from user research, a market insight, the strategy or a technical limit, never against an external rule. A decision about the whole product goes in the product decision log. Every decision made for a feature goes in that feature's decision log, in its flow file, and any other feature that follows it cites its ID. Each says why, who decided and when. A decision that is no longer true moves to an archive, and nothing may cite it.
  • Business rule: what the product does, citing the external rules and decisions it comes from. The law allows an extension of up to two more months; the team decided an extension is always the full two months. The rule cites both, so nobody reads "always two months" as a mistake. A rule can hold on every screen of the product, or of one feature: written once, it is never repeated screen by screen.
  • Open question: a choice not made yet. It names who answers it, what the product does meanwhile, and the flows and screens it applies to. The answer becomes a decision.
  • Glossary: what each word in the product means today.

The feature level

  • Flow: each step of a task, who acts, and the screen state it lands on, with evals for what no screen shows, such as a message the product must never send.
  • Screen state: one situation a screen can be in, such as overdue: when it applies, what it shows and in which words, which rules it follows, and what it never shows, such as a note another role may not see.
  • Eval: one exact situation, given as the facts that set it, and what the product must do in it. As in AI evaluation, it has defined inputs and one pass criterion, so two people who read it reach the same verdict. When two states can be true at once, such as overdue and waiting for proof of identity, an eval says which one wins and what it keeps.
  • Not covered: what a flow or a screen leaves out on purpose, such as refusing a request.

Evals are where a decision becomes exact. Four from the example:

EvalThe situationWhat the screen must show
E-13A request arrived on 3 November. The privacy lead opens it on 3 December, the due date itself.Due soon, not yet overdue. It offers Mark as answered, Extend and Ask for proof of identity.
E-09A request arrived on 31 January. February has no 31st.The due date is 28 February, the last day of that month.
E-11A request arrived on 3 November and was extended on 20 November. The privacy lead opens it on 5 February, two days after the new due date.Overdue. It offers only Mark as answered, because a request can be extended only once, and only before its due date passes.
E-12A request arrived on 3 November. The privacy lead asked for proof of identity on 12 November, and it has not arrived. They open the request on 5 December.Overdue, and it still says when proof was asked for. It offers Proof received and Mark as answered.

Each row reads as a sentence for a person and runs as a test on the built screen.

03

How it stays true

A source of truth is only useful while it is true. Five things keep it true: how each decision is written, how a change gets in, the gates on every change, what happens to a gap, and how much of it an agent reads.

Each decision is written once

A rule can apply on several screens, and a decision can shape several rules. So, as in a normalised database, each item is written once, and everything that uses it cites its ID, the code included: a check fails when a rule a screen applies is named nowhere in that screen's code. The overdue state cites the rule for overdue requests. That rule cites the one-month deadline in the law and the decision that an overdue request never leaves the list on its own. When the law changes, a search for its ID finds the rule, then the state, then the screen and its code.

It changes like code

The spec lives in the product's repository, beside the code, as docs as code. Every change is a pull request on a branch, and it counts only once a person merges it. Two people changing the same rule see the conflict, as they would in code. A change to the product starts in the spec, in the same pull request as the code that follows it, or before it. Code owners set who approves each part: legal for the external rules, product for the decisions.

THE PRODUCT SPECin the repository, beside the codeFINDINGSFINDINGSA CHANGEa new or changeddecisionSPEC CHECKa script findswhat is missingSPEC REVIEWthe synthetic userfinds what is wrongMERGEa person merges;only now it countsA CHANGED RULE GOES BACK TO “TO CONFIRM”RULES WATCH, ON A SCHEDULEan agent reads the official sourcesand finds the rules that changed

Gates run on every change

Like continuous integration on code, gates check the spec before a change merges. What they find goes back to the change.

GateWhenWhat it finds
Spec check, a scriptEvery change to the specWhat is missing or out of date: a step that lands on no state, a situation no state covers, a step that does not say where a request goes as days pass, a state or a rule with no eval, a rule with no source, a citation of a replaced decision, an open question that reaches other features
Spec review, by the synthetic userBefore each mergeWhat is wrong: the feature read as each role, against the external rules and the persona sheets.
Rules watch, an agent, optionalOn a schedule, when the external rules change often, as in a regulated productAn external rule whose source changed. It goes back to "to confirm" until a person reads it again, and its ID shows everything that depends on it. The rules watch lives with the spec, so every tool reads the same external rules.

The spec review runs three times, and only what two runs agree on is kept; a change that only rewords runs it once. A fix changes the spec, so the review runs again. The feature merges when no kept finding goes against a rule or a decision, and every other one is fixed, asked or listed as left out. The reviews stop when what is kept is only edge cases a product or feature rule already answers. The spec check fails until a review of the current version is in.

No gap is left to a guess

Because every person and every agent builds from the spec, mistakes included, it has to be precise. A choice that no source settles is not left for whoever builds next to guess: it becomes an open question, with what the product does meanwhile, and its answer goes into the decision log. A question that touches one feature can stay open while the work goes on. One that reaches other features is answered before the change merges, because a guess there spreads.

A gap left on purpose is written down too. Each flow and screen lists what it does not cover, so a review does not report it as missed and an agent does not fill it on a guess.

The same holds for a contradiction. When a new flow goes against a decision that applies to it, the agent stops and asks which it is: replace the decision, edit it, or add a decision for this feature only. Features can decide differently; the spec only needs to say so.

It stays small

The spec holds only what cannot be read anywhere else. It never copies what the code or the design system already says, because a copy goes out of date.

Small also keeps an agent's context window for the work. The product level is short enough to load in every session, like an AGENTS.md file. Before an agent works on a feature, one command prints that feature's part of the spec: the rules that hold on every screen, its flow, its states and evals, and only the other rules and decisions they cite or that name it. The agent reads that, not the whole spec.

04

How the work uses it

The spec does not set how a team works. The work can start on paper or in a call with a user. What changes is that all of it starts from the same decisions, and a decision changed in the spec reaches all of it.

THE PRODUCT SPECgoals, rules, decisions,open questions, flows,states and evalsIDEATIONstarts from the goals, decisions and open questionsDEFINITIONwrites the flow, states and evals on a branchTESTINGruns every eval as a testDEVELOPMENTbuilds the screens and the backend from the specANSWERINGsearches an ID and finds everything that uses it

Ideation

Ideation works from the spec as its context: the goals, what was decided and why, and the open questions. An agent exploring ideas, in a chat, a canvas or a design file, starts from what the product already holds, not from a blank prompt. An idea can still go against a decision; the decision then changes in the spec, on purpose. The idea chosen becomes a definition.

Definition

A feature is defined as a flow, then its states, then its evals, on a branch. The spec check finds the gaps and the spec review finds what is wrong. Once merged, the feature is decided, even if no screen is built yet.

Testing

Each eval runs as a test. A behaviour check runs every eval on the built screen, the synthetic user walks the built product as each role, and each failure names the eval or rule it breaks. When I broke the example on purpose, one change at a time, each break was caught: an overdue request that still offers Extend, an extension of three months instead of two, a badge that says “Late” instead of “Overdue”.

Development

An agent builds the screen with the design system from the flow, the states and the evals, and the screen is done when every eval passes. A script turns the same rules and evals into a handoff file for the backend, with one acceptance test per eval, including the flow evals no screen shows.

Answering a question

A search for an ID finds every flow, state, eval and line of code that uses it, and the decision it comes from.

05

What this does not cover

  • It holds what was decided, and the words each screen shows. Other content, such as articles or emails, and the designs live outside it and cite the decisions they follow.
  • The gates find what is missing or wrong in what was written. Whether a decision is a good one is still the team's call.
  • The spec review is a model reading the spec. Three runs reduce what it misses or invents; they do not remove it, and it has not been compared with a review by a person. In a test, I planted ten known problems in the example spec. Each of three review runs found nine. All three missed the same one: a missing step, not a wrong line. A script now checks for that kind of step, and each miss found later is logged with what changed. A fix can also bring its own gap: on the example, the round after a fix found one in it.
  • Only written evals run. A spec review can point out a missing one, but it does not write it. The flow evals are listed for the backend's tests; the kit does not run them.
  • A decision changed in the spec reaches everything that works from it. Copies kept elsewhere, such as a design file or a test plan, still drift.
  • A rule's ID in the code makes the rule easy to find; only the evals show the code applies it.
  • It does not test usability or say what to build.
  • It was built on one flow of a made-up product, then tried on one product of my own. I work alone, so it has not been tried with a team, and what a team needs is still open: who may change which part of the spec, who approves each change, and how two people working on the same decision agree.
  • It works for a new product or an existing one: either way, it needs the decisions written down. How to recover them from an existing product is not covered.

06

Where it came from

I was already working this way on my own projects. A comment from a VP of Design on one of my LinkedIn posts, about gates spread through the work, made me see it as a framework, and I packaged it as something reusable and thought through.

On Mesa Jurídica, the agents I worked with wrote this layer before it had a name. The flows came first, each drawn on a board before its screens, and one review of a flow found 26 missing states before any screen was built. A sheet for each screen held its content and logic, a glossary said what each thing meant, and a log kept each of my decisions. It worked, but it was prose: nothing had an ID, nothing checked that a screen matched its sheet, and the decision log grew to 247 KB. This framework keeps the same parts and adds the IDs, the evals and the gates.

Then I tried it on Lune, a ritual guide I am building, at the moment its direction changed. Its decisions were scattered: in a long log, in the code and inside the text of each ritual. Writing them into the spec put each one in one place, with its source. Working alone, end to end, I make several decisions a day, and the spec is where each one is logged, with why, so the next session starts from it.

Further reading

Next case

04 / 09