Automated summary
Describes the error handling and display pattern used in Supabase Studio, where errors are classified in the data layer and troubleshooting UI is rendered by an ErrorMatcher component.
Strengths
- Cleanly separates classification (data/fetchers.ts, error-patterns.ts) from presentation (ErrorMatcher, error-mappings.tsx)
- Lists the key files with their purpose, making the pattern easy to locate in the repo
- Includes a concrete "What NOT to do" section covering real pitfalls (passing error.message, regex in mappings, Object.assign)
- Explains the full flow from handleError through to the rendered troubleshooting component
Limitations
- Highly specific to the Supabase Studio repository; the referenced paths and components do not exist elsewhere
- Assumes familiarity with React Query and Studio's internal architecture
- Gives guidance but no complete end-to-end example of adding a new error type
Use when adding or changing how an API request error is displayed in Supabase Studio, or when writing troubleshooting steps for a new error type.
Do not use for a React or Supabase project outside the Studio repo, or as a general-purpose error handling guide.
Security analysis
SafeThis is a pure documentation/pattern skill describing an internal Supabase Studio error-classification convention. It declares no tools, contains no shell commands, network calls, file mutations, or credential handling, and only references repo-local paths and React component usage. No execution risk of any kind.
No concerns found
How this analysis is madeExamples
I'm rendering a tables list in Supabase Studio and the query failed. Wire up ErrorMatcher so the error shows a troubleshooting section, using the project ref for the support form.Add a new error type for 'pool exhausted' responses: register the regex pattern in data/error-patterns.ts, create the error class, and add a troubleshooting component with the right mapping.Add a 'Debug with AI' button to the ConnectionTimeout troubleshooting component using a hook inside the component rather than a callback prop.name: studio-error-handling description: Error display and troubleshooting pattern for Supabase Studio. Use when showing a failed API request or query error in the UI (AlertError, toast, inline message), adding troubleshooting steps for a new error type, or wiring up the AI assistant debug button from an error state.
Studio Error Handling Pattern
Full docs and code examples: apps/studio/components/interfaces/ErrorHandling/README.md
How it works
Classification happens in the data layer: handleError in data/fetchers.ts tests the error message against ERROR_PATTERNS and throws the matching error subclass (e.g. ConnectionTimeoutError extends ResponseError). The component (ErrorMatcher) reads errorType from the instance and does an O(1) lookup — it never does regex matching.
handleError() → throws ConnectionTimeoutError → React Query catches → ErrorMatcher reads errorType → renders troubleshooting
Key files
| File | Purpose |
| ------------------------------------- | ---------------------------------------------------------------- |
| data/error-patterns.ts | Array of { pattern, ErrorClass } — the regex lives here |
| types/api-errors.ts | Error classes, KnownErrorType union, ClassifiedError type |
| ErrorMatcher.tsx | Component — reads errorType, looks up mapping, renders |
| error-mappings.tsx | Record<KnownErrorType, { id, Troubleshooting: ComponentType }> |
| errorMappings/ConnectionTimeout.tsx | Reference troubleshooting component |
| TroubleshootingSections.tsx | Reusable accordion section components |
| TroubleshootingAccordion.tsx | Accordion wrapper with telemetry |
Usage
Pass the full error object from React Query — not error.message:
{
isError && (
<ErrorMatcher title="Failed to load tables" error={error} supportFormParams={{ projectRef }} />
)
}
What NOT to do
- Do not pass
error.messagetoErrorMatcher— pass the fullerrorobject so the class is preserved. - Do not put regex patterns in
error-mappings.tsx— they belong indata/error-patterns.ts. - Do not use
Object.assignto stamperrorType— throw a proper subclass instead. - Do not pass a raw URL string for support — use
supportFormParams={{ projectRef }}. - Do not put the page title inside the error mapping — it belongs on the
<ErrorMatcher>caller. - Do not add callback props (
onDebugWithAI,onRestartProject) to troubleshooting components — use hooks inside them instead.
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/supabase-studio-error-handling-mte1lfvk' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/supabase-studio-error-handling-mte1lfvk/download' --output '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md.part' && mv '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md.part' '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && test -s '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/studio-error-handling' && cp -R '.skill-downloads/supabase-studio-error-handling-mte1lfvk' '.claude/skills/studio-error-handling'Cursor
test -f '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && test -s '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/studio-error-handling' && cp -R '.skill-downloads/supabase-studio-error-handling-mte1lfvk' '.cursor/skills/studio-error-handling'Codex
test -f '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && test -s '.skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/studio-error-handling' && cp -R '.skill-downloads/supabase-studio-error-handling-mte1lfvk' '.agents/skills/studio-error-handling'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/supabase-studio-error-handling-mte1lfvk'openskills read 'supabase-studio-error-handling-mte1lfvk'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/supabase-studio-error-handling-mte1lfvk/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.