What the agent does
The agent reads how colour is applied before it adds a theme. In the Angular RealWorld app, package.json pins @angular/core at 21.2.12, Vitest at ^4.0.18 and the test script is vitest. Playwright is a separate script, test:e2e, pointed at the spec suite. angular.json builds the project angular-conduit and sets styles to a single file, realworld/assets/theme/styles.css, which arrives as a git submodule (realworld-apps/realworld) rather than as a stylesheet in src. The setup script is git submodule init && git submodule update && bun install, and the lockfile is bun.lock. Until that submodule is present, the app has no theme file to extend. Component CSS is almost empty: home.component.css only sets cursor: pointer on .nav-link and .tag-pill. The pages a reader actually sees are the routes in src/app/app.routes.ts: home and tag/:tag, login and register (both auth.component), settings behind requireAuth, profile, editor and editor/:slug behind the same guard, and article/:slug.
The theme work goes in the submodule stylesheet, as CSS variables on :root, with a dark set under a data attribute or a class on the document, not as a second copy of every rule. prefers-color-scheme: dark is the default when the reader has not chosen. The toggle lives in the navbar that header.component.html already renders twice, once for authState unauthenticated (Home, Sign in, Sign up) and once for authenticated (Home, New Article, Settings, profile). The choice is stored in localStorage and applied before first paint so the home banner does not flash the light background. Ionicons and the Google font links in src/index.html stay as they are. The agent does not fork the theme by pasting a private styles.css next to angular.json, because the build would still load the submodule path.
It then serves the app and opens the sandbox browser on the routes that do not need an account, and on settings, editor and profile once it has signed in through the app's own form. The pages are home, article, login, register, settings, editor and profile. Each is captured in the light theme and the dark theme. Contrast is checked on the brand green against both backgrounds, on the muted text used for dates, and on the navbar links. A follow-up from a teammate, for example a different dark background or a toggle moved into settings, is applied to the same variables and the same pages are captured again.
Before the pull request, it runs the checks the repository already has. vitest covers the unit tests. The Playwright scripts live in package.json as test:e2e and test:e2e:security; the security-tagged run is separate and is not required to prove the theme. The pull request names the CSS variables that changed, the attribute the toggle sets, and attaches both screenshots of every main route.
Start it with one API call
POST https://api.prix.dev/o/{org}/sessions with this body:
{
"agent": "codex",
"input": "Add dark mode that follows prefers-color-scheme and a toggle that remembers the choice. Initialize the realworld submodule first: angular.json loads styles only from realworld/assets/theme/styles.css, and bun.lock is the lockfile. Define the dark palette as CSS variables, do not duplicate the theme, and put the toggle in the navbar in header.component.html for both auth states. Persist the choice so the first paint matches it. Screenshot home, article, login, register, settings, editor and profile in both themes in the browser, check contrast on brand and muted text, and post the screenshots. Apply follow-ups before opening the pull request. Run the vitest script. Do not add a second stylesheet beside the submodule path.",
"resources": [
{
"url": "https://github.com/your-org/your-app"
}
]
}- Get an API key. In the console, open Settings, then API keys, and create a key for your org. Send it in the Authorization header as a Bearer token.
- Send the request. POST the body in request.json to https://api.prix.dev/o/{org}/sessions, with your repository as the resources URL. The run starts in its own cloud sandbox.
- Read what came back. Follow the run on its live stream or wait for the run.completed webhook, then read the result and its trajectory.
What comes back
What comes back is a pull request whose diff is the theme file from the submodule path, the navbar toggle in header.component.html, and a few lines that set the document attribute before bootstrap. The description lists the variables, says the default follows prefers-color-scheme, and embeds or attaches the light and dark screenshots of home, article, login, register, settings, editor and profile. Files the agent saved on the session are artifacts: each has a name, a mime type and a URL on api.prix.dev that downloads that file for an hour.
A reviewer looks at the screenshots before the CSS. They check that body text and the muted dates stay readable on the dark background, that the navbar toggle is present for a signed-out reader and a signed-in one, and that angular.json still points styles at the submodule file. They also check that a reload keeps the override the toggle stored, and that clearing it returns the app to the system preference.
Teammates do that looking while the run is still open. The live stream is GET /o/{org}/sessions/{id}/events. A follow-up is POST /o/{org}/sessions/{id}/messages with a new input. While the turn is still running that call answers 409 TURN_ACTIVE. The console queues a follow-up sent mid-turn. When the turn ends the sandbox parks with its disk, and the follow-up wakes it, so the screenshots and the edited theme are still there.
Run it on every design change
Start one run when a design change asks for a theme pass, with this body and the repository in resources. The person who starts it, or an org admin, sends follow-ups as the screenshots appear. Everyone in the org can read the transcript. One person at a time can take the sandbox browser, on a five-minute lease.
A webhook on the API key posts run.completed, run.failed or run.cancelled, including session_url, when the turn finishes. Parked sandboxes are kept for 7 idle days, so a review that waits overnight can still send the follow-up that changes a colour. A key allows max_concurrent runs at once, 4 unless you set another limit, and a further start is 429.
The use case this job follows, with its automation and trigger: Steer a run as a team.
Why run it on Rush?
Dark mode on this app is a change to a submodule stylesheet plus a navbar, and the way you know it worked is a screenshot of article text, not a green unit test. The sandbox browser takes those captures at both themes without a shared screen. The designer corrects one background in a follow-up, and the agent recaptures the same routes, instead of the work sitting in someone's branch until the next pairing hour.
The pull request is the part a person merges. The transcript is the part that shows which variable changed after the comment, and the artifact URLs are the screenshots. Other theme runs, on other repositories, do not share the sandbox or the branch.
Frequently asked questions
The theme file is a submodule. Will the agent commit a copy instead?
The prompt forbids a second stylesheet. angular.json already has styles set to realworld/assets/theme/styles.css, and the setup script initializes that submodule. The agent edits the file the build loads. If the submodule URL is wrong for your fork, say so in a follow-up and it will retarget the path the build uses.
Does the toggle remember a choice that disagrees with the system?
Yes. prefers-color-scheme is the default only when nothing has been stored. The toggle writes the override where the app can read it before the first paint, and a later visit uses that value even when the operating system disagrees. Clearing the stored value returns to the system preference.
Will it break the Vitest or Playwright suites?
It runs the vitest script before it opens the pull request. The e2e scripts are test:e2e and test:e2e:security, and they live against the RealWorld spec. Ask for test:e2e in the prompt when you want that suite too. A failure is in the transcript with the command's output, and the agent does not report the theme done while that command is red.
Can a teammate change the palette while the agent is still working?
Yes. They send a follow-up once the turn is finished, or the console holds one they send earlier and delivers it when the turn ends. The sandbox still has the branch and the browser. POST while status is running returns 409 TURN_ACTIVE. The starter or an org admin is who may send it.