what's the optimal setup for AI efficiency?
One of the biggest shifts in how I work on this site is that I rarely write code directly anymore — I'll often hand a task to an AI agent like CODEX or Cursor, let it open a pull request, and then review the result. That workflow only holds up if there's a fast feedback loop: I need to see the real build, not just a diff. The CI/CD setup here is designed around exactly that.
Cloudflare Pages builds and deploys a live preview for every pull request automatically. When an agent opens a PR — or when I push a branch myself — Cloudflare spins up a full production-equivalent deployment at a unique URL. I can click through the actual site, not just read code, before deciding whether to merge. This is the most important piece of the loop: it turns code review into site review.

The unit tests run with Vitest using jsdom and React Testing Library. They're focused on the core UI components — the pieces most likely to break silently when logic changes. Each test file isolates a single component and covers its key behaviors, including loading states, error states, and edge cases like formatting and data boundaries.
Cypress covers the things unit tests can't: does the app actually load, can you navigate around it, and does it hold up on mobile? The E2E suite runs against a full production build of the app and tests real browser behavior — not mocked components. Three spec files cover the main concerns.

A single GitHub Actions workflow runs on every pull request to main. It installs dependencies, runs the Vitest unit tests, builds the Next.js app for production, starts the server, and then runs the full Cypress suite against it. If anything fails, Cypress screenshots are uploaded as artifacts so I can see exactly what broke. The workflow enforces that both layers — unit and E2E — pass before a merge is considered.
# .github/workflows/cypress.yml (simplified)
- run: npm test -- --run # Vitest unit tests
- run: npm run build # Next.js production build
- run: npm start & # Start the server
- run: npx wait-on http://localhost:3000
- run: npm run cypress:run # Cypress E2E suitePutting it together: an agent opens a PR, GitHub Actions runs unit tests and E2E tests, and Cloudflare Pages deploys a live preview. If the tests pass and the preview looks right, I merge to main — and Cloudflare auto-deploys the production site. The whole thing means I can move fast, delegate freely to AI agents, and still catch regressions before they ship.