backend-supabase-write

Implements Supabase migrations, RPC functions, and Angular services for the Peajes transport project.

Updated Jan 31, 2023
One-click install
npx skills add https://github.com/Briian3306/Transporte --skill backend-supabase-write-briian3306
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: backend-supabase-write
Source: https://github.com/Briian3306/Transporte/tree/main/ibarra-app/.agents/skills/backend-supabase-write
Command: npx skills add https://github.com/Briian3306/Transporte --skill backend-supabase-write-briian3306

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? It enforces a consistent, safe workflow for making Supabase backend changes in the Peajes / Transporte Ibarra project, preventing common mistakes like testing against the remote database, creating duplicate migration timestamps via MCP, or leaving the local CLI database without seed data. ## Core Features & Use Cases - Migration authoring and validation: Create SQL migrations for RPC functions, views, triggers, policies, and RLS, then validate them against the local Supabase CLI with pgTAP tests before any remote push. - Two-environment contract enforcement: Supabase CLI is the only testing environment and DESARROLLO is the only remote, with explicit guards against db reset --linked, MCP apply_migration duplicates, and hardcoded secrets. - Documentation and handoff: Every change is documented under docs/backend/ using the SQL task template, followed by the backend-documenter and backend-tester skills. - Use Case: When adding a new RPC for toll pass (pasadas) reporting, write the migration, run db reset --local --no-seed plus pgTAP tests, restore app data with pnpm seed:local, then push to DESARROLLO only after verifying migration history alignment. ## Quick Start Ask the agent to implement a new Supabase RPC or migration for the Peajes backend and validate it against the local Supabase CLI before pushing to DESARROLLO.

Frequently Asked Questions about backend-supabase-write

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test Supabase migrations locally before pushing to remote?▼

Run `npx supabase db reset --local --no-seed` followed by `npx supabase test db` to validate schema and pgTAP tests against the local CLI. Then restore app data with `pnpm seed:local`, which reloads Auth, pasadas, and the tarifario v2 catalog.

How do I fix Supabase db push failing with remote migration versions not found?▼

This happens when MCP `apply_migration` created a different timestamp than the local filename. Use `npx supabase migration repair --linked --status reverted <mcp_timestamp>` then mark the filename timestamp as applied, and re-run `migration list --linked` to confirm.

Can I use the remote Supabase project for testing SQL changes?▼

No. The workflow mandates that all SQL and migration testing runs against the local Supabase CLI at 127.0.0.1:54321. The DESARROLLO remote is only for development deployment after local tests pass, and `db reset --linked` against it is forbidden.

Why is my local Supabase database empty after db reset with --no-seed?▼

The `--no-seed` flag applies only schema migrations without loading Auth users, pasadas, or the tarifas v2 catalog. Run `pnpm seed:local` afterward to restore Kong, Auth/RBAC, pasadas, and the tarifario v2 ETL data.

What are the limitations of this Supabase backend workflow?▼

It does not cover frontend wizard or template UI work, shared models owned by another agent, or staging/production deployments since none exist in this flow. It also forbids reusing checklist_templates and requires explicit user authorization before any DESARROLLO push.