- Home
- Skills
- Data & Databases
- Ship-It Check: Pre-Deploy Pre-Mortem for Next.js + Postgres
More screenshots
Works with the AI Agents you already use
Ship-It Check: Pre-Deploy Pre-Mortem for Next.js + Postgres
Pre-deploy pre-mortem for Next.js + Postgres: catches leaked secrets, dangerous migrations and missing rollbacks. Green/yellow/red verdict with exact fixes.
$7.99
Ship-It Check: Pre-Deploy Pre-Mortem for Next.js + Postgres
Example session with this skill installed
I'm about to deploy my Next.js + Postgres shop app to production. Is this safe to deploy?
- Read your context and instructions
- Compiled the ship-it check
RED NO-GO - shop
Stack: Next.js 14 · Prisma · PostgreSQL · Docker · GitHub Actions
Scan: 8 files, 6 critical, 10 warnings (after verification: 6 confirmed)
Blockers - fix before deploying
-
[SEC-001] Live Stripe secret key committed to the repo -
.env:1
Why it hurts in production: anyone with repo access, or who ever cloned it, can charge and refund customers. Evidence (redacted):sk_liv...[redacted]
Fix: rotate the key in the Stripe dashboard now, then move it to your host's environment variables. (~5 min) -
[SEC-003]
.envis tracked by git -.env
Why it hurts in production: every secret in the file is exposed to everyone with repo access, and it also stays in git history.
Fix:git rm --cached .env && echo ".env" >> .gitignore, then rotate every secret it contained. (~5 min) -
[ENV-001] Service-role key exposed to the browser via
NEXT_PUBLIC_-.env:2
Why it hurts in production:NEXT_PUBLIC_*values are inlined into the JavaScript bundle, so any visitor can read a key that bypasses all row-level security.
Fix: rename it toSUPABASE_SERVICE_ROLE_KEY, read it only in server code, and rotate it. (~10 min) -
[DB-014]
prisma migrate devruns in the build -package.json(scripts.build)
Why it hurts in production:migrate devis for local development. It can reset the database and prompts interactively, so the build can hang or wipe data.
Fix:"build": "prisma generate && next build", and runprisma migrate deployas a separate, explicit deploy step. (~3 min)
[DB-004] ADD COLUMN "plan" TEXT NOT NULL with no default - prisma/migrations/20260901_add_plan/migration.sql:1
Why it hurts in production: it fails as soon as users has one row, and the deploy aborts half-way.
Fix: ADD COLUMN "plan" TEXT NOT NULL DEFAULT 'free' (~2 min)
-
[DB-002]
DROP COLUMN "legacy_id"in the same release as the code change -prisma/migrations/20260902_drop_legacy/migration.sql:1
Why it hurts in production: irreversible data loss, and any old app instance still running during the rollout that selectslegacy_idwill start throwing errors.
Fix: expand/contract. Remove every read and write oflegacy_idfirst, deploy, then drop the column in a later release. (~1 deploy cycle) -
[MANUAL] Stripe webhook never verifies the signature -
app/api/stripe/webhook/route.ts:2
Why it hurts in production: anyone can POST a fakecheckout.session.completedevent and get orders fulfilled for free.
Fix: read the raw body withawait req.text()and callstripe.webhooks.constructEvent(body, signature, process.env.STRIPE_WEBHOOK_SECRET)before trusting the event. (~10 min)
Conditions - deploy only if
- The Stripe and Supabase keys above have been rotated, not just removed from the repo.
- You confirm roughly how big
ordersis. I assumed it is large, so the index below is treated as a lock risk.
Also noted (non-blocking)
[DB-007] CREATE INDEX without CONCURRENTLY on orders blocks writes until it finishes (20260902_drop_legacy/migration.sql:2). Put it in its own migration with CONCURRENTLY.
[DB-015] Nothing in the scripts, Dockerfile or CI appears to run migrations on deploy. Make the order explicit: migrate first, then switch traffic.
- [NEXT-003] Prisma Client is never generated. Add
"postinstall": "prisma generate".
[DOCKER-001/002] No .dockerignore (COPY . . will copy .env into the image) and the base image is node:latest. Pin it, for example node:20-alpine.
- [NEXT-004/005] No lockfile and no health-check endpoint.
- [OPS-001/004] No test script, so CI only builds. No error monitoring either.
- [SEC-005]
.envis in git history, so rotating the secrets matters more than deleting the file.
Rollback plan
Code: redeploy the previous image or tag. Fast, about 2 minutes, as long as the old code still matches the schema.
Data: migration 20260902_drop_legacy drops legacy_id. That data cannot be restored without a backup, and Prisma migrations are forward-only, so recovery means a new corrective migration or a restore.
- Trigger: a spike in 5xx on routes touching
users, or failed Stripe webhooks, in the first 15 minutes. - Point of no return: the moment
DROP COLUMNruns. Take a verified database backup before deploying.
Not verified
- Production environment values and hosting settings.
- Table sizes, which decide how risky the lock and migration items really are.
- Auth logic on routes the scan cannot see, and runtime behaviour.
Next step
Rotate the Stripe and Supabase keys right now, since they are the only blockers that cost money while you wait. Want me to apply the safe fixes (.gitignore, .dockerignore, postinstall, health route, pinned Docker tag)?
Connects securely to your tools. The creator never sees your data.
About this skill
Know if your deploy will break production, before you ship it Most production incidents come from the same short list: a secret in the repo, a NEXT_PUBLIC_ variable that exposes it, a migration that locks a table or fails on existing rows, an env var that exists on your laptop and nowhere else, and no plan for going back. Ship-It Check assumes your deploy will fail and hunts for the reason while it is still cheap to fix. You get a clear GO / GO WITH CONDITIONS / NO-GO verdict, the blockers ordered by severity with exact fixes, and a rollback plan written for this release. What it does
- Runs a fast, read-only scan of your repo with 40+ automated checks: secrets and credentials, env var mistakes, Postgres migration risks, Next.js and packaging pitfalls, Docker and CI gaps.
- Verifies every finding by opening the file and the line, so you get real problems and not a wall of regex noise.
- Reviews what scanners can't see: auth on new routes and Server Actions, webhook signature checks, Supabase RLS, previews pointing at the production database, migration order versus code order.
- Gives you the verdict first, then the fixes: file, line, why it hurts in production, and a command or code you can paste.
- Writes a rollback plan based on the migrations actually in this release, including the point of no return.
- Friday mode: say you are deploying late or before a weekend and the rules get stricter, ending with a plain "ship now" or "ship Monday".
- Works in your language: ask in English, Portuguese, Spanish or German and the report comes back in that language.
What it catches (examples)
- Live Stripe, AWS, OpenAI, GitHub or Supabase service_role keys committed to the repo
- .env files tracked by git, or sitting in history
- Secrets exposed to the browser through NEXT_PUBLIC_*
- ADD COLUMN ... NOT NULL with no default (fails on existing rows)
- DROP COLUMN, DROP TABLE, TRUNCATE, DELETE without WHERE
- CREATE INDEX without CONCURRENTLY, constraints without NOT VALID, column renames that break the running version
- prisma migrate dev or db push in a build or deploy path
- Stripe webhooks that never verify the signature
- Multiple PrismaClient instances, missing prisma generate, ignoreBuildErrors turned on
- Docker images with baked-in secrets, unpinned base images, no .dockerignore
- CI pipelines that install dependencies but never run tests
Example verdict
On the included demo repo (planted problems), it returns
NO-GO - shop
Stack: Next.js 14 · Prisma · PostgreSQL · Docker · GitHub Actions Scan: 14 files · 10 critical · 22 warnings
- [DB-004] ADD COLUMN "plan" TEXT NOT NULL with no default
Why it hurts: fails as soon as users has one row; the deploy aborts half-way.
Fix: ADD COLUMN "plan" TEXT NOT NULL DEFAULT 'free' (~2 min)
How to use it
Install the skill, open your project in your agent and say something like:
- "Is this safe to deploy?"
- "Run a pre-deploy check on this repo."
- "Review my migrations before I release."
- "It's Friday 5pm, should I ship this?"
Built for Node.js / TypeScript / Next.js apps with PostgreSQL through Prisma, Drizzle, Knex or Supabase. Solo developers, freelancers and small teams who ship without a dedicated platform engineer. Safe by design
- Read-only. It never changes your project until you approve a specific fix.
- No network access in the scanner, no database connection, nothing touches production.
- Secrets are redacted in every report.
- Plain Python 3.8+, standard library only. The code is yours to read.
What it is not It is not a penetration test or a replacement for code review. It reads files; it does not run your app, see your hosting settings or know your table sizes, and every report says what it could not verify. Requirements An AI coding agent that supports the SKILL.md format and can run shell commands with Python 3.8+. Without shell access the skill falls back to a guided manual review using the same checklist. Includes SKILL.md workflow, an automated scanner, and four reference guides: check catalog, safe PostgreSQL migrations, Next.js deploy pitfalls, and rollback and operations. Includes a ready-to-paste GitHub Actions job to run the scan on every pull request. Future updates included.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
Requires an agent that can run shell commands with Python 3.8+ for the automated scanner; without it, the skill falls back to a guided manual review.
Stack-specific checks cover Node.js / TypeScript / Next.js with PostgreSQL (Prisma, Drizzle, Knex, Supabase). Other stacks get only the generic checks (secrets, Docker, CI, SQL migrations).
Reads files only: it cannot see production environment values, hosting settings or table sizes, and it does not run your app or test auth logic. Every report lists what it could not verify.
The scanner is pattern-based, so findings are verified by your agent before being reported. It is a safety net, not a replacement for code review or a security audit.
CI checks cover GitHub Actions.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
Python
Git