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 agentmods add skills/kensaurus/cursor-kenji/backend-db-performancenpx skills add kensaurus/cursor-kenji --skill backend-db-performancegit clone --depth 1 https://github.com/kensaurus/cursor-kenjiWrote 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/kensaurus/cursor-kenji/backend-db-performance)<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/backend-db-performance"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/backend-db-performance.svg" alt="Measured on agentmods" height="20"></a>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 | $0.00056 | $0.02637 |
| Opus 5 | $0.00028 | $0.01319 |
| Sonnet 5 | $0.00011 | $0.00527 |
| Haiku 4.5 | $0.00006 | $0.00264 |
Grade A, and why
backend-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 yesterday.
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 — 442 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Optimization Skill
Degree of freedom: MIXED. Which query/index/N+1 to fix [HIGH freedom];
existing-index probes and EXPLAIN ANALYZE [LOW freedom — run exactly].
How to reason
- Observe — EXPLAIN ANALYZE /
pg_stat_statements/ existingpg_indexes - Interpret — seq scan vs N+1 vs over-fetch vs missing pagination
- Classify — add-index / eager-load / narrow-select / paginate / leave-alone
- Severity — write-path timeout outranks a 200ms list page
Worked example
Observe:
/feedp95 2.4s; Prisma logs 81 queries;pg_indexeshas noidx_posts_user_created. Interpret:findManyposts then per-rowuser.findUnique— N+1;ORDER BY created_atis a seq scan. Classify: eager-loadinclude: { author }+ composite index(user_id, created_at DESC). Verify: EXPLAIN ANALYZE → Index Scan; query count 2; p95 < 200ms. Did not add a duplicate index.
Self-critique before reporting
- Existing first — listed
pg_indexes/ migrations beforeCREATE INDEX - EXPLAIN — the claimed winner has ANALYZE output, not intuition
- No duplicate index — the proposed name was queried and absent
- Right owner — schema consistency →
audit-db-schema; RLS access →plan-rls-audit
Systematic approach to identifying and fixing database performance issues.
When to Use
- Slow page loads (database bottleneck)
- Query timeout errors
- N+1 queries
- Schema design review
- Index optimization
- Migration planning
CRITICAL: Check Existing First [LOW freedom — run exactly]
Before ANY optimization, verify current state:
- Check existing indexes:
SELECT indexname, indexdef FROM pg_indexes
WHERE schemaname = 'public' AND tablename = 'your_table';
- Check existing migrations:
ls -la supabase/migrations/ | grep -i "index\|optim\|perf"
- Check if index already exists:
SELECT 1 FROM pg_indexes WHERE indexname = 'your_proposed_index';
- Check Supabase advisors for current issues:
- Use
get_advisorsMCP tool for performance/security - Don't re-fix already addressed issues
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.
- yesterday First seen · 442 lines · 56 tokens per session scan A be3e6d0dd5cf
backend-db-performance is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 7d ago), licensed MIT. It adds 56 tokens to every session and 2,637 once invoked, about $0.0003 per session on Opus 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-09-03.
Other skills, from other repositories
devlab-dao-sql-compat
DAO 层通用 SQL 方言兼容性检查 + 系统性修复工作流。支持 MyBatis/JPA/MyBatis-Plus/SQLAlchemy 四种持久层框架,扫描源码识别 Oracle/PostgreSQL/MySQL 方言混用风险,自动修复 80% 常见陷阱,剩余 20% 由 Agent 辅助人工确认。七阶段流程 + adapter 模式框架适配。触发词:SQL 兼容性、方言混用、Oracle 转 PG、PG 转 Oracle、MyBatis 迁移、JPA 方言、Hibernate SQL、SQLAlchemy raw SQL、数据库国产化改造、DAO 层 SQL 检查。.
public-postgres-expert-base
PostgreSQL 知识基座。覆盖 Schema Design、Indexing(B-Tree/GIN/GiST/BRIN)、JSONB、Partitioning、Extensions。供 devlab-postgres-usage 通过 extends 继承。.
multi-tenant-safety-checker
Ensures tenant isolation at query and policy level using Row Level Security, automated testing, and security audits. Prevents data leakage between tenants. Use for "multi-tenancy", "tenant isolation", "RLS", or "data security".
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.
database-optimizer
Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.
postgres-pro
Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.