#564 by GitHub stars
timescale/pg-aiguide
MCP server and Claude plugin for Postgres skills and documentation. Helps AI coding tools generate better PostgreSQL code.
History
Review weekly changes to SKILL.md before updating. Dates mark the weeks in which we observed each version; checks apply to the recorded commits.
View weekly changes
skills/design-postgis-tables/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/design-postgres-tables/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/find-hypertable-candidates/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Network or broad shell
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/migrate-postgres-tables-to-hypertables/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/pgvector-semantic-search/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/postgres/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/postgres-database-migration/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Network or broad shell
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/postgres-hybrid-text-search/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Network or broad shell
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/schema-exploration/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Network or broad shell
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/setup-timescaledb-hypertables/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
skills/timescaledb-hyperfunctions/SKILL.md
Week of Oct 26, 2026 · Line counts unavailable
Before Not checked yet → After Instructions only
First observation → 5d3b76b5c986
No earlier version was observed for comparison.
Verified commit 5d3b76b5c986693b30753828b404aa66ba34c31a
git clone --filter=blob:none --no-checkout https://github.com/timescale/pg-aiguide.git .hotskills/timescale-pg-aiguide && git -C .hotskills/timescale-pg-aiguide checkout --detach 5d3b76b5c986693b30753828b404aa66ba34c31a
# Copy each selected skill directory from .hotskills/timescale-pg-aiguide into .claude/skills/<skill-name>/Heat
5.1- Star growth, last 7 daysAhead of 60% of tracked repositories
- Star growth, last 24 hoursAhead of 83% of tracked repositories
- Rank movement, last 7 daysAhead of 23% of tracked repositories
- Commits, last 30 daysAhead of 67% of tracked repositories
- Accounts asking about it through MCP, last 7 daysNot available
- Hot votes this weekAhead of 0% of tracked repositories
Heat never changes the order by stars, and sponsorship never touches it. How heat works
Stars over time
Individual skills in this repository
- design-postgis-tables
skills/design-postgis-tables - design-postgres-tables
skills/design-postgres-tables - find-hypertable-candidates
skills/find-hypertable-candidates - migrate-postgres-tables-to-hypertables
skills/migrate-postgres-tables-to-hypertables - pgvector-semantic-search
skills/pgvector-semantic-search - postgres
skills/postgres - postgres-database-migration
skills/postgres-database-migration - postgres-hybrid-text-search
skills/postgres-hybrid-text-search - schema-exploration
skills/schema-exploration - setup-timescaledb-hypertables
skills/setup-timescaledb-hypertables - timescaledb-hyperfunctions
skills/timescaledb-hyperfunctions
How it works
design-postgis-tables
When your agent uses it
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
What it loads into context
Frontmatter
65 tokensAlways available to the agent
SKILL.md
4,160 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Before You Start (5 Questions)
- Core Rules
- Geometry vs Geography
- Geometry Types
- Coordinate Systems (SRID)
- Spatial Indexing
- Table Design Examples
- Performance Patterns
- Data Validation
- Do Not Use
- Common Pitfalls
Files
../../.claude-plugin/marketplace.jsonasset1,260 bytesSKILL.mdcore16,924 bytes
Read SKILL.md
# PostGIS Spatial Table Design
## Before You Start (5 Questions)
1. What is the geographic scope (single city/region vs global)?
2. What are your primary query patterns (within-radius, bbox, intersects, nearest-neighbor)?
3. What units do you need for distance/area (meters vs CRS units), and how accurate must they be?
4. What is the expected scale (rows, write rate), and is the data mostly append-only?
5. Do you need 3D (Z) or measures (M), or is 2D enough?
**SQL injection note:** When turning these patterns into application code, use parameterized queries for user-provided values (WKT/WKB, coordinates, IDs, radii). Avoid string-concatenating untrusted input into SQL; for dynamic identifiers, use safe identifier quoting/whitelisting.
## Core Rules
View the complete source on GitHubdesign-postgres-tables
When your agent uses it
Use this skill for general PostgreSQL table design. **Trigger when user asks to:** - Design PostgreSQL tables, schemas, or data models when creating new tables and when modifying existing ones. - Choose data types, constraints, or indexes for PostgreSQL - Create user tables, order tables, reference tables, or JSONB schemas - Understand PostgreSQL best practices for normalization, constraints, or indexing - Design update-heavy, upsert-heavy, or OLTP-style tables **Keywords:** PostgreSQL schema, table design, data types, PRIMARY KEY, FOREIGN KEY, indexes, B-tree, GIN, JSONB, constraints, normalization, identity columns, partitioning, row-level security Comprehensive reference covering data types, indexing strategies, constraints, JSONB patterns, partitioning, and PostgreSQL-specific best practices.
What it loads into context
Frontmatter
201 tokensAlways available to the agent
SKILL.md
4,191 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Core Rules
- PostgreSQL “Gotchas”
- Data Types
- Table Types
- Row-Level Security
- Constraints
- Indexing
- Partitioning
- Special Considerations
- Generated Columns
- Extensions
- JSONB Guidance
- Examples
Files
SKILL.mdcore16,881 bytes
Read SKILL.md
# PostgreSQL Table Design
## Core Rules
- Define a **PRIMARY KEY** for reference tables (users, orders, etc.). Not always needed for time-series/event/log data. When used, prefer `BIGINT GENERATED ALWAYS AS IDENTITY`; use `UUID` only when global uniqueness/opacity is needed.
- **Normalize first (to 3NF)** to eliminate data redundancy and update anomalies; denormalize **only** for measured, high-ROI reads where join performance is proven problematic. Premature denormalization creates maintenance burden.
- Add **NOT NULL** everywhere it’s semantically required; use **DEFAULT**s for common values.
- Create **indexes for access paths you actually query**: PK/unique (auto), **FK columns (manual!)**, frequent filters/sorts, and join keys.
- Prefer **TIMESTAMPTZ** for event time; **NUMERIC** for money; **TEXT** for strings; **BIGINT** for integer values, **DOUBLE PRECISION** for floats (or `NUMERIC` for exact decimal arithmetic).
## PostgreSQL “Gotchas”
- **Identifiers**: unquoted → lowercased. Avoid quoted/mixed-case names. Convention: use `snake_case` for table/column names.
- **Unique + NULLs**: UNIQUE allows multiple NULLs. Use `UNIQUE (...) NULLS NOT DISTINCT` (PG15+) to restrict to one NULL.View the complete source on GitHubfind-hypertable-candidates
When your agent uses it
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables. **Trigger when user asks to:** - Analyze database tables for hypertable conversion potential - Identify time-series or event tables in an existing schema - Evaluate if a table would benefit from Timescale/TimescaleDB - Audit PostgreSQL tables for migration to Timescale/TimescaleDB/TigerData - Score or rank tables for hypertable candidacy **Keywords:** hypertable candidate, table analysis, migration assessment, Timescale, TimescaleDB, time-series detection, insert-heavy tables, event logs, audit tables Provides SQL queries to analyze table statistics, index patterns, and query patterns. Includes scoring criteria (8+ points = good candidate) and pattern recognition for IoT, events, transactions, and sequential data.
What it loads into context
Frontmatter
227 tokensAlways available to the agent
SKILL.md
2,461 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- TimescaleDB Benefits
- Step 1: Database Schema Analysis
- Step 2: Candidacy Scoring (8+ points = good candidate)
- Common Patterns
- Analysis Output Requirements
Files
SKILL.mdcore10,525 bytesSKILL.mdcore10,525 bytesSKILL.mdcore10,525 bytes
Read SKILL.md
# PostgreSQL Hypertable Candidate Analysis
Identify tables that would benefit from TimescaleDB hypertable conversion. After identification, use the companion "migrate-postgres-tables-to-hypertables" skill for configuration and migration.
## TimescaleDB Benefits
**Performance gains:** 90%+ compression, fast time-based queries, improved insert performance, efficient aggregations, continuous aggregates for materialization (dashboards, reports, analytics), automatic data management (retention, compression).
**Best for insert-heavy patterns:**
- Time-series data (sensors, metrics, monitoring)
- Event logs (user events, audit trails, application logs)
- Transaction records (orders, payments, financial)
- Sequential data (auto-incrementing IDs with timestamps)View the complete source on GitHubmigrate-postgres-tables-to-hypertables
When your agent uses it
Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation. **Trigger when user asks to:** - Migrate or convert PostgreSQL tables to hypertables - Execute hypertable migration with minimal downtime - Plan blue-green migration for large tables - Validate hypertable migration success - Configure compression after migration **Prerequisites:** Tables already identified as candidates (use find-hypertable-candidates first if needed) **Keywords:** migrate to hypertable, convert table, Timescale, TimescaleDB, blue-green migration, in-place conversion, create_hypertable, migration validation, compression setup Step-by-step migration planning including: partition column selection, chunk interval calculation, PK/constraint handling, migration execution (in-place vs blue-green), and performance validation queries.
What it loads into context
Frontmatter
224 tokensAlways available to the agent
SKILL.md
3,643 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Step 1: Optimal Configuration
- Step 2: Migration Planning
- Step 3: Performance Validation
- Success Criteria
Files
SKILL.mdcore15,068 bytes
Read SKILL.md
# PostgreSQL to TimescaleDB Hypertable Migration
Migrate identified PostgreSQL tables to TimescaleDB hypertables with optimal configuration, migration planning and validation.
**Prerequisites**: Tables already identified as hypertable candidates (use companion "find-hypertable-candidates" skill if needed).
## Step 1: Optimal Configuration
### Partition Column Selection
```sql
-- Find potential partition columns
SELECT column_name, data_type, is_nullable
FROM information_schema.columnsView the complete source on GitHubpgvector-semantic-search
When your agent uses it
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. **Trigger when user asks to:** - Store or search vector embeddings in PostgreSQL - Set up semantic search, similarity search, or nearest neighbor search - Create HNSW or IVFFlat indexes for vectors - Implement RAG (Retrieval Augmented Generation) with PostgreSQL - Optimize pgvector performance, recall, or memory usage - Use binary quantization for large vector datasets **Keywords:** pgvector, embeddings, semantic search, vector similarity, HNSW, IVFFlat, halfvec, cosine distance, nearest neighbor, RAG, LLM, AI search Covers: halfvec storage, HNSW index configuration (m, ef_construction, ef_search), quantization strategies, filtered search, bulk loading, and performance tuning.
What it loads into context
Frontmatter
234 tokensAlways available to the agent
SKILL.md
3,628 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Golden Path (Default Setup)
- Core Rules
- Type Rules
- Standard Pattern
- HNSW Index
- IVFFlat Index (Generally Not Recommended)
- Quantization Strategies
- Performance by Dataset Size
- Filtering Best Practices
- Bulk Loading
- Maintenance
- Monitoring & Debugging
- Common Issues (Symptom → Fix)
Files
SKILL.mdcore15,106 bytes
Read SKILL.md
# pgvector for Semantic Search
Semantic search finds content by meaning rather than exact keywords. An embedding model converts text into high-dimensional vectors, where similar meanings map to nearby points. pgvector stores these vectors in PostgreSQL and uses approximate nearest neighbor (ANN) indexes to find the closest matches quickly—scaling to millions of rows without leaving the database. Store your text alongside its embedding, then query by converting your search text to a vector and returning the rows with the smallest distance.
This guide covers pgvector setup and tuning—not embedding model selection or text chunking, which significantly affect search quality. Requires pgvector 0.8.0+ for all features (`halfvec`, `binary_quantize`, iterative scan).
## Golden Path (Default Setup)
Use this configuration unless you have a specific reason not to.
- Embedding column data type: `halfvec(N)` where `N` is your embedding dimension (must match everywhere). Examples use 1536; replace with your dimension `N`.
- Distance: cosine (`<=>`)
- Index: HNSW (`m = 16`, `ef_construction = 64`). Use `halfvec_cosine_ops` and query with `<=>`.
- Query-time recall: `SET hnsw.ef_search = 100` (good starting point from published benchmarks, increase for higher recall at higher latency)
- Query pattern: `ORDER BY embedding <=> $1::halfvec(N) LIMIT k`View the complete source on GitHubpostgres
When your agent uses it
Use this skill for any PostgreSQL database work — table design, indexing, data types, constraints, extensions (pgvector, PostGIS, TimescaleDB), search, and migrations. **Trigger when user asks to:** - Explore an existing PostgreSQL database to understand its objects and relationships - Design or modify PostgreSQL tables, schemas, or data models - Choose data types, constraints, indexes, or partitioning strategies - Work with pgvector embeddings, semantic search, or RAG - Set up full-text search, hybrid search, or BM25 ranking - Use PostGIS for spatial/geographic data - Set up TimescaleDB hypertables for time-series data - Migrate tables to hypertables or evaluate migration candidates - Plan or execute safe schema migrations with zero downtime **Keywords:** PostgreSQL, Postgres, SQL, schema, table design, indexes, constraints, pgvector, PostGIS, TimescaleDB, hypertable, semantic search, hybrid search, BM25, time-series, migration
What it loads into context
Frontmatter
243 tokensAlways available to the agent
SKILL.md
829 tokensWhen the skill is activated
Reference documents
45,797 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Available References
- How to Use
Files
SKILL.mdcore3,784 bytesreferences/backfill-strategies.mddoc2,389 bytesreferences/complete-example.mddoc2,091 bytesreferences/design-postgis-tables.mddoc16,924 bytesreferences/design-postgres-tables.mddoc16,881 bytesreferences/find-hypertable-candidates.mddoc10,525 bytesreferences/migrate-postgres-tables-to-hypertables.mddoc15,068 bytesreferences/pgvector-semantic-search.mddoc15,106 bytesreferences/postgres-database-migration.mddoc24,796 bytesreferences/postgres-hybrid-text-search.mddoc12,600 bytesreferences/schema-exploration/guide.mddoc4,382 bytesreferences/schema-exploration/references/data-values.mddoc5,874 bytesreferences/schema-exploration/references/extensions.mddoc1,875 bytesreferences/schema-exploration/references/foreign-tables.mddoc4,015 bytesreferences/schema-exploration/references/overview.mddoc6,026 bytesreferences/schema-exploration/references/partitioning-and-inheritance.mddoc6,844 bytesreferences/schema-exploration/references/psql.mddoc2,159 bytesreferences/schema-exploration/references/query-authoring.mddoc2,198 bytesreferences/schema-exploration/references/routines.mddoc2,921 bytesreferences/schema-exploration/references/security.mddoc2,530 bytesreferences/schema-exploration/references/tables.mddoc7,915 bytesreferences/schema-exploration/references/triggers.mddoc1,640 bytesreferences/schema-exploration/references/views.mddoc2,507 bytesreferences/setup-timescaledb-hypertables.mddoc18,850 bytesreferences/validation-queries.mddoc3,527 bytes
Read SKILL.md
# PostgreSQL Expert Skills
This skill provides comprehensive PostgreSQL expertise through specialized references. Load the appropriate reference based on the task.
## Available References
### Existing Databases
- **[schema-exploration](references/schema-exploration/guide.md)** — Read-only, question-driven exploration of schemas, tables, views, routines, triggers, RLS, and extensions using `pg_catalog`. **Use to understand an existing database before designing changes or writing queries.**
### Table Design
- **[design-postgres-tables](references/design-postgres-tables.md)** — Data types, constraints, indexes, JSONB patterns, partitioning, and PostgreSQL best practices. **Use for any general table/schema design task.**
- **[design-postgis-tables](references/design-postgis-tables.md)** — PostGIS spatial table design: geometry vs geography types, SRIDs, spatial indexing, and location-based query patterns. **Use when the task involves geographic or spatial data.**
### SearchView the complete source on GitHubpostgres-database-migration
When your agent uses it
Use this skill for planning, testing, and safely executing PostgreSQL schema migrations — especially when working with production data or shared databases. **Trigger when user asks to:** - Test a schema migration before applying it to production - Add, remove, or rename columns safely on a live table - Change a column's data type without downtime - Add or drop indexes, constraints, or foreign keys on large tables - Understand which ALTER TABLE operations lock the table - Roll back a failed migration - Plan a zero-downtime migration strategy - Fork a database to test a migration safely **Keywords:** migration, schema change, ALTER TABLE, add column, drop column, rename column, change type, zero downtime, lock, AccessExclusiveLock, concurrent index, forking, rollback, backfill, deploy Covers: lock-level reference for every common DDL operation, safe migration patterns, fork-based testing, zero-downtime column changes, index creation, constraint addition, backfill strategies, pre/post-migration validation, and rollback planning.
What it loads into context
Frontmatter
236 tokensAlways available to the agent
SKILL.md
5,620 tokensWhen the skill is activated
Reference documents
1,970 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- DDL Lock Reference
- Safe Migration Patterns
- Backfill Strategies
- Migration Validation
- Rollback Planning
- Transaction Strategy
- Dealing with Long-Running Queries
- Fork-Based Migration Testing
- Complete Migration Example
- Advanced Considerations
- Common Pitfalls
Files
SKILL.mdcore24,796 bytesSKILL.mdcore24,796 bytesSKILL.mdcore24,796 bytesreferences/backfill-strategies.mddoc2,389 bytesreferences/complete-example.mddoc2,091 bytesreferences/validation-queries.mddoc3,527 bytes
Read SKILL.md
# 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 |
|-----------|-----------|-------|View the complete source on GitHubpostgres-hybrid-text-search
When your agent uses it
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF). **Trigger when user asks to:** - Combine keyword and semantic search - Implement hybrid search or multi-modal retrieval - Use BM25/pg_textsearch with pgvector together - Implement RRF (Reciprocal Rank Fusion) for search - Build search that handles both exact terms and meaning **Keywords:** hybrid search, BM25, pg_textsearch, RRF, reciprocal rank fusion, keyword search, full-text search, reranking, cross-encoder Covers: pg_textsearch BM25 index setup, parallel query patterns, client-side RRF fusion (Python/TypeScript), weighting strategies, and optional ML reranking.
What it loads into context
Frontmatter
208 tokensAlways available to the agent
SKILL.md
3,087 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- When to Use Hybrid Search
- Data Preparation
- Golden Path (Default Setup)
- RRF Query Pattern
- Weighting Keyword vs Semantic
- Reranking with ML Models
- Performance Considerations
- Scaling with pgvectorscale
- Monitoring & Debugging
- Common Issues
Files
SKILL.mdcore12,600 bytesSKILL.mdcore12,600 bytesSKILL.mdcore12,600 bytesSKILL.mdcore12,600 bytesSKILL.mdcore12,600 bytes
Read SKILL.md
# Hybrid Text Search
Hybrid search combines keyword search (BM25) with semantic search (vector embeddings) to get the best of both: exact keyword matching and meaning-based retrieval. Use Reciprocal Rank Fusion (RRF) to merge results from both methods into a single ranked list.
This guide covers combining [pg_textsearch](https://github.com/timescale/pg_textsearch) (BM25) with [pgvector](https://github.com/pgvector/pgvector). Requires both extensions. For high-volume setups, filtering, or advanced pgvector tuning (binary quantization, HNSW parameters), see the **pgvector-semantic-search** skill.
pg_textsearch is a new BM25 text search extension for PostgreSQL, fully open-source and available hosted on Tiger Cloud as well as for self-managed deployments. It provides true BM25 ranking, which often improves relevance compared to PostgreSQL's built-in ts_rank and can offer better performance at scale. Note: pg_textsearch is currently in prerelease and not yet recommended for production use. pg_textsearch currently supports PostgreSQL 17 and 18.
## When to Use Hybrid Search
- **Use hybrid** when queries mix specific terms (product names, codes, proper nouns) with conceptual intent
- **Use semantic only** when meaning matters more than exact wording (e.g., "how to fix slow queries" should match "query optimization")
- **Use keyword only** when exact matches are critical (e.g., error codes, SKUs, legal citations)
View the complete source on GitHubschema-exploration
When your agent uses it
Explore an existing PostgreSQL database before answering questions about its data or writing SQL. Use this skill whenever a user asks for a query or a data-backed answer against an unfamiliar schema (counts, missing or failed records, recent changes), asks where a business concept lives, or asks how tables, joins, views, routines, triggers, RLS, or extensions work. Find the relevant objects with read-only pg_catalog queries, then request approval before inspecting data-derived statistics or rows. Not a schema-design or migration guide.
What it loads into context
Frontmatter
129 tokensAlways available to the agent
SKILL.md
891 tokensWhen the skill is activated
Reference documents
11,724 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Workflow
- Example finding
- Safety and execution
Files
SKILL.mdcore4,382 bytesSKILL.mdcore4,382 bytesreferences/data-values.mddoc5,874 bytesreferences/extensions.mddoc1,875 bytesreferences/foreign-tables.mddoc4,015 bytesreferences/overview.mddoc6,026 bytesreferences/partitioning-and-inheritance.mddoc6,844 bytesreferences/psql.mddoc2,159 bytesreferences/query-authoring.mddoc2,198 bytesreferences/routines.mddoc2,921 bytesreferences/security.mddoc2,530 bytesreferences/tables.mddoc7,915 bytesreferences/triggers.mddoc1,640 bytesreferences/views.mddoc2,507 bytes
Read SKILL.md
# Explore a PostgreSQL database
Start with the user's question, not a full-database audit unless that is the explicit ask. Use the database connection already available to you; if none is available, ask for access or work from provided schema files. Stay within the database and schemas the user has authorized. Catalog metadata can reveal sensitive names or source code: do not export it unnecessarily.
## Workflow
1. Establish the current database, server version, role, and scope. Use [overview](references/overview.md) for a small inventory. Choose relevant schemas; do not assume `public` contains the application.
2. Pick the most promising object(s) and read **only** the matching drill-down reference: [tables](references/tables.md), [partitioning/inheritance](references/partitioning-and-inheritance.md), [foreign tables](references/foreign-tables.md), [views](references/views.md), [routines](references/routines.md), [triggers](references/triggers.md), [security/RLS](references/security.md), or [extensions](references/extensions.md). Follow cross-references only when the question requires them.
3. Corroborate meaning with comments, definitions, keys, and known dependencies. Names are clues, not proof of business meaning. If data-derived values would help, use [data-derived values](references/data-values.md) **only after obtaining approval** for the specific columns and access method. Ask the user when semantics remain ambiguous.
4. If the user wants SQL, follow [query authoring](references/query-authoring.md): establish join keys and grain, then validate a vetted read-only query with plain `EXPLAIN` where authorized. Do not mistake a valid plan for proof of business semantics.
5. Stop once you can answer. Report the specific schema-qualified objects and evidence, distinguish observations from inferences, and state limitations (permissions, stale statistics, missing dependencies, unknown application logic).
## Example finding
View the complete source on GitHubsetup-timescaledb-hypertables
When your agent uses it
Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any insert-heavy table. **Trigger when user asks to:** - Create or design SQL schemas/tables AND Timescale/TimescaleDB/TigerData/Tiger Cloud is available - Set up hypertables, compression, retention policies, or continuous aggregates - Configure partition columns, segment_by, order_by, or chunk intervals - Optimize time-series database performance or storage - Create tables for sensors, metrics, telemetry, events, or transaction logs **Keywords:** CREATE TABLE, hypertable, Timescale, TimescaleDB, time-series, IoT, metrics, sensor data, compression policy, continuous aggregates, columnstore, retention policy, chunk interval, segment_by, order_by Step-by-step instructions for hypertable creation, column selection, compression policies, retention, continuous aggregates, and indexes.
What it loads into context
Frontmatter
262 tokensAlways available to the agent
SKILL.md
4,422 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Step 1: Create Hypertable
- Step 2: Compression Policy (Optional)
- Step 3: Retention Policy
- Step 4: Create Continuous Aggregates
- Step 5: Aggregate Refresh Policies
- Step 6: Real-Time Aggregation (Optional)
- Step 7: Compress Aggregates
- Step 8: Aggregate Retention
- Step 9: Performance Indexes on Continuous Aggregates
- Step 10: Optional Enhancements
- Step 11: Verify Configuration
- Performance Guidelines
- Schema Best Practices
- API Reference (Current vs Deprecated)
- Questions to Ask User
Files
SKILL.mdcore18,850 bytes
Read SKILL.md
# 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
```sql
CREATE TABLE your_table_name (View the complete source on GitHubtimescaledb-hyperfunctions
When your agent uses it
Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledb_toolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct counts, top-N, and downsampling. **Trigger when user asks to:** - Compute percentiles/medians/p95/p99 over large or rolled-up time-series data - Compute rates or deltas from monotonic counters (Prometheus-style) or gauges - Compute time-weighted averages or integrals over irregularly sampled data - Track uptime/downtime from heartbeats, or time spent in each state - Build OHLC/candlestick or VWAP data for financial ticks - Store re-aggregatable summaries in continuous aggregates (two-step aggregation, rollup) - Approximate COUNT DISTINCT, find top-N / most frequent values, or downsample for charts **Keywords:** timescaledb_toolkit, hyperfunctions, percentile_agg, uddsketch, tdigest, approx_percentile, stats_agg, time_weight, counter_agg, gauge_agg, heartbeat_agg, state_agg, candlestick_agg, hyperloglog, approx_count_distinct, min_n, max_n, mcv_agg, lttb, asap_smooth, rollup, two-step aggregation
What it loads into context
Frontmatter
365 tokensAlways available to the agent
SKILL.md
5,507 tokensWhen the skill is activated
Reference documents
0 tokensLoaded on request
Token counts are estimates. Scripts run separately; they are not counted as reference context.
The playbook
- Setup
- The Two-Step Pattern (read this first)
- Choosing a Function
- Percentiles
- Statistical Summaries
- Time-Weighted Averages
- Counters and Gauges
- Heartbeats and Uptime
- State Tracking
- Financial: Candlesticks
- Approximate Distinct, Top-N, Frequency
- Downsampling for Charts
- Continuous Aggregates with Hyperfunctions
- Common Mistakes
- Reference
Files
SKILL.mdcore21,089 bytes
Read SKILL.md
# TimescaleDB Toolkit Hyperfunctions
Hyperfunctions are SQL aggregates and accessors from the `timescaledb_toolkit` extension for analysis that plain PostgreSQL aggregates handle badly: percentiles that can be re-aggregated, rates over resetting counters, averages over irregular samples, uptime, state durations, and more.
## Setup
```sql
CREATE EXTENSION IF NOT EXISTS timescaledb_toolkit; -- preinstalled on Tiger Cloud
SELECT extversion FROM pg_extension WHERE extname = 'timescaledb_toolkit';
ALTER EXTENSION timescaledb_toolkit UPDATE; -- after upgrading the package
```
**Only use functions from the default schema in persistent objects.** Anything in the `toolkit_experimental` schema can change between releases, and `ALTER EXTENSION ... UPDATE` **drops** views, continuous aggregates, and functions that depend on it. All functions in this skill are stable.
View the complete source on GitHubSkills included
- design-postgis-tables
- design-postgres-tables
- find-hypertable-candidates
- migrate-postgres-tables-to-hypertables
- pgvector-semantic-search
- postgres
- postgres-database-migration
- postgres-hybrid-text-search
- schema-exploration
- setup-timescaledb-hypertables
- timescaledb-hyperfunctions
Repository facts
- License
- Apache-2.0
- Created
- Jul 23, 2025
- Last pushed
- Nov 3, 2026
- Forks
- 121
- Open issues
- 6
- Project activity
- Active
Rank over the last 12 weeks
Now #564 · best #399 · down 92 in 30 days
- #553 on Nov 1
- #556 on Nov 2
- #559 on Nov 3
- #561 on Nov 4
- #562 on Nov 5
- #564 since Nov 6
51 earlier periods
- #377 on Aug 2
- #394 on Aug 6
- #388 on Aug 9
- #401 on Aug 10
- #398 on Aug 12
- #402 on Aug 13
- #399 on Aug 15
- #408 on Aug 17
- #416 on Aug 19
- #412 on Aug 20
- #416 on Aug 21
- #419 from Aug 23 to Aug 24
- #424 on Aug 25
- #421 on Aug 26
- #428 on Aug 27
- #417 on Aug 30
- #431 on Aug 31
- #437 on Sep 1
- #428 on Sep 2
- #432 on Sep 3
- #420 on Sep 4
- #427 on Sep 6
- #448 on Sep 15
- #454 on Sep 16
- #448 on Sep 17
- #455 on Sep 18
- #460 on Sep 22
- #454 on Sep 23
- #446 on Sep 25
- #440 on Sep 26
- #456 on Sep 27
- #463 on Sep 28
- #465 on Sep 30
- #463 on Oct 1
- #459 on Oct 2
- #457 on Oct 5
- #472 on Oct 7
- #484 on Oct 8
- #480 on Oct 10
- #495 on Oct 12
- #490 on Oct 13
- #494 on Oct 14
- #500 on Oct 16
- #486 on Oct 17
- #506 on Oct 19
- #515 on Oct 21
- #502 on Oct 23
- #536 on Oct 25
- #542 on Oct 28
- #549 on Oct 29
- #551 from Oct 30 to Oct 31
Before you install
Network or broad shellAutomated signals, not a guarantee
Checked Nov 3, 2026
Not fully analyzed: some files were too long, unreadable or missing. This never lowers the level.
Show 9 notes
skills/find-hypertable-candidates/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/find-hypertable-candidates/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-database-migration/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-database-migration/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-hybrid-text-search/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-hybrid-text-search/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-hybrid-text-search/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/postgres-hybrid-text-search/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzedskills/schema-exploration/SKILL.md:1Analysis incomplete: Referenced executable target unavailable; not analyzed
- No broad tool permissions
- No dangerous shell commands
- 31 network referencesin 8 files: .claude-plugin/marketplace.json:3 postgres-hybrid-text-search/SKILL.md:27 postgres/references/postgres-hybrid-text-search.md:27 and 5 more
- No hidden or obfuscated text
- No instruction overrides
- No executable scripts
- 2 references to secretsin 2 files: postgres-hybrid-text-search/SKILL.md:206 postgres/references/postgres-hybrid-text-search.md:206
- No requests to vote in Hot
Show all 33 signals by file
.claude-plugin/marketplace.json
- Network accessline 3
"owner": { "name": "TigerData", "url": "https://tigerdata.com", - Network accessline 4
"name": "TigerData", "url": "https://tigerdata.com", "email": "support@tigerdata.com" - Network accessline 5
"url": "https://tigerdata.com", - Network accessline 19
"author": { "name": "TigerData", "url": "https://tigerdata.com" - Network accessline 20
"name": "TigerData", "url": "https://tigerdata.com" }, - Network accessline 21
"url": "https://tigerdata.com" - Network accessline 22
}, "homepage": "https://tigerdata.com", "repository": "https://github.com/timescale/pg-aiguide", - Network accessline 23
"homepage": "https://tigerdata.com", - Network accessline 24
"repository": "https://github.com/timescale/pg-aiguide", - Network accessline 40
"pg-aiguide": { "type": "http", "url": "https://mcp.tigerdata.com/docs?disable_mcp_skills=1" - Network accessline 41
"type": "http", "url": "https://mcp.tigerdata.com/docs?disable_mcp_skills=1" } - Network accessline 42
"url": "https://mcp.tigerdata.com/docs?disable_mcp_skills=1"
skills/pgvector-semantic-search/SKILL.md
- Network accessline 76
For other distance operators (L2, inner product, etc.), see the [pgvector README](https://github.com/pgvector/pgvector). - Network accessline 285
For large datasets with label-based filters, [pgvectorscale](https://github.com/timescale/pgvectorscale)'s StreamingDiskANN index supports filtered indexes on `smallint[]` columns. Labels are indexed alongside vectors, enabling efficient fi
skills/postgres-database-migration/SKILL.md
- Network accessline 431
The safest way to test a migration is to run it against a copy of your actual database — same schema, same data, same edge cases. Providers such as [Neon](https://neon.tech) support fast database forking. Without database forking, you need - Network accessline 448
**Limitation:** fork-based testing runs your migration in isolation — it won't catch issues caused by concurrent database traffic (e.g., lock contention under load, deadlocks with concurrent writes, or replication lag from heavy WAL generat
skills/postgres-hybrid-text-search/SKILL.md
- Network accessline 27
This guide covers combining [pg_textsearch](https://github.com/timescale/pg_textsearch) (BM25) with [pgvector](https://github.com/pgvector/pgvector). Requires both extensions. For high-volume setups, filtering, or advanced pgvector tuning ( - Network accessline 66
- **Negative scores**: The `<@>` operator returns negative values where lower = better match. RRF uses rank position, so this doesn't affect fusion. - **Language config**: Change `text_config` to match your content language (e.g., `'french' - Network accessline 67
- **Language config**: Change `text_config` to match your content language (e.g., `'french'`, `'german'`). See [PostgreSQL text search configurations](https://www.postgresql.org/docs/current/textsearch-configuration.html). - Access to secretsline 206
[Credential-related source omitted] - Network accessline 230
For large datasets (10M+ vectors) or workloads with selective metadata filters, consider [pgvectorscale](https://github.com/timescale/pgvectorscale)'s StreamingDiskANN index instead of HNSW for the semantic search component. - Network accessline 263
See the [pgvectorscale documentation](https://github.com/timescale/pgvectorscale) for more details on filtered indexes and tuning parameters.
skills/postgres/references/pgvector-semantic-search.md
- Network accessline 76
For other distance operators (L2, inner product, etc.), see the [pgvector README](https://github.com/pgvector/pgvector). - Network accessline 285
For large datasets with label-based filters, [pgvectorscale](https://github.com/timescale/pgvectorscale)'s StreamingDiskANN index supports filtered indexes on `smallint[]` columns. Labels are indexed alongside vectors, enabling efficient fi
skills/postgres/references/postgres-database-migration.md
- Network accessline 431
The safest way to test a migration is to run it against a copy of your actual database — same schema, same data, same edge cases. Providers such as [Neon](https://neon.tech) support fast database forking. Without database forking, you need - Network accessline 448
**Limitation:** fork-based testing runs your migration in isolation — it won't catch issues caused by concurrent database traffic (e.g., lock contention under load, deadlocks with concurrent writes, or replication lag from heavy WAL generat
skills/postgres/references/postgres-hybrid-text-search.md
- Network accessline 27
This guide covers combining [pg_textsearch](https://github.com/timescale/pg_textsearch) (BM25) with [pgvector](https://github.com/pgvector/pgvector). Requires both extensions. For high-volume setups, filtering, or advanced pgvector tuning ( - Network accessline 66
- **Negative scores**: The `<@>` operator returns negative values where lower = better match. RRF uses rank position, so this doesn't affect fusion. - **Language config**: Change `text_config` to match your content language (e.g., `'french' - Network accessline 67
- **Language config**: Change `text_config` to match your content language (e.g., `'french'`, `'german'`). See [PostgreSQL text search configurations](https://www.postgresql.org/docs/current/textsearch-configuration.html). - Access to secretsline 206
[Credential-related source omitted] - Network accessline 230
For large datasets (10M+ vectors) or workloads with selective metadata filters, consider [pgvectorscale](https://github.com/timescale/pgvectorscale)'s StreamingDiskANN index instead of HNSW for the semantic search component. - Network accessline 263
See the [pgvectorscale documentation](https://github.com/timescale/pgvectorscale) for more details on filtered indexes and tuning parameters.
skills/timescaledb-hyperfunctions/SKILL.md
- Network accessline 374
Use the `search_docs` tool with source `tiger` (for example "hyperfunctions counter_agg") for full signatures and newer functions. Source: https://github.com/timescale/timescaledb-toolkit
How the signals fit together
Facts from a static read of the files at the pinned commit. They describe what the code does, not why.
Some files could not be read; the facts below still hold.
No combined signals at this commit.
Works with
| Agent | Status | Evidence | Install to |
|---|---|---|---|
| Claude Code | Native | Manifest .claude-plugin/marketplace.json | .claude/skills/<skill-name>/ |
| Codex | Compatible | Standard SKILL.md skills/design-postgis-tables/SKILL.md | .agents/skills/<skill-name>/ |
| Cursor | Compatible | Standard SKILL.md skills/design-postgis-tables/SKILL.md | .cursor/skills/<skill-name>/ |
| Gemini CLI | Compatible | Standard SKILL.md skills/design-postgis-tables/SKILL.md | .gemini/skills/<skill-name>/ |
| GitHub Copilot | Compatible | Standard SKILL.md skills/design-postgis-tables/SKILL.md | .github/skills/<skill-name>/ |
| OpenCode | Compatible | Standard SKILL.md skills/design-postgis-tables/SKILL.md | .opencode/skills/<skill-name>/ |
- Native The repository ships a manifest, folder or frontmatter field for this agent.
- Compatible A standard SKILL.md that this agent can read.
- Unknown No evidence either way.
Derived automatically from paths, manifests and frontmatter. Not tested on each agent.
Explore alternatives and comparisons
Add this badge to your README
It updates every night and links to this page.
[](https://hotskills.dev/skill/timescale-pg-aiguide/)