К основному содержанию
плагин

clickhouse-best-practices — плагин Claude Code: правила и установка

Плагин добавляет агенту правила для проектирования схем ClickHouse, оптимизации запросов и загрузки данных. Пригодится во время работы с таблицами и аналитическими запросами.

Установить в Claude Code · Через маркетплейс плагинов Все способы и платформы ↓
/plugin install clickhouse-best-practices@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-community
/plugin install clickhouse-best-practices@claude-community
/plugin marketplace add anthropics/claude-plugins-official
Открыть на GitHub

Что делает clickhouse-best-practices

clickhouse-best-practices добавляет в Claude Code 28 правил для ClickHouse. Они охватывают выбор первичного ключа и типов данных, JOIN, пакетную вставку, мутации, партиционирование, пропускающие индексы, материализованные представления, асинхронные вставки, OPTIMIZE и JSON. Правила расставлены по влиянию: от CRITICAL до MEDIUM.

Скилл активируется автоматически, когда вы создаёте таблицы, пишете запросы или проектируете поток загрузки данных. Поэтому рекомендации появляются в контексте задачи, а не отдельным справочником. Плагин рассчитан на работу с ClickHouse.

Без ClickHouse в задаче эти правила не дадут полезного контекста. Установка выполняется через официальный marketplace Claude Code.

Какие задачи решает

  • выбрать первичный ключ для таблицы ClickHouse
  • подобрать типы данных для схемы
  • оптимизировать JOIN и запросы
  • спроектировать пакетную загрузку данных
  • решить, где применять партиционирование и материализованные представления

Примеры запросов агенту

  • Спроектируй таблицу ClickHouse для событий и объясни выбор первичного ключа.
  • Проверь этот запрос ClickHouse и предложи оптимизацию JOIN.
  • Подскажи схему загрузки данных в ClickHouse с учётом пакетных вставок.

Как установить clickhouse-best-practices

Через маркетплейс плагинов

/plugin install clickhouse-best-practices@claude-plugins-official
/plugin marketplace add anthropics/claude-plugins-community
/plugin install clickhouse-best-practices@claude-community
/plugin marketplace add anthropics/claude-plugins-official

По шагам, с командами для каждой платформы: Плагины Claude Code: маркетплейсы, установка и как собрать свой

Вопросы о clickhouse-best-practices

Как установить clickhouse-best-practices в Claude Code?

Добавьте официальный marketplace командой /plugin marketplace add anthropics/claude-plugins-official, затем установите плагин: /plugin install clickhouse-best-practices@claude-plugins-official.

Что делает clickhouse-best-practices?

Плагин даёт Claude Code 28 правил для схем ClickHouse, запросов и загрузки данных. Правила упорядочены по влиянию и применяются автоматически в подходящем контексте.

Когда активируется clickhouse-best-practices?

Скилл включается при создании таблиц, написании запросов и проектировании потоков загрузки данных в ClickHouse.

Исходный текст

SKILL.md · Apache-2.0
# ClickHouse Agent Skills

The official Agent Skills for [ClickHouse](https://clickhouse.com/). These skills help LLMs and agents to adopt best practices when working with ClickHouse and [chdb](https://clickhouse.com/docs/chdb) (in-process ClickHouse for Python).

You can use these skills with open-source ClickHouse and managed ClickHouse Cloud. [Try ClickHouse Cloud with $300 in free credits](https://clickhouse.com/cloud?utm_medium=github&utm_source=github&utm_ref=agent-skills).

## Installation

### npx

```bash
npx skills add clickhouse/agent-skills
```
The CLI auto-detects installed agents and prompts you to select where to install.

### clickhousectl

Use the ClickHouse CLI [`clickhousectl`](https://github.com/ClickHouse/clickhousectl) to install the agent skills:

```bash
clickhousectl skills
```

## What is this?

Agent Skills are packaged instructions that extend AI coding agents (Claude Code, Cursor, Copilot, etc.) with domain-specific expertise. This repository provides skills for ClickHouse databases and chdb — covering schema design, query optimization, data ingestion patterns, and in-process analytics with Python.

When an agent loads these skills, it gains knowledge of ClickHouse best practices and chdb APIs, and can apply them while helping you design tables, write queries, analyze data, or troubleshoot performance issues.

Skills follow the open specification at [agentskills.io](https://agentskills.io).

## Available Skills

### ClickHouse Best Practices

**28 rules** covering schema design, query optimization, and data ingestion—prioritized by impact.

| Category | Rules | Impact |
|----------|-------|--------|
| Primary Key Selection | 4 | CRITICAL |
| Data Type Selection | 5 | CRITICAL |
| JOIN Optimization | 5 | CRITICAL |
| Insert Batching | 1 | CRITICAL |
| Mutation Avoidance | 2 | CRITICAL |
| Partitioning Strategy | 4 | HIGH |
| Skipping Indices | 1 | HIGH |
| Materialized Views | 2 | HIGH |
| Async Inserts | 2 | HIGH |
| OPTIMIZE Avoidance | 1 | HIGH |
| JSON Usage | 1 | MEDIUM |

**Location:** [`skills/clickhouse-best-practices/`](./skills/clickhouse-best-practices/)

**For humans:** Read [SKILL.md](./skills/clickhouse-best-practices/SKILL.md) for an overview, or [AGENTS.md](./skills/clickhouse-best-practices/AGENTS.md) for the complete compiled guide.

**For agents:** The skill activates automatically when you work with ClickHouse—creating tables, writing queries, or designing data pipelines.

### ClickHouse Architecture Advisor

**5 decision frameworks** covering workload-aware architecture decisions for real-time ClickHouse deployments.

| Decision Area | Impact |
|---------------|--------|
| Ingestion Strategy | CRITICAL |
| Join & Enrichment Patterns | CRITICAL |
| Late-Arriving Data & Upserts | CRITICAL |
| Time-Series Partitioning | HIGH |
| Real-Time Pre-Aggregation | HIGH |

Complements `clickhouse-best-practices` by answering *when*, *why*, and *how* — not just *what*. All recommendations are explicitly classified as `official`, `derived`, or `field` guidance.

**Location:** [`skills/clickhouse-architecture-advisor/`](./skills/clickhouse-architecture-advisor/)

**For humans:** Read [SKILL.md](./skills/clickhouse-architecture-advisor/SKILL.md) for an overview, or [AGENTS.md](./skills/clickhouse-architecture-advisor/AGENTS.md) for the compiled guide.

**For agents:** The skill activates during architecture design sessions — when choosing ingestion patterns, designing time-series schemas, selecting enrichment strategies, or handling mutable state.

### ClickHouse JS Node Troubleshooting

**Troubleshooting guide** for the ClickHouse Node.js client (`@clickhouse/client`). Covers common failure modes including socket hang-up / `ECONNRESET`, Keep-Alive misconfiguration, data type mismatches, read-only user restrictions, proxy / pathname URL confusion, TLS certificate errors, compression issues, logging setup, and query parameter interpolation.

**Location:** [`skills/clickhouse-js-node-troubleshooting/`](./skills/clickhouse-js-node-troubleshooting/)

**For agents:** The skill activates when users report errors, unexpected behavior, or configuration questions involving the ClickHouse Node.js client — including vague symptoms like "my inserts keep failing" or "connection drops randomly" in a Node.js context. Not used for browser/Web client issues.

### chdb DataStore

**Pandas-compatible API** for chdb — drop-in pandas replacement backed by ClickHouse. Write `import chdb.datastore as pd` and use the same pandas API, 10-100x faster. Supports 16+ data sources (MySQL, PostgreSQL, S3, MongoDB, Iceberg, Delta Lake, etc.) with cross-source joins.

**Location:** [`skills/chdb-datastore/`](./skills/chdb-datastore/)

**For agents:** The skill activates when you analyze data with pandas-style syntax, speed up slow pandas code, query remote databases as DataFrames, or join data across different sources.

### chdb SQL

**In-process ClickHouse SQL** for Python — run SQL queries on local files, remote databases, and cloud storage without a server. Covers `chdb.query()`, Session, DB-API 2.0, parametrized queries, UDFs, streaming, and all ClickHouse table functions.

**Location:** [`skills/chdb-sql/`](./skills/chdb-sql/)

**For agents:** The skill activates when you write SQL queries against files, use ClickHouse table functions, build stateful analytical pipelines, or use advanced ClickHouse SQL features.

### Infra ClickHouse

**Local and cloud workflows** for running ClickHouse with [`clickhousectl`](https://github.com/ClickHouse/clickhousectl). The top-level `SKILL.md` is a decision tree that routes to the right reference: [`ref/local.md`](./skills/infra-clickhouse/ref/local.md) for local development (install ClickHouse, start a server, create schemas, seed data) and [`ref/cloud.md`](./skills/infra-clickhouse/ref/cloud.md) for ClickHouse Cloud (authenticate, create a service, migrate schemas, connect an application). The local workflow hands off to cloud when going to production. Supersedes `clickhousectl-local-dev` and `clickhousectl-cloud-deploy`.

**Location:** [`skills/infra-clickhouse/`](./skills/infra-clickhouse/)

**For agents:** The skill activates when a user wants to build an application with ClickHouse, set up a local development environment, deploy to production, or manage a ClickHouse Cloud service.

### Infra Postgres

**Local and cloud workflows** for running Postgres with [`clickhousectl`](https://github.com/ClickHouse/clickhousectl). The top-level `SKILL.md` is a decision tree that routes to the right reference: [`ref/local.md`](./skills/infra-postgres/ref/local.md) for local Docker-backed Postgres development (start, psql client, `.env` wiring, lifecycle) and [`ref/cloud.md`](./skills/infra-postgres/ref/cloud.md) for managed ClickHouse Cloud Postgres services (beta) — authentication, service creation, connections and TLS, runtime configuration, read replicas, failover, and point-in-time restore. [`ref/migrate.md`](./skills/infra-postgres/ref/migrate.md) migrates an existing Postgres (Neon, Supabase, RDS, ...) into ClickHouse Cloud Postgres with `pg_dump`/`pg_restore`. The local workflow hands off to cloud when going to production.

**Location:** [`skills/infra-postgres/`](./skills/infra-postgres/)

**For agents:** The skill activates when a user wants to set up a local Postgres for development, connect an application to Postgres, or create and manage a managed Postgres service in ClickHouse Cloud.

### ClickStack OTel Collector

**Step-by-step workflow** for wiring an OpenTelemetry collector into a Managed ClickStack service on ClickHouse Cloud. Covers deploying a new local collector (Docker run or Docker Compose) or configuring an existing collector, creating a dedicated ingest SQL user, sending rich synthetic telemetry, and verifying the data is visible in ClickStack.

**Location:** [`skills/clickstack-otel-collector/`](./skills/clickstack-otel-collector/)

**For agents:** The skill activates when a user wants to connect an OpenTelemetry collector to a Managed ClickStack service, send telemetry (logs, traces, metrics) into ClickStack, or verify their observability data pipeline end-to-end.

## Quick Start

After installation, your AI agent will reference these skills when:

- Creating new tables with `CREATE TABLE`
- Choosing `ORDER BY` / `PRIMARY KEY` columns
- Selecting data types for columns
- Optimizing slow queries
- Writing or tuning JOINs
- Designing data ingestion pipelines
- Handling updates or deletes
- Analyzing data with pandas-style DataStore API
- Querying files or databases with chdb SQL
- Joining data across different sources (MySQL + S3 + local files)
- Setting up a local ClickHouse development environment or deploying to ClickHouse Cloud with `clickhousectl`
- Setting up a local Postgres or a managed ClickHouse Cloud Postgres service with `clickhousectl`
- Wiring an OpenTelemetry collector into Managed ClickStack

Example prompts:
> "Create a table for storing user events with fields for user_id, event_type, properties (JSON), and timestamp"

The agent will apply relevant ClickHouse best practices rules.

> "Load this Parquet file and group by country, show top 10 by revenue"

The agent will use chdb DataStore or SQL to query the file directly.

> "Join my MySQL customers table with this local orders.parquet file"

The agent will use chdb's cross-source join capabilities.

## Supported Agents

Skills are **agent-agnostic**—the same skill works across all supported AI coding assistants:

| Agent | Config Directory |
|-------|------------------|
| [Claude Code](https://claude.ai/code) | `.claude/skills/` |
| [Cursor](https://cursor.sh) | `.cursor/skills/` |
| [Windsurf](https://codeium.com/windsurf) | `.windsurf/skills/` |
| [GitHub Copilot](https://github.com/features/copilot) | `.github/skills/` |
| [Gemini CLI](https://github.com/google-gemini/gemini-cli) | `.gemini/skills/` |
| [Cline](https://github.com/cline/cline) | `.cline/skills/` |
| [Codex](https://openai.com/codex) | `.codex/skills/` |
| [Goose](https://github.com/block/goose) | `.goose/skills/` |
| [Roo Code](https://roo.ai) | `.roo/skills/` |
| [OpenHands](https://github.com/All-Hands-AI/OpenHands) | `.openhands/skills/` |

And 13 more including Amp, Kiro CLI, Trae, Zencoder, and others.

The installer detects which agents you have by checking for their configuration directories. If an agent isn't listed, either install it first or create its config directory manually (e.g., `mkdir -p ~/.cursor`).

## License

Apache 2.0 — see [LICENSE](./LICENSE) for details.

© ClickHouse Inc · Apache-2.0 · ClickHouse/agent-skills

Похожие плагины

Все плагины по теме «Данные и базы» →
clickhouse ClickHouse Подключает Claude к базам ClickHouse Cloud: просмотр схем, read-only SQL-запросы и правила по работе с ClickHouse. ★ 7звёзд репо clickhouse-io affaan-m Справочник архитектурных шаблонов и оптимизации ClickHouse: помогает проектировать таблицы на движках MergeTree и ускорять медленные аналитические запросы. CX Codex +1 4 500установок design-postgres-tables tigerdata Скилл-справочник по проектированию таблиц PostgreSQL: типы данных, индексы, ограничения, JSONB и партиционирование. Пригодится, когда агент создаёт или меняет схему. CX Codex +1 613установок sql-pro https://github.com/Jeffallan Оптимизирует медленные SQL-запросы, проектирует схемы баз данных и устраняет проблемы производительности. Пригодится при разборе планов EXPLAIN и миграции диалектов. CX Codex +1 6 400установок mysql-best-practices Mindrally Скилл задаёт агенту правила проектирования схем MySQL, индексов и оптимизации запросов. Пригодится, когда агент пишет миграции или разбирает медленный запрос. CX Codex +1 2 700установок postgresql-best-practices Mindrally Скилл с правилами разработки на PostgreSQL: типы данных, схема, индексы, разбор планов запросов и обслуживание базы. CX Codex +1 1 500установок

Из того же набора9

clickhouse-best-practices Скилл с набором правил для проверки схем, запросов и конфигураций ClickHouse. Помогает агентам избежать типичных ошибок в дизайне таблиц, оптимизации JOIN и батчировании данных. CX Codex +1 21 700установок clickhouse-architecture-advisor Помогает спроектировать архитектуру ClickHouse под конкретный тип нагрузки: от стратегии вставки до партиционирования. Дополняет clickhouse-best-practices ссылками на документацию. CX Codex +1 9 800установок chdb-sql Скилл учит агента писать аналитический SQL по parquet, CSV, S3 и удалённым базам через chDB — это ClickHouse, встроенный в процесс Python, сервер поднимать не нужно. CX Codex +1 8 900установок chdb-datastore Скилл учит агента ускорять код на pandas через chDB и движок ClickHouse. Пригодится для тяжёлых выборок, паркета и объединения разных баз данных. CX Codex +1 7 900установок clickhouse-js-node-troubleshooting Помогает находить и устранять сбои в Node.js-клиенте @clickhouse/client: обрывы сокетов, ошибки типов данных и проблемы с TLS. CX Codex +1 7 600установок clickhouse-js-node-coding Помогает агенту писать код с пакетом @clickhouse/client: подключение, вставка строк, выборки, параметры запросов. CX Codex +1 7 000установок clickhouse-managed-postgres-rca Ищет причины просадки производительности ClickHouse-managed Postgres по метрикам Prometheus и Slow Query Patterns, предлагая исправления без их применения. CX Codex +1 6 600установок clickhouse-js-node-rowbinary Генерирует TypeScript и JavaScript для чтения и записи потоков ClickHouse RowBinary в Node.js. Нужен при работе с двоичным HTTP-форматом таблиц. CX Codex +1 6 400установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой