db

A workflow for designing or reviewing how an application stores data, including tables, relationships, rules, indexes, and migrations. A migration is a controlled change to an existing database structure or its data.

In plain words
What is it for?
Use it to design database schemas, plan migrations, review existing designs, analyze slow queries, recommend indexes, and produce schema diagrams or migration files.
Why use it?
It helps prevent unsafe schema changes, slow queries, broken relationships, and difficult rollbacks.

Command

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.

agentmods
npx agentmods add commands/srstomp/pokayokay/db
Clone the repo
git clone --depth 1 https://github.com/srstomp/pokayokay
Per session 5 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 458 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00005 $0.00458
Opus 5 $0.00003 $0.00229
Sonnet 5 $0.00001 $0.00092
Haiku 4.5 $0.00001 $0.00046

Measured 2d ago against content hash d0f53ff0820c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

db 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 2d 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.

plugins/pokayokay/commands/db.md · 77 lines

What it actually says

Database Design Workflow

Design or review database for: $ARGUMENTS

Steps

1. Identify Database Context

Detect from project:

  • ORM: Prisma, Drizzle, TypeORM, Sequelize
  • Database: PostgreSQL, MySQL, SQLite, MongoDB
  • Existing schema: Check for migration files

2. Identify Task Type

From $ARGUMENTS, determine the goal:

  • Schema design: New tables, relationships, constraints
  • Migration: Plan safe schema changes
  • Optimization: Index design, query analysis
  • Review: Audit for anti-patterns

3. Execute Task

For Schema Design:

  • Identify entities and relationships
  • Define constraints (PK, FK, unique, check)
  • Plan indexes for query patterns
  • Consider normalization level

For Migrations:

  • Plan backward-compatible changes
  • Design rollback strategy
  • Handle data migrations
  • Test on staging first

For Optimization:

  • Analyze slow queries with EXPLAIN
  • Recommend indexes
  • Identify N+1 patterns
  • Suggest denormalization if needed

4. Generate Artifacts

  • Schema diagram (Mermaid ERD)
  • Migration files (Prisma/Drizzle format)
  • Index recommendations
  • Query improvements

5. Create Implementation Tasks

npx @stevestomp/ohno-cli create "DB: [specific change]" -t feature

Covers

  • Entity relationship modeling
  • Index strategy
  • Migration planning
  • Query optimization
  • Constraint design
  • Data integrity
  • /pokayokay:api - Design API for database entities
  • /pokayokay:work - Implement schema changes
  • /pokayokay:test - Database testing strategy

Skill Integration

When database work involves:

  • API changes → Also load api-design skill
  • Data security → Also load security-audit skill
  • Query monitoring → Also load observability skill
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. 2d ago First seen · 77 lines · 5 tokens per session scan A d0f53ff0820c

Subscribe to this mod's changes

db is a command published in the GitHub repository srstomp/pokayokay (9 stars, last pushed 1mo ago), licensed MIT. It adds 5 tokens to every session and 458 once invoked, about $0.0000 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-31.