| name | deploy-build-guardrails |
| description | Prevent deploy/build failures for SNS and Runner by enforcing guardrails around Next.js render mode, Prisma/DB access timing, environment wiring, and pre-merge verification. Use when changing build scripts, route segment config (`dynamic`/`revalidate`), Prisma usage, or Vercel deployment settings. |
Deploy Build Guardrails
Use this skill whenever a change can affect CI/Vercel build success.
1) Scope And Risk Classification
Treat the change as P1 at minimum when one or more are true:
apps/sns/src/app/** page/route segment config changes (dynamic, revalidate, runtime, preferredRegion)
- New Prisma reads/writes are introduced in server components or route handlers
apps/sns/package.json build or Prisma scripts change
- Vercel env/region assumptions change
Escalate to P0 if the change can weaken security boundaries while fixing build failures.
2) Build-Phase Triage Contract
Classify failure before patching:
- Install phase failure (
npm/dependency resolution)
- Type/compile phase failure (
tsc, syntax)
- Next.js build phase failure (
next build)
- Static export/prerender failure (
Export encountered errors on following paths)
- Runtime-only startup failure (deployment succeeds, requests fail)
Do not patch blindly. Record exact failing phase and failing route/file first.
3) Next.js Rendering Guardrails (Critical)
For pages that call Prisma-backed functions directly in server components:
- Default to
export const dynamic = "force-dynamic" unless build-time DB access is explicitly required and guaranteed.