agentleFS
huiferhuifer/CloudSaver/skills/supabase-audit/SKILL.md

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.

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
  1. Very specific:

    Use pg_stat_statements to find slow queries.

    line 50
  2. Very specific:

    Check dead tuple ratio and vacuum status.

    line 60
  3. Very specific:

    Ensure proper connection management.

    line 65

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Supabase Cost Optimization Expert

Cost Components

ComponentFree TierBilling Metric
Database500MBStorage size
Storage1GBStorage + Egress
Auth50,000 MAUMonthly Active Users
Edge Functions500K invocationsInvocations
Realtime200 concurrentConnections
Bandwidth5GBEgress

Common Anti-Patterns

Anti-PatternProblemReference
Slow queriesHigh CPU timereferences/slow-queries.md
Missing indexesSequential scansreferences/index-optimization.md
Missing FK indexesSlow joinsreferences/missing-foreign-key-index.md
Table bloatDead tuplesreferences/table-bloat.md
Connection issuesToo many connectionsreferences/connection-pooling.md
Inefficient joinsCartesian productsreferences/inefficient-join.md
Correlated subqueriesN+1 patternreferences/slow-subquery.md
Deep paginationOFFSET performancereferences/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

OptimizationBeforeAfterImprovement
Add index500ms5ms99%
Clean bloat500MB300MB40%
Use pooling60 conn200+ conn233%
Fix join5000ms50ms99%
Cursor pagination100ms5ms95%

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%)

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.