database-deity

database-deity is a skill for Claude Code from v0idOS/performance-deity. It costs 0 tokens per session (296 once invoked), scanned A, original, MIT.

A database performance guide for SQL queries and ORM code, where an ORM is a tool that lets code work with database records. It examines query plans, indexes, and repeated queries inside loops.

In plain words
What is it for?
Use it to analyze slow queries, inspect or infer needed indexes, find queries inside loops, and rewrite SQL or ORM code using joins, grouped lookups, or eager loading.
Why use it?
It helps find why database work is slow, including the N+1 problem: one query loads a list, then another query runs for every item in that list.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the performance-deity plugin — 17 skills shipped together

Good fit Use it to analyze slow queries, inspect or infer needed indexes, find queries inside loops, and rewrite SQL or ORM code using joins, grouped lookups, or eager loading.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/v0idos/performance-deity/database-deity
Install

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.

Any agent
npx skills add v0idOS/performance-deity --skill database-deity
Clone the repo
git clone --depth 1 https://github.com/v0idOS/performance-deity

Made for: Claude Code.

Or install performance-deity, the plugin that ships this one along with the rest of its 17 skills.

Wrote 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.

agentmods badge for database-deity

README.md
[![agentmods](https://agentmods.dev/badge/skills/v0idos/performance-deity/database-deity/github.svg)](https://agentmods.dev/skills/v0idos/performance-deity/database-deity)
Your own site
<a href="https://agentmods.dev/skills/v0idos/performance-deity/database-deity"><img src="https://agentmods.dev/badge/skills/v0idos/performance-deity/database-deity/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.

agentmods 80×15 button for database-deity

Your own site · 80×15
<a href="https://agentmods.dev/skills/v0idos/performance-deity/database-deity"><img src="https://agentmods.dev/badge/skills/v0idos/performance-deity/database-deity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 296 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00296
Opus 5.5 $0.00000 $0.00118
Sonnet 5.5 $0.00000 $0.00059
Haiku 4.5 $0.00000 $0.00030

Measured 1mo ago against content hash 15643ee64efe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

database-deity 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.

archive/database-deity/SKILL.md · 28 lines

What it actually says

Database Deity: The N+1 Slayer

Description

This skill optimizes database queries and ORM interactions, focusing on index usage, query planning, and eliminating the N+1 query problem.

Triggers

Activate when the user mentions:

  • "slow query", "SQL"
  • "database optimization", "ORM"
  • "N+1"
  • Or explicitly runs /plugin performance-deity:database

Core Directives

Phase 1: Explain & Analyze

  1. Take the user's slow query or ORM logic.
  2. Generate the raw SQL.
  3. Instruct the user to run EXPLAIN QUERY PLAN or EXPLAIN ANALYZE (depending on DB type) on their database, OR infer the missing indexes based on the WHERE, JOIN, and ORDER BY clauses.

Phase 2: The N+1 Audit

  1. Check if the code is running queries inside a loop.
  2. If yes, rewrite the logic to use IN (...) clauses, SQL JOINs, or ORM eager loading (e.g., .include(), .populate(), select_related).

Phase 3: The Rewrite

  1. Provide the optimized SQL or ORM code.
  2. Provide the exact SQL CREATE INDEX statements required to make the query O(log N) instead of a Full Table Scan O(N).
  3. Explain the theoretical reduction in disk I/O.
Changes

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.

  1. 1mo ago First seen · 28 lines · 0 tokens per session scan A 15643ee64efe

Subscribe to this mod's changes

database-deity is a skill published in the GitHub repository v0idOS/performance-deity (2 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 296 tokens. 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.

Related

Other skills, from other repositories

ggsql

Write ggsql queries — a grammar of graphics for SQL. Use when the user wants to create, modify, or understand a ggsql visualization query.

posit-dev/skills · 33 tokens

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.

oliver-kriska/claude-elixir-phoenix · 51 tokens

phoenix-contexts

Phoenix context design — creating/splitting contexts, Scope (1.8+), Ecto.Multi, PubSub, routers, plugs, controllers. Use when editing contexts, routers, or designing boundaries.

oliver-kriska/claude-elixir-phoenix · 46 tokens

ecto-n1-check

Detect N+1 query anti-patterns specifically — Repo calls inside Enum/for loops, missing preloads on associations. Use when N+1 is explicitly suspected, NOT for unrelated Ecto questions or wider database performance.

oliver-kriska/claude-elixir-phoenix · 49 tokens

data-migration

Moves data from one system to another without losing it or corrupting it — profiling the source before mapping, deciding between big-bang and parallel-run cutover, reconciling counts and values rather than assuming, handling the records that will not map cleanly, and planning a rollback that is actually executable.…

cbrock84/headcount · 102 tokens

data-modeling

Designs the warehouse and semantic layer — source-to-mart structure, dimensional modeling, grain, slowly changing dimensions, and the metric layer analytics reads through. Use this to design or restructure a warehouse, model a new source, decide on grain or table structure, build a semantic or metric layer, or…

cbrock84/headcount · 77 tokens