The Omni Loop's band above the prompt: what this session is on, its stage and its links, from omni now.


Omni Loop turns product plans into delivered software across Vertuoza's engineering repositories. A PM writes a PRD. The PRD becomes a plan of waves and slices, and coding agents deliver it. Anyone with a coding-agent slot can lend it to a PRD they do not own.
The loop works with Claude Code, Codex, Cursor, Gemini CLI and any coding agent that reads AGENTS.md: see Any coding agent.
On top of that delivery sits a game. Each PRD is a planet the organisation terraforms together. Unanswered questions, stuck slices and shipped bugs are Entropy, and they cost the owning team points until someone closes them. The game only reads the delivery layer and can be removed without touching it (game/, .github/workflows/game.yml).
docs/guide/, served at /docs by the app. Joining a team that already runs it? Start with Join a team, then How the loop works and Use cases.docs/superpowers/specs/2026-09-24-omni-plan-game-design.mdgame/README.mdapps/galaxy/README.mdA pnpm workspace:
| Path | What |
|---|---|
kit/ | the delivery kit (omni CLI) |
game/ | the game layer: projector, ledger, economy, banner, rankings |
packages/design | @omni/design: the Omni Loop design system — the colour tokens (tokens.css), the fonts (fonts.css), the 16-bit crest logo, the OMNI_LOOP brand, hand-placed pixel sprites and the planet renderer (README) |
packages/galaxy | @omni/galaxy: folds ledger events into the galaxy view; the demo world |
apps/galaxy | @omni/galaxy-app: the OMNI LOOP arcade, a Next.js app for Vercel |
supabase/ | the game's database and source of truth: migrations, access checks, config, demo seed |
gh auth statuspnpm install
pnpm test
The tests run entirely on fixtures and never call GitHub.
The kit, the game and the scripts read their environment once, in kit/lib/env/read.ts, as groups: each one set whole, or left unset and its feature off. A group half set or a malformed value stops the command with one line naming the variables, never a value (ADR-0057). Every one is optional:
<!-- omni:env-variables -->
OPENROUTER_API_KEY, and optionally OPENROUTER_MODEL: the model omni harvest asks where each decision belongs, and whether a rule is worth a law; omni knowledge judge, the sweep of a repository's untested laws, needs it (Laws and their tests).PROOF_URL and PROOF_STORAGE_STATE: the address /omni:prove films and the file omni proof session writes its sign-in to.OMNI_LOOP_WORKSPACE: the workspace a game command plays for when --workspace names none.SUPABASE_URL (or NEXT_PUBLIC_SUPABASE_URL) and SUPABASE_SERVICE_ROLE_KEY: the game's database, for the game:* commands, personas-import and schemas:verify --production.OMNI_TOKEN: a kit token (omk_…, made by omni setup-token) that signs every omni command in to the Omni page where no browser can, such as a cloud session; set, it wins over the sign-in omni signin keeps, and omni whoami prints (OMNI_TOKEN ··<last four>).OMNI_SESSION_ID: the session id every omni command records its work under and omni dossier open tags a draft with, under any coding agent; set, it wins over the session id Claude Code sets. Unset under an agent that gives none, omni dossier open generates one and keeps it for the checkout in .omni-loop/local/session.json.OMNI_HEARTBEAT: off stops the heartbeat every omni command run in a session sends the Omni page, at most once a minute and in the background; on, or unset, keeps it. Claude Code's own hook still runs omni heartbeat after each tool call.OMNI_ASK: on turns ask mode on with no omni ask on, as a cloud session's fresh clone needs, so omni ask question asks the person on the Omni page; off turns it off whatever omni ask on wrote; unset, omni ask on and omni ask off decide.<!-- /omni:env-variables -->
The app and the arcade each list their own: apps/omni-app/README.md, apps/galaxy/README.md.
pnpm galaxy:dev # http://localhost:3000 — the arcade, on the demo galaxy
With a local Supabase, Vercel deployment and the artifact build: apps/galaxy/README.md.
Everything the game knows lives in Supabase (apps/galaxy/README.md), and belongs to a workspace: Vertuoza is the workspace vertuoza. Repositories are grouped into sectors and the fleets are rows in teams, both of a workspace, and both changed by a migration in supabase/migrations/:
insert into public.sectors (workspace_id, name, repos)
select id, 'core-belt', array['nimbus-core', 'nimbus-api'] from public.workspaces where slug = 'vertuoza';
insert into public.teams (workspace_id, name, label, color, motto, mascot, home, sort)
select id, 'pirates', 'PIRATES', '#2fc6a4', 'Takes the zones nobody claims.', 'pirate', 'core-belt', 50
from public.workspaces where slug = 'vertuoza';
update public.teams set retired_at = now() -- retire, never delete
where name = 'invincible-team' and workspace_id = (select id from public.workspaces where slug = 'vertuoza');
The fleets today: BEAVER, OCTOPOD, PICSOU, C.I.A. and PIRATES. People join one in the arcade: they sign in with their GitHub account, which makes them members of the workspace of every GitHub org of theirs that has the Omni App installed (vertuoza for the vertuoza org), pick a fleet, enter a name and build a hero, and from then on their pull requests score for that fleet.
With SUPABASE_URL and SUPABASE_SERVICE_ROLE_KEY set (locally: npx supabase status). Each command reads and writes one workspace, named by --workspace <slug> or, failing that, by OMNI_LOOP_WORKSPACE; there is no default:
pnpm game:banner 2332 --workspace vertuoza # one planet's banner, read live from GitHub
pnpm game:project --workspace vertuoza # snapshot the workspace's GitHub and append new events to its ledger
pnpm game:score --workspace vertuoza # fold its ledger into this month's season
pnpm game:export backup/ --workspace vertuoza # its row, ledger, sectors, fleets and players as JSONL
game:project writes permanent history. Run it against production only once the sectors hold the real repositories.
The workflow polls every 15 minutes and posts rankings every Monday. It does nothing until it is switched on. The token, rankings issue and GAME_ENABLED steps are described in game/README.md › Setup.
Omni Loop is free software under the GNU Affero General Public License v3.0 (AGPL-3.0-only). You may copy, change and share it; anyone who runs a changed version as a network service must publish its full source under the same license. The fonts in packages/design/fonts/ keep their own SIL Open Font License, beside each font.
hooks/register.tsx 93 lines1// The omni-hud mod (PRD 1208's spec, "The band"): a band above the prompt drawn from
2// `omni now --json`, and the slash command that turns it off and on. It only draws: it reads
3// nothing but `omni now`'s answer, sends nothing anywhere and changes no file.
4//
5// - **When it asks.** `node <project root>/.omni-loop/bin/omni.mjs now --json --session <id>`, at
6// the session's start, after a tool call (at most once every 10 seconds) and every 30 seconds.
7// The latest answer is held in `$.state`, so the band redraws when it changes. While the answer
8// holds an approval wait (PRD 1322's s5), it asks again every 5 seconds, so the approved line shows
9// within seconds, and once more when its toast ends, so the highlight lasts 10 seconds.
10// - **Hidden** while the session is on nothing, while the command fails or prints no answer of
11// `omni now`'s shape, while a survey holds the band, and while the person turned it off.
12// - **The command** turns the band off, or on again, for this person across sessions (`$.store`).
13import { atom, read, update } from 'claude-code'
14import type { EngineInterface, Register, Timer } from 'claude-code'
15
16import type { HudNow } from '../types/index.d.ts'
17import { bandRows, parseNow, waitAgainIn } from './band.ts'
18
19const OFF_KEY = 'isOff'
20const EVERY_MS = 30_000
21const AFTER_TOOL_MS = 10_000
22
23const now = atom({ plugin: 'omni-hud', key: 'now' } as const, null)
24const isOff = atom({ plugin: 'omni-hud', key: 'isOff' } as const, false)
25
26/** When the band last asked `omni now`, in `$.clock.now()`'s milliseconds. */
27let askedAt = Number.NEGATIVE_INFINITY
28/** The next ask an approval wait asked for, cancelled by any ask before it. */
29let waitAgain: Timer | null = null
30
31/** Asks `omni now --json` and holds its answer, `null` when it failed or had another shape. */
32async function ask($: EngineInterface): Promise<void> {
33 askedAt = await $.clock.now()
34 let answer: HudNow | null = null
35 try {
36 const root = await $.session.root()
37 const session = await $.session.id()
38 const run = await $.process.run(['node', `${root}/.omni-loop/bin/omni.mjs`, 'now', '--json', '--session', session], { cwd: root })
39 answer = run.exitCode === 0 ? parseNow(run.stdout) : null
40 } catch {
41 answer = null
42 }
43 await update($, now, () => answer)
44 waitAgain?.cancel()
45 const again = waitAgainIn(answer, await $.clock.now())
46 waitAgain = again === null ? null : $.clock.after(again, () => void ask($))
47}
48
49export const register: Register = on => {
50 on('session.start', async ($, e, next) => {
51 await $.command.register({ name: 'omni-hud', description: 'Turn the Omni band above the prompt off, or on again' })
52 const stored = await $.store.get(OFF_KEY)
53 await update($, isOff, () => stored === true)
54 await ask($)
55 $.clock.every(EVERY_MS, () => void ask($))
56 return next(e)
57 })
58
59 on('tool.call', async ($, e, next) => {
60 const result = await next(e)
61 if ((await $.clock.now()) - askedAt >= AFTER_TOOL_MS) $.clock.after(0, () => void ask($))
62 return result
63 }).catch(($, e, next) => next(e))
64
65 on('command.run', { command: 'omni-hud' }, async $ => {
66 const off = !(await read($, isOff))
67 await $.store.set(OFF_KEY, off)
68 await update($, isOff, () => off)
69 return { text: off ? 'The Omni band is off. Type /omni-hud to turn it on again.' : 'The Omni band is on.' }
70 })
71
72 on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
73 if (e.props.hasSurvey || (await read($, isOff))) return next(e)
74 const rows = bandRows(await read($, now))
75 if (rows.length === 0) return next(e)
76 const { Box, Link, Text } = $.ui.resolve(e)
77 return (
78 <Box key="omni-hud" flexDirection="column">
79 {rows.map(row => (
80 <Box key={row.key}>
81 <Text wrap="truncate-end" {...(row.toast ? { inverse: true, bold: true } : {})}>
82 {row.parts.flatMap((part, index) => [
83 ...(index > 0 ? [<Text dimColor> · </Text>] : []),
84 'href' in part ? <Link href={part.href} label={part.label} /> : <Text>{part.text}</Text>,
85 ])}
86 </Text>
87 </Box>
88 ))}
89 </Box>
90 )
91 })
92}
93types/index.d.ts 35 lines1// The omni-hud mod's state contract: what its band draws from, held by the host for the session.
2
3/** A link of what the session is on. */
4export type HudLink = { label: string; href: string };
5
6/** A slice being built, or stuck. */
7export type HudSlice = { id: string; name: string | null; state: string };
8
9/** What the session works on: a PRD, a bug fix or a visual fix. */
10export type HudWork = { kind: string; number: number; topic: string; stage: string | null; slices: HudSlice[]; links: HudLink[] };
11
12/** The loop, or the roadmap it drives, above the work. */
13export type HudHeadline = { kind: string; number?: number; progress?: string; links: HudLink[] };
14
15/** The approval wait's line (PRD 1322's s5), a toast until `until` (milliseconds since the epoch) when `toast`. */
16export type HudWait = { line: string; toast: boolean; until: number | null };
17
18/** What `omni sync` last kept (PRD 1990); `setupDone`, the newcomer's steps done, only while `blue`. */
19export type HudSync = { status: 'blue' | 'red' | 'orange' | 'green'; headline: string | null; checkedAt: string; setupDone?: number };
20
21/** The runner slots free while a runner is online for this repository (PRD 2251). */
22export type HudRunners = { free: number; slots: number };
23
24/** The last milestone of the followed runner job (PRD 2251). */
25export type HudRunner = { line: string };
26
27/** `omni now --json`'s answer, as the band reads it; `wait` only while an approval wait shows something, `sync` once `omni sync` has run. */
28export type HudNow = { headline: HudHeadline | null; work: HudWork | null; doing: string | null; wait: HudWait | null; sync: HudSync | null; runners: HudRunners | null; runner: HudRunner | null };
29
30declare module 'claude-code' {
31 interface PluginState {
32 'omni-hud': { now: HudNow | null; isOff: boolean };
33 }
34}
35hooks/band.ts 202 lines1// What the band draws, from `omni now --json`'s answer (PRD 1208's spec, "The band"): pure.
2//
3// - **The answer** is read only when it parses and has the shape `omni now` prints; anything else
4// is no answer, and the band hides.
5// - **At most five rows.** The headline (`roadmap 7 · 3/7 merged · roadmap page`), only with one;
6// the work (`PRD 315 help-and-status · building · now: s3 tabs, s4 board`), with `doing` in place
7// of the "now" part while a loop runs; the approval wait's line, below; the work's links, only
8// with some.
9// - **The approval wait** (PRD 1322's spec, §6): while `omni wait approval` runs, its line, the
10// `wait` row, after the work and before its links; the approved or voided line is the `toast` row,
11// drawn highlighted, until the answer says it is over.
12// - **The sync row** (PRD 1990): `omni now`'s `sync` field, drawn first as the status line draws its
13// badge (`🟢 in sync`, `🟠 <headline>`, `🔴 <headline>`, `🔵 setting up <k>/4`); no field, no row.
14// It shows with the session on nothing too: the band is then this row alone.
15// - **The runner rows** (PRD 2251): `runners <free>/<slots> slots free` while `omni now` carries `runners`, and
16// the followed job's last milestone from `runner`; each is hidden when absent. They show with the session on
17// nothing too.
18// - **Nothing** while the session is on nothing: no headline, no work and no wait.
19import type { HudHeadline, HudLink, HudNow, HudRunner, HudRunners, HudSlice, HudSync, HudWait, HudWork } from '../types/index.d.ts'
20
21/** One piece of a row: plain text, or a link. */
22export type BandPart = { text: string } | HudLink
23
24/** One row of the band: its pieces, drawn with ` · ` between them; highlighted when `toast`. */
25export type BandRow = { key: string; parts: BandPart[]; toast?: boolean }
26
27const IN_FLIGHT = ['in-flight', 'claimed-stale']
28
29const isRecord = (value: unknown): value is Record<string, unknown> =>
30 typeof value === 'object' && value !== null && !Array.isArray(value)
31
32function asLinks(value: unknown): HudLink[] | null {
33 if (!Array.isArray(value)) return null
34 const links: HudLink[] = []
35 for (const item of value) {
36 if (!isRecord(item) || typeof item.label !== 'string' || typeof item.href !== 'string') return null
37 links.push({ label: item.label, href: item.href })
38 }
39 return links
40}
41
42function asSlices(value: unknown): HudSlice[] | null {
43 if (!Array.isArray(value)) return null
44 const slices: HudSlice[] = []
45 for (const item of value) {
46 if (!isRecord(item) || typeof item.id !== 'string' || typeof item.state !== 'string') return null
47 const name = typeof item.name === 'string' ? item.name : null
48 slices.push({ id: item.id, name, state: item.state })
49 }
50 return slices
51}
52
53function asWork(value: unknown): HudWork | null | undefined {
54 if (value === null) return null
55 if (!isRecord(value)) return undefined
56 const { kind, number, topic, stage } = value
57 const slices = asSlices(value.slices ?? [])
58 const links = asLinks(value.links ?? [])
59 if (typeof kind !== 'string' || typeof number !== 'number' || typeof topic !== 'string') return undefined
60 if (stage !== null && stage !== undefined && typeof stage !== 'string') return undefined
61 if (!slices || !links) return undefined
62 return { kind, number, topic, stage: stage ?? null, slices, links }
63}
64
65function asHeadline(value: unknown): HudHeadline | null | undefined {
66 if (value === null) return null
67 if (!isRecord(value) || typeof value.kind !== 'string') return undefined
68 const links = asLinks(value.links ?? [])
69 if (!links) return undefined
70 const headline: HudHeadline = { kind: value.kind, links }
71 if (typeof value.number === 'number') headline.number = value.number
72 if (typeof value.progress === 'string') headline.progress = value.progress
73 return headline
74}
75
76function asWait(value: unknown): HudWait | null | undefined {
77 if (value === null) return null
78 if (!isRecord(value)) return undefined
79 const { line, toast, until } = value
80 if (typeof line !== 'string' || typeof toast !== 'boolean') return undefined
81 if (until !== null && typeof until !== 'number') return undefined
82 return { line, toast, until }
83}
84
85const SYNC_STATUSES = ['blue', 'red', 'orange', 'green'] as const
86
87const asSyncStatus = (value: unknown): HudSync['status'] | null => SYNC_STATUSES.find((status) => status === value) ?? null
88
89function asSync(value: unknown): HudSync | null | undefined {
90 if (value === null) return null
91 if (!isRecord(value)) return undefined
92 const { status, headline, checkedAt, setupDone } = value
93 const known = asSyncStatus(status)
94 if (known === null || typeof checkedAt !== 'string') return undefined
95 if (headline !== null && typeof headline !== 'string') return undefined
96 if (setupDone !== undefined && typeof setupDone !== 'number') return undefined
97 return { status: known, headline, checkedAt, ...(setupDone === undefined ? {} : { setupDone }) }
98}
99
100/** `omni now --json`'s stdout as an answer, or `null` when it does not parse or has another shape. */
101export function parseNow(stdout: string): HudNow | null {
102 let data: unknown
103 try {
104 data = JSON.parse(stdout)
105 } catch {
106 return null
107 }
108 if (!isRecord(data)) return null
109 const headline = asHeadline(data.headline ?? null)
110 const work = asWork(data.work ?? null)
111 const doing = data.doing ?? null
112 const wait = asWait(data.wait ?? null)
113 const sync = asSync(data.sync ?? null)
114 const runners = asRunners(data.runners ?? null)
115 const runner = asRunner(data.runner ?? null)
116 if (headline === undefined || work === undefined || wait === undefined || sync === undefined) return null
117 if (runners === undefined || runner === undefined) return null
118 if (doing !== null && typeof doing !== 'string') return null
119 return { headline, work, doing, wait, sync, runners, runner }
120}
121
122function asRunners(value: unknown): HudRunners | null | undefined {
123 if (value === null) return null
124 if (!isRecord(value)) return undefined
125 const { free, slots } = value
126 if (typeof free !== 'number' || typeof slots !== 'number') return undefined
127 return { free, slots }
128}
129
130function asRunner(value: unknown): HudRunner | null | undefined {
131 if (value === null) return null
132 if (!isRecord(value) || typeof value.line !== 'string') return undefined
133 return { line: value.line }
134}
135
136const slug = (kind: string, number: number): string =>
137 kind === 'prd' ? `PRD ${number}` : kind === 'bug' || kind === 'visual' ? `${kind} #${number}` : `${kind} ${number}`
138
139const sliceLabel = ({ id, name }: HudSlice): string => (name ? `${id} ${name}` : id)
140
141function headlineRow(headline: HudHeadline): BandRow {
142 const title = headline.number === undefined ? headline.kind : `${headline.kind} ${headline.number}`
143 const parts: BandPart[] = [{ text: title }]
144 if (headline.progress) parts.push({ text: headline.progress })
145 return { key: 'headline', parts: [...parts, ...headline.links] }
146}
147
148function workRow(now: HudNow): BandRow | null {
149 const { work, headline, doing } = now
150 if (!work) return doing ? { key: 'work', parts: [{ text: doing }] } : null
151 const parts: BandPart[] = [{ text: `${slug(work.kind, work.number)} ${work.topic}` }]
152 if (work.stage) parts.push({ text: work.stage })
153 const building = work.slices.filter((slice) => IN_FLIGHT.includes(slice.state))
154 if (headline && doing) parts.push({ text: doing })
155 else if (building.length > 0) parts.push({ text: `now: ${building.map(sliceLabel).join(', ')}` })
156 return { key: 'work', parts }
157}
158
159const waitRow = ({ line, toast }: HudWait): BandRow =>
160 toast ? { key: 'toast', parts: [{ text: line }], toast: true } : { key: 'wait', parts: [{ text: line }] }
161
162const runnersRow = ({ free, slots }: HudRunners): BandRow => ({ key: 'runners', parts: [{ text: `runners ${free}/${slots} slots free` }] })
163
164/** The words of the sync row, as the status line words its badge. */
165function syncRow({ status, headline, setupDone }: HudSync): BandRow {
166 const dot = { green: '🟢', orange: '🟠', red: '🔴', blue: '🔵' }[status]
167 const words = status === 'blue' ? `setting up ${setupDone ?? 0}/4` : status === 'green' ? 'in sync' : (headline ?? status)
168 return { key: 'sync', parts: [{ text: `${dot} ${words}` }] }
169}
170
171/** The band's rows for an answer: the sync row first, then none while the session is on nothing. */
172export function bandRows(now: HudNow | null): BandRow[] {
173 if (!now) return []
174 const rows: BandRow[] = now.sync ? [syncRow(now.sync)] : []
175 const runnerRows: BandRow[] = [
176 ...(now.runners ? [runnersRow(now.runners)] : []),
177 ...(now.runner ? [{ key: 'runner', parts: [{ text: now.runner.line }] }] : []),
178 ]
179 if (!now.work && !now.headline && !now.wait) return [...rows, ...runnerRows]
180 if (now.headline) rows.push(headlineRow(now.headline))
181 const work = workRow(now)
182 if (work) rows.push(work)
183 if (now.wait) rows.push(waitRow(now.wait))
184 if (now.work && now.work.links.length > 0) rows.push({ key: 'links', parts: now.work.links })
185 return [...rows, ...runnerRows]
186}
187
188/** How often the band asks `omni now` while a wait waits. */
189const WAITING_EVERY_MS = 5_000
190
191/**
192 * When the band asks `omni now` again for the wait in `now`, in milliseconds from `at`: when the
193 * toast ends, every 5 seconds while it waits so the approval shows within seconds, else `null`.
194 */
195export function waitAgainIn(now: HudNow | null, at: number): number | null {
196 const wait = now?.wait
197 if (!wait) return null
198 if (wait.toast && wait.until !== null) return Math.max(0, wait.until - at)
199 return WAITING_EVERY_MS
200}
201
202