edge-function-consolidator

Audits Supabase edge functions and produces a consolidation plan with bucket classifications.

Updated Sep 24, 2025
One-click install
npx skills add https://github.com/chriso789/pitch-1 --skill edge-function-consolidator-chriso789
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: edge-function-consolidator
Source: https://github.com/chriso789/pitch-1/tree/main/.agents/skills/edge-function-consolidator
Command: npx skills add https://github.com/chriso789/pitch-1 --skill edge-function-consolidator-chriso789

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Supabase projects accumulate edge function sprawl that approaches the 500-function cap, leaving dead, duplicate, and overlapping handlers that are risky to clean up because live webhook URLs and tenant resolution must not break. ## Core Features & Use Cases - Full function audit: Enumerates every function in supabase/functions, scans static references in src/ and config.toml, and cross-checks 30-day invocation evidence from function_edge_logs. - Eight-bucket classification: Sorts each function into live-pinned, live-private, cron-worker, duplicate, dead, consolidate-router, move-to-queue, or move-off-supabase with explicit evidence. - Consolidation report: Produces router route tables (crm-router, admin-router, worker-tick), duplicate canonical picks, deletion candidates with proof, and a safe migration order. - Use Case: When a CRM project nears the Supabase function cap, run the audit to identify 40 dead functions, merge 25 CRUD endpoints into routers, and consolidate scheduled jobs into one cron-dispatched worker-tick. ## Quick Start Audit all Supabase edge functions in this project and produce a consolidation plan classifying each as live, duplicate, dead, or a router candidate.

Frequently Asked Questions about edge-function-consolidator

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

FAQPage Schema
How do I consolidate too many Supabase edge functions?▼

Audit every function in supabase/functions, classify each into buckets like live-pinned, duplicate, dead, or consolidate-router, then merge small handlers sharing auth and tenant logic into router functions. Deletions require 30 days of zero invocations in function_edge_logs.

How to find dead Supabase edge functions safely?▼

A function is dead only when it has zero references in src/, other functions, and cron config, plus zero invocations in function_edge_logs for at least 30 days. Anything failing either check is flagged as suspect, not deleted.

Can webhook receiver functions be merged into a router?▼

No. Webhook receivers for providers like Stripe, Telnyx, or QBO keep their exact /functions/v1/<name> URLs because provider-side configs depend on them. Consolidation happens behind the stable URL, never by renaming or merging endpoints.

When should an edge function move to a queue worker instead?▼

Move functions to a queue-backed worker-tick when they call rate-limited external APIs, run AI inference on multiple records, compile PDFs, or loop over more than about 50 rows. Synchronous edge functions are a poor fit for retryable long-running work.

What are the limits of Supabase edge functions for heavy compute?▼

Functions exceeding 30 seconds wall time, needing GPU or over 1GB memory, or holding long-lived connections should move off Supabase to external workers like Fly, Cloud Run, or Lambda. The audit only flags these as future migration candidates.