tesser help setup when it puts a repo on Tesser, so it is written to the agent. What it leaves behind is the repo’s own skill at .agents/skills/tesser/, which every agent after it reads instead.
tesser --help and tesser help manifest are the reference for the tool and
the manifest format. Read both first and trust them over this guide.
You are building for the next agents. Each arrives in a fresh worktree with
a task and no human to ask, and reads only the repo’s tesser skill. Most tasks
need one of three things, cheapest first, each one command in the repo skill:
- A focused check: a test file or a typecheck on the worktree’s
workbench (
tesser exec -- <cmd>). - The running app, no code change: open a page, sign in, create a record, against the org’s shared instances, which you pin. Zero personal boxes.
- The running app with a change:
tesser devonly the services the change touches; every other dep stays on its shared instance.
Order of work
Setup is mostly waiting on cold boxes. Never wait on one thing while something else could run:- Anything over 30 s runs in the background (your tool’s background
option):
dev,make,snapshot create, migrations, installs, tests. Its exit arrives as a notification. Never write a foreground loop that sleeps on a file, log or task output (tail -f | grep -m1never exits). - Work a queue of things that need no box while they boot: manifests, run
scripts,
login.sh,create.sh,db.sh,up.sh, the repo skill, reading the auth code. - Block only when the queue is empty, with
tesser wait <box>in the foreground, at most 9 minutes per call. A minute after each launch, readtesser logs <box>: a crash loop shows there long beforewaitgives up. Never end your turn to wait: background tasks die with it.
- In the first few minutes, write every manifest you can from the repo’s
own config and start them all: infra with
tesser make <infra> --ensure-running <full sha>, each app box with its first coldtesser dev. Fix a manifest and restart only that box. - While they boot, write the dev user,
login.sh,create.sh,up.shand the repo skill. Test each script once its box is up. - When
login.shandcreate.shwork against your own box, its config is final: pin every app service the main page needs, frontend included, at your HEAD (start from main, so HEAD’s migrations are main’s), andtesser snapshot create --sha <HEAD>, all at once. A pin from the worktree whose own box of that service works hands that warm box over; your nextdevof it is a new box. Pin each once: a re-pin is a new cold box. Then commit the refresh workflow (template below), whether or not you can push. - As soon as your own box passes the browser check, tell the user the URL, how to sign in and, unless you ran it, the workflow’s grant line, then prove path 2 (section 5).
1. Up
Start from the repo’s own dev and agent tooling (README,docker-compose*,
Makefile, package.json scripts, .env.example, .devcontainer, CI) and
override only hosts, ports and URLs.
- Where the files go: one
.tomlper process in.agents/skills/tesser/, with.claude/skillslinked to../.agents/skills(only.claude/skills/tesser -> ../../.agents/skills/tesserwhen.claude/skillsholds other skills). A repo with skills only in.claude/skillsuses.claude/skills/tesser/and.agents/skills/tesser -> ../../.claude/skills/tesser; the paths below work in either layout. - Pin every port.
[run] devpoints at a run script thatexecs the process.[health]has a realpathand a timeout sized for the cold first install; a port answering is not health. - Lean setup. Install only what the dev processes import (in a monorepo,
pnpm --filter=<app>... install,yarn workspaces focus). Runtimes come prebuilt (the repo’s pinned node,uv,misewithruby.compile=false); compiling one from source is a bug. Skip native builds the dev server never loads. Never invent a secret the code validates: copy it from the repo’s example env. Cut any step over 2 minutes the page does not need. - Declare what setup reads in
[run] setup_inputs: lockfiles, every package.json (**/package.json), patches,.npmrc, the setup script, and the sources of anything setup builds. tesser skips all of setup when none changed, so a missing input means a stale build. Inside setup, gate each install or build on a hash of its files’ contents, never git’s index or mtimes (template below). - Slow state is shared. Infra holds every database, queue, cache and
search container the app’s migrations or boot touch, and is pinned first:
adding one later re-pins infra onto an empty disk. A new-sha pin is a new
box: app boxes hold no database container, and uploads go to object
storage (the user’s test bucket, else rustfs). An app with its state on
local disk (SQLite, git repos, an all-in-one VM,
bin/setupwith system services) gets no infra: pin it alone; each new-sha pin resets it to its seed. Shared instances that share state are pinned at the same sha. - One service migrates. The schema’s owner (usually the API) migrates
and seeds from its run script on shared instances (
$TESSER_SLOTispinned), and elsewhere only while a row only the seed makes is missing, so the first box of a fresh setup fills the empty schema itself. Migrate runs every start and an exit takes the instance down, so it waits for the database, uses the deploy form (prisma migrate deploy,rails db:migrate,alembic upgrade head,manage.py migrate --noinput), nevermigrate dev,db push,db:resetor anything that prompts, and seeds only when that row is missing. After an infra re-pin,make <app> --ensure-running <its sha> --restart(without it, a same-sha re-pin is a no-op) andsync <app> --restart. - Nobody else touches the shared schema: not workers, frontends, task
agents or
[run] setup(which also runs on personal boxes and the snapshot builder). Pin only commits whose migrations are on main. - Worktrees stay apart inside shared state. Each signs in to its own
tenant (section 2). Redis prefixes, queue names and bucket prefixes carry
$TESSER_SLOT. A worktree whose change adds migrations copies the shared database into a new one (pg_dump | psql;CREATE DATABASE … TEMPLATErefuses while the shared app holds connections), names it in its.env.tesser, and applies only its new migrations there, never against the shared one. - What survives. Snapshots and pool boxes carry
/home/ubuntuand docker’s data, not/usr,/optor apt packages. System packages go in the manifest’sapt, the same list in every manifest. Setup writes only under$HOMEand docker, leaves nothing running, and gives containersrestart: unless-stopped; anything else is logged and makes setup rerun after every reboot. Setup also runs on the snapshot builder, which has no box id or address: anything per box goes in the run script. - Outside services (email, OAuth, payments, LLMs): use the user’s own
test-mode keys, copied from their local env file into a gitignored file you
tesser env pushto your boxes. Shared instances get values only throughtesser env set, the human’s call: ask, or use stand-ins there. A live key becomes a stand-in. Without a key: a local stand-in (mailpit,rustfs/rustfs:1.0.4for S3; minio’s images are gone, so replace it in the repo’s compose too), a fake value where the app only checks one is set, or the app’s switch to turn the feature off. Never commit a key. up.sh: path 2 by default. It fails on a missing shared instance, never pinning one, and prints<svc> <box_id> <url>for the sign-in service.up.sh <svc>...is path 3:tesser dev --detachon those, printing their lines once they start. It never wires or restarts a shared instance.
- tesser syncs only what git does not ignore. Run
git status --ignored .agents .claudeafter writing files. - Node is the repo’s pin (
tesser --help) and pnpm/yarn followpackageManager; never install node, source fnm, runcorepack enableor overwrite/usr/local/bin. If the repo installs its own node system-wide, remove those links in the run script. - Host and origin. Requests arrive as
Host: localhost:P,Originrewritten to match: base URLs, allowed hosts, CSRF origins and auth config namelocalhost; a one-URL app setsbox_address = trueand names$TESSER_BOX_HOST:P. A URL only the browser loads from another port, or lands on with no page (email, OAuth redirect), nameshttp://$TESSER_BOX_HOST:P, neverlocalhost:P. - Cookies do not follow a page’s call to another port: proxy the API
through the frontend dev server (Vite
server.proxy, Next rewrites) when auth is a cookie. - Compile-time public env (
NEXT_PUBLIC_*,VITE_*) must be in the run script’s environment when the dev server starts. CSP and dev-origin checks must accept*.localhost. tesser sshruns on the box as it is, with no sync;execandsynccopy the worktree. After a run script edit,tesser sync <box> --restart.
2. Signed in
Read the auth code for how the app makes a session (login route, cookie or token name, where the frontend keeps it), then build:- A user and tenant per caller.
login.sh <box_id> [name](up.sh’s sign-in line, neverservice ls) signs in asdev+<name>@example.com(default: worktree folder), creating it on first call with a constant password, its own tenant named after it, an admin role, verified email and onboarding done, through the app’s own seed, CLI or signup API; SQL last. Two worktrees never share a user. - Box-only switches that remove the human: email verification, captcha
and the first-run wizard off, each gated on an env var only boxes set.
Every request reaches the box from one address, so find the auth code’s
per-IP rate limits. Where the app keys them on the leftmost
X-Forwarded-Forentry,login.shandcreate.shsend an IP hashed from the caller’s name (10.<a>.<b>.<c>); the daemon keeps it. Check with curl that two names get separate limits; if not, skip the limit where$TESSER_SLOTis set, before you pin the app (adding it later restarts the shared instance). Where the app only offers magic links or OAuth, enable its password or dev-login path, or catch the email in mailpit. - Every
login.shcall is an independent session (vary the User-Agent or device id if the app ties sessions together), made with the app’s real login request, never a forged token. It prints JSON a browser loads ({"cookies":[{"name","value"}],"localStorage":{...}}) and writes a curl jar inside the worktree (gitignored) named for the box, usable only there. Prove independence: mint A, mint B, load B in a browser; A must stay signed in. Some apps rotate a refresh token on use: load one session in two fresh browsers in turn; if the second is signed out, say so in the repo skill. The session you hand anyone comes from alogin.shcall nobody has opened.
login.sh printed: never automate the login form; wait for
domcontentloaded and one known selector, at most 20 s each, never
networkidle. A dev server that compiles per route (Next, Vite) gets 90 s
once on a route’s first load, never a retry loop; put the measured first and
warm load in the repo skill. On failure, or on a login, setup or onboarding
URL, print the final URL, the first 800 characters of text and every response >= 400. A page is
done when it loads with no page errors and no failed request to the app’s
own hosts: fix each, or name it in the repo skill with why it is harmless.
3. Data
- A tenant worth testing in. The first
login.shcall fills the caller’s tenant, through the app’s API, with what a customer has after onboarding: the top-level object and what the main pages show (a project with issues; a survey with responses). Later calls only sign in. create.sh <box_id> <name>: one more main record in the caller’s tenant, printing the URL where its name shows verbatim. Note name rules.db.sh: a database shell (tesser ssh <infra> -- docker exec -i <db> psql …), anddb.sh -c '<sql>'for one query. Say which tables hold the main records.
4. The repo’s tesser skill
Template below. Copyable commands, a sentence of why where the next agent would otherwise guess. Shared instances belong to whoever sets the repo up: the skill tells task agents to read from them, write only in their own tenant, and report a missing or broken one rather than rebuild it.5. Prove it from zero
Commit,git worktree add a fresh checkout, and run exactly what the next
agent would for path 2, in the foreground, reading only the repo skill. Start
path 3 there first (up.sh <svc>), then up.sh, login.sh <box_id>,
create.sh <box_id> PROOF<6 random A-Z0-9>, then load the printed URL with
the login.sh session in a headless browser and require the marker in the
page’s text. Fix every slow or wrong step and re-run only it. Record path 3’s
cold time, from up.sh <svc> to its tesser wait exiting 0, else “not measured”.
Last, tesser feedback "<what you ran, what happened, what you expected>"
for the thing in tesser itself that cost you the most time.
The repo’s own skill: .agents/skills/tesser/SKILL.md
The only file the next agent reads, sections in this order. Cut any the repo
does not need; never pad one.
Templates
A working frontend + backend shape. Replaceapp, ports and commands; check
field names against tesser help manifest.
Manifest: an app server
Manifest: infra containers
infra-dev.sh runs docker compose -f .agents/skills/tesser/compose.tesser.yml up
in the foreground and provisions buckets and queues on every start. Pin image
tags: a floating tag that stops pulling takes every new infra box down.
Setup: app-up.sh
Run: app-run.sh
Scheduled refresh of the shared backend
TESSER_GRANT: tesser grant create github:<owner>/<repo> --branch main (--aws-role on self-hosted orgs); run it if allowed. Infra
is not in the loop: re-pin it only by hand (see One service migrates). If the
repo’s workflows pin action versions, pin tesser too.