Creates standard Supabase service files for table operations, ensuring architectural consistency.

Install

mkdir -p .claude/skills/implement-service && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/9827" && unzip -o skill.zip -d .claude/skills/implement-service && rm skill.zip

Installs to .claude/skills/implement-service

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Implementa um arquivo de service Supabase seguindo o padrão do projeto. Use quando o Claude solicitar a criação de um novo service ou quando um componente estiver acessando o Supabase diretamente (violação de arquitetura).
222 charsno explicit “when” trigger
Intermediate

Key capabilities

  • Create Supabase service files
  • Implement CRUD operations
  • Manage real-time subscriptions
  • Admin access implementation

How it works

It implements boilerplate-free services for Supabase tables, following project conventions.

Inputs & outputs

You give it
Table name
You get back
Service file

When to use implement-service

  • Creating new database service files
  • Adding CRUD operations for new tables
  • Implementing real-time subscriptions

About this skill

Implemente o service app/src/services/$0Service.js para a tabela $0.

Regras inegociáveis

  • Import APENAS: import { supabase } from '../lib/supabaseClient';
  • Todas as funções são async e fazem throw error em caso de falha
  • Listagens retornam data ?? [] (nunca null)
  • Prefixos: fetch (leitura), create, update, delete, subscribe (realtime), admin (acesso total)

Template de implementação

import { supabase } from '../lib/supabaseClient';

// ── Leitura pública ────────────────────────────────────────────────────────────
export async function fetch[Entidade]() {
  const { data, error } = await supabase
    .from('[tabela]')
    .select('*')
    .order('created_at', { ascending: false });
  if (error) throw error;
  return data ?? [];
}

// ── Realtime subscription ──────────────────────────────────────────────────────
export function subscribe[Entidade](callback) {
  callback(); // carrega dados iniciais imediatamente
  const channel = supabase
    .channel('[tabela]-realtime')
    .on('postgres_changes', { event: '*', schema: 'public', table: '[tabela]' }, callback)
    .subscribe();
  return () => supabase.removeChannel(channel); // cleanup obrigatório
}

// ── Escrita (usuário autenticado) ──────────────────────────────────────────────
export async function create[Entidade](payload) {
  const { data, error } = await supabase
    .from('[tabela]')
    .insert(payload)
    .select()
    .single();
  if (error) throw error;
  return data;
}

export async function update[Entidade](id, changes) {
  const { data, error } = await supabase
    .from('[tabela]')
    .update(changes)
    .eq('id', id)
    .select()
    .single();
  if (error) throw error;
  return data;
}

export async function delete[Entidade](id) {
  const { error } = await supabase
    .from('[tabela]')
    .delete()
    .eq('id', id);
  if (error) throw error;
  return true;
}

// ── Admin (acesso sem filtro de RLS) ──────────────────────────────────────────
export async function adminFetch[Entidade]() {
  const { data, error } = await supabase
    .from('[tabela]')
    .select('*, profiles(display_name)')
    .order('created_at', { ascending: false });
  if (error) throw error;
  return data ?? [];
}

Após criar o arquivo

  1. Verificar se algum componente em features/ importa supabaseClient diretamente para esta tabela
  2. Se sim, substituir pelo service recém-criado
  3. Rodar build: cd app && npm run build
  4. Reportar resultado ao Claude

When not to use it

  • Direct Supabase access in components
  • Non-Supabase projects

Limitations

  • Strict project conventions
  • Requires Supabase client

How it compares

It prevents architectural violations by centralizing Supabase access in service files.

Compared to similar skills

implement-service side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
implement-service (this skill)04moNo flagsIntermediate
cloudbase-document-database-web-sdk12moNo flagsIntermediate
relational-database-web-cloudbase12moReviewIntermediate
convex06moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry