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/kok-o/koko-contextos-agents/databasenpx skills add kok-o/koko-contextos-agents --skill databasegit clone --depth 1 https://github.com/kok-o/koko-contextos-agentsWrote 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/skills/kok-o/koko-contextos-agents/database)<a href="https://agentmods.dev/skills/kok-o/koko-contextos-agents/database"><img src="https://agentmods.dev/badge/skills/kok-o/koko-contextos-agents/database.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.1 | $0.00026 | $0.01039 |
| Opus 5 | $0.00013 | $0.00519 |
| Sonnet 5 | $0.00005 | $0.00208 |
| Haiku 4.5 | $0.00003 | $0.00104 |
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.
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)
- NEVER do
SELECT *in production: Always select explicit columns required by the caller to minimize memory bandwidth and lock footprint. - 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).
- NEVER execute queries in loops (The N+1 Anti-Pattern): Always use batch loading (
inArray,DataLoader, or relationalinclude/JOIN). - 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.
- NEVER perform multi-entity writes without a database transaction: Any operation touching multiple records must use
prisma.$transactionordb.transaction. - 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:
- 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. - 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.
- Phase 3 (Contract): Update application code to read and write exclusively from the new column.
- Phase 4 (Cleanup): Once traffic is fully shifted, remove the old column and mark the new column as
NOT NULLin a separate migration.
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.
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.
- today Changed · +52 lines c181f0c92b10
- 5d ago First seen · 50 lines · 26 tokens per session scan A 166f7b6a40cd
database is a skill published in the GitHub repository kok-o/koko-contextos-agents (2 stars, last pushed yesterday), licensed MIT. It adds 26 tokens to every session and 1,039 once invoked, about $0.0001 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.
Other skills, from other repositories
cache_patterns
Instruction set for enabling and operating the Spring Cache abstraction in Spring Boot when implementing application-level caching for performance-sensitive workloads.
system-design-data-architecture
Choose and scale the data layer: SQL versus NoSQL per access pattern, single data ownership, replication and read scaling, partition key choice, hot partition and celebrity key mitigation. Use when selecting a store, planning sharding, or fixing a data-tier bottleneck.
database-hana
Apply SAP HANA database standards for SQL parameterization, in-memory engine optimization, dynamic IN query chunking, column aliasing on joins, and datatype casting. Use when writing SQL for SAP HANA, optimizing HANA queries, or diagnosing HANA driver errors.
database-mongodb
Apply MongoDB data-modeling, indexing, and query rules from access patterns. Use when designing schemas, choosing embed vs reference, or tuning MongoDB query behavior.
database-postgresql
Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.
database-redis
Optimize Redis as cache and coordination infrastructure with TTL, eviction, and latency-aware key design. Use when implementing Redis caching, key invalidation, or Redis performance work.