What the agent does
The agent reads what CI does today before changing it. In an app started from Shopify/shopify-app-template-remix, .github/workflows/ci.yml runs on every push and pull request with a Node matrix of 20.19.0, 22 and 24, and its only steps are actions/checkout, actions/setup-node and yarn install. Nothing is linted, type-checked or built, so a pull request that breaks remix vite:build still shows a green check. package.json already has the commands: lint runs eslint --cache with the @remix-run/eslint-config presets and the prettier config from .eslintrc.cjs, build runs remix vite:build, and setup runs prisma generate && prisma migrate deploy. There is no typecheck script, although tsconfig.json is strict with noEmit, so tsc is the natural check.
Two details decide the order of steps. app/db.server.ts imports PrismaClient from @prisma/client, and that client is generated from prisma/schema.prisma (a SQLite datasource at file:dev.sqlite), so prisma generate has to run before either tsc or the build sees the types; the agent adds it as its own step and keeps prisma migrate deploy out of CI, since a migration needs a database and the build does not. The engines field allows >=20.19 <22 || >=22.12 and .npmrc sets engine-strict=true, so the matrix stays as it is and a Node version the app refuses fails loudly rather than silently.
Then it writes the workflow. A typecheck script of tsc goes into package.json, and the job gains four steps after the install: prisma generate, yarn lint, yarn typecheck and yarn build, each a named step so a failure is readable in the checks tab. Because the template ships no lockfile, the agent keeps yarn install rather than switching to a frozen install that would fail on the first run, and says so in the pull request as the next thing to fix. It also adds concurrency keyed on the ref so a force-push cancels the older run, and leaves the Dependabot config in .github/dependabot.yml, which already updates the actions weekly, untouched.
Before opening the pull request it runs the same four commands in the sandbox and reads their output, because the point is a CI that fails for real reasons. If yarn lint reports existing problems, such as the console.log in app/routes/webhooks.app.uninstalled.tsx that the Remix config may flag, the agent fixes the ones that are clearly lint and lists the rest rather than adding --max-warnings to hide them.
Start it with one API call
POST https://api.phoenix.so/o/{org}/sessions with this body:
{
"agent": "codex",
"input": "Our CI workflow only runs yarn install. Add a typecheck script that runs tsc, then extend .github/workflows/ci.yml so each matrix job runs prisma generate, yarn lint, yarn typecheck and yarn build as separate named steps after the install, with a concurrency group on the ref. Do not run prisma migrate deploy in CI. Run all four commands yourself first; fix lint errors that are genuinely lint, and list anything you left unfixed. Open a pull request that quotes each command's result and notes that no lockfile is committed.",
"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.phoenix.so/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
The pull request changes two files, package.json for the new typecheck script and .github/workflows/ci.yml for the added steps and the concurrency block, plus whatever source files the lint fixes touched. Its description quotes the exit status and tail of each of the four commands as they ran in the sandbox, so a reviewer can see that yarn build produced build/server/index.js and build/client, and that tsc passed against the generated Prisma types.
Opening the pull request also runs the new workflow on GitHub, three times for the three Node versions, which is the proof that matters: the checks on the pull request are the same steps the description claims. A reviewer confirms the steps are ordered with prisma generate first, that nothing deploys or migrates, and that any lint problem the agent left unfixed is listed with its file and rule.
The transcript at GET /o/{org}/sessions/{id}/messages holds every command and its full output, including the first yarn lint run before any fix, so the before and after can be compared.
Run it on every pull request
This run is the one-time setup; afterwards the workflow itself runs on every pull request. If you later want CI gaps closed across several apps built from the same template, send POST /o/{org}/sessions with this body once per repository, with a request_id that is a UUID v5 of the repository name so a retried send returns the same run.
A webhook URL on the API key reports run.completed with the session URL and the pull request for each one. When a run finds the workflow already has the steps, the result says so and no pull request is opened.
The use case this job follows, with its automation and trigger: Hand off a long task.
Why run it on Rush?
The work is small but the proof is the point, and proving it means installing the app, generating the Prisma client and running the Remix build the way a runner would, in a clean environment rather than a laptop with a cached node_modules. The sandbox is that clean environment, and the command output stays in the transcript instead of in a terminal that closed.
A pull request that shows the four commands passing, and lists the lint it could not responsibly fix, is a change a reviewer can merge in a minute. Several apps on the same template get the same treatment at once, one run each.
Frequently asked questions
Why does prisma generate run before the type check?
Because app/db.server.ts imports the generated client, and without it tsc fails on a missing module. The step is cheap and needs no database; prisma migrate deploy, which does, stays out of CI.
Will it switch the workflow to npm or pnpm?
No. The workflow uses yarn and the template commits no lockfile, so the agent keeps yarn install and notes that committing a lockfile and using a frozen install is the next step. Say which package manager you use in the prompt and it writes the install step for that one.
What if lint already fails on main?
The agent fixes problems that are plainly lint, such as unused imports, and lists the rest in the pull request with file and rule. It does not add flags that turn failures into warnings, since that would make the new step meaningless.
Does the build need Shopify API credentials?
No. remix vite:build compiles the app without talking to Shopify; SHOPIFY_API_KEY and the other variables in app/shopify.server.ts are read at runtime. The build step runs with no secrets.