> Agent-ready spec from Diff of the Day (2026-12-03, idea 3). Give this file to your coding agent (Claude Code, Codex, Cursor) and ask it to build the P0 requirements first.

# Spec: App driver CLI for coding agents

## Problem Statement
A coding agent that cannot run the app guesses whether a change works. A person then has to check by hand. Lauren Tan describes packaged CLI tools that agents reuse, with a screenshot as proof.

## Goals
- Drive one screen of a running app from the command line.
- Save a screenshot and a short text snapshot of the screen.
- Let the agent run the same commands on every change.
- Finish a full run of the 3 steps in under 30 seconds.

## Non-Goals
- Full end-to-end test coverage: one screen is enough to learn what helps.
- A new test framework: a thin CLI over a browser driver is simpler.
- Visual diff of screenshots: a person looks at the proof first.

## User Stories
- As a developer, I want the agent to run the screen before it says done so that I see proof.
- As a reviewer, I want a screenshot in the pull request so that I can check the result fast.
- Edge case: when the app does not start, the CLI exits with a clear message and no screenshot.

## Requirements
### P0
- [ ] One command per user step. Accept: each command prints ok or a clear error.
- [ ] A command that saves a screenshot to a named file. Accept: the file exists after the run.
- [ ] A command that prints a text snapshot of the screen. Accept: the text lists the visible controls.
### P1
- [ ] A single command that runs all 3 steps. Accept: exit code 0 only when all steps pass.
- [ ] A short section in the agent project file that tells the agent when to run it. Accept: the agent runs it in a test session.
### P2
- [ ] A second screen. Accept: it uses the same driver code.

## Success Metrics
- The agent runs the CLI in 9 of 10 changes to the screen.
- A full run takes under 30 seconds.
- At least 1 wrong change is caught by the CLI in the first week.

## Open Questions
- Which screen has the most bugs today?
- Does the app need test data that the CLI must create?

## Timeline
- Saturday morning: driver and first step.
- Saturday afternoon: other steps and screenshot.
- Sunday: agent instructions and a real session.

## Agent Instructions
- Stack: a browser driver library in the language of the app and a thin CLI wrapper.
- Build order: one step, screenshot, snapshot, run-all command, agent instructions.
- Safety: run against a local or test instance only, and never use real user data or production credentials.
- Done when: all P0 acceptance checks pass and the agent attaches a screenshot in one real session.

## Sources
- Lauren Tan on the Grok bot team practices, https://x.com/poteto/status/2121673563489140863