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 subhansh-dev/agent-maxxing --skill database-patternsgit clone --depth 1 https://github.com/subhansh-dev/agent-maxxingWrote 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/subhansh-dev/agent-maxxing/database-patterns)<a href="https://agentmods.dev/skills/subhansh-dev/agent-maxxing/database-patterns"><img src="https://agentmods.dev/badge/skills/subhansh-dev/agent-maxxing/database-patterns/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.
<a href="https://agentmods.dev/skills/subhansh-dev/agent-maxxing/database-patterns"><img src="https://agentmods.dev/badge/skills/subhansh-dev/agent-maxxing/database-patterns.svg" alt="Reviewed on agentmods" width="80" 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.00018 | $0.00539 |
| Opus 5.5 | $0.00007 | $0.00216 |
| Sonnet 5.5 | $0.00004 | $0.00108 |
| Haiku 4.5 | $0.00002 | $0.00054 |
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 1mo 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 — 78 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Database Patterns
Schema Design
Naming
- Tables: plural, snake_case (
users,order_items) - Columns: snake_case (
created_at,user_id) - Primary keys:
id(auto-increment or UUID) - Foreign keys:
<table>_id(user_id,order_id) - Timestamps:
created_at,updated_at,deleted_at
Data Types
- Strings:
VARCHAR(n)for known max,TEXTfor unlimited - Numbers:
INTEGERfor whole numbers,DECIMAL(p,s)for money - Booleans:
BOOLEANorTINYINT(1) - Dates:
TIMESTAMPfor date+time,DATEfor date only - JSON:
JSONB(PostgreSQL) for flexible structure
Relationships
- One-to-many: foreign key on the many side
- Many-to-many: junction table
- One-to-one: foreign key with unique constraint
Indexing
When to Index
- Columns used in WHERE clauses
- Columns used in JOIN conditions
- Columns used in ORDER BY
- Columns with high cardinality (many unique values)
When NOT to Index
- Small tables (< 1000 rows)
- Columns with low cardinality (boolean, status)
- Columns that are frequently updated
- Tables with heavy write loads
Index Types
- B-tree: default, good for most queries
- Hash: exact match only, very fast
- GIN: full-text search, JSON queries
- Partial: index with WHERE clause
Migrations
Rules
- Every migration must be reversible
- Never modify a deployed migration
- Add columns as nullable first, then backfill
- Create index CONCURRENTLY in production
- Test migrations on a copy of production data
Safe Migration Pattern
-- Step 1: Add nullable column
ALTER TABLE users ADD COLUMN bio TEXT;
-- Step 2: Backfill
UPDATE users SET bio = '' WHERE bio IS NULL;
-- Step 3: Add NOT NULL constraint
ALTER TABLE users ALTER COLUMN bio SET NOT NULL;
Query Optimization
- Use EXPLAIN ANALYZE to check query plans
- Avoid SELECT * — select only needed columns
- Use LIMIT for large result sets
- Batch inserts instead of single inserts
- Use connection pooling
- Avoid N+1 queries — use JOINs or eager loading
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.
- 1mo ago First seen · 78 lines · 18 tokens per session scan A 2b924bcc43fc
database-patterns is a skill published in the GitHub repository subhansh-dev/agent-maxxing (2 stars, last pushed 3mo ago), licensed MIT. It adds 18 tokens to every session and 539 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-08-31.
Other skills, from other repositories
schema-drift-detector
Detects unrelated schema.rb changes in PRs by cross-referencing against included migrations. Use when reviewing PRs with database schema changes.
data-migration-expert
Validates data migrations, backfills, and production data transformations against reality. Use when PRs involve ID mappings, column renames, enum conversions, or schema changes.
data-migrations-reviewer
Conditional code-review persona, selected when the diff touches migration files, schema changes, data transformations, or backfill scripts. Reviews code for data integrity and migration safety. Spawned by the ce:review-beta skill as part of a reviewer ensemble.
database-migrations
Change a schema safely on a live system — reversible, ordered, zero-downtime.
backend-patterns
Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.
review-implement-phase
Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.