Token导航 LogoToken导航

Agent Skill · 运维和基础设施

clickhouse-architect(CLIckhouse 建筑师)

clickhouse-architect 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

clickhouse-architect 是运维和基础设施类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在运维和基础设施类的 2,449 个 Skill 里排第 566。

总安装 2,619周安装 107GitHub Stars 38下载 847核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:clickhouse-architect(CLIckhouse 建筑师)
来源仓库:https://github.com/terrylica/cc-skills
仓库路径:skills/clickhouse-architect
安装命令:
npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-architect
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-architect

这个 Skill 是做什么的

运维和基础设施类 Skill 处理部署、监控、日志和云资源,多数需要较高的执行权限。

clickhouse-architect 用于 ClickHouse 表结构设计、压缩算法选择与性能优化。它覆盖 SharedMergeTree 和 ReplicatedMergeTree 部署场景,提供结构化建表建议。

使用时需指定工作负载类型(如 OLAP、IoT 或金融数据),工具将推荐合适的 ORDER BY 键和压缩策略。安装前应检查仓库维护状态,避免使用已弃用的参数或配置方式。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/clickhouse-architect

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-archite…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

clickhouse-architect 怎么安装?

在终端执行 npx skills add https://github.com/terrylica/cc-skills --skill clickhouse-architect。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

clickhouse-architect 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

clickhouse-architect 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

clickhouse-architect 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

clickhouse-architect 用的人多吗?

公开数据是累计安装 2,619 次,近一周安装 107 次,下载 847 次,GitHub 38 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

clickhouse-architect 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理运维和基础设施类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

运维和基础设施类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
brainstorming

头脑风暴 · Codex、Claude

3,148,776173,131操作浏览器MIT通过
copywriting

文案写作 · Codex、Claude

1,996,72425,583需要联网MIT通过
openclaw-secure-linux-cloud

OpenClaw secure linux cloud 命令行 · Codex、Claude

1,853,08840接触敏感数据未明确未通过
xget

xget 命令行 · Codex、Claude

1,799,28040执行命令未明确未通过
requesting-code-review

代码审查请求 · Codex、Claude

1,590,144173,103权限未标注MIT通过
clickhouse-architect

CLIckhouse 建筑师 · 本页

2,61938接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

ClickHouse Architect

Prescriptive schema design, compression selection, and performance optimization for ClickHouse (v24.4+). Covers both ClickHouse Cloud (SharedMergeTree) and self-hosted (ReplicatedMergeTree) deployments.

Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.

When to Use This Skill

Use this skill when:

  • Designing ClickHouse table schemas with ORDER BY key selection
  • Selecting compression codecs for column types
  • Configuring partition keys for data lifecycle management
  • Adding performance accelerators (projections, indexes, dictionaries)
  • Auditing and optimizing existing ClickHouse schemas

Core Methodology

Schema Design Workflow

Follow this sequence when designing or reviewing ClickHouse schemas:

  1. Define ORDER BY key (3-5 columns, lowest cardinality first)
  2. Select compression codecs per column type
  3. Configure PARTITION BY for data lifecycle management
  4. Add performance accelerators (projections, indexes)
  5. Validate with audit queries (see scripts/)
  6. Document with COMMENT statements — ClickHouse table and column COMMENTs are the single source of truth (SSoT) for what each column means, how it was computed, and what constraints apply. No external doc, skill, or wiki supersedes the COMMENT. See references/schema-documentation.md

ORDER BY Key Selection

The ORDER BY clause is the most critical decision in ClickHouse schema design.

Rules:

  • Limit to 3-5 columns maximum (each additional column has diminishing returns)
  • Place lowest cardinality columns first (e.g., tenant_id before timestamp)
  • Include all columns used in WHERE clauses for range queries
  • PRIMARY KEY must be a prefix of ORDER BY (or omit to use full ORDER BY)

Example:

-- Correct: Low cardinality first, 4 columns
CREATE TABLE trades (
    exchange LowCardinality(String),
    symbol LowCardinality(String),
    timestamp DateTime64(3),
    trade_id UInt64,
    price Float64,
    quantity Float64
) ENGINE = MergeTree()
ORDER BY (exchange, symbol, timestamp, trade_id);

-- Wrong: High cardinality first (10x slower queries)
ORDER BY (trade_id, timestamp, symbol, exchange);

Compression Codec Quick Reference

Column TypeDefault CodecRead-Heavy AlternativeExample
DateTime/DateTime64CODEC(DoubleDelta, ZSTD)CODEC(DoubleDelta, LZ4)timestamp DateTime64(3) CODEC(DoubleDelta, ZSTD)
Float prices/gaugesCODEC(Gorilla, ZSTD)CODEC(Gorilla, LZ4)price Float64 CODEC(Gorilla, ZSTD)
Integer countersCODEC(T64, ZSTD)—count UInt64 CODEC(T64, ZSTD)
Slowly changing integersCODEC(Delta, ZSTD)CODEC(Delta, LZ4)version UInt32 CODEC(Delta, ZSTD)
String (low cardinality)LowCardinality(String)—status LowCardinality(String)
General dataCODEC(ZSTD(3))CODEC(LZ4)Default compression level 3

When to use LZ4 over ZSTD: LZ4 provides 1.76x faster decompression. Use LZ4 for read-heavy workloads with monotonic sequences (timestamps, counters). Use ZSTD (default) when compression ratio matters or data patterns are unknown.

Note on codec combinations:

Delta/DoubleDelta + Gorilla combinations are blocked by default (allow_suspicious_codecs) because Gorilla already performs implicit delta compression internally—combining them is redundant, not dangerous. A historical corruption bug (PR #45615, Jan 2023) was fixed, but the blocking remains as a best practice guardrail.

Use each codec family independently for its intended data type:

-- Correct usage
price Float64 CODEC(Gorilla, ZSTD)              -- Floats: use Gorilla
timestamp DateTime64 CODEC(DoubleDelta, ZSTD)   -- Timestamps: use DoubleDelta
timestamp DateTime64 CODEC(DoubleDelta, LZ4)    -- Read-heavy: use LZ4

PARTITION BY Guidelines

PARTITION BY is for data lifecycle management, NOT query optimization.

Rules:

  • Partition by time units (month, week) for TTL and data management
  • Keep partition count under 1000 total across all tables
  • Each partition should contain 1-300 parts maximum
  • Never partition by high-cardinality columns

Example:

-- Correct: Monthly partitions for TTL management
PARTITION BY toYYYYMM(timestamp)

-- Wrong: Daily partitions (too many parts)
PARTITION BY toYYYYMMDD(timestamp)

-- Wrong: High-cardinality partition key
PARTITION BY user_id

Anti-Patterns Checklist (v24.4+)

PatternSeverityModern StatusFix
Too many parts (>300/partition)CriticalStill criticalReduce partition granularity
Small batch inserts (<1000)CriticalStill criticalBatch to 10k-100k rows
High-cardinality first ORDER BYCriticalStill criticalReorder: lowest cardinality first
No memory limitsHighStill criticalSet max_memory_usage
Denormalization overuseHighStill criticalUse dictionaries + materialized views
Large JOINsMedium180x improvedStill avoid for ultra-low-latency
Mutations (UPDATE/DELETE)Medium1700x improvedUse lightweight UPDATEs (v24.4+); see DELETE Strategy Guide below

DELETE Strategy Guide (v13.49.0+ Best Practices)

Choose the right DELETE strategy based on scope. Ranked fastest to slowest:

StrategySyntaxSpeedUse When
DROP PARTITIONALTER TABLE t DROP PARTITION (key1, key2, keyN)Instant (metadata-only)Purge entire partition ranges (months, corrupt data, test data)
DELETE IN PARTITIONALTER TABLE t DELETE IN PARTITION (...) WHERE conditionFast (scans 1 partition)Targeted row removal within a known partition
ALTER TABLE DELETEALTER TABLE t DELETE WHERE conditionSlow (scans all parts)Fallback when partition is unknown
DELETE FROM (lightweight)DELETE FROM t WHERE conditionVariableANTI-PATTERN for write pipelines — see warning below

Anti-pattern: Lightweight DELETE FROM before INSERT

DELETE FROM sets _row_exists=0 masks instead of physically removing rows. These ghost rows:

  • Persist until ClickHouse background merge (unpredictable timing)
  • Show up in queries without FINAL as phantom data
  • Cause false anomalies in monitoring/integrity checks
  • Were the root cause of months of phantom Stathera gaps in production (opendeviationbar #269)

Use DELETE FROM only for: ad-hoc data correction where ghost rows don't matter (analytics cleanup, dev/test). Never use in write pipelines where INSERT follows DELETE.

All DELETE mutations should use: SETTINGS mutations_sync = 1 to block until completion (prevents INSERT-DELETE race conditions).

Partition-aware DELETE tip: If your partition key includes the columns you're filtering on (e.g., PARTITION BY (symbol, threshold, toYYYYMM(timestamp))), use DELETE IN PARTITION to scope the scan to a single partition instead of scanning all parts.

Table Engine Selection

DeploymentEngineUse Case
ClickHouse CloudSharedMergeTreeDefault for cloud deployments
Self-hosted clusterReplicatedMergeTreeMulti-node with replication
Self-hosted singleMergeTreeSingle-node development/testing

Cloud (SharedMergeTree):

CREATE TABLE trades (...)
ENGINE = SharedMergeTree('/clickhouse/tables/{shard}/trades', '{replica}')
ORDER BY (exchange, symbol, timestamp);

Self-hosted (ReplicatedMergeTree):

CREATE TABLE trades (...)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/trades', '{replica}')
ORDER BY (exchange, symbol, timestamp);

Skill Delegation Guide

This skill is the hub for ClickHouse-related tasks. When the user's needs extend beyond schema design, invoke the related skills below.

Delegation Decision Matrix

User NeedInvoke SkillTrigger Phrases
Create database users, manage permissionsdevops-tools:clickhouse-cloud-management"create user", "GRANT", "permissions", "credentials"
Configure DBeaver, generate connection JSONdevops-tools:clickhouse-pydantic-config"DBeaver", "client config", "connection setup"
Validate schema contracts against live databasequality-tools:schema-e2e-validation"validate schema", "Earthly E2E", "schema contract"

Typical Workflow Sequence

  1. Schema Design (THIS SKILL) → Design ORDER BY, compression, partitioning
  2. User Setup → clickhouse-cloud-management (if cloud credentials needed)
  3. Client Config → clickhouse-pydantic-config (generate DBeaver JSON)
  4. Validation → schema-e2e-validation (CI/CD schema contracts)

Example: Full Stack Request

User: "I need to design a trades table for ClickHouse Cloud and set up DBeaver to query it."

Expected behavior:

  1. Use THIS skill for schema design
  2. Invoke clickhouse-cloud-management for creating database user
  3. Invoke clickhouse-pydantic-config for DBeaver configuration

Performance Accelerators

Projections

Create alternative sort orders that ClickHouse automatically selects:

ALTER TABLE trades ADD PROJECTION trades_by_symbol (
    SELECT * ORDER BY symbol, timestamp
);
ALTER TABLE trades MATERIALIZE PROJECTION trades_by_symbol;

Materialized Views

Pre-compute aggregations for dashboard queries:

CREATE MATERIALIZED VIEW trades_hourly_mv
ENGINE = SummingMergeTree()
ORDER BY (exchange, symbol, hour)
AS SELECT
    exchange,
    symbol,
    toStartOfHour(timestamp) AS hour,
    sum(quantity) AS total_volume,
    count() AS trade_count
FROM trades
GROUP BY exchange, symbol, hour;

Dictionaries

Replace JOINs with O(1) dictionary lookups for large-scale star schemas:

When to use dictionaries (v24.4+):

  • Fact tables with 100M+ rows joining dimension tables
  • Dimension tables 1k-500k rows with monotonic keys
  • LEFT ANY JOIN semantics required

When JOINs are sufficient (v24.4+):

  • Dimension tables <500 rows (JOIN overhead negligible)
  • v24.4+ predicate pushdown provides 8-180x improvements
  • Complex JOIN types (FULL, RIGHT, multi-condition)

Benchmark context: 6.6x speedup measured on Star Schema Benchmark (1.4B rows).

CREATE DICTIONARY symbol_info (
    symbol String,
    name String,
    sector String
)
PRIMARY KEY symbol
SOURCE(CLICKHOUSE(TABLE 'symbols'))
LAYOUT(FLAT())  -- Best for <500k entries with monotonic keys
LIFETIME(3600);

-- Use in queries (O(1) lookup)
SELECT
    symbol,
    dictGet('symbol_info', 'name', symbol) AS symbol_name
FROM trades;

Scripts

Execute comprehensive schema audit:

clickhouse-client --multiquery < scripts/schema-audit.sql

The audit script checks:

  • Part count per partition (threshold: 300)
  • Compression ratios by column
  • Query performance patterns
  • Replication lag (if applicable)
  • Memory usage patterns

Additional Resources

Reference Files

ReferenceContent
references/schema-design-workflow.mdComplete workflow with examples
references/compression-codec-selection.mdDecision tree + benchmarks
references/anti-patterns-and-fixes.md13 deadly sins + v24.4+ status
references/audit-and-diagnostics.mdQuery interpretation guide
references/idiomatic-architecture.mdParameterized views, dictionaries, dedup
references/schema-documentation.mdCOMMENT patterns + naming for AI understanding
references/cache-schema-evolution.mdCache invalidation + schema evolution patterns

External Documentation

Python Driver Policy

Use clickhouse-connect (official) for all Python integrations.

# ✅ RECOMMENDED: clickhouse-connect (official, HTTP)
import clickhouse_connect

client = clickhouse_connect.get_client(
    host='localhost',
    port=8123,  # HTTP port
    username='default',
    password=''
)
result = client.query("SELECT * FROM trades LIMIT 1000")
df = client.query_df("SELECT * FROM trades")  # Pandas integration

Why NOT clickhouse-driver

Factorclickhouse-connectclickhouse-driver
MaintainerClickHouse Inc.Solo developer
Weekly commitsYes (active)Sparse (months)
Open issues41 (addressed)76 (accumulating)
Downloads/week2.7M1.5M
Bus factor riskLow (company)High (1 person)

Do NOT use clickhouse-driver despite its ~26% speed advantage for large exports. The maintenance risk outweighs performance gains:

  • Single maintainer (mymarilyn) with no succession plan
  • Issues accumulating without response
  • Risk of abandonment breaks production code

Exception: Only consider clickhouse-driver if you have extreme performance requirements (exporting millions of rows) AND accept the maintenance risk.

ClickHouse COMMENT = Single Source of Truth

Every ClickHouse table and column MUST have a COMMENT that fully documents its meaning, computation method, and constraints. The COMMENT is the SSoT — no external document, skill, or wiki supersedes it.

Why

  • ClickHouse COMMENTs have no length limit, support newlines, URLs, and unicode
  • Zero performance impact on queries (pure metadata, never in data path)
  • Visible via DESCRIBE table, SHOW CREATE TABLE, system.columns
  • Survives schema migrations (preserved through ALTER operations)

What to Include in COMMENTs

  • Column purpose in plain English
  • Computation formula (if derived/computed)
  • Unit (seconds, milliseconds, bps, ratio)
  • Valid range or enum values
  • Anti-patterns (what NOT to do with this column)
  • GitHub issue link for provenance
  • Source script that populates the column

Example

ALTER TABLE t COMMENT COLUMN session_label
'STRICT session label. 8 values: sydney_only, tokyo_only, ...
Only set when ENTIRE bar (open→close) falls within one session.
cross_session = bar spans boundary. Use WHERE is_pure_session=1.
GitHub: https://github.com/org/repo/issues/54
Source: scripts/populate-sessions/populate_v3.py';

Anti-Pattern

NEVER create a ClickHouse column without a COMMENT. A column without documentation is a column that will be misused.

Related Skills

SkillPurpose
devops-tools:clickhouse-cloud-managementUser/permission management
devops-tools:clickhouse-pydantic-configDBeaver connection generation
quality-tools:schema-e2e-validationYAML schema contracts
quality-tools:multi-agent-e2e-validationDatabase migration validation

Troubleshooting

IssueCauseSolution
Too many partsOver-partitionedReduce partition granularity (monthly not daily)
Slow queriesWrong ORDER BY orderPut lowest cardinality columns first
High memory usageNo memory limits setConfigure max_memory_usage setting
Codec error on Delta+GorillaSuspicious codec combinationUse each codec family independently
Projection not usedOptimizer chose different planCheck EXPLAIN to verify projection selection
Dictionary staleLifetime expiredIncrease LIFETIME or trigger refresh
Replication lagPart merges falling behindCheck merge_tree settings, add resources
INSERT too slowSmall batch sizesBatch to 10k-100k rows per INSERT

Post-Execution Reflection

After this skill completes, check before closing:

  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.

Only update if the issue is real and reproducible — not speculative.

平台分布

Claude Code

28.46%
按下载量换算241

OpenCode

24.55%
按下载量换算208

Antigravity

17.7%
按下载量换算150

Gemini CLI

10.94%
按下载量换算93

windsurf

7.03%
按下载量换算60

trae

3.08%
按下载量换算26

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills