Behavior extraction with workflow blueprint

Watching agents at work and turning what they do into reusable contracts.

Documenting what the agent really did

The Agentic Workflow Blueprint covers the structure: routing, contracts, subskills, chaining. This is the practical side: how to pull real behavior out of agents and turn it into a reusable skill.

It is not about documenting what the system should do. It is about documenting what the agent really did to solve a problem, and turning that evidence into a contract.

The idea in one sentence: when an agent solves a problem, its decisions (which tool, in what order, which check, how to handle failure) are in the tool calls. Extracting means getting them out before they die with the conversation.

The cycle

1. Observethe agent runs, fails and solves2. Identifythe decision pattern3. Formalizeit becomes a SKILL.md4. Operateloaded in another contextthe blueprint growsevery failure refines the contract
It is not a document written once and forgotten: it is a living system that keeps operational knowledge.

Mental model as contract

A mental model is the agent's picture of how something works. Without extraction it dies with the conversation, and the next session finds everything out from scratch. The blueprint turns the mental model into a file.

Observationfixed bug X with YMental modeltype A bug: steps B, C, DSKILL.mdGoalwhat the model solvesScopewhen it applies and when notTriggerswhich signals turn the model onProcedurethe steps taken from the real runInvariantsrules found in practiceReview gatehow to know it worked

Evidence, not invention

The contract's sections are not invented: they come from evidence. An example from the lab: running Temporal, the agent found that ListWorkers returns 501 UNRESOLVED. It was not config, it was an upstream bug. That became an invariant of the skill:

Invariants:
- ListWorkers returns 501: upstream handler bug, ignore
- docker compose for lifecycle, never a bare docker restart

Without extraction, that knowledge is lost. With the contract, the agent knows from the first turn.

Subskills as decomposition

A complex mental model breaks into smaller ones, each with its own triggers, invariants and gates. In the documentation pipeline, document, review and changelog are three separate models. When document fails, the retry focuses on it, without rerunning review or changelog.

In real context

Each of these skills was born the same way: the agent operated, hit a problem, solved it, and the behavior was extracted.

ProjectWhat became a contract
temporal-standaloneserver lifecycle, upstream bugs and API keys became a skill loaded before operating
CheckoutPPthe Pagar.me v5 integration became a skill with auth, endpoints and fallbacks
ApixTemporal workflows (Ruby SDK, task queues, head-of-line blocking) became executable contracts

What makes the model reusable

The contract is self-contained and linkable. It needs no context from the previous session. Triggers say when to load it, the procedure says what to do, invariants say what never to break and the review gate says how to know it worked. If it works in one project, it works in another, because the contract is about behavior, not about a file layout.

The automatic extraction, through the daily routine, is in the learning system.

References