Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add sawrus/agent-guides --skill db-performancegit clone --depth 1 https://github.com/sawrus/agent-guidesWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/sawrus/agent-guides/db-performance)<a href="https://agentmods.dev/skills/sawrus/agent-guides/db-performance"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/db-performance/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/sawrus/agent-guides/db-performance"><img src="https://agentmods.dev/badge/skills/sawrus/agent-guides/db-performance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Excessive Agency · line 192 Skill allows unbounded resource consumption (API calls, storage, compute). Without rate limits or quotas, a compromised or misbehaving agent can cause denial-of-service or cost overruns.Fix: Set explicit rate limits, timeouts, and resource quotas for API calls, file operations, and compute. Implement circuit breakers for runaway loops.
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.01714 |
| Opus 5.5 | $0.00013 | $0.00686 |
| Sonnet 5.5 | $0.00006 | $0.00343 |
| Haiku 4.5 | $0.00003 | $0.00171 |
Grade A, and why
db-performance scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Skill: Database Performance
Expertise: EXPLAIN ANALYZE, index design (partial/covering), pg_stat_statements, autovacuum tuning, PgBouncer sizing.
When to load
When investigating slow queries, designing indexes, tuning PostgreSQL config, or sizing PgBouncer pools.
Query Analysis with pg_stat_statements
-- Enable (add to postgresql.conf, then restart or reload)
-- shared_preload_libraries = 'pg_stat_statements'
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
-- Top 10 slowest queries by total time
SELECT
left(query, 120) AS query_snippet,
calls,
round(total_exec_time::numeric, 2) AS total_ms,
round(mean_exec_time::numeric, 2) AS mean_ms,
round(stddev_exec_time::numeric, 2) AS stddev_ms,
rows
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;
-- Top queries by mean execution time (find worst-per-call)
SELECT
left(query, 120),
calls,
round(mean_exec_time::numeric, 2) AS mean_ms,
round(rows::numeric / calls, 1) AS rows_per_call
FROM pg_stat_statements
WHERE calls > 100 -- ignore one-offs
ORDER BY mean_exec_time DESC
LIMIT 10;
-- Queries with high I/O (missing index candidates)
SELECT
left(query, 120),
calls,
round(mean_exec_time::numeric, 1) AS mean_ms,
shared_blks_read + shared_blks_hit AS total_blocks,
round(shared_blks_hit::numeric / NULLIF(shared_blks_hit + shared_blks_read, 0) * 100, 1) AS cache_hit_pct
FROM pg_stat_statements
WHERE calls > 50
ORDER BY shared_blks_read DESC
LIMIT 10;
-- Reset stats after tuning
SELECT pg_stat_statements_reset();
EXPLAIN ANALYZE (reading execution plans)
-- Always use ANALYZE BUFFERS for real cost data
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT o.*, c.email
FROM orders o
JOIN customers c ON c.id = o.customer_id
WHERE o.status = 'pending'
AND o.created_at > now() - interval '7 days';
/* Reading the output:
Seq Scan → full table scan, may need index
Index Scan → good, using index
Index Only Scan → best, covering index (no heap access)
Nested Loop → OK for small datasets; bad for large
Hash Join → good for large joins
Merge Join → good for pre-sorted data
Key numbers:
- actual time=START..END ms per row
- rows=N vs rows=N (estimated vs actual — big diff = stale stats)
- Buffers: hit=N read=N (high 'read' = cache miss → index opportunity)
*/
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 206 lines · 32 tokens per session scan A 31835792121c
db-performance is a skill published in the GitHub repository sawrus/agent-guides (19 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 1,714 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
postgresql
Expert PostgreSQL assistance covering advanced SQL, JSONB, indexing (B-Tree, GIN, BRIN), query optimization with EXPLAIN ANALYZE, and replication. Use when designing robust relational schemas or tuning performance.
timescaledb
Expert TimescaleDB time-series database assistance covering PostgreSQL hypertables, continuous aggregates, and data retention policies. Use when storing high-volume time-series telemetry, IoT metrics, or financial data.
prisma
Expert Prisma ORM assistance covering Prisma schema, migrations, type-safe queries, relation filters, and Accelerate. Use when modeling databases and querying SQL in TypeScript/JavaScript.
cockroachdb
Expert CockroachDB distributed SQL assistance covering global ACID transactions, Raft consensus, multi-region survivability, and geo-partitioning. Use when scaling relational PostgreSQL workloads across multiple clouds or regions.
cosmosdb
Expert Azure Cosmos DB assistance covering NoSQL API, partition key design, Request Units (RU/s) optimization, and change feed. Use when building globally distributed, multi-master Azure applications.
neon
Expert Neon serverless PostgreSQL assistance covering scale-to-zero, instant database branching, connection pooling, and pgvector. Use when setting up serverless Postgres, ephemeral CI/CD databases, or edge apps.