Skip to content
lalalunePublic

Repository files navigation

Vibestack

Ship apps. Not slop.

Build formally verified full-stack applications in English.
What you want is what you get.

vibestack.fun · SKILL.md · Concepts · How it works · Quickstart · The stack · Studio · Commands · Examples

Vibestack is a way to build an app with a coding agent in which what the app does is written down and proved, not hoped for. You describe the app in stories; your agent turns them into rules, a formal model and the code; pnpm check proves the code keeps every rule and records the rules that changed for you to read. Concepts explains the words if formal methods are new to you, How it works walks through it with a real example, and Quickstart starts a project.

Watch Vibestack explained in three minutes

Vibestack Studio

Concepts

You need no background in formal methods: you write stories and read rules, and your agent writes the rest. How it works shows what a story, a rule and its Quint model are; these are the other words you will meet.

  • State machine. The app described as the states it can be in (an order is open, submitted or paid) and the events that move it between them (submit, pay), each allowed only when its condition holds.
  • Simulation. Running the model through many random sequences of events and testing every rule after each step. A broken rule comes back as a counterexample, the exact steps that break it. A simulation is fast and finds most mistakes, but it tries many cases, not all of them.
  • Proof. A machine-checked argument, by Dafny, that the generated code keeps a rule in every state and for every input, including the ones no simulation or test tried.
  • Proved or simulated. What the code owes a rule is proved once Dafny finishes the proof. Until then it is simulated only: it held in every simulation, which is strong evidence but not a guarantee, and pnpm check fails until a person settles for that with pnpm accept unproved.

What pnpm check runs says which stage checks each.

How it works

You say what your app should do, in plain English. Vibestack turns it into rules and a state machine, proves that the rules hold in every state and for every input, generates the code that runs the machine, and checks that your app keeps to it. A test catches only the bugs someone thought to test for; a proof covers every case a rule speaks of.

From a story to a running app

flowchart LR
  you(["You: stories"]) --> spec["spec/**/*.md<br/>stories · rules · Quint"]
  spec -- generate --> gen["gen/<br/>TypeScript core · Effect adapter"]
  gen --> shell["src/*.vibe<br/>VibeLang shell"]
  gen --> ui["src/*.tsx<br/>React interface"]
  shell --> tests["test/<br/>journeys · conformance"]
  ui --> tests
  spec -. simulate .-> sim([counterexample or witness])
  gen -. "Dafny + LemmaScript" .-> proof([proof for all states and inputs])
  tests -. "pnpm check" .-> review(["review, recorded by the check"])
Loading
  1. Story. In spec/index.md you write what a user wants: "As a shopper, I want to submit my order and pay it off in one or more payments, so that I do not need the whole amount at once."
  2. Rules. Each story gets rules, one checkable sentence each: "A payment never exceeds the balance."
  3. Model. Under each rule, a few lines of Quint say the same thing formally: the state, the events that change it, and when each one is allowed.
  4. Generated machine. pnpm gen writes gen/ from the model: a TypeScript state machine, an Effect Machine service and React hooks. Nobody edits it.
  5. App. Code in src/ does what a model cannot: storage, HTTP, the screens. It sends each event through the machine, so it can only do what the rules allow.
  6. Check. pnpm check simulates the model, proves the generated code with Dafny, and runs the types, the tests and a bot that explores every page. A broken rule comes back as a counterexample: the steps that break it.
  7. Review. Once every other stage passes, pnpm check records each rule that changed in spec/lock.json, and you read them in the diff. With "signOff": true the rules wait for your pnpm accept instead. A rule changed later comes back for review.

Your agent does steps 2 to 6, looping on pnpm check until it passes, or, with signOff, until only your sign-off is left (AGENTS.md). Studio shows the same spec live: the stories, the screens and the state machine, which you can step through.

What pnpm check runs

Its stages run in order, and a failure stops the ones that depend on it. The stage table says what each catches and when it is skipped.

Quickstart

Paste into your agent:

Read https://vibestack.fun/SKILL.md and create a new project.

ChatGPT (Codex) Claude Grok Bot Cursor Muse

For desktop app deeplinks (codex://, claude://, grokbot://, cursor://) or an existing repository (Read https://vibestack.fun/SKILL.md and upgrade an existing project.), open vibestack.fun.

Or run from the terminal (requires Node 26+ and pnpm):

# New project (or scaffold an example: order | dashboard | fullstack | assistant)
pnpm dlx --package=https://github.com/lalalune/vibestack/releases/latest/download/create-vibestack.tgz create-vibestack my-app
cd my-app && pnpm dev   # create-vibestack installs, runs doctor --install-dafny, and offers to start this itself

# Launch Vibestack Studio on any project with spec/
pnpm dlx --package=https://github.com/lalalune/vibestack/releases/latest/download/vibestack-studio.tgz vibestack-studio

Packages are distributed as .tgz tarballs on GitHub Releases (the unscoped vibestack name on npm belongs to an unrelated package).

The stack

Stories and rules live in spec/**/*.md with formal Quint underneath. gen/ is derived, simulated, and proved with Dafny and LemmaScript. Effects run in VibeLang on Effect, interfaces in React + Tailwind + shadcn/ui, and real journeys in Vitest, Storybook, Bombadil, and ESLint.

Layer Owns Verified by
Requirements Stories and rules in spec/**/*.md, edited in Markdown or Studio review, recorded by pnpm check (or pnpm accept with signOff)
Model Quint state, transitions, always / step / sometimes / leadsTo rules, laws model, always, sometimes
Generated core gen/<name>.ts, gen/<name>.effect.vibe (Machine), gen/<name>.react.ts replay, proof (Dafny + LemmaScript)
Shell HTTP, storage, queues, I/O in VibeLang on Effect 4 (or plain TS in typescript mode) types (vibelang / tsc)
Interface React, Vite, Tailwind v4, shadcn/ui on Radix, @repo/design-system tokens types, ESLint token rules, Storybook
Deployment Alchemy v2 (alchemy.run) on Cloudflare Workers, Static Assets, and SQLite Durable Objects pnpm test:deploy (workerd), post-deploy Alchemy.Action
Tests Vitest + Playwright journeys, spec conformance drivers, Bombadil page exploration tests, traces, explore

Agents follow AGENTS.md, SPEC.md, and .agents/skills/, iterating on pnpm check until it is green; what moved in the spec is recorded by that check and shows in its output and the diff, or, with signOff on, waits for your pnpm accept. See CONTRIBUTING.md for caching, test policy, and CI details.

Studio

# open Vibestack Studio on the current project
pnpm dlx --package=https://github.com/lalalune/vibestack/releases/latest/download/vibestack-studio.tgz vibestack-studio

# open Vibestack Studio on any directory with spec/
npx --yes --package=https://github.com/lalalune/vibestack/releases/latest/download/vibestack-studio.tgz vibestack-studio ./path/to/project

# in a scaffolded app: Studio + app dev servers, Studio opened in the browser
pnpm dev

# the app on a phone on the same Wi-Fi, or an Android phone over USB, with hot reload: scan the QR code it prints
pnpm cli device
# the same server in the iOS Simulator, or through adb reverse in an Android emulator, booted if none runs
pnpm cli device --ios
pnpm cli device --android

Studio prints its address (studio: http://localhost:4321/…, or the next free port) and, while it serves, names it in .studio/serving.json, where an agent finds it. Started again while that Studio still answers, as by a second pnpm dev, it shows and opens that address and starts no second one. spec studio --open opens the browser even when its output is not a terminal, as under pnpm dev.

vibestack-studio is a standalone package with zero runtime npm dependencies and a prebuilt React UI. Inspect and edit Stories, live Layout previews, and interactive States graphs side by side, run checks, and, with signOff on, sign off directly in the browser.

pnpm dev writes gen/ before it starts the app's Vite server beside Studio. Then save a spec in any editor: Studio stops a check still running and checks again, and a check writes gen/ before anything else, only the files whose text changed, so Vite serves the new modules without a rebuild while simulation, proofs and tests run behind it. A spec that is not valid keeps its last good modules in gen/, so the app keeps running until it is fixed. An edit made in Studio's page reaches gen/ once it is published. Without Studio, pnpm exec spec watch does the same in a terminal, and writes gen/ in its own warm process before each check.

Add to an existing project

vibestack init is non-destructive and auto-detects vibelang vs. plain typescript mode (pass --mode vibelang|typescript|specs-only or --exclude <dirs> to customize):

pnpm add -D https://github.com/lalalune/vibestack/releases/latest/download/vibestack.tgz
pnpm exec vibestack init
pnpm exec vibestack doctor --install-dafny
pnpm exec spec new
pnpm check

Upgrade an existing project to the latest release without clobbering custom edits:

pnpm vibestack upgrade                     # upgrade to latest release
pnpm exec vibestack upgrade --dry-run      # preview managed file updates first

Configuration

Configure Vibestack in an optional root vibestack.json (or under "vibestack" in package.json):

{
  "mode": "vibelang",
  "spec": {
    "dir": "spec",
    "exclude": ["models", "product"],
    "owners": { "assistant": "packages/plugin-assistant" }
  },
  "cacheDir": ".spec-cache",
  "stages": { "types": "vibelang", "tests": "vitest", "explore": "auto" },
  "signOff": false
}

signOff (default false) decides who records the review in spec/lock.json. Off, a pnpm check that passes every other stage, with every story given rules and every rule its Quint, records what moved itself and prints it under review; a push is never held for a separate sign-off. On, each changed story, rule and contract stays a failing review item until a person reads it and runs pnpm accept. Obligations that are simulated only are recorded by pnpm accept unproved in either case.

Run pnpm check --frozen in CI: it records nothing and fails, naming each item, wherever a check would have changed spec/lock.json, so a pull request cannot merge with a review its author's check never recorded. A project, or a workspace package that checks a spec tree of its own, that already has reviews in spec/lock.json and names no signOff is told once, by name, by the vibestack upgrade that takes it past 0.3.0, that the default is now false; set "signOff": true there to keep signing off each review.

Commands

vibestack and spec are identical binaries provided by the vibestack package.

Command Does
pnpm dlx --package=https://github.com/lalalune/vibestack/releases/latest/download/create-vibestack.tgz create-vibestack <name> [--example order|dashboard|fullstack|assistant] Scaffolds a clean project from template/ or a standalone example
pnpm exec vibestack init [<dir>] [--mode vibelang|typescript|specs-only] Non-destructively initializes an existing repository
pnpm vibestack upgrade [version] [--dry-run] Upgrades vibestack, refreshes managed skills/docs, and aligns toolchain pins
pnpm exec vibestack doctor [--install-dafny] Checks Node 26+, pnpm, Dafny 4.11 and the Z3 a proof runs, Quint, Chromium, and stale worktrees, and installs Dafny 4.11 if missing
pnpm exec vibestack worktrees [--json] / worktrees add <name> --purpose <text> [--base <ref>] / worktrees note <path> <purpose> / worktrees hook uninstall Lists the repository's worktrees with class, age, size and purpose from the git-ignored .worktrees.json, which the git hook vibestack link installs fills on each git worktree add; adds one under .worktrees/ on a branch of its own, records why one exists, or removes the hooks and keeps them off in this clone
pnpm exec vibestack clean [--json] [--apply] [--idle] [--orphans] [--machine] [--days <n>] Shows what merged, pruned and idle worktrees and agents' orphaned checkouts take, and with --machine what else fills the disk; --apply removes them and relinks worktrees of a moved repository
pnpm exec vibestack cache why [<dir>] [--json] Says which part of each cache key changed where check produced a result again: an input, the tools' code, the verifier
pnpm dlx --package=https://github.com/lalalune/vibestack/releases/latest/download/vibestack-studio.tgz vibestack-studio [<dir>] Launches standalone Vibestack Studio on any project with spec/
pnpm dev Writes gen/, then starts Vibestack Studio and every workspace package's dev script together, on localhost, and opens Studio in the browser; a saved spec change reaches the running app without a rebuild
pnpm cli device [--app <path>] [--port <number>] [--host <address>] [--ios] [--android] [--target <device>] [--https] In a scaffolded app: serves the app on the local network with hot reload and prints its address, on macOS its Bonjour .local address too, and a QR code for a phone on the same Wi-Fi; with no network address it serves 127.0.0.1 alone. A server of the same app already on the network is reused, not started twice, and nothing is built; otherwise it builds what the app uses, with //#gen, and while it serves, a saved spec regenerates gen/. When adb is installed it runs adb reverse, for the app's port and the local ports its Vite config proxies to, on each attached Android device and each one attached later, and removes those forwards when it stops; with none attached it prints the command. --ios opens http://localhost:<port>/ in an iOS Simulator (the booted one, else Simulator's current device, else the newest iPhone), booting it; --android runs adb reverse and sends a VIEW intent for that address to the attached emulator or USB phone, else boots the only AVD first; with several to choose from it names them and asks for --target. Both need --host on loopback, 0.0.0.0 or no --host, and refuse --https, since a browser already treats localhost as secure. Devices boot before anything is built. It never stops a device. Checked in an iOS Simulator and an Android emulator, not on a phone: a saved .tsx edit or design token reaches the page as a hot update that keeps what was typed, and a saved .vibe edit as a hot update of src/main.tsx, which does not reload the page and resets the state its components held. --https serves over HTTPS, for what a browser allows only on a secure page, with a self-signed certificate that openssl makes and .cache/device-tls/ keeps; a browser warns before it opens the page. Saving the Vite config restarts the server on the same port, still regenerating gen/. While it runs, anyone on that network can read the project's files through it; --host 127.0.0.1 serves the simulators alone, and does not reuse a server that answers on the network: it starts another on the next free port, or refuses the --port it was given; --host 0.0.0.0 prints the network addresses it serves
pnpm dev:cf Starts local Cloudflare workerd runtime via Alchemy (ALCHEMY_FAST_DISTILLED=1 alchemy dev) in scaffolded apps and examples
pnpm deploy / pnpm deploy:plan Plans or deploys Cloudflare infrastructure via pnpm cli deploy and verifies live endpoints
pnpm test:deploy Verifies built Workers and static assets inside offline local workerd
pnpm check [<dir>] [--json] [--frozen] [--timings] Runs generation, simulation, proofs, types, tests, conformance, and exploration; --frozen, for CI, records nothing and fails where the check would change spec/lock.json
pnpm gen [<dir>] Generates gen/ only
pnpm exec spec watch [<dir>] Writes gen/ whenever the spec changes, then checks; a newer change to the spec stops that check and starts again
pnpm accept [<dir>] [unproved] [--timings] With "signOff": true, the user's sign-off: checks again, rerunning only what changed since the last check, and records reviewed rules in spec/lock.json; off, says the check records them. unproved records the obligations that are simulated only
pnpm new [<path>] Fills an empty root spec or creates a starter spec/<path>/index.md
pnpm cli <command> [--json] Runs project CLI subcommands (packages/cli); pnpm cli --help lists registered levers
pnpm quick Fast local types, lint, and tests of changed packages
pnpm verify Full CI suite: build, types, tests, browser tests, checks, lint, analyze, selftests
pnpm exec vibestack remote <command> Runs this repository's builds, tests, checks and dev servers on boat.dev or SSH boxes; after setup, also vibestack-remote <command>; see Remote boxes

Remote boxes

Twenty agents running pnpm check at once will saturate any laptop. vibestack remote moves the heavy work (installs, builds, tests, Quint model checking, Dafny proofs, browser tests, dev servers) to remote Linux boxes. Agents keep running locally and type the same commands; nothing in Claude Code, Codex or Antigravity changes.

node <vibestack checkout>/packages/vibestack/src/spec.ts remote setup
                                          # once per machine, from any directory: the client, the pnpm/npx/pnpx/vsr
                                          # shims and vibestack-remote in ~/.local/bin; rerun after updating vibestack
vibestack-remote add boat                 # boat.dev sandboxes: installs the CLI, logs in, records the largest box your plan allows
vibestack-remote enable                   # once per repository: every worktree of it now runs remotely
pnpm check                                # runs on the box; output, exit code and files it writes come back
pnpm dev                                  # runs on the box; prints [remote] http://localhost:5173
  • Where. add boat gives each worktree its own boat.dev sandbox (x86_64 Ubuntu), sized from the project's largest memory need. The boat plan sets the ceiling: the $20 plan offers up to large (8 vCPU, 16 GB), xlarge (16 vCPU, 32 GB) needs the $100 plan. add ssh <host> adds an always-on box you reach over SSH (a Hetzner dedicated server, exe.dev, any VM); worktrees stick to the box with the most free memory. Both kinds can be configured; enable --provider <name> picks one.
  • Cost. One sandbox per worktree, created by its first command and stopped 30 minutes after its last ends (the box keeps itself on while a command runs; if it prints [remote] the box cannot keep itself on, only a connected client does, so stay attached to a long run); the next command resumes it in seconds. large bills at twice the rate of default (4 vCPU, 8 GB), so keep memoryGb honest. The first setup in a repository saves a template automatically, so new worktrees start warm; vibestack-remote template saves a fresh one.
  • Sync. Before each command the worktree (tracked, untracked and the include files below) is snapshotted as a git commit with a private index and pushed over one multiplexed SSH connection; only new objects travel. The box fetches history from GitHub once, using your gh token for that fetch only. It rewrites only the files that changed, at the same absolute path as on your machine, so error paths are real local paths and mtime caches stay warm. Files the command writes (the lockfile, snapshots, and ignored files matching outputs, by default gen/**) come back when it exits; a file you edited meanwhile keeps your version and the box's copy is saved under .git/vibestack-remote/kept/. Dev servers also get your edits live. SSH compresses the traffic, which matters most on a slow link.
  • Git stays local. Commit and push as usual; the box never pushes.
  • Like a local process, that survives you. Piped stdin reaches the command and Ctrl-C stops it. The command runs on the box as a job, detached from the SSH connection and from the client: when the connection drops it keeps running, and the client reconnects for as long as it takes and receives the output it missed, exactly once. SIGTERM or SIGHUP (an agent's tool timeout, a closed terminal) detaches a check, build or test: it keeps running and the client exits 75. Running the same command again on the same files picks it up, live or finished, with every line and its exit code, whether or not you committed those files meanwhile; a finished run waits 7 days to be collected. A newer start of the same command in the same directory on changed files stops an older one no client is following and says which run it replaced; a run that was replaced or cancelled is not kept, so asking for it again runs it. A dev server (watch) stops on any signal, 12 hours (detachHours) after its client went silent, and when its script is started again in that directory while no client follows it.
  • Exit code. Always the command's own. Files that could not be brought back are a [remote] line, and the next run brings them.
  • Ports. Ports a command listens on are forwarded to localhost while it runs.
  • Secrets. Ignored files matching include (default .env, .env.*, .dev.vars) travel with the worktree (and so into a boat template saved from it, which stays private to your account); variables named in env are copied from your shell. ~/.config/vibestack/turbo-cache.json is copied to each box, so boxes share the Turbo remote cache with your machine and CI. When it also has a boxToken (the cache worker's optional CACHE_BOX_TOKEN), a box receives only the apiUrl and that token, never the write token: what boxes write stays in a box namespace that CI never reads, and boxes share their spec results with each other through it. Set the worker's secret before adding boxToken: a box whose token the worker does not accept says so in one [remote] line and runs without the remote Turbo cache and without shared spec results. "sharedCache": { "spec": "r" } in ~/.config/vibestack/remote.json makes boxes only import spec results, and "off" stops the sharing.
  • Memory. Every command runs in its own cgroup capped at its memoryGb; a box admits a command only when the limits of what already runs leave room, so one runaway proof cannot take down the others. The box is sized for the largest limit, so a small project limit with one large command keeps most runs light. vibestack-remote stats reports peak memory per command and --write records suggested limits in vibestack.json, never more than the largest box your plan offers.

The project commits what it needs, never where it runs:

{
  "remote": {
    "memoryGb": 4,
    "commands": { "check": { "memoryGb": 12 }, "dev": { "watch": true }, "deploy": { "local": true } },
    "include": ["**/.env", "**/.dev.vars"],
    "outputs": ["gen/**", "**/gen/**"],
    "env": ["CLOUDFLARE_API_TOKEN", "CLOUDFLARE_ACCOUNT_ID"],
    "provision": ["pnpm exec vibestack doctor --install-dafny"],
    "start": ["docker compose up -d"]
  }
}

setup (default: a frozen, offline-preferred pnpm install) runs on the box step by step: a worktree runs only the commands it has not yet run against the current lockfile and setupInputs (files inside submodules included), so appending a command runs just that one. provision installs what the box needs: it runs when its commands change, when it has not run against the lockfiles among setupInputs, or when a tool it installed is gone, and not again because the box stopped and resumed. start runs once per boot of the box in each worktree, after both: the commands that start what the project needs running, such as a local database, which no stop survives. An install command (pnpm install, pnpm add) is its own setup, and neither runs before it. Commands run on the exact Node node names (default 26.13.1). The worktrees of a box share one pnpm store, one Turbo cache per repository and every spec result (.spec-cache entries) any of them computed, so a new worktree starts warm, and a template carries all three to new boxes: one saved by an older vibestack holds none, so save a fresh one with vibestack-remote template after updating. A command that is not watched stops after timeoutMinutes (default 1440), or when its processes used no CPU and wrote nothing for stallMinutes (default 45); commands.<script> sets either for one command. enable --config <file> stores a file's remote block for branches that have none; a branch's own vibestack.json wins over it. The other vibestack-remote commands (in an enabled repository vsr runs, vsr attach and vsr cancel are the same as the three here):

Command Does
status the worktree's sandbox and plan, the box's memory, load and running commands; never starts a sandbox
stats [--write] peak memory per command and suggested limits
doctor checks the client, plan, box and memory limits end to end
shell opens a shell in the worktree on its box
runs the worktree's runs on its box, live and not yet collected: id, age, state, command
attach [run] [--tail N] follows a run to its end, files and exit code included
cancel [run] stops a run on the box, the newest live one when none is named; naming a finished run drops it
template saves the warmed sandbox as the repository's template
stop, destroy stops or deletes the worktree's sandbox
gc [--yes] deletes sandboxes of removed worktrees; --yes also deletes vs … sandboxes this machine has no record of

VIBESTACK_REMOTE=off runs one command locally.

Examples

Each example is a standalone project consuming vibestack as a package:

Project What it covers Scaffold / Open in Studio
Order checkout Guards, payments, cancellation, and a proved event ledger create-vibestack demo --example order · vibestack-studio examples/order
Team dashboard Shared spreadsheets, chat notifications, and a project registry create-vibestack demo --example dashboard · vibestack-studio examples/dashboard
Shared to-do list HTTP server, browser client, and two tabs over an unreliable network create-vibestack demo --example fullstack · vibestack-studio examples/fullstack
Assistant Trusted senders, bounded turns, confirmation before payment, secret card create-vibestack demo --example assistant · vibestack-studio examples/assistant

Repository

Path Holds
packages/vibestack Released as vibestack.tgz: CLI, generator, simulator, prover, testing/design/eslint exports, and bundled skills
packages/studio Released as vibestack-studio.tgz: standalone Vibestack Studio server and prebuilt React UI
packages/create-vibestack Released as create-vibestack.tgz: project scaffolder bundling template/
apps/site vibestack.fun: the landing page, and the docs rendered from README.md and SPEC.md
template/ Starter workspace (template/apps/app, template/packages/cli, template/packages/design-system, template/packages/ui, template/spec/)
examples/ Standalone example applications (examples/order, examples/dashboard, examples/fullstack, examples/assistant)
selftest/ Tool self-tests, docs/example checks, and spec fixtures
.agents/skills/ Canonical agent skills and references

Contributing

See CONTRIBUTING.md.

License

MIT