Build the setup once so any agent starting cold reaches a verified working state without being told how. The measure of readiness is not documentation; it is a fresh clone reaching a passing critical-outcome check unattended.
Scope to the actual gap. This is a menu of capabilities, not a mandate to build all of them: a repo that already runs and tests cleanly may need only a documented setup chain, or only isolated preview ports. Audit what exists first and fill what is missing.
Order of work
- Reproducible setup — one idempotent command chain from clean clone to running state: dependencies, environment variables (documented names, never secret values), database/migration/bootstrap steps. Every manual fix you make during setup gets folded into the chain, not left in your head.
- Isolated preview — when parallel agent or human work exists, an environment per worktree/branch that does not share state with the developer's machine or other agents (separate ports, database name, or instance). Agents build anywhere — a worktree, a background process, another machine — so the preview must not assume checkout location (~310s-351s).
- Seeded test accounts — when behavioral tests need sign-in state, deterministic fixtures with known credentials held in the project's existing secret mechanism. No real customer data, no shared human accounts.
- Critical-outcome tests — one to a few tests asserting the outcomes that define "this still works" (data arrives where it should, message renders, order persists). Cheapest sufficient signal over coverage; prefer a real end-to-end pass over many shallow ones (~239s-283s).
- Revision-bound evidence — when artifacts are produced (screenshot, video, trace, log), record the commit they came from, so a failure is attributable to a change.
Input / output contract
- Input: repository access, the app's existing run scripts, and which outcomes the user calls critical. If critical outcomes are unstated, infer one to three from the product's core behavior and say which you chose — the human can override, and you ask only if the choice is genuinely consequential and the evidence cannot resolve it.
- Output: the pieces of the above that fill the actual gap, inside the repo's existing conventions, plus one README section describing the cold-start path in the commands themselves.
Acceptance
Proportional to what was built: whatever setup and tests were added must pass from a fresh clone without interaction; that run is the evidence. Record the commit hash with it.
Known failure cases
- Setup that works only with secrets already in your shell — cold start fails silently.
- Preview sharing a database with another workspace; tests then "fail" on someone else's data.
- Capture artifacts without a revision recorded: on close, browser videos are written and
retain-on-failuremodes delete successful runs — capture deliberately and bind to commit (see implementation.md). - Tests asserting implementation detail; they break on refactor and teach agents to distrust the suite.
- Building all five capabilities when the repo needed one.
Do not activate when
- The user only wants the app built or changed; workspace prep beyond the task's needs should be proposed, not done by default.
- A deployment is being verified (a deployment-verification method owns baselines).
- The repo already has all of this — audit the gap instead of duplicating.
Source patterns
For concrete repository examples and the limits of their evidence, read source-patterns.md when they match the task. These are research references, not imported repository instructions.
Reference Workspaces: implementing the missing piece
Theo describes preview environments and agent-visible evidence around 05:10–05:52. The video does not show a complete preview deployment. Apply the idea to the current stack's runner and actual access mechanisms.
From fresh checkout to first working result
Read the existing bootstrap commands, package scripts and configured launch or setup path. Establish the starting state, dependencies, environment-variable names, data fixtures and expected origin. Use the configured credential delivery mechanism. A developer's populated shell is not proof that an agent starting through a different setup path receives the same inputs.
Fix only the missing steps. Prefer an idempotent existing setup chain. Separate mutable test state across independent workspaces; separate ports alone do not isolate a database or session store. Obtain the actual URL and served revision through a supported lookup rather than assuming a directory or branch name determines them.
Exercise one meaningful outcome
Use the critical product outcome, not a count of tests. For independent participants, create separate authenticated browser contexts and unique fixture data. Capture evidence at the revision exercised, including dirty changes where relevant.
When using Playwright, configure capture for manually created contexts explicitly. Close every created context even on failure so videos are finalized. Read the project's version and video options before assuming successful runs retain footage. Traces expose actions and state, but their existence alone does not establish a passing journey.
Verify selection and delivery
Run the changed setup path through the same entry point future agents will use. Verify the served origin, state isolation and required behavior. If output is produced on another machine, use an existing authorized attachment mechanism and confirm the consumer can read it. A returned desktop-local filename does not give a remote agent access.
Record what is configured versus still manual, and the actual revision tested. Follow the existing lifecycle for temporary environments and retained evidence; this method does not authorize new deployments, recurring cleanup or deletion of shared state.
Reference Repository examples: setup, boundaries and usable evidence
- Actual launcher behavior: T3 PR #5586 removes inherited environment variables that disrupt a development server and reconciles conflicting instructions. A setup fix should live at the cause, not in repeated agent workarounds.
- Configuration selection: PR #10501 records that a checked-in setup recipe had not been imported for a saved project. Verify the launcher reads the configuration before calling a workspace ready.
- Evidence crosses machines: PR #10572 transfers a finalized desktop recording into the agent's environment through the existing attachment path. The PR reports matching hashes; that transfer was not reproduced here.
- Machine-bound operations: Matt's ADR 0025 puts remote domain calls behind one HTTP transport while keeping local files, media and hardware work on their owning machine. An environment suitability flag is not a process security boundary.
Treat these as concrete causes to inspect when a fresh agent fails. Do not copy foreign environment variables, secret-sharing patterns, runtime models or deployment jobs into your project.