database

database is a skill for Claude Code, Codex from kok-o/contextos-agents. It costs 26 tokens per session (1,039 once invoked), scanned A, original, Apache-2.0.

A collection of practices for designing and maintaining databases, including schemas, indexes, migrations, transactions, and ORM queries. An ORM is a library that lets code work with database records through programming-language objects.

In plain words
What is it for?
Use it for relational database design, PostgreSQL or MySQL work, Prisma or Drizzle queries, migrations, indexing, and query performance problems.
Why use it?
It helps avoid slow queries, unsafe schema changes, inconsistent multi-record updates, and common query mistakes such as N+1 queries.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for relational database design, PostgreSQL or MySQL work, Prisma or Drizzle queries, migrations, indexing, and query performance problems.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kok-o/contextos-agents/database
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 kok-o/contextos-agents --skill database
Clone the repo
git clone --depth 1 https://github.com/kok-o/contextos-agents

Made for: Claude Code, Codex.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/kok-o/contextos-agents/database"><img src="https://agentmods.dev/badge/skills/kok-o/contextos-agents/database.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,039 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.00026 $0.01039
Opus 5.5 $0.00010 $0.00416
Sonnet 5.5 $0.00005 $0.00208
Haiku 4.5 $0.00003 $0.00104

Measured today against content hash c181f0c92b10, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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

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.

catalog/skills/database/SKILL.md · 102 lines

How it starts

The opening of the file, as written. The whole thing — 102 lines — stays where its author put it; the contents beside it link to each section on GitHub.

database

Overview

Relational database design, query optimization, migration safety, connection pooling in serverless environments, and ORM usage across PostgreSQL, Prisma, and Drizzle.

When to Use

Activate for tasks involving database schema design, migrations, indexing, relational models, ORM queries, transactions, or query performance tuning.

Rules & Patterns

Negative Constraints (What NOT to Do)

  1. NEVER do SELECT * in production: Always select explicit columns required by the caller to minimize memory bandwidth and lock footprint.
  2. NEVER run destructive migrations without backward compatibility: Always follow expand-and-contract (Phase 1: add new column as nullable; Phase 2: backfill; Phase 3: make non-nullable & remove old column).
  3. NEVER execute queries in loops (The N+1 Anti-Pattern): Always use batch loading (inArray, DataLoader, or relational include / JOIN).
  4. NEVER leave foreign keys without indexes: In PostgreSQL/MySQL, child foreign key columns must always have an index to prevent table-level locking on cascade deletes.
  5. NEVER perform multi-entity writes without a database transaction: Any operation touching multiple records must use prisma.$transaction or db.transaction.
  6. NEVER open unpooled database connections in Serverless / Edge functions: Serverless scale-outs will instantly exhaust PostgreSQL's max_connections.

Zero-Downtime Migrations (Expand-and-Contract)

When modifying schemas with zero downtime:

  1. Phase 1 (Expand): Add the new column as NULLABLE (or with a default value). Deploy the application code that reads from old column and writes to both old and new.
  2. Phase 2 (Backfill): Run an asynchronous batch migration job in chunks (e.g. 1000 rows at a time) to populate data from old column to new column.
  3. Phase 3 (Contract): Update application code to read and write exclusively from the new column.
  4. Phase 4 (Cleanup): Once traffic is fully shifted, remove the old column and mark the new column as NOT NULL in a separate migration.

Read the full file on GitHub · 102 lines

Files

What ships with it

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

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. today First seen · 102 lines · 26 tokens per session scan A c181f0c92b10

Subscribe to this mod's changes

database is a skill published in the GitHub repository kok-o/contextos-agents (10 stars, last pushed today), licensed Apache-2.0. It adds 26 tokens to every session and 1,039 once invoked, about $0.0001 per session on Opus 5.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-10-25.

Related

Other skills, from other repositories

sql-expert

Expert SQL & relational databases: queries, schema design, indexing, query-plan optimization, and transactions (Postgres/MySQL/SQLite). Trigger keywords: SQL, database, Postgres, MySQL, SQLite, JOIN, index, EXPLAIN, query plan, slow query, N+1, normalization, transaction, isolation, deadlock, migration. Use for…

Miaoge-Ge/coding-agent-skills · 93 tokens

postgresql-table-design

Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.

wshobson/agents · 37 tokens

supabase-cli

This skill should be used when user asks to "use supabase CLI", "supabase init", "supabase start", "run migrations", "deploy edge functions", "manage Supabase project", or works with the supabase command-line tool for local development and project management.

fcakyon/claude-codex-settings · 60 tokens

supabase-js

This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.

fcakyon/claude-codex-settings · 64 tokens

polar-local-environment

This skill should be used when setting up or managing Polar local development environment with Docker.

fcakyon/claude-codex-settings · 22 tokens

solr-extending

To build Solr plugins: SearchComponent, QParser, URP, DocTransformer.

griddynamics/rosetta · 23 tokens