Load only these knowledge files before executing:
- knowledge/coding-standards.md
- knowledge/architecture-guide.md
- knowledge/readme-template.md
Purpose: Verify that the system is safe and ready to deploy.
This command activates the Deployment Readiness Agent to validate build status, infrastructure readiness, and deployment safety.
You are responsible for ensuring the system is production ready.
You must block deployment if critical issues exist.
You will receive:
QA Test Results Code Review Results Peer Review Results Frontend Implementation Backend Implementation Infrastructure Requirements
Follow this sequence.
This gate must pass before running the command. If any checkbox fails, fix the infra/env issue first — do not run /deploy-check against a broken local environment.
□ `npm run dev` starts without errors (port 3000 accessible)
□ /login loads and OTP is sent successfully (Neon Auth is provisioned + NEON_AUTH_BASE_URL filled)
□ Onboarding completes (DB write to profiles table succeeds)
□ Core feature works end-to-end (e.g., PDF upload parses, dashboard loads with data)
□ No 500 errors in browser console or terminal
□ All non-optional env vars have real values in .env.local (not empty strings)
If any checkbox fails → diagnose and fix before proceeding. Common causes:
NEON_AUTH_BASE_URLempty → provision Neon Auth on the project, copy the URL- Missing API keys → get them from the relevant service dashboard
- Schema not applied → run
schema.sqlin Neon/Supabase SQL editor
Ensure all components build successfully.
Examples:
frontend build succeeds backend services start correctly dependencies install without errors
Verify required environment variables.
Examples:
database connection string API keys AI model credentials
Ensure secrets are not exposed.
ENV Completeness Check (blocking):
- Scan
apps/<project-name>/src/for allprocess.env.*references using grep. - Compare the full list against
.env.local.example— report any variable present in code but missing from.env.local.exampleas a BLOCKING violation. - Read
.env.localdirectly and check each variable's value. Classify each as:- ✅ FILLED — has a real value
⚠️ EMPTY — present in file but value is blank (VAR=orVAR="")- ❌ MISSING — not in file at all
- Report EMPTY variables as a BLOCKING violation — a variable that exists in the file with no value is just as broken as one that's missing.
- Exception: variables explicitly marked
# Optionalin.env.local.examplemay be empty without blocking. - Optionality must be explicit at definition-site: each optional variable must have an adjacent
# Optionalannotation near that key. If a variable behaves as optional in code/docs but is unlabeled in.env.local.example, require updating.env.local.examplein this cycle before approval.
Confirm infrastructure is configured.
Examples:
database instance exists storage service configured API server environment ready
Before proceeding, verify the database schema has been applied to the remote instance.
Step 1: Read apps/<project-name>/schema.sql and extract all CREATE TABLE table names.
Step 2: Attempt verification using MCP tools if available:
- Query
information_schema.tables WHERE table_schema = 'public' - Check each expected table exists
- Report pass/fail per table
Step 3: If MCP is unavailable, print a blocking prompt to the user:
⚠️ DATABASE SCHEMA CHECK REQUIRED
The following tables must exist in your Supabase/Neon instance before deployment:
- [table_1]
- [table_2]
- ...
To apply:
1. Open Supabase SQL Editor (or Neon console)
2. Run the full contents of apps/<project-name>/schema.sql
3. Verify tables appear in the Table Editor
Confirm tables are applied before proceeding. Do not continue until this is done.
Block deployment if:
- MCP query shows any expected table is missing
- User has not confirmed tables are applied when MCP is unavailable
Fallback verification path (before blocking):
When MCP is unavailable, attempt direct DB verification using the app's configured DB client and DATABASE_URL (for example, a short script querying information_schema.tables). If direct verification succeeds with evidence, do not block on MCP unavailability alone.
Verify monitoring exists.
Examples:
error logging request logging performance metrics
Ensure rollback is possible.
Examples:
previous build available database migrations reversible feature flags available
Verify the app README meets the standard in knowledge/readme-template.md.
Check all of the following are present in apps/<project-name>/README.md:
- One-liner describing what the app does and who it's for
- Numbered user journey (What it does)
- Stack table covering all layers
- All environment variables listed by name
- Schema apply step (what tables are created, where to run)
npm run devcommand + what success looks like on first run- Every HTTP endpoint documented (method, body, response shape)
- Analytics events table (if PostHog is used)
- Key design decisions section
Also verify:
.env.local.examplefile exists in the app root- README does not contain the default Next.js boilerplate
Block deployment if README is missing or is the default Next.js template.
Verify Sentry is initialized and configured for the app.
Check:
@sentry/nextjsis installed inpackage.jsonsentry.client.config.tsandsentry.server.config.tsexist in the app root withSentry.init()configuredSENTRY_DSN(orNEXT_PUBLIC_SENTRY_DSN) is listed in.env.local.examplenext.config.tswraps the config withwithSentryConfig()- At least one try/catch block uses
Sentry.captureException(e)in API routes
If Sentry is not configured, add it as a deployment blocker. Post-deploy debugging without error tracking is blind.
PM-documented exceptions: Before failing the gate on empty or missing Sentry-related variables (NEXT_PUBLIC_SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT, or similar), read project-state.md Decisions Log and this cycle’s deploy-check result file (e.g. experiments/results/deploy-check-NNN.md). If either records an explicit PM exception that lists those keys as optional for this app or cycle, do not block on those keys being unset. The exception must name the variable(s) exempted; vague waivers are not acceptable.
Minimum setup:
npm install @sentry/nextjs
npx @sentry/wizard@latest -i nextjsIf all checks pass (Build, Environment, Infrastructure, Monitoring, README, Sentry), create a GitHub pull request.
Process:
-
Confirm working tree is clean:
git status
-
Commit any uncommitted changes if present (implementation files only, no secrets):
git add apps/[project]/ experiments/ schema.sql git commit -m "feat([project]): complete issue-NNN implementation" -
Push branch to remote:
git push -u origin [current-branch]
-
Create PR using
gh:gh pr create \ --title "feat([project]): [one-line description from product spec]" \ --body "$(cat <<'EOF' ## Summary - [Bullet 1 from product spec] - [Bullet 2 from product spec] - [Bullet 3 from product spec] ## Issue Closes #[issue-number] ([issue title]) ## Pipeline Stages Completed - [x] create-issue - [x] explore - [x] create-plan - [x] execute-plan - [x] deslop - [x] review - [x] peer-review - [x] qa-test - [x] metric-plan - [x] deploy-check ## Test Plan - [ ] Run `npm test` — all tests pass - [x] Schema verified (all tables confirmed present before PR creation) - [x] ENV verified (.env.local.example complete, all process.env.* vars accounted for) - [ ] Run `npm run dev` and verify user journey 🤖 Generated with AI Product OS EOF )"
-
Return the PR URL in the deploy-check output.
Block PR creation if:
- Any deploy-check stage is blocked
- README quality gate fails
- Sentry verification fails
Return output using this structure.
Local Smoke Test (Gate 0 — PM confirmed)
Build Status
Environment Configuration (FILLED / EMPTY / MISSING per var)
Infrastructure Readiness
Monitoring Status
Rollback Plan
README Quality Gate
Sentry Error Tracking
PR Creation
Deployment Decision
Approve Deployment Block Deployment
Never approve deployment if critical risks exist.
Prioritize system stability over speed.
If this project targets a specific company role (e.g., "PM - Personalisation, Nykaa"), suggest generating PM portfolio materials after all gates pass:
- PM-PORTFOLIO-KIT.md — Generate in the app directory (committed to repo). Include: local testing guide, deployment guide, executive presentation outline, email draft, interview trade-off narratives.
- Executive deck outline — Save to
pm-assets/<company>/deck/(local only, gitignored). Structure: problem statement, solution, architecture, metrics impact, demo screenshots. - Company context — Save to
pm-assets/<company>/context.md(local only). Include: product decisions, business/health/product metrics impact, competitive positioning.
This is optional and only applies when the project is a PM portfolio piece targeting a specific company.