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 rileyhilliard/claude-essentials --skill writing-sqlgit clone --depth 1 https://github.com/rileyhilliard/claude-essentialsWrote 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/rileyhilliard/claude-essentials/writing-sql)<a href="https://agentmods.dev/skills/rileyhilliard/claude-essentials/writing-sql"><img src="https://agentmods.dev/badge/skills/rileyhilliard/claude-essentials/writing-sql/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/rileyhilliard/claude-essentials/writing-sql"><img src="https://agentmods.dev/badge/skills/rileyhilliard/claude-essentials/writing-sql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00050 | $0.00557 |
| Opus 5.5 | $0.00020 | $0.00223 |
| Sonnet 5.5 | $0.00010 | $0.00111 |
| Haiku 4.5 | $0.00005 | $0.00056 |
Grade A, and why
writing-sql 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 — 38 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Writing SQL
Core principle: Every query you write has an execution plan. Write SQL with that plan in mind, not just the result.
This skill covers only what Claude's defaults miss. Topics already handled by managing-databases/postgres-querying.md (LATERAL, CTE materialization, DISTINCT ON, EXPLAIN red flags, ROWS vs RANGE) are not repeated here.
Topic Navigation
| Task | Load |
|---|---|
| Planner picking bad plans on multi-column WHERE | extended-statistics.md |
| LIKE search not using index, text pattern matching | index-internals.md |
| Composite index column ordering, INCLUDE clause | index-internals.md |
| Type mismatch between param and column silently bypassing index | index-internals.md |
| Conditional aggregation, pivot queries, subtotals | aggregation-patterns.md |
| GROUPING SETS, ROLLUP, CUBE | aggregation-patterns.md |
| NULL edge cases in aggregates and window functions | aggregation-patterns.md |
| Paginating large result sets | query-anti-patterns.md |
| NOT IN returning zero rows unexpectedly | query-anti-patterns.md |
| DISTINCT added to fix duplicate rows | query-anti-patterns.md |
| Correlated subqueries in SELECT list | query-anti-patterns.md |
| Functions in WHERE bypassing indexes | query-anti-patterns.md |
Iron Rules
These apply to every query, no exceptions:
- Never paginate with OFFSET on large tables. Use keyset pagination.
- Never use NOT IN when the subquery column is nullable. Use NOT EXISTS.
- Always match parameter types to column types exactly. Implicit casts bypass indexes.
- Replace CASE WHEN inside aggregates with FILTER. It's cleaner and semantically correct.
- When a multi-column WHERE produces bad estimates, add extended statistics before adding hints or rewrites.
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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 · 38 lines · 50 tokens per session scan A 23cc891a10bf
writing-sql is a skill published in the GitHub repository rileyhilliard/claude-essentials (130 stars, last pushed 2mo ago), licensed MIT. It adds 50 tokens to every session and 557 once invoked, about $0.0002 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
azure-resource-manager-postgresql-dotnet
Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…
jpa-patterns
JPA/Hibernate patterns and common pitfalls (N+1, lazy loading, transactions, queries). Use when user has JPA performance issues, LazyInitializationException, or asks about entity relationships and fetching strategies.
ecto-patterns
Use when a task touches Ecto, even a how-to question: schemas, changesets, validations, queries, preloads, Multi, migrations, constraints, money fields. Load it before writing Ecto code. Skip for Ash.
kysely
Guidelines for developing with Kysely, a type-safe TypeScript SQL query builder with autocompletion support.
sql-query-performance
Use when writing or changing a query against PostgreSQL from Go — avoiding N+1 loops, reading EXPLAIN output, indexing, and keyset pagination.
sqlsugar
Use when doing multi-database ORM operations in .NET — SQL Server, MySQL, PostgreSQL, SQLite, Oracle with fluent API, code-first, and LINQ. SqlSugar: high-performance .NET ORM supporting 10+ databases.