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 makifbaysal/tasktrooper --skill sql-query-performancegit clone --depth 1 https://github.com/makifbaysal/tasktrooperWrote 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/makifbaysal/tasktrooper/sql-query-performance)<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/sql-query-performance"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/sql-query-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/makifbaysal/tasktrooper/sql-query-performance"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/sql-query-performance.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.00035 | $0.01085 |
| Opus 5.5 | $0.00014 | $0.00434 |
| Sonnet 5.5 | $0.00007 | $0.00217 |
| Haiku 4.5 | $0.00003 | $0.00109 |
Grade A, and why
sql-query-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 8d 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 — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
SQL Query Performance (Go)
Overview
Go has no ORM to blame for an N+1 — it's a loop you wrote yourself, calling the repository once per item instead of once for the batch. This skill is the Go-side half of query performance; java-persistence covers the JPA/Hibernate side.
Core principle: one round trip per request-shaped operation, not one per row.
N+1 in Go
// ❌ one query per item: N+1
for _, id := range ids {
task, err := repo.Get(ctx, id) // round trip per id
...
}
// ✅ one query for the batch
tasks, err := repo.GetMany(ctx, ids) // SELECT ... WHERE id = ANY($1)
SELECT id, title, status FROM tasks WHERE id = ANY($1);
Bind ids as a []uuid.UUID (pgx encodes a Go slice as a Postgres array directly — no manual IN (...) string building). For a write-side batch, use pgx.Batch to pipeline multiple statements over one round trip instead of looping with individual Exec calls.
Database hygiene
- Every call takes a
context.Context—QueryContext/ExecContext(database/sql) or pgx'sctxparameter — so a slow query is cancelable and traceable. defer rows.Close()immediately after a successfulQuery, and checkrows.Err()after the loop — aQuerythat returns rows can still fail mid-stream, and an unclosedRowsleaks the connection.- Use
Exec, notQuery, for statements that return no rows (INSERT/UPDATE/DELETEwithoutRETURNING) —Queryleaves a result set open that must still be drained. - No
SELECT *in application code — name the columns, so an added column doesn't silently change scan order or payload size.
Reading EXPLAIN
psql "$DATABASE_URL" -c "EXPLAIN (ANALYZE, BUFFERS) <query with literal values, not placeholders>"
Run it against realistically seeded data, not an empty table — an empty-table plan hides the index Postgres would actually need. Read for:
Seq Scanon a table bigger than a few thousand rows → missing index.- Estimated vs actual row counts far apart → stale statistics (
ANALYZE <table>) or a predicate the planner can't estimate well. - A
Sortthat spills to disk (Sort Method: external merge) → needswork_memtuning or an index that avoids the sort.
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.
- 8d ago First seen · 87 lines · 35 tokens per session scan A 99f01c675ee7
sql-query-performance is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 35 tokens to every session and 1,085 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-10-05.
Other skills, from other repositories
go-add-migration
Create properly named PostgreSQL migration files for GOB microservices.
encore-go-database
Work with PostgreSQL in Encore Go using sqldb.NewDatabase from encore.dev/storage/sqldb — schema migrations and SQL queries.
mfd
A Go code generator that reads XML descriptions of a PostgreSQL schema and creates models, repositories, services, and test helpers. It is used through project Makefile commands.
golang-database
Comprehensive guide for Go database access. Covers parameterized queries, struct scanning, NULLable column handling, error patterns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use this skill whenever writing, reviewing, or debugging…
golang-samber-hot
In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…
golang-fullstack-error-handling
Unified Go + GORM + PostgreSQL error handling review. Covers error wrapping, context propagation, PostgreSQL error codes (23505, 40001), errors.Is/As mapping, and retry logic. Ensures proper error chains and robust database failure recovery.