pg-aiguide is a knowledge and tooling project that gives AI coding assistants version-aware PostgreSQL documentation and curated database practices. Developers use it through agent skills, an MCP server, or a Claude Code plugin to help coding tools generate better PostgreSQL code. The catalogue entries are its skills, instructions, MCP integration, and rule.
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 timescale/pg-aiguide --skill setup-timescaledb-hypertablesgit clone --depth 1 https://github.com/timescale/pg-aiguideWrote 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/timescale/pg-aiguide/setup-timescaledb-hypertables)<a href="https://agentmods.dev/skills/timescale/pg-aiguide/setup-timescaledb-hypertables"><img src="https://agentmods.dev/badge/skills/timescale/pg-aiguide/setup-timescaledb-hypertables/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/timescale/pg-aiguide/setup-timescaledb-hypertables"><img src="https://agentmods.dev/badge/skills/timescale/pg-aiguide/setup-timescaledb-hypertables.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
- NVIDIA SkillSpector pass
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.00219 | $0.04422 |
| Opus 5 | $0.00110 | $0.02211 |
| Sonnet 5 | $0.00044 | $0.00884 |
| Haiku 4.5 | $0.00022 | $0.00442 |
Grade A, and why
setup-timescaledb-hypertables 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 10d 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 — 497 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TimescaleDB Complete Setup
Instructions for insert-heavy data patterns where data is inserted but rarely changed:
- Time-series data (sensors, metrics, system monitoring)
- Event logs (user events, audit trails, application logs)
- Transaction records (orders, payments, financial transactions)
- Sequential data (records with auto-incrementing IDs and timestamps)
- Append-only datasets (immutable records, historical data)
Step 1: Create Hypertable
CREATE TABLE your_table_name (
timestamp TIMESTAMPTZ NOT NULL,
entity_id TEXT NOT NULL, -- device_id, user_id, symbol, etc.
category TEXT, -- sensor_type, event_type, asset_class, etc.
value_1 DOUBLE PRECISION, -- price, temperature, latency, etc.
value_2 DOUBLE PRECISION, -- volume, humidity, throughput, etc.
value_3 INTEGER, -- count, status, level, etc.
metadata JSONB -- flexible additional data
) WITH (
tsdb.hypertable,
tsdb.partition_column='timestamp',
tsdb.enable_columnstore=true, -- Disable if table has vector columns
tsdb.segmentby='entity_id', -- See selection guide below
tsdb.orderby='timestamp DESC', -- See selection guide below
tsdb.sparse_index='minmax(value_1),minmax(value_2),minmax(value_3)' -- see selection guide below
);
Compression Decision
- Enable by default for insert-heavy patterns
- Disable if table has vector type columns (pgvector) - indexes on vector columns incompatible with columnstore
Partition Column Selection
Must be time-based (TIMESTAMP/TIMESTAMPTZ/DATE) or integer (INT/BIGINT) with good temporal/sequential distribution.
Common patterns:
- TIME-SERIES:
timestamp,event_time,measured_at - EVENT LOGS:
event_time,created_at,logged_at - TRANSACTIONS:
created_at,transaction_time,processed_at - SEQUENTIAL:
id(auto-increment when no timestamp),sequence_number - APPEND-ONLY:
created_at,inserted_at,id
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.
- 10d ago First seen · 497 lines · 219 tokens per session scan A dcfce6a31d21
setup-timescaledb-hypertables is a skill published in the GitHub repository timescale/pg-aiguide (1,835 stars, last pushed yesterday), licensed Apache-2.0. It adds 219 tokens to every session and 4,422 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
database-optimizer
Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.
postgres-pro
Use when optimizing PostgreSQL queries, configuring replication, or implementing advanced database features. Invoke for EXPLAIN analysis, JSONB operations, extension usage, VACUUM tuning, performance monitoring.
pdlc-db-migrate
A database migration manager driven by database design documents. A migration is a versioned script that changes a database structure and can also undo that change.
pdlc-db-design
A database design workflow that turns an existing product requirements document and, when available, API design into a database plan. It describes entities, fields, links, indexes, constraints, and an entity-relationship diagram, which shows how data types connect.
database
ออกแบบ Database Schema สำหรับ PostgreSQL และ Laravel แบบ code-first สร้าง schema, relationships, business rules และ migration-ready guidance ใช้ skill นี้ทันทีเมื่อผู้ใช้พูดถึง database schema, table design, Entity-Relationship, Laravel migration, PostgreSQL model เช่น "ออกแบบ table ให้หน่อย", "ช่วยทำ ER diagram"…
sql-expert
Expert SQL query writing, optimization, and database schema design with support for PostgreSQL, MySQL, SQLite, and SQL Server. Use when working with databases for: (1) Writing complex SQL queries with joins, subqueries, and window functions, (2) Optimizing slow queries and analyzing execution plans, (3) Designing…