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 skills add AmariahAK/atlarix-skills --skill databasegit clone --depth 1 https://github.com/AmariahAK/atlarix-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/skills/amariahak/atlarix-skills/database)<a href="https://agentmods.dev/skills/amariahak/atlarix-skills/database"><img src="https://agentmods.dev/badge/skills/amariahak/atlarix-skills/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.00002 | $0.00841 |
| Opus 5 | $0.00001 | $0.00420 |
| Sonnet 5 | $0.00000 | $0.00168 |
| Haiku 4.5 | $0.00000 | $0.00084 |
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 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 — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Patterns
When to use this skill
Use this skill when designing schemas, writing queries, or shipping migrations—especially when correctness and safety matter more than clever SQL.
Core patterns
Always parameterize queries (never string concat)
Bad:
"... WHERE id = " + userId
Good:
- placeholders / prepared statements
- ORM query builders
Index strategy (minimal and intentional)
Add indexes for:
- foreign keys used in joins
- columns used in frequent filters (
WHERE) - columns used in sorting (
ORDER BY) on large tables
Avoid:
- indexing everything (writes get slower)
- redundant composite indexes
Migration safety (backward compatible)
Rules:
- additive first: add column nullable → backfill → enforce NOT NULL later
- don’t drop columns in the same migration as adding replacements
- avoid long locks on hot tables (use online patterns where possible)
Transactions
Use transactions for:
- multi-step writes that must succeed/fail together
- invariants across rows/tables
Avoid:
- long-running transactions that hold locks during network calls
Example (pseudo-SQL):
BEGIN;
UPDATE accounts SET balance = balance - 100 WHERE id = :from_id;
UPDATE accounts SET balance = balance + 100 WHERE id = :to_id;
COMMIT;
N+1 detection
Symptoms:
- a loop that queries per item
- slow endpoints that scale with list size
Fix patterns:
- join + aggregate
IN (...)query- preloading/relations in ORM
SQLite-specific quirks
- Consider WAL mode for concurrency
- Be careful with “type affinity” (validate types at boundaries)
- Prefer STRICT tables if available in your SQLite version
Connection pooling
- Use pooling for server apps
- Use one-off connections for scripts (but close them)
Schema design: constraints are your friend
Prefer database-enforced invariants:
- NOT NULL for required fields
- UNIQUE for natural keys where appropriate
- CHECK constraints for bounded enums / ranges
Why:
- catches bugs earlier than application code
- prevents “invalid state” from ever being stored
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 · 136 lines · 2 tokens per session scan A 81d3f2aa1cb5
Database Patterns is a skill published in the GitHub repository AmariahAK/atlarix-skills (2 stars, last pushed 7d ago), licensed Apache-2.0. It adds 2 tokens to every session and 841 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-09-03.
Other skills, from other repositories
drizzle-orm
Drizzle ORM — TypeScript SQL ORM. Schema definition, queries, migrations, transactions, RQB, extensions.
Drizzle ORM Testing
Testing patterns for Drizzle ORM covering migration testing, query builder testing, transaction testing, and database integration testing with PostgreSQL, SQLite, and MySQL.
database-patterns
Database design and migration patterns for Alembic migrations, schema design (SQL/NoSQL), and database versioning. Use when creating migrations, designing schemas, normalizing data, managing database versions, or handling schema drift.
drizzle-orm
Use when modeling data or querying with Drizzle ORM in TypeScript — pgTable schema in .ts, type-safe select/insert/relational queries, drizzle-kit migrations. NOT Prisma Client or schema.prisma (that is prisma-orm), NOT ORM-agnostic migration strategy (that is db-migrations), NOT Postgres engine tuning or EXPLAIN…
database-sql
Design database schemas, write efficient SQL queries, create migrations, and optimize database performance. Use when working with databases, writing queries, or designing data models.
database-query
Generate, optimize, and explain SQL queries - supports SQLite, PostgreSQL, MySQL with schema introspection, migration generation, and query performance analysis.