imn@dev:~/flow$ cat case-study.md

FLOW.EXE

PERSONAL · FLAGSHIP

route the data. don't melt the cpu. a mobile puzzle game in a backend-developer aesthetic — and the LLM pipeline that designs its levels.

[ flow-exe.app ↗ ][ app store ↗ ]repo: private // ask me about it
flow.exe board: the signal runs from the input on the left to the output on the right

// the signal above is the whole game. hover to replay.

imn@dev:~/flow$ cat 01-what-it-is.md

you rotate pipe tiles — corners, tees, bridges, splitters — until the data flow reaches the sink. in the way: firewalls gated by boolean formulas (SW1∧SW2), one-way diodes, viruses that corrupt the stream, overheating tiles, and a patrolling saboteur AGENT that re-rotates your work.

difficulty runs BASIC → LEGEND. daily puzzles with streaks, leaderboards, achievements, RU/EN localization.

built with React Native / Expo + Supabase.

rotating pipesSW1∧SW2 firewallsdiodesvirusesoverheatingsaboteur AGENTdaily streaksleaderboards
IN
OUT
moves 0/7

// live board — the actual @flow/game engine, ported as-is; tap tiles to rotate

// what the later tiers add — same renderer, no gameplay attached

  • SW1∧SW2
    firewall — shut until SW1 and SW2 are both on
  • ON
    SW1
    switch — drives every firewall on its link
  • diode — conducts one way only
  • SHUT
    valve — a tap opens or shuts the pipe
  • virus — the host sleeps until you cure it

imn@dev:~/flow$ cat 02-engine.md

the zero-dependency engine

packages/game is pure TypeScript with zero dependencies — no React, no Supabase, no Node builtins. the invariant is enforced by a unit test: if a dependency sneaks in, CI fails.

the same engine runs everywhere:

webreact nativelevel-pipeline solver

// packages/game/package.json

{
  "name": "@flow/game",
  "dependencies": {}   ← enforced by a unit test
}

imn@dev:~/flow$ cat 03-level-pipeline.md

levels are designed by an LLM pipeline

a workflow, not an agent: four stateless stages, no tools, no memory for the models. all state lives in the database.

01 designer

emits a full solved topology for the level.

Sonnet 5 (basic/advanced) · Opus 4.8 (complex)

→ builder

02 builder

deterministically finalizes: canonicalization, rotations, scramble.

no LLM — pure code

→ evaluator

03 evaluator

BFS solver with witness solutions + difficulty metrics M1–M8. verdict: auto-accept / reject / borderline.

no LLM — solver + metrics

→ critic (borderline only)

04 critic

targeted repair of borderline levels.

Sonnet 5

↺ back to evaluator

structured output — Vercel AI SDK generateObject + Zod schemas at every stage boundary.

state — only in the DB. stages are stateless and restartable.

config — thresholds and prompts live in YAML, not code.

curation — human review loop via an internal /review UI.

imn@dev:~/flow$ cat 04-extra-legend.md

deep content: EXTRA and LEGEND

the hardest tiers don't go through the automatic pipeline. they're built manually: builder scripts + subagents, plus a separate prover that proves solution minimality — not "looks hard", but mathematically minimal.

// prover output

LEGEND pair  8 … minimality proven ∎
LEGEND pair 13 … minimality proven ∎
LEGEND pair 21 … minimality proven ∎

// proven, not vibes.

imn@dev:~/flow$ cat 05-takeaways.md

what transfers to client work

$ treat LLM systems as workflows with typed contracts — stateless stages, state in the DB, structured outputs validated at every gate.

$ keep the deterministic core dependency-free; let AI live at the edges.

$ evaluate before you ship — solvers, metrics and auto-accept thresholds beat manual QA.

$ human-in-the-loop where it pays: a /review UI turns curation into minutes.

// the same shape powers client pipelines: scraping → llm analysis → checks → review.