If you build complex multi-step workflows for coding agents (Claude Code, Cursor, Antigravity), you have probably run into the same wall I kept hitting: giant SKILL.md files decay.

When you front-load 300 lines of instructions, edge cases, and formatting rules into a skill at Turn 1, it looks great on paper. By Turn 12, after tool outputs, file reads, and subagent handoffs have filled the context window, the LLM starts skimming. It rushes past the setup, forgets the pacing rules, skips a validation step, or invents its own shortcut.

The fix isn’t a longer skill. It’s replacing the giant skill with a thin wrapper, or no skill at all, and putting a deterministic state machine in charge.

That is what I rebuilt Flux Player (original write-up) to do.


The Problem With Giant Skills

A traditional skill is a static wall of text. It dumps every phase of a workflow (research, planning, implementation, review, QA, packaging) into the model’s lap at once and hopes the model stays disciplined across 20+ turns.

Three things break reliably:

  1. Attention Decay: Rules for Step 6 get drowned out by noise from Steps 1 to 4.
  2. State Spoofing and Skipping: Nothing mechanically stops an agent from jumping straight to “done” when a check hasn’t actually passed.
  3. No Deterministic Recovery: When an output fails to pass muster, you don’t get a predetermined rollback and remediation prompt. You get whatever improvisation the LLM feels like trying next.

Thin Skill + Flux Cartridge

Flux Player SNES-style console loading a Flux Cartridge

In Flux v3, your skill shrinks to a few lines:

Run flux start. Follow ONLY the active state’s instructions. Advance via flux step <TARGET>.

Everything else lives in a cartridge (cartridge.yaml or cartridge.py) that defines the state machine. Instead of trusting the LLM to remember the whole playbook, Flux persists the session in .flux/state.json, tracks history on a stack, and acts as a strict runtime referee:

  • Just-In-Time Craft Prompts: Flux only outputs the instructions, tone rules, and BAD vs. GOOD examples needed for the current state, right when the agent enters it.
  • Persona and Model Pinning: Each state specifies the exact virtual persona, role boundary, and model tier (opus, sonnet, haiku) required for that step.
  • Mechanical “Pass Muster” Guardrails: Transitions are gated by real checks: shell commands (pytest, linters), file/regex assertions, JSON/YAML schema checks, expected_outputs, or Python validator functions.
  • Predetermined Failure Routing: If a guardrail fails, Flux blocks the transition, emits a predetermined fail_prompt populated with {errors} and {attempt}, and routes to .SELF (retry), .BACK (pop the history stack), or an upstream recovery state after max_retries.

Here is what a minimal YAML guardrail looks like:

states:
  IMPLEMENT:
    persona: Staff Engineer
    model: sonnet
    expected_outputs: [src/app.py]
    prompt: |
            Implement the plan in PLAN.md with tests. Leave zero TODOs in src/.
    transitions:
      - target: REVIEW
        when: Implementation and tests pass
        guards:
          - command: uv run pytest -q
          - type: file_not_contains
            path: src
            pattern: "TODO|FIXME"
            regex: true
        on_fail: .SELF
        max_retries: 3
        on_max_retries: .BACK
        fail_prompt: |
          Checks failed (attempt {attempt}/{max_retries}):
          {errors}          
        max_retries_prompt: |
                    Failed {attempt} times. Rolling back to revise PLAN.md first.

Real-World Example: Moving a Graphic Novel Studio Onto Flux

I recently stress-tested this on my multi-volume educational Graphic Novel skill: a pipeline with a Showrunner, Curriculum Architect, Dialogue Screenwriter, Panel Formatter, OCR Pre-Screener, two tiers of Vision QA, and an EPUB packager.

Before Flux, even with a detailed SKILL.md, the generated Volume 1 script rushed straight into system acronyms on Page 1, teleported characters into a whiteboard lecture on Page 2 without establishing their relationship, and rattled off definitions instead of letting the student character ask “Wait, I don’t get it."

Moving the pipeline into an 18-state Flux cartridge (cartridge.py) solved this cleanly:

Graphic Novel Studio: Flux v3 State Machine

  1. Dynamic Just-In-Time Prompts: STAGE_5A_SCREENWRITER swaps its prompt dynamically between Volume 1 (enforcing a 3-page Hollywood opening crescendo before any diagrams appear) and Volumes 2+ (continuity re-entry).
  2. A Dedicated STAGE_5A_READER_PROXY Gate: Before panel formatting even begins, a Script Doctor state checks the screenplay for gentle “you can think of it like…" explanations, at least three “Wait, what does that mean?" student pushbacks, and zero leaked CamelCase keys or insider jargon.
  3. Token-Tier and QA Control: OPUS 5.5 runs once for the Master Showrunner (STAGE_3_SHOWRUNNER), SONNET 5.5 handles curriculum, dialogue, and likeness QA, and HAIKU 5.5 runs zero-image bash orchestration, layout pagination, and EPUB packaging, with automatic on_fail rollbacks to STAGE_8_RENDER_OCR whenever Vision QA flags a page.

Skills are great for telling an agent that a workflow exists. State machines are how you make the workflow actually hold together.

When you move the rules out of a giant static prompt and into a Flux cartridge, the LLM stops juggling 18 steps in its head. It just does the one job in front of it, passes the gate, and moves to the next state.

You can check out the updated Flux v3 repo here: github.com/adamjgrant/fluxplayer.