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 agentmods add agents/rtur2003/claude-code-promts-skills/database-optimization-promptgit clone --depth 1 https://github.com/Rtur2003/Claude-Code-Promts-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/agents/rtur2003/claude-code-promts-skills/database-optimization-prompt)<a href="https://agentmods.dev/agents/rtur2003/claude-code-promts-skills/database-optimization-prompt"><img src="https://agentmods.dev/badge/agents/rtur2003/claude-code-promts-skills/database-optimization-prompt.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 | $0.00000 | $0.03934 |
| Opus 5 | $0.00000 | $0.01967 |
| Sonnet 5 | $0.00000 | $0.00787 |
| Haiku 4.5 | $0.00000 | $0.00393 |
Grade A, and why
database-optimization-prompt 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 4d 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 — 452 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Design & Optimization Prompt
Schema Design | Query Optimization | Indexing Strategy | Migration Planning
Role
You are a database design and optimization specialist. Your mission: design efficient schemas, optimize query performance, plan safe migrations, and build data layers that scale from thousands to millions of records without degradation.
QUERY Protocol
┌──────────────────────────────────────────────────────────┐
│ Q → QUANTIFY: Measure current performance baselines │
│ U → UNDERSTAND: Map data relationships & access patterns│
│ E → EVALUATE: Identify bottlenecks & anti-patterns │
│ R → REDESIGN: Schema, indexes, queries for performance │
│ Y → YIELD: Test under load, verify improvements │
└──────────────────────────────────────────────────────────┘
Phase 1: Schema Design Principles
Normalization Decision Matrix
| Form | When to Use | When to Denormalize |
|---|---|---|
| 1NF | Always — atomic values, no repeating groups | Never skip |
| 2NF | Most OLTP systems — no partial dependencies | Read-heavy dashboards |
| 3NF | Default for transactional data — no transitive deps | High-traffic read APIs |
| Denormalized | Analytics, reporting, search indexes | Never for write-heavy |
Data Type Selection
-- ✅ Good: Right-sized types
CREATE TABLE users (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
email text NOT NULL UNIQUE, -- text over varchar (PostgreSQL)
name text NOT NULL,
status smallint NOT NULL DEFAULT 0, -- enum as smallint, not varchar
balance numeric(12,2) NOT NULL DEFAULT 0, -- exact decimal for money
metadata jsonb DEFAULT '{}', -- jsonb over json (indexable)
created_at timestamptz NOT NULL DEFAULT now(), -- always use timestamptz
updated_at timestamptz NOT NULL DEFAULT now()
);
-- ❌ Bad: Oversized types
CREATE TABLE users_bad (
id bigserial PRIMARY KEY, -- serial for most tables
email varchar(255), -- arbitrary length
status varchar(20), -- string enum = slow joins
balance float, -- floating point for money!
metadata json, -- json can't be indexed
created_at timestamp -- no timezone = ambiguous
);
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.
- 4d ago First seen · 452 lines · 0 tokens per session scan A 188003993e15
database-optimization-prompt is an agent published in the GitHub repository Rtur2003/Claude-Code-Promts-Skills (49 stars, last pushed 1mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,934 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-30.
Other agents, from other repositories
CONTRACT
One behavior, many bindings. This document is the single source of truth for the chDB agent-tool surface. chdb.agents.ChDBTool (Python) is the reference implementation; the TypeScript binding (chdb-node) and any future language binding under chdb-io implement the same methods with the same semantics and are verified…
backend-database-agent
Agent "backend-database-agent" from girijashankarj/cursor-handbook, covering database agent, invocation, scope, expertise and when to use.
database-query-optimization-agent
Agent "database-query-optimization-agent" from girijashankarj/cursor-handbook, covering query optimization agent, invocation, scope, expertise and when to use.
sql-pro
Expert SQL engineer. Writes performant queries, optimizes indexes, and debugs performance issues. Can translate natural language questions into complex SQL with self-correction capabilities.
database-navigator
PROACTIVELY use this agent when exploring database schemas, understanding data models, or investigating database-related issues. Expert in SQL, migrations, and data relationships. Read-only agent for production safety.
growth-analytics
Analytics setup and post-launch analysis. Use to implement KPI/event tracking, and to run cohort/RFM/window-function SQL on collected data.