postgres-code-review — скилл для Claude Code: проверка PostgreSQL
Скилл postgres-code-review проверяет SQL, схемы и код работы с PostgreSQL: ищет проблемы с индексами, JSONB, соединениями и транзакциями. Подключайте его при ревью изменений в базе.
Apache-2.0 158 установок ★ 89 обновлён 2026-09-15
npx skills add existential-birds/beagle --skill postgres-code-review -a claude-codeЧто делает postgres-code-review
Скилл проходит по запросам и схемам, проверяя индексы для WHERE и JOIN, порядок столбцов в составных индексах и выбор операторов JSONB. Он также смотрит, как настроен пул соединений, освобождаются ли соединения и подходит ли уровень изоляции транзакций. Проверяет и параметризацию запросов на риск SQL-инъекции.
Перед выводами скилл просит указать пути к проверяемому коду. Замечания о производительности должны ссылаться на конкретный SQL или схему, а риск инъекции — на способ передачи значений. Затем он предлагает открыть подходящий файл из references/ и пройти чек-лист. Для каждого вывода нужны ссылки на код: без них ревью не соответствует заданным проверкам.
Установка через npx skills add existential-birds/beagle --skill postgres-code-review -a claude-code; файл скилла находится в ~/.claude/skills/postgres-code-review/SKILL.md.
Какие задачи решает
- найти запросы без подходящих индексов
- проверить операторы и индексы для JSONB
- обнаружить утечки соединений и ошибки настройки пула
- оценить изоляцию транзакций и риск взаимоблокировок
- проверить, передаются ли значения SQL-запросам как параметры
Примеры запросов агенту
- Проверь запросы и миграции на проблемы с индексами.
- Посмотри, правильно ли используются JSONB-операторы и индексы.
- Проверь управление соединениями и транзакциями на утечки и взаимоблокировки.
Как установить postgres-code-review
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill postgres-code-review -a claude-code2Вручную: положить файлы
~/.claude/skills/postgres-code-review/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/postgres-code-review/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill postgres-code-review -a codex2Вручную: положить файлы
.agents/skills/postgres-code-review/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill postgres-code-review -a cursor2Вручную: положить файлы
.cursor/skills/postgres-code-review/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-python/skills/postgres-code-review2Вручную: положить файлы
.github/skills/postgres-code-review/SKILL.md1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill postgres-code-review -a gemini-cli2Командой платформы
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-python/skills/postgres-code-reviewВручную: положить файлы
.devin/skills/postgres-code-review/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill postgres-code-review -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о postgres-code-review
Как установить postgres-code-review в Claude Code?
Выполните npx skills add existential-birds/beagle --skill postgres-code-review -a claude-code. Файл скилла находится по пути ~/.claude/skills/postgres-code-review/SKILL.md.
Что делает postgres-code-review?
Проверяет SQL, схемы PostgreSQL и код управления соединениями. Ищет проблемы с индексами, JSONB, безопасностью запросов и транзакциями.
Как скилл подтверждает замечания о производительности?
Он требует указать конкретный SQL-запрос или схему для замечаний об индексах, последовательном сканировании и JSONB. Риск SQL-инъекции нужно связать с найденным способом объединения запроса и значений.
Исходный текст
SKILL.md · Apache-2.0
--- name: postgres-code-review description: Reviews PostgreSQL code for indexing strategies, JSONB operations, connection pooling, and transaction safety. Use when reviewing SQL queries, database schemas, JSONB usage, or connection management. --- # PostgreSQL Code Review ## Quick Reference | Issue Type | Reference | |------------|-----------| | Missing indexes, wrong index type, query performance | [references/indexes.md](references/indexes.md) | | JSONB queries, operators, GIN indexes | [references/jsonb.md](references/jsonb.md) | | Connection leaks, pool configuration, timeouts | [references/connections.md](references/connections.md) | | Isolation levels, deadlocks, advisory locks | [references/transactions.md](references/transactions.md) | ## Review Checklist - [ ] WHERE/JOIN columns have appropriate indexes - [ ] Composite indexes match query patterns (column order matters) - [ ] JSONB columns use GIN indexes when queried - [ ] Using proper JSONB operators (`->`, `->>`, `@>`, `?`) - [ ] Connection pool configured with appropriate limits - [ ] Connections properly released (context managers, try/finally) - [ ] Appropriate transaction isolation level for use case - [ ] No long-running transactions holding locks - [ ] Advisory locks used for application-level coordination - [ ] Queries use parameterized statements (no SQL injection) ## Gates (before reporting findings) Use this sequence so conclusions stay evidence-bound (not “I checked mentally”): 1. **Scope** — Record the concrete paths (and line ranges or symbols if helpful) for the SQL, DDL/migrations, and connection code under review. **Pass:** every subsystem you critique (queries, JSONB, pool, transactions) has at least one cited path. 2. **SQL/DDL citation for performance claims** — Index, sequential-scan, JSONB-operator, and plan-related findings must point to the exact statement or schema (quoted excerpt or `file:line`). **Pass:** each such finding includes that citation. 3. **Binding check before injection flags** — Only assert SQL-injection risk after locating how SQL and values are combined (bound parameters vs string concat/format/f-strings). **Pass:** you name the mechanism you saw in code for each flagged callsite. Then load the relevant reference doc from [Quick Reference](#quick-reference) and walk the [Review Checklist](#review-checklist). ## When to Load References - Reviewing SELECT queries with WHERE/JOIN → indexes.md - Reviewing JSONB columns or JSON operations → jsonb.md - Reviewing database connection code → connections.md - Reviewing BEGIN/COMMIT or concurrent updates → transactions.md ## Review Questions 1. Will this query use an index or perform a sequential scan? 2. Are JSONB operations using appropriate operators and indexes? 3. Are database connections properly managed and released? 4. Is the transaction isolation level appropriate for this operation? 5. Could this cause deadlocks or long-running locks?
© existential-birds · Apache-2.0 · existential-birds/beagle