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/timescale/pg-aiguide/postgres-database-migrationnpx skills add timescale/pg-aiguide --skill postgres-database-migrationgit clone --depth 1 https://github.com/timescale/pg-aiguideWhat 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.00222 | $0.05633 |
| Opus 5 | $0.00111 | $0.02816 |
| Sonnet 5 | $0.00044 | $0.01127 |
| Haiku 4.5 | $0.00022 | $0.00563 |
Grade A, and why
postgres-database-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 yesterday.
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 — 487 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Database Migrations
A schema migration that works on an empty dev database can fail, lock, or corrupt data on a production table with millions of rows. This guide covers how to assess risk, test against real data, and execute migrations safely.
DDL Lock Reference
Every schema change acquires a lock. The critical question is: does it block reads and writes, and for how long?
Fast, Non-Blocking Operations
These complete in milliseconds regardless of table size. They only hold a brief AccessExclusiveLock for the catalog update, not for data rewriting.
| Operation | Lock Level | Notes |
|---|---|---|
ADD COLUMN (nullable, no default) |
AccessExclusiveLock (brief) |
Fast. No table rewrite. Metadata-only change. |
ADD COLUMN ... DEFAULT x (PG 11+) |
AccessExclusiveLock (brief) |
Fast. Non-volatile defaults stored in catalog, not backfilled. |
DROP COLUMN |
AccessExclusiveLock (brief) |
Fast. Column marked invisible; space reclaimed by VACUUM over time. |
SET DEFAULT / DROP DEFAULT |
AccessExclusiveLock (brief) |
Metadata change only. Does not touch existing rows. |
CREATE INDEX CONCURRENTLY |
ShareUpdateExclusiveLock |
Non-blocking. Allows reads and writes during build. Slower than regular index creation. |
DROP INDEX CONCURRENTLY |
ShareUpdateExclusiveLock |
Non-blocking. Waits for queries using the index to finish, then drops. No table-level exclusive lock. |
RENAME COLUMN |
AccessExclusiveLock (brief) |
Metadata change only. Fast. |
RENAME TABLE |
AccessExclusiveLock (brief) |
Metadata change only. Fast. |
ADD CONSTRAINT ... NOT VALID |
ShareUpdateExclusiveLock |
Adds constraint for new rows only. Does not scan existing data. |
VALIDATE CONSTRAINT |
ShareUpdateExclusiveLock |
Scans existing rows but allows concurrent reads and writes. |
CREATE/DROP TRIGGER |
ShareRowExclusiveLock |
Brief catalog update. |
Slow or Blocking Operations
What ships with it
3 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.
- yesterday First seen · 487 lines · 222 tokens per session scan A 19cb18c5a55d
postgres-database-migration is a skill published in the GitHub repository timescale/pg-aiguide (1,825 stars, last pushed 5d ago), licensed Apache-2.0. It adds 222 tokens to every session and 5,633 once invoked, about $0.0011 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
implement-factory
Factory loop orchestrator for multi-feature or multi-component implementation manifests. Use for high-complexity work with parallel-eligible workstreams and holdout-scenario evaluation.
analyze
Deep-dive codebase analysis that explains how things actually work — business rules, architecture patterns, auth flows, data models, integrations, and performance hotspots. Use whenever the user asks "how does X work", "map the Y flow", "what are the business rules for Z", "trace the auth path", "explore the codebase…
debug
Systematically diagnose and resolve bugs through conversational investigation and root cause analysis.
specify-factory
Decompose a multi-feature or multi-component specification into factory-consumable artifacts. Use this for high-complexity work — multiple features, three or more components, or parallel-eligible workstreams.
specify-solution
Create and validate solution design documents (SDD). Use when designing architecture, defining interfaces, documenting technical decisions, analyzing system components, or working on solution.md files in .start/specs/.
brainstorm
You MUST use this before any creative work — creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements, and design before implementation.