From supabase-builder
Diagnose a failing Supabase edge function. Pulls recent logs via the Supabase MCP, pattern-matches against 10 common failure modes, and proposes a specific fix. Triggered by "edge function is broken", "edge function not working", "diagnose my edge function", "why is my edge function failing", "debug edge function", "edge function error".
How this skill is triggered — by the user, by Claude, or both
Slash command
/supabase-builder:edge-fn-doctorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Supabase edge function failures come from a short list of causes. This skill reads your logs, matches the symptom to one of ten known patterns, and tells you exactly what to fix.
Supabase edge function failures come from a short list of causes. This skill reads your logs, matches the symptom to one of ten known patterns, and tells you exactly what to fix.
.coworker/supabase-config.json for project_ref.If either fails, say: "I need the Supabase MCP connected and a project ref saved. Run /supabase-setup or paste your project ref."
If the user named a function, use it. Otherwise:
list_edge_functions(project_id=<ref>)
Show the list and ask which one's broken.
get_logs(project_id=<ref>, service="edge-function")
Filter logs for the specific function name. Grab the last 50 entries (or the last 10 minutes, whichever is more).
If logs are empty:
Read references/common-failures.md — it contains the 10 patterns with symptom → cause → fix.
For each failure mode, check the log output for the pattern signature:
| # | Pattern | Signature in logs |
|---|---|---|
| 1 | CORS preflight missing | "CORS", "preflight", OPTIONS request with 4xx |
| 2 | Missing env secret | Deno.env.get returning undefined, "secret not set" |
| 3 | HMAC verification fail | "signature mismatch", "invalid signature", 401 on signed requests |
| 4 | RLS blocking insert | "new row violates row-level security policy", 403 |
| 5 | Function timeout | "exceeded maximum execution time", timeouts around 60s |
| 6 | Deno import error | "failed to resolve module", "cannot find import" |
| 7 | Invalid JWT | "JWT expired", "invalid token" |
| 8 | External API rate limit | 429 status codes from calling APIs |
| 9 | Deploy / bundle failure | no recent logs despite deploy, or "module not found" on cold start |
| 10 | 404 on function URL | requests hitting the domain but returning "function not found" |
Match the most recent failure in logs to the most likely pattern. If multiple match, list them in order of likelihood.
Present the diagnosis in this format:
⚠️ Diagnosis: <pattern name>
Symptom: <what I saw in logs>
Root cause: <why it happens>
Fix: <specific, step-by-step>
Confidence: High / Medium / Low
For medium or low confidence, show top 2-3 candidate patterns and ask the user which symptom matches their experience.
For each failure mode, the fix has a specific form:
apply_migration.Never apply a fix silently. Always show what's changing and ask.
After applying:
get_logs.If still broken after one fix attempt, re-run Step 3 with the updated logs. Patterns often stack (fix #1 reveals #2).
Append to .coworker/logs/supabase-activity.md:
### YYYY-MM-DD
- Debugged: <function-name>
- Pattern: <pattern name>
- Fix applied: <short description>
- Status: resolved | pending | unresolved
Some failures aren't patterns — they're architecture problems:
Honesty about the limits of the tool beats invented fixes.
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub heymitch/vip-accelerator --plugin supabase-builder