一键导入
supabase
Supabase migration safety, local testing workflow, grant requirements, fallback observability, and health endpoint patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Supabase migration safety, local testing workflow, grant requirements, fallback observability, and health endpoint patterns.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Review recently changed files for code reuse, quality, and efficiency issues, then fix them. Use when implementation is already complete and you want a final cleanup pass that mirrors Claude Code's `/simplify` behavior as closely as Codex can, without overriding Claude's native `/simplify`.
Python-specific patterns: uv/poetry virtual environments, python -m imports, version pinning, pip restrictions on macOS.
| name | Supabase |
| description | Supabase migration safety, local testing workflow, grant requirements, fallback observability, and health endpoint patterns. |
Wrong -- push migration directly to remote:
supabase db push # bug in migration -> production database corrupted
Right -- test locally first:
supabase start # requires Docker Desktop
supabase db reset # apply all migrations locally
docker exec supabase_db_<project> psql -U postgres -c "SELECT * FROM new_table LIMIT 1;"
supabase db push # only after local verification
Wrong -- create table without grants (RLS blocks access):
CREATE TABLE public.posts (id uuid PRIMARY KEY, title text NOT NULL);
-- Clients get 403: permission denied
Right -- include explicit grants:
CREATE TABLE public.posts (id uuid PRIMARY KEY, title text NOT NULL);
GRANT SELECT ON public.posts TO anon, authenticated;
Wrong -- grant per-table, forget on future tables:
GRANT SELECT ON posts TO anon; -- next table has same bug
Right -- set default privileges in initial setup migration:
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO anon, authenticated;
Wrong -- silent fallback hides production bug:
if (error) return DEFAULT_POSTS; // nobody knows
Right -- log at ERROR level when fallback activates:
if (error) {
console.error('[TABLE_FALLBACK] posts query failed:', error.message);
return DEFAULT_POSTS;
}
Wrong -- health check only tests connectivity:
app.get('/health', async () => {
await supabase.from('posts').select('count');
return { status: 'healthy' }; // doesn't detect degraded state
});
Right -- check actual data access:
app.get('/health', async () => {
const { data, error } = await supabase.from('posts').select('id').limit(1);
if (error) return { status: 'degraded', reason: error.message };
return { status: 'healthy' };
});