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 nikandr-surkov/ai-saas-starter --skill db-migrationgit clone --depth 1 https://github.com/nikandr-surkov/ai-saas-starterWrote 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/nikandr-surkov/ai-saas-starter/db-migration)<a href="https://agentmods.dev/skills/nikandr-surkov/ai-saas-starter/db-migration"><img src="https://agentmods.dev/badge/skills/nikandr-surkov/ai-saas-starter/db-migration/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/nikandr-surkov/ai-saas-starter/db-migration"><img src="https://agentmods.dev/badge/skills/nikandr-surkov/ai-saas-starter/db-migration.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.00034 | $0.00391 |
| Opus 5 | $0.00017 | $0.00196 |
| Sonnet 5 | $0.00007 | $0.00078 |
| Haiku 4.5 | $0.00003 | $0.00039 |
Grade A, and why
db-migration 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 9d 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.
What it actually says
Database migration
Applied migrations are immutable history. This skill exists so nobody ever "just edits the SQL file".
Steps
- Ask the user first. Schema changes are on the ASK FIRST list in AGENTS.md. Describe the change and why.
- Edit
src/db/schema.tsonly. Conventions:- Every foreign key gets an index.
- Timestamps:
createdAtwithdefaultNow(), timezone-aware. - Money in integer cents; credits in integers.
- Enums via
pgEnum, named<table>_<column>.
- Generate:
pnpm db:generate. Never write migration SQL by hand. - Read the generated file in
drizzle/. Confirm: no unintendedDROP, correct column types/defaults, indexes present. Column renames often generate drop+create — if data must survive, say so and write the migration plan out for the user before applying. - Apply locally:
pnpm db:migrate(Postgres running viadocker compose up -d). - Run
pnpm test— the ledger suite will catch schema drift in credit tables. - Commit
src/db/schema.tsand the newdrizzle/files together.
Never
- Edit or delete an existing file in
drizzle/. - Run
drizzle-kit pushagainst anything but a throwaway local DB — this repo uses generated, committed migrations. - Touch
credit_transactionssemantics (signed integer amounts, UNIQUEidempotencyKey) without reading.claude/rules/billing.md.
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.
- 9d ago First seen · 38 lines · 34 tokens per session scan A 0f06f9feb133
db-migration is a skill published in the GitHub repository nikandr-surkov/ai-saas-starter (19 stars, last pushed 1mo ago), licensed MIT. It adds 34 tokens to every session and 391 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
optimize-a-query
Diagnose and fix a slow Postgres query in the builders-stack — read its EXPLAIN plan, find the missing index or the ORM N+1, and confirm the fix. Use when a page or endpoint is slow, a query times out, or pgstatstatements shows a hot query. Pairs with design-a-schema for the index itself.
run-lean-on-neon
Keep Postgres fast under load and inside Neon's free tier. Use when choosing a connection string, worrying about "the DB crashes at load", deciding a session strategy, or trying to stay under Neon's free limits (storage / compute-hours). Corrects the common mistake of reaching for postgresql.conf / PgTune — most of…
laravel-vector-search
Use when implementing semantic/vector search in Laravel 13 with PostgreSQL + pgvector.
prisma-database-setup
Guides for configuring Prisma with different database providers (PostgreSQL, MySQL, SQLite, MongoDB, etc.). Use when setting up a new project, changing databases, or troubleshooting connection issues. Triggers on "configure postgres", "connect to mysql", "setup mongodb", "sqlite setup".
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.