- Home
- Skills
- Testing & Debugging
- Next.js and Supabase Production Debugger
More screenshots
Works with the AI Agents you already use
Next.js and Supabase Production Debugger
Your Next.js and Supabase app works locally and fails in production. Your agent scans the project, traces the symptom to its cause, fixes it, and proves the fix.
Free
Next.js and Supabase Production Debugger
Example session with this skill installed
I am getting a generic 500 error on my /api/profile-update route in production, but it works locally. I have the server log: 'new row violates row level security policy for table profiles'.
- Read your context and instructions
- Compiled the next js
Production diagnosis: user-dashboard (production)
Symptom: POST /api/profile-update, 500 Internal Server Error, "new row violates row level security policy"
Evidence: Server log: "new row violates row level security policy for table profiles"; Scanner finding: RLS enabled on profiles but no INSERT policy found for authenticated role.
Findings
- [Blocker, High Confidence] Missing RLS Insert Policy
Catalog match:auth-rls-violation-04
Cause: Confirmed. The table has RLS enabled but lacks a specific policy allowing theauthenticatedrole to insert new rows, causing the transaction to fail. Works locally because local DB may have RLS disabled or usesservice_role.
Fix: Add an RLS policy for theprofilestable.create policy "Users can insert their own profile." on profiles for insert with check (auth.uid() = id);
Verify: Run the POST request again from the production preview environment using a test user token.
Not checked: RPC errors, because the log explicitly pointed to a table-level RLS violation.
Learning log: Added entry regarding RLS parity between local and production environments.
Next steps
- Run the provided SQL migration in your Supabase SQL editor.
- Trigger a production smoke test to confirm the 500 error is resolved.
- Run
python -I scripts/scan_project.py .to check for other missing policies.
Connects securely to your tools. The creator never sees your data.
About this skill
Debugging production failures in the Next.js and Supabase stack is notoriously difficult because errors are often swallowed by Vercel or hidden behind generic 500 status codes. This skill provides a systematic diagnostic framework to stop the guessing game. It uses a specialized scanner to detect configuration drift and matches live error logs against a catalog of proven failure patterns from real-world deployments.
What it does
- Project scanning runs a Python-based utility to identify high-risk configuration errors and security leaks.
- Symptom triage maps HTTP status codes like 401s, 429s, and redirect loops to specific root causes.
- Pattern matching compares server logs against a catalog of known failures in Next.js, Supabase, and Vercel.
- Security auditing identifies RLS policy gaps and accidental secret key exposures during the debug flow.
- Knowledge retention maintains a local learning log to prevent the same bug from recurring in future sprints.
How it works
- Initialize diagnostics by reading the project learning log and scanning the codebase with
scripts/scan_project.py. - Collect evidence including status codes, response bodies, and raw server-side logs to isolate the environment.
- Analyze and Triage using the built-in triage flow to move from symptoms to specific failure categories.
- Propose and Verify small, targeted fixes with specific verification steps for each change.
Frameworks & tools
Targeted at Next.js applications deployed on Vercel using Supabase for Auth, Database, and Storage. Requires Python to run the bundled scanner script.
Why this beats prompting it yourself
Generic prompts often suggest broad refactors when the issue is a specific RLS policy or a Vercel-specific environment variable mismatch. This skill follows a strict evidence-based workflow that prevents "hallucinated fixes" by requiring log-to-catalog matching.
Use cases
- Resolve silent 500 errors in Vercel production environments.
- Debug failing Supabase RPC calls or Auth redirect loops.
- Perform a pre-release audit of RLS policies and environment variables.
- Fix broken file uploads or downloads in Supabase Storage.
Known limitations
Does not have direct access to live Vercel or Supabase dashboard logs unless provided by the user. Scanner requires a Python environment to execute.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Requires Python for scanner scripts. Cannot directly access cloud dashboards. User must provide raw log output. Database changes require manual approval.
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
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 4 days ago
- Free with an Agensi account