基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kinncj/Heimdall --skill supabase-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
Manage GitHub Projects v2 board: add issues, update field values, and query board state. Use when managing project boards.
Run WCAG 2.2 Level AA accessibility audits against generated UI. Use when a story has ui:true or when asked to audit accessibility.
Generate a complete component file tree wired to design tokens with tests and Gherkin spec. Use when scaffolding a new UI component.
| name | supabase-patterns |
| description | Apply Supabase schema, RLS policies, and edge function patterns. Use when building on Supabase. |
# Start local Supabase stack
supabase start
# Apply migrations
supabase db push
# Generate TypeScript types
supabase gen types typescript --local > src/types/supabase.ts
# Deploy Edge Functions
supabase functions deploy {function-name}
# Stop
supabase stop
-- supabase/migrations/{timestamp}_{description}.sql
-- Up migration (always additive in production)
CREATE TABLE IF NOT EXISTS public.{table_name} (
id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
user_id uuid REFERENCES auth.users(id) ON DELETE CASCADE NOT NULL,
created_at timestamptz DEFAULT now() NOT NULL,
updated_at timestamptz DEFAULT now() NOT NULL
);
-- Enable RLS ALWAYS
ALTER TABLE public.{table_name} ENABLE ROW LEVEL SECURITY;
-- RLS Policies
CREATE POLICY "{table_name}_select_own"
ON public.{table_name} FOR SELECT
USING (auth.uid() = user_id);
CREATE POLICY "{table_name}_insert_own"
ON public.{table_name} FOR INSERT
WITH CHECK (auth.uid() = user_id);
CREATE POLICY "{table_name}_update_own"
ON public.{table_name} FOR UPDATE
USING (auth.uid() = user_id)
WITH CHECK (auth.uid() = user_id);
CREATE POLICY "{table_name}_delete_own"
ON public.{table_name} FOR DELETE
USING (auth.uid() = user_id);
// supabase/functions/{name}/index.ts
import { serve } from 'https://deno.land/std@0.177.0/http/server.ts'
import { createClient } from 'https://esm.sh/@supabase/supabase-js@2'
serve(async (req: Request) => {
const authHeader = req.headers.get('Authorization')
if (!authHeader) {
return new Response(JSON.stringify({ error: 'Unauthorized' }), {
status: 401,
headers: { 'Content-Type': 'application/json' }
})
}
const supabase = createClient(
Deno.env.get('SUPABASE_URL') ?? '',
Deno.env.get('SUPABASE_ANON_KEY') ?? '',
{ global: { headers: { Authorization: authHeader } } }
)
// Never use service_role key in Edge Functions unless absolutely necessary
const { data: { user }, error } = await supabase.auth.getUser()
(error || !user) {
(.({ : }), { : })
}
})
service_role key to client code.supabase gen types typescript for type safety.supabase start before deploying.