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 ragnarok22/agent-skills --skill queryset-optimizergit clone --depth 1 https://github.com/ragnarok22/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/ragnarok22/agent-skills/queryset-optimizer)<a href="https://agentmods.dev/skills/ragnarok22/agent-skills/queryset-optimizer"><img src="https://agentmods.dev/badge/skills/ragnarok22/agent-skills/queryset-optimizer.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.1 | $0.00084 | $0.00879 |
| Opus 5 | $0.00042 | $0.00439 |
| Sonnet 5 | $0.00017 | $0.00176 |
| Haiku 4.5 | $0.00008 | $0.00088 |
Grade A, and why
queryset-optimizer 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 — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
QuerySet Optimizer
Audit Django query performance with deterministic checks and evidence-backed recommendations.
Workflow
Step 1: Set scope and baseline target
- Locate the Django backend root (directory containing
manage.py). - Define the optimization target:
- endpoint or view
- serializer
- background task
- repeated ORM hotspot from profiling data
- If target is unknown, scan all app directories and prioritize read-heavy paths first (list endpoints, feed pages, reports).
Step 2: Capture runtime query evidence (preferred)
Collect at least one measurable baseline for the target before changing code.
Open Django shell:
uv run manage.py shell 2>/dev/null || python manage.py shell
Then capture query count for one representative code path:
from django.db import connection
from django.test.utils import CaptureQueriesContext
with CaptureQueriesContext(connection) as ctx:
# Execute the target path, for example evaluating the target queryset.
list(qs)
print(f"queries={len(ctx.captured_queries)}")
If runtime capture is not feasible, continue with static analysis and mark runtime validation as not evaluated.
Step 3: Run static scan
Read references/antipatterns.md for rule IDs, severity, search commands, and fix patterns.
For each rule:
- Run the suggested search command.
- Manually validate each candidate.
- Exclude false positives (tests, migrations, fixtures, one-off scripts) unless explicitly relevant.
- Record confirmed findings with:
- ID
- Severity
- File and line number
- Evidence (1-2 lines)
- Fix recommendation
- Expected impact (query count, memory, latency, or lock time)
Step 4: Score
Start from 100 and deduct points per confirmed finding:
| Severity | Deduction |
|---|---|
| High | -8 |
| Medium | -5 |
| Low | -2 |
Rules:
- Floor score at
0. - Cap duplicate deductions for each rule ID to 3 findings.
- Deduct only for confirmed findings.
- Add
+5bonus (max100) when before/after query counts are measured for at least one hotspot.
What ships with it
3 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.
- 8d ago First seen · 134 lines · 84 tokens per session scan A 97028a365568
queryset-optimizer is a skill published in the GitHub repository ragnarok22/agent-skills (5 stars, last pushed 2mo ago), licensed MIT. It adds 84 tokens to every session and 879 once invoked, about $0.0004 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-08-31.
Other skills, from other repositories
fix-failing-tests
Diagnose a failing test in the googleapis/mcp-toolbox repo and land a fix by reasoning from the actual error: read the failure, reproduce it, shrink it until the cause is forced into the open, then fix the cause. Use this whenever a test or CI job is red, a build breaks after a change, many packages fail at once, or a…
triage-issues
Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…
postgresql-indexing
PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…
graphjin-eval
Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.
axiom-audit-grdb-performance
Use when the user mentions GRDB performance review, slow GRDB queries, app-group database setup audit, a ValueObservation that stopped updating, or pre-release GRDB scan.
django-perf-review
Django performance code review. Use when asked to "review Django performance", "find N+1 queries", "optimize Django", "check queryset performance", "database performance", "Django ORM issues", or audit Django code for performance problems.