Development and Tools
Continuous Integration
The short version
Continuous integration (CI) means every push automatically runs your tests, typecheck, and a build on a clean machine. I do not have to remember to do it. A machine that does not have my leftover local junk does the check.
Why it matters
CI catches breaks before merge, so I can trust main. "It works on my laptop" is not the same as a fresh checkout. If the check is green, the branch is safe to merge.
How it works
- You push a branch.
- A workflow starts on a clean machine.
- You get a green check or a red check.
- You merge only when it is green. Branch protection (required checks) blocks the merge until then.
Key concepts
- Commit: a save point with a message about what changed.
- Branch: a copy of the work so
mainstays clean. - Pull request: the review, discussion, and checks wrapper before merge.
- Diff: what changed, line by line.
- Checks: the automated jobs (tests, typecheck, build).
- Caching and speed: reuse install folders so CI stays fast.
- Preview deploys: a live URL per branch, for example on Vercel, so you can click through the change.
- CI vs CD: CI proves the change is good. CD (continuous delivery or deployment) ships it.
Tips for AI-assisted development
- Write the spec first. I tell the agent what done looks like before it writes code.
- Let the agent open a PR. I review it on GitHub, not in chat.
- Read the diff. That is the real change, line by line.
- Don't trust an agent's reported test results. I let CI prove it on a clean machine.
- Keep PRs small. Small diffs are easier to read and cheaper to revert.
- Wait for checks before merging. Green means merge. Red means fix.
- Keep CI fast. I aim for under 2 minutes so I actually wait for it.
- Use the preview URL. I eyeball the change on a live page before I merge.
A tiny GitHub Actions workflow
Drop this in .github/workflows/ci.yml. Every push and pull request runs tests, typecheck, and a build.
name: CI
on:
push:
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- run: npm ci
- run: npm test
- run: npx tsc --noEmit
- run: npm run build