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 navikt/copilot --skill postgresql-reviewgit clone --depth 1 https://github.com/navikt/copilotWrote 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/navikt/copilot/postgresql-review)<a href="https://agentmods.dev/skills/navikt/copilot/postgresql-review"><img src="https://agentmods.dev/badge/skills/navikt/copilot/postgresql-review.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.00021 | $0.01668 |
| Opus 5 | $0.00010 | $0.00834 |
| Sonnet 5 | $0.00004 | $0.00334 |
| Haiku 4.5 | $0.00002 | $0.00167 |
Grade A, and why
postgresql-review 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 7d 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 — 217 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Review Skill
Review and optimize PostgreSQL queries, schemas, and patterns for Nav applications. Covers EXPLAIN analysis, index strategies, JSONB patterns, and common anti-patterns.
Query Analysis
Run EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) to analyze queries:
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT * FROM vedtak
WHERE bruker_id = '12345678901'
AND status = 'aktiv'
ORDER BY opprettet_dato DESC
LIMIT 10;
Red Flags in EXPLAIN Output
| Sign | Problem | Solution |
|---|---|---|
Seq Scan on large table |
Missing index | CREATE INDEX |
Sort with external merge |
Not enough work_mem |
Increase work_mem or add index with correct sort order |
Nested Loop with high rows |
Cartesian product / missing join index | Add index on join column |
Hash Join with Batches > 1 |
work_mem too low |
Increase work_mem for the session |
Large difference between estimated and actual rows |
Outdated statistics | ANALYZE tablename; |
Index Strategies
-- Simple index for lookups
CREATE INDEX idx_vedtak_bruker_id ON vedtak(bruker_id);
-- Composite index — columns in order of selectivity
CREATE INDEX idx_vedtak_bruker_status ON vedtak(bruker_id, status);
-- Partial index — only relevant rows
CREATE INDEX idx_vedtak_aktive ON vedtak(bruker_id)
WHERE status = 'aktiv';
-- Covering index — avoids table lookup
CREATE INDEX idx_vedtak_covering ON vedtak(bruker_id, status)
INCLUDE (opprettet_dato, belop);
-- Concurrent — no table locking (requires outside transaction)
CREATE INDEX CONCURRENTLY idx_vedtak_dato ON vedtak(opprettet_dato);
When to Use What?
| Scenario | Index Type |
|---|---|
WHERE a = x |
B-tree on a |
WHERE a = x AND b = y |
Composite (a, b) |
WHERE a = x AND status = 'aktiv' |
Partial index WHERE status = 'aktiv' |
WHERE a LIKE 'prefix%' |
B-tree (prefix only) |
WHERE a @> '{"key": "val"}' |
GIN on JSONB |
| Full-text search | GIN with to_tsvector |
| Geography | GiST |
What ships with it
1 file 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.
- 7d ago First seen · 217 lines · 21 tokens per session scan A fcd00261cd89
postgresql-review is a skill published in the GitHub repository navikt/copilot (54 stars, last pushed today), licensed MIT. It adds 21 tokens to every session and 1,668 once invoked, about $0.0001 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-30.
Other skills, from other repositories
loom-sql-optimization
Analyzes and optimizes SQL queries for performance.
postgres
Execute queries on the Postgres database. Use this skill DIRECTLY whenever the user asks anything about database contents, counts, or data — do NOT read compose.yml or SQL migration files first.
database-architecture
MANDATORY when designing schemas, writing migrations, creating indexes, or making architectural database decisions - enforces PostgreSQL 18 best practices including AIO, UUIDv7, temporal constraints, and modern indexing strategies.
postgis
MANDATORY when working with geographic data, spatial queries, geometry operations, or location-based features - enforces PostGIS 3.6.1 best practices including STCoverageClean, SFCGAL 3D functions, and bigint topology.
timescaledb
MANDATORY when working with time-series data, hypertables, continuous aggregates, or compression - enforces TimescaleDB 2.24.0 best practices including lightning-fast recompression, UUIDv7 continuous aggregates, and Direct Compress.
postgres-rls
MANDATORY when touching auth tables, tenant isolation, RLS policies, or multi-tenant database code - enforces Row Level Security best practices and catches common bypass vulnerabilities.