AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Ag Referencia Supabase

skill-andregusman-raiz-a-gusman-claude-ag-referencia-supabase · by andregusman-raiz

Patterns para Supabase, PostgreSQL, RLS, migrations, e Zod schemas

No reviews yet
0 installs
26 views
0.0% view→install

Install

$ agentstack add skill-andregusman-raiz-a-gusman-claude-ag-referencia-supabase

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-andregusman-raiz-a-gusman-claude-ag-referencia-supabase)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Ag Referencia Supabase? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Skill: Supabase Patterns

Referencia de patterns para Supabase, PostgreSQL, RLS, e integracao com TypeScript.

Quando Ativar

  • Trabalhando com banco de dados Supabase
  • Criando migrations
  • Configurando RLS
  • Definindo schemas com Zod

Zod Schema Pattern

import { z } from 'zod';

export const userSchema = z.object({
  id: z.string().uuid(),
  email: z.string().email(),
  name: z.string().min(1).max(255),
  role: z.enum(['superadmin', 'core_team', 'external_agent', 'client']),
  created_at: z.string().datetime(),
  updated_at: z.string().datetime(),
});

export type User = z.infer;

export const createUserSchema = userSchema.omit({
  id: true, created_at: true, updated_at: true,
});
export type CreateUser = z.infer;

export const updateUserSchema = createUserSchema.partial();
export type UpdateUser = z.infer;

Repository Pattern

export const userRepository = {
  async findById(id: string): Promise {
    const { data, error } = await supabase
      .from('users').select('*').eq('id', id).single();
    if (error) throw error;
    return data ? userSchema.parse(data) : null;
  },

  async create(input: CreateUser): Promise {
    const { data, error } = await supabase
      .from('users').insert(input).select().single();
    if (error) throw error;
    return userSchema.parse(data);
  },
};

RLS (Row Level Security)

Patterns Comuns

-- Usuario ve apenas seus dados
CREATE POLICY "users_own_data" ON public.users
  FOR ALL USING (auth.uid() = id);

-- Todos leem, apenas dono edita
CREATE POLICY "posts_read_all" ON public.posts
  FOR SELECT USING (true);
CREATE POLICY "posts_write_own" ON public.posts
  FOR INSERT WITH CHECK (auth.uid() = author_id);

-- Baseado em role
CREATE POLICY "admin_full_access" ON public.users
  FOR ALL USING (
    EXISTS (SELECT 1 FROM public.users WHERE id = auth.uid() AND role = 'superadmin')
  );

-- Baseado em organizacao
CREATE POLICY "org_members_only" ON public.projects
  FOR SELECT USING (
    org_id IN (SELECT org_id FROM public.org_members WHERE user_id = auth.uid())
  );

Checklist RLS

  • [ ] ENABLE ROW LEVEL SECURITY em TODA tabela
  • [ ] Policy para SELECT, INSERT, UPDATE, DELETE
  • [ ] Service role bypass apenas para admin APIs

Migrations

  • Numeracao sequencial: 20260219000001_create_users.sql
  • Uma migracao por mudanca logica
  • Idempotente: IF NOT EXISTS
  • Incluir RLS na mesma migration da tabela

Audit Trail

CREATE TABLE IF NOT EXISTS public.audit_logs (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  table_name TEXT NOT NULL,
  record_id UUID NOT NULL,
  action TEXT NOT NULL CHECK (action IN ('INSERT', 'UPDATE', 'DELETE')),
  old_data JSONB,
  new_data JSONB,
  user_id UUID REFERENCES auth.users(id),
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

Realtime

const channel = supabase
  .channel('messages')
  .on('postgres_changes',
    { event: '*', schema: 'public', table: 'messages', filter: `room_id=eq.${roomId}` },
    (payload) => console.log('Change:', payload)
  )
  .subscribe();

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.