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 Hainrixz/claude-db --skill db-index-hygienegit clone --depth 1 https://github.com/Hainrixz/claude-dbWrote 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/hainrixz/claude-db/db-index-hygiene)<a href="https://agentmods.dev/skills/hainrixz/claude-db/db-index-hygiene"><img src="https://agentmods.dev/badge/skills/hainrixz/claude-db/db-index-hygiene/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/hainrixz/claude-db/db-index-hygiene"><img src="https://agentmods.dev/badge/skills/hainrixz/claude-db/db-index-hygiene.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.00049 | $0.00906 |
| Opus 5 | $0.00024 | $0.00453 |
| Sonnet 5 | $0.00010 | $0.00181 |
| Haiku 4.5 | $0.00005 | $0.00091 |
Grade A, and why
db-index-hygiene 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 11d 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 — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.
db-index-hygiene (M12)
The inverse of M11: M11 adds missing indexes, M12 removes the ones that only cost. Every index slows
writes and consumes storage and cache; duplicates and never-read indexes are pure overhead. Feeds the
Performance & Scale score (axis performance, relational Higiene de índices w16).
What it checks
- Exact duplicates — two indexes with the identical key column list (and same type/predicate); one is redundant.
- Redundant prefix — index on
(a)is fully covered by an existing index on(a, b); the shorter one can usually be dropped (B-tree leftmost-prefix rule). - Unused — an index with no scans over a representative window (Tier-2
idx_scan = 0). This is runtime truth: never declared unused from static analysis alone.
Score / axis
Feeds performance only (relational Higiene de índices w16; folds into Indexación in NoSQL profiles).
Tier-0 (static)
Parse declared indexes and detect exact duplicates and leftmost-prefix redundancy from the DDL alone
(established for duplicates — purely structural). Unused-index detection is runtime-only and
emits status: needs_api at Tier-0 (never a silent pass) with a nudge to Tier-2.
Tier-1/2 (verification query, Postgres)
Duplicate/redundant (Tier-1 catalog):
SELECT indrelid::regclass AS tbl, array_agg(indexrelid::regclass) AS dupes
FROM pg_index GROUP BY indrelid, indkey, indclass, indpred
HAVING count(*) > 1;
Unused (Tier-2, requires sustained stats):
SELECT relname AS tbl, indexrelname AS idx, idx_scan, pg_size_pretty(pg_relation_size(indexrelid)) AS sz
FROM pg_stat_user_indexes WHERE idx_scan = 0 ORDER BY pg_relation_size(indexrelid) DESC;
Method index_check / query_stat. The Tier-2 result confirms M12.*.unused as established;
without a representative window it stays directional, and if stats are needed to decide → needs_api.
Findings
Emit findings per schema/finding.schema.json. Examples:
M12.users.duplicate_email_index— two indexes on the same key (severity:2,warn, axisperformance, confidenceestablishedfrom DDL,fixable: proposed—DROP INDEX).M12.orders.redundant_prefix_index—(status)covered by(status, created_at)(severity:1,warn,established/directional,fixable: proposed).M12.events.unused_index— zero scans over the window (severity:2,warn,establishedTier-2 /needs_apiat Tier-0,fixable: proposed).
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.
- 11d ago First seen · 71 lines · 49 tokens per session scan A 6f909e25f01c
db-index-hygiene is a skill published in the GitHub repository Hainrixz/claude-db (19 stars, last pushed 2mo ago), licensed MIT. It adds 49 tokens to every session and 906 once invoked, about $0.0002 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
dynamodb
Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…
malloy-lookml-review
Analyze LookML files as prior art for Malloy modeling. Used during Step 1 (DISCOVER) when .lkml files are present. Coordinates reference files that extract business logic, relationships, and curation decisions. Works with or without a database connection.
convex-migrations
Schema migration strategies for evolving applications including adding new fields, backfilling data, removing deprecated fields, index migrations, and zero-downtime migration patterns.
database-design-patterns
Database schema design patterns and optimization strategies for relational and NoSQL databases. Use when designing database schemas, optimizing query performance, or implementing data persistence layers at scale.
database-sql
Design database schemas, write efficient SQL queries, create migrations, and optimize database performance. Use when working with databases, writing queries, or designing data models.
data-design
Data modeling, schema design, and data architecture.