postgres · timescale — скилл для Claude Code: работа с PostgreSQL
Скилл для работы с PostgreSQL: проектирование таблиц, индексы, pgvector, PostGIS, TimescaleDB и миграции. Пригодится, когда агент пишет SQL вслепую.
npx skills add timescale/pg-aiguide --skill postgres -a claude-codeЧто делает postgres
Скилл разбит на отдельные справочники, и агент подгружает нужный по задаче. Для существующей базы есть schema-exploration — чтение схем, таблиц, представлений, триггеров, RLS и расширений через pg_catalog. Дальше по списку: design-postgres-tables для типов, ограничений, индексов, JSONB и партиционирования, design-postgis-tables для геометрии, SRID и пространственных индексов.
Поиск закрывают два справочника: pgvector-semantic-search про индексы HNSW и IVFFlat, хранение halfvec, квантование и фильтрованный поиск, и postgres-hybrid-text-search про сочетание BM25 с векторным поиском через RRF. Для TimescaleDB есть создание гипертаблиц со сжатием и политиками хранения, поиск кандидатов на конвертацию и пошаговая миграция. Отдельный справочник — postgres-database-migration: блокировки DDL, безопасные паттерны, таймауты, план отката.
Задачи бывают составные, и тогда агент грузит несколько справочников сразу. Скилл не подключается к вашей базе сам: он даёт агенту инструкции и SQL-паттерны, а доступ к серверу вы настраиваете отдельно. Если в проекте нет PostgreSQL, ставить нечего.
Какие задачи решает
- разобраться в незнакомой схеме перед правками
- выбрать тип данных и ограничения для новой таблицы
- настроить векторный поиск по эмбеддингам
- собрать гибридный поиск из ключевых слов и смысла
- перевести обычную таблицу в гипертаблицу TimescaleDB
Примеры запросов агенту
- Изучи схему базы в
pg_catalogи покажи связи между таблицами заказов - Спроектируй таблицу для хранения эмбеддингов с индексом HNSW
- Составь план миграции этой таблицы в гипертаблицу без блокировок
Как установить postgres
1Через Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a claude-code2Вручную: положить файлы
~/.claude/skills/postgres/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/postgres/
1Через Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a codex2Вручную: положить файлы
.agents/skills/postgres/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a cursor2Вручную: положить файлы
.cursor/skills/postgres/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install timescale/pg-aiguide postgres2Вручную: положить файлы
.github/skills/postgres/SKILL.md1Через Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a gemini-cli2Командой платформы
gemini skills install https://github.com/timescale/pg-aiguide --path skills/postgresВручную: положить файлы
.devin/skills/postgres/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add timescale/pg-aiguide --skill postgres -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о postgres
Как установить postgres в Claude?
Выполните npx skills add timescale/pg-aiguide --skill postgres -a claude-code. Скилл появится в ~/.claude/skills/postgres/SKILL.md.
Что делает скилл postgres?
Даёт агенту справочники по проектированию таблиц, индексам, pgvector, PostGIS, TimescaleDB и миграциям. Агент подгружает нужный файл под конкретную задачу.
Скилл сам подключается к базе?
Нет. Он даёт инструкции и SQL-паттерны, а доступ к серверу PostgreSQL вы настраиваете отдельно.
Исходный текст
SKILL.md · Apache-2.0
--- name: postgres description: | 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 license: Apache-2.0 metadata: author: tigerdata --- # 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.** ### Search - **[pgvector-semantic-search](references/pgvector-semantic-search.md)** — Vector similarity search with pgvector: HNSW/IVFFlat indexes, halfvec storage, quantization, filtered search, and tuning. **Use for embeddings, RAG, or semantic search.** - **[postgres-hybrid-text-search](references/postgres-hybrid-text-search.md)** — Hybrid search combining BM25 keyword search with pgvector semantic search using RRF. **Use when combining keyword and meaning-based search.** ### TimescaleDB - **[setup-timescaledb-hypertables](references/setup-timescaledb-hypertables.md)** — Hypertable creation, compression, retention policies, continuous aggregates, and indexes. **Use when setting up TimescaleDB from scratch.** - **[find-hypertable-candidates](references/find-hypertable-candidates.md)** — SQL queries to analyze existing tables and score them for hypertable conversion. **Use when evaluating which tables to migrate.** - **[migrate-postgres-tables-to-hypertables](references/migrate-postgres-tables-to-hypertables.md)** — Step-by-step migration: partition column selection, in-place vs blue-green, validation. **Use when executing a migration.** ### Migrations - **[postgres-database-migration](references/postgres-database-migration.md)** — DDL lock reference, safe migration patterns, timeout strategies, rollback planning, and fork-based testing. **Use when planning or executing schema changes on production databases.** ## How to Use 1. Identify which reference matches the user's task from the descriptions above. 2. Load the reference file to get detailed instructions and SQL patterns. 3. For tasks spanning multiple areas (e.g., "design a table with vector search"), load multiple references as needed.
© tigerdata · Apache-2.0 · timescale/pg-aiguide
Похожие скиллы
Все скиллы по теме «Данные и базы» →Сначала — postgres от других авторов.