supabase-audit
Skill2 starsChanged 5 months agoApache-2.0View on GitHub
Supabase cost optimization and audit expert. Monitors database performance, storage, bandwidth, Edge Functions, Auth MAU, and provides optimization recommendations. Trigger when user mentions Supabase costs, database optimization, or Supabase audit.
In this repository8 other files it gives its agents.
- cloudflare-auditSkill
- cost-audit-masterSkill
- cost-monitorSkill
- d1-cost-optimizerSkill
- index-optimizerSkill
- query-rewriterSkill
- redis-auditSkill
- spend-cap-managerSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 50
Use pg_stat_statements to find slow queries.
- Very specific: line 60
Check dead tuple ratio and vacuum status.
- Very specific: line 65
Ensure proper connection management.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Supabase Cost Optimization Expert
Cost Components
| Component | Free Tier | Billing Metric |
| Database | 500MB | Storage size |
| Storage | 1GB | Storage + Egress |
| Auth | 50,000 MAU | Monthly Active Users |
| Edge Functions | 500K invocations | Invocations |
| Realtime | 200 concurrent | Connections |
| Bandwidth | 5GB | Egress |
Common Anti-Patterns
| Anti-Pattern | Problem | Reference |
| Slow queries | High CPU time | references/slow-queries.md |
| Missing indexes | Sequential scans | references/index-optimization.md |
| Missing FK indexes | Slow joins | references/missing-foreign-key-index.md |
| Table bloat | Dead tuples | references/table-bloat.md |
| Connection issues | Too many connections | references/connection-pooling.md |
| Inefficient joins | Cartesian products | references/inefficient-join.md |
| Correlated subqueries | N+1 pattern | references/slow-subquery.md |
| Deep pagination | OFFSET performance | references/inefficient-pagination.md |
Audit Workflow
Step 1: Check Database Size
SELECT pg_database_size(current_database());
SELECT pg_size_pretty(pg_database_size(current_database()));Step 2: Identify Expensive Queries
Use pg_stat_statements to find slow queries.
See references/slow-queries.md for detailed analysis.
Step 3: Check Index Usage
Analyze sequential scans vs index scans.
See references/index-optimization.md for optimization strategies.
Step 4: Monitor Table Bloat
Check dead tuple ratio and vacuum status.
See references/table-bloat.md for cleanup procedures.
Step 5: Verify Connection Pooling
Ensure proper connection management.
See references/connection-pooling.md for configuration.
Benchmark Reference
| Optimization | Before | After | Improvement |
| Add index | 500ms | 5ms | 99% |
| Clean bloat | 500MB | 300MB | 40% |
| Use pooling | 60 conn | 200+ conn | 233% |
| Fix join | 5000ms | 50ms | 99% |
| Cursor pagination | 100ms | 5ms | 95% |
Output Format
## Supabase Cost Audit Report
### 1. Current Usage
- Database size: X MB / 500 MB (X%)
- Storage: X GB / 1 GB (X%)
- Bandwidth: X GB / 5 GB (X%)
- Auth MAU: X / 50,000 (X%)
### 2. Anti-Patterns Detected
| Query | Anti-Pattern | Reference | Fix |
|-------|--------------|-----------|-----|
| ... | ... | ... | ... |
### 3. Recommendations (by priority)
1. [P0] Fix: <anti-pattern> → Expected improvement: XX%
Reference: references/<file>.md
### 4. Cost Projection
- Current: $X/month
- After optimization: $X/month
- Savings: $X/month (XX%)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

