# Add Lint, Type Check and Build Steps to CI for a Shopify App

Yes. An agent extends a Shopify app's GitHub Actions workflow so every pull request runs ESLint, tsc and the Remix build, not only an install.

[Run this on Rush](https://cloud.getrush.ai/run/add-lint-to-ci/shopify-app/). Opens the console with this prompt ready to send, in a Project that has your repository.

## 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`

```json
{
  "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"
    }
  ]
}
```

1. **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.
2. **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.
3. **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.

## 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.

## More Shopify App jobs

- [Add Order Webhooks to a Shopify App](https://getrush.ai/run/add-order-webhooks/shopify-app/)
- [Add Retry Logic for Throttled Shopify Admin API Calls](https://getrush.ai/run/add-retry-logic/shopify-app/)
- [Add a Theme App Extension to a Shopify App](https://getrush.ai/run/add-theme-app-extension/shopify-app/)

## The same job on other stacks

- [Add ESLint and Prettier Checks to CI for a tRPC App](https://getrush.ai/run/add-lint-to-ci/trpc/)
- [Run Credo and mix format in CI for an Elixir App](https://getrush.ai/run/add-lint-to-ci/credo/)
- [Add an ESLint Check to GitHub Actions for a Next.js App](https://getrush.ai/run/add-lint-to-ci/eslint/)

## Keep reading

- [How a Rush run works on your repository, from request to pull request](https://getrush.ai/cloud/)
- [Compare cloud agents, agent sandboxes and AI code review](https://getrush.ai/compare/)
- [Rush pricing: Free, Pro and Max](https://getrush.ai/pricing/)
