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 skills/shahtuyakov/claude-setup/database-patternsnpx skills add shahtuyakov/claude-setup --skill database-patternsgit clone --depth 1 https://github.com/shahtuyakov/claude-setupWhat 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.00049 | $0.01136 |
| Opus 5 | $0.00024 | $0.00568 |
| Sonnet 5 | $0.00010 | $0.00227 |
| Haiku 4.5 | $0.00005 | $0.00114 |
Grade A, and why
database-patterns 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 3d 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 — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Patterns
Modern database design and implementation patterns.
Database Selection
| Database | Best For | Use When |
|---|---|---|
| PostgreSQL | Relational data, complex queries | Structured data, ACID needed, analytics |
| MongoDB | Document-oriented, flexible schema | Rapid iteration, nested data, horizontal scale |
| SQLite | Embedded, local-first | Mobile apps, desktop apps, edge |
| Redis | Caching, sessions | High-speed reads, ephemeral data |
ORM Selection
| ORM | Best For | Trade-offs |
|---|---|---|
| Drizzle | Performance, serverless | SQL knowledge required |
| Prisma | Developer experience | Larger bundle, slower edge |
| TypeORM | NestJS, decorators | Legacy patterns |
| Kysely | Type-safe SQL builder | Lower-level |
Reference Files
| Topic | Load | Use When |
|---|---|---|
| Schema design | references/schema-design.md |
Designing tables, relationships |
| PostgreSQL | references/postgresql-patterns.md |
PostgreSQL-specific patterns |
| MongoDB | references/mongodb-patterns.md |
MongoDB-specific patterns |
| ORM patterns | references/orm-patterns.md |
Prisma, Drizzle usage |
| Migrations | references/migrations.md |
Schema versioning |
| Security | references/security.md |
SQL injection, encryption |
Quick Start Patterns
PostgreSQL Table
CREATE TABLE users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
email VARCHAR(255) NOT NULL UNIQUE,
name VARCHAR(100) NOT NULL,
password_hash VARCHAR(255) NOT NULL,
email_verified_at TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
deleted_at TIMESTAMPTZ
);
CREATE INDEX users_email_idx ON users(email) WHERE deleted_at IS NULL;
Drizzle Schema
import { pgTable, uuid, varchar, timestamp } from 'drizzle-orm/pg-core';
export const users = pgTable('users', {
id: uuid('id').primaryKey().defaultRandom(),
email: varchar('email', { length: 255 }).notNull().unique(),
name: varchar('name', { length: 100 }).notNull(),
passwordHash: varchar('password_hash', { length: 255 }).notNull(),
emailVerifiedAt: timestamp('email_verified_at', { withTimezone: true }),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
deletedAt: timestamp('deleted_at', { withTimezone: true }),
});
What ships with it
6 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.
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.
- 3d ago First seen · 150 lines · 49 tokens per session scan A 7e91dbf2210d
database-patterns is a skill published in the GitHub repository shahtuyakov/claude-setup (13 stars, last pushed 8mo ago), licensed MIT. It adds 49 tokens to every session and 1,136 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
supabase-expert
Supabase database optimization specialist.
moai-domain-database
Database specialist covering PostgreSQL, MongoDB, Redis, Oracle, and cloud database platforms (Neon, Supabase, Firestore). Use for schema design, query optimization, indexing strategies, data modeling, or cloud database selection. Cloud vendor guide absorbed from moai-platform-database-cloud.
ck:databases
Design schemas, write queries for MongoDB and PostgreSQL. Use for database design, SQL/NoSQL queries, aggregation pipelines, indexes, migrations, replication, performance optimization, psql CLI.
database-engineer
SQLite database expertise for migrations, multi-tenant patterns, transactional safety, FTS5 virtual tables, and schema evolution. Use this skill for ANY work involving schema changes, data migrations, INSERT/UPSERT semantics, FTS5 rebuilds, transaction rollback design, multi-tenant data isolation, or SQLite…
intelligence-engineer
VNX-specific domain expertise for the intelligence system, central state databases, and dispatch lifecycle. Use when working on qualityintelligence.db / runtimecoordination.db / dispatchtracker.db, codesnippets FTS5, snippetmetadata linkage, successpatterns / antipatterns, T0 state projection (t0state.json)…
azure-cosmos-db
Expert knowledge for Azure Cosmos DB development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Cosmos DB SQL/Mongo/Cassandra APIs, change feed, multi-region HA, vector…