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 Miaoge-Ge/coding-agent-skills --skill sql-expertgit clone --depth 1 https://github.com/Miaoge-Ge/coding-agent-skillsWrote 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/miaoge-ge/coding-agent-skills/sql-expert)<a href="https://agentmods.dev/skills/miaoge-ge/coding-agent-skills/sql-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/sql-expert/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/miaoge-ge/coding-agent-skills/sql-expert"><img src="https://agentmods.dev/badge/skills/miaoge-ge/coding-agent-skills/sql-expert.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00093 | $0.01102 |
| Opus 5.5 | $0.00037 | $0.00441 |
| Sonnet 5.5 | $0.00019 | $0.00220 |
| Haiku 4.5 | $0.00009 | $0.00110 |
Grade A, and why
sql-expert 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 — 79 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL & Database Expert
Think in sets, not loops. The database is smarter than your application loop. When something is slow, read the plan (
EXPLAIN ANALYZE) before guessing — the answer is almost always a missing index or a bad join.
When to Use
- Writing, debugging, or optimizing SQL.
- Schema design: tables, relationships, constraints, types, migrations.
- Slow queries, missing/unused indexes, N+1, lock contention.
- Transactions, isolation levels, and concurrency correctness.
When NOT to Use
- ORM/app wiring →
nodejs-backend-expert/ language skill. - Vector/semantic retrieval →
rag-expert. - Data-platform / warehouse-scale architecture →
software-architect.
Core Principles
1. Schema design
- Normalize to 3NF by default; denormalize only for a measured read win, and then keep it consistent (triggers/jobs).
- Right types:
timestamptz(not naive timestamps),numeric/decimalfor money (never float),uuid/bigintkeys, nativeenum/boolean. Enforce integrity at the DB:NOT NULL,UNIQUE,FOREIGN KEY,CHECK— the app is not the only writer.
2. Query like a pro
- Select only needed columns (no
SELECT *in app queries — it breaks covering indexes and over-fetches). - Know your JOINs and beware fan-out: a one-to-many join multiplies rows and inflates
SUM/COUNT. Pre-aggregate in a subquery/CTE. - Kill N+1 patterns: one query with a JOIN or
WHERE id IN (...)instead of a query per row. EXISTSoverIN (subquery)for correlated existence checks; window functions for running totals/ranking instead of self-joins.
3. Indexing
- Index columns in
WHERE,JOIN, andORDER BY. Composite index order: equality columns first, then the range/sort column. The index serves a left-to-right prefix. - A function/expression on the column (
WHERE lower(email)=…,WHERE created_at::date=…) defeats a plain index — index the expression or rewrite as a sargable range. - Indexes speed reads, slow writes, and use space — add deliberately. Drop unused ones. Use partial/covering indexes for hot queries.
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 · 79 lines · 93 tokens per session scan A 5b65f02c4e82
sql-expert is a skill published in the GitHub repository Miaoge-Ge/coding-agent-skills (7 stars, last pushed 4mo ago), licensed MIT. It adds 93 tokens to every session and 1,102 once invoked, about $0.0004 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-31.
Other skills, from other repositories
database
Database architecture, schema design, Prisma, Drizzle ORM, indexing strategies, migrations, and N+1 query resolution.
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.
supabase-cli
This skill should be used when user asks to "use supabase CLI", "supabase init", "supabase start", "run migrations", "deploy edge functions", "manage Supabase project", or works with the supabase command-line tool for local development and project management.
supabase-js
This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.
polar-local-environment
This skill should be used when setting up or managing Polar local development environment with Docker.
saas-multi-tenant
Design and implement multi-tenant SaaS architectures with RLS, tenant isolation, and PostgreSQL / Desain dan implementasikan arsitektur SaaS multi-tenant dengan RLS, isolasi tenant, dan PostgreSQL.