How it works
The loop
Four steps, each a separate CLI command:
| Step | Command | What happens |
|---|---|---|
| Record | reelier mcp --wrap "..." | Sits in front of your agent’s real MCP tools, captures a lossless trace. |
| Compile | reelier compile trace.jsonl | Turns the trace into a SKILL.md, deterministically — zero LLM calls. |
| Replay | reelier run skill.md | Runs it again at Level 0: no LLM, milliseconds, byte-identical. |
| Self-heal | reelier run skill.md --max-level 1|2 | When the world drifts, an LLM patches the one broken step once, writes it back. |
The five atoms
Every step in a compiled skill is exactly five kinds of information:
| Atom | Carries |
|---|---|
| intent | A natural-language sentence: what the step is for. |
| action | A tool name + a JSON args template (with {{var}} holes). |
| assert | Zero or more predicates over the observation the tool returned. |
| bind | Zero or more extractions from the observation, feeding later steps. |
| effect | Exactly one of read, idempotent-write, or destructive. |
A step with zero assertions is honestly reported as unchecked, never passed— Reelier never claims to have verified something it didn’t actually check.
Level 0: no LLM, by construction
Level 0 replay is the default and the only level that runs unless you opt in with --max-level. No LLM client is ever constructed or called at --max-level 0— not configured to no-op, actually never touched. If a step diverges (an assertion fails, a bind can’t find its path, a tool errors) the run simply stops there; every remaining step is recorded skipped.
The escalation ladder (L0 → L1 → L2 → L3)
Opt-in via --max-level 1 or --max-level 2:
- L0 (default, always on) — deterministic replay, zero LLM calls, fails closed on divergence.
- L1— re-evaluates the step’s already-captured observation with an LLM-patched assert/bind set. Nothing is re-executed; L1 never calls a tool again, only re-reads the same result with fresh eyes.
- L2 — tried only if L1 didn’t hold and
--max-level 2. The LLM may propose patched args too, and the step’s tool is re-executed exactly once — but only when the step’s effect isreadoridempotent-write. A destructive step is never handed to L2. - L3(not implemented) — full agentic recovery when the recorded trace no longer applies at all. Today that’s a human editing the skill by hand.
A successful heal is written back to the skill file immediately, with a changelog line recording what changed and why — the point of the ladder is that the same drift never has to escalate twice.
The determinism boundary (honest)
Replay is deterministic for the recorded tool-call sequence — same tool, same args (after filling any {{var}}holes), same assertions checked against a fresh result. It is not a video or screen replay, and it does not replay open-ended generation or judgment calls: a step is either a concrete tool call with a checkable outcome, or it’s not something Level 0 can express. Escalation (L1/L2) uses an LLM only to patch a broken assertion or re-derive one failed step’s args — never to freely reason through the whole workflow again.