Agent skill

Clickhouse Core Workflow A

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning.

MITAuto-check passedDatabases

Install Clickhouse Core Workflow A

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-core-workflow-a -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clickhouse-core-workflow-a --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clickhouse-core-workflow-a .claude/skills/clickhouse-core-workflow-a && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
clickhouse-core-workflow-a
GitHub stars
2.8k
Token cost
~1.6k tokens
SKILL.md length
576 words
Files
3 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning.

  • Works in 4 steps: Choose the Right Engine → Design the ORDER BY (Sort Key) → Write the Table DDL → …
  • Creating new tables
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Clickhouse Core Workflow A is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning. Use when creating new tables, choosing an engine, designing sort keys, or modeling data for analytical workloads on ClickHouse or ClickHouse Cloud. Trigger with "clickhouse schema design", "clickhouse table design", "clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/implementation.md` and `references/schema-examples.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Data warehousing and Database schema design. It works with ClickHouse. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Creating new tables
  • Choosing an engine
  • Designing sort keys
  • Modeling data for analytical workloads on ClickHouse

Example prompts

  • “clickhouse schema design”
  • “clickhouse table design”
  • “clickhouse ORDER BY”
  • “/clickhouse-core-workflow-a”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Grep

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Choose the Right Engine
  2. Design the ORDER BY (Sort Key)
  3. Write the Table DDL
  4. Choose a Partition Expression

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • clickhouse.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clickhouse Core Workflow A loads about 1.6k tokens when it runs, and up to ~2.6k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 576 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 576 words, ~1,581 tokens.

Download SKILL.mdSave it as .claude/skills/clickhouse-core-workflow-a/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
clickhouse-core-workflow-a
description
Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning. Use when creating new tables, choosing an engine, designing sort keys, or modeling data for analytical workloads on ClickHouse or ClickHouse Cloud. Trigger with "clickhouse schema design", "clickhouse table design", "clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
compatibility
Designed for Claude Code
version
1.7.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, database, analytics, clickhouse, olap

ClickHouse Schema Design (Core Workflow A)

Overview

Design ClickHouse tables with correct engine selection, ORDER BY keys, partitioning, and codec choices for analytical workloads. This skill covers the four schema decisions that determine query speed and storage cost — engine, sort key, partition expression, and column codecs — then points to references/ for full DDL and the programmatic apply path.

Prerequisites

  • @clickhouse/client connected (see clickhouse-install-auth)
  • Understanding of your query patterns (what you filter and group on)

Instructions

Step 1: Choose the Right Engine
EngineBest ForDedup?Example
MergeTreeGeneral analytics, append-only logsNoClickstream, IoT
ReplacingMergeTreeMutable rows (upserts)Yes (on merge)User profiles, state
SummingMergeTreePre-aggregated countersSums numericsPage view counts
AggregatingMergeTreeMaterialized view targetsMerges statesDashboards
CollapsingMergeTreeStateful row updatesCollapses +-1Shopping carts

ClickHouse Cloud uses SharedMergeTree — it is a drop-in replacement for MergeTree on Cloud. You do not need to change your DDL.

Step 2: Design the ORDER BY (Sort Key)

The ORDER BY clause is the single most important schema decision. It defines:

  • Primary index — sparse index over sort-key granules (8192 rows default)
  • Data layout on disk — rows sorted physically by these columns
  • Query speed — queries filtering on ORDER BY prefix columns hit fewer granules

Rules of thumb:

  1. Put low-cardinality filter columns first (event_type, status)
  2. Then high-cardinality columns you filter on (user_id, tenant_id)
  3. End with a time column if you use range filters (created_at)
  4. Do NOT put high-cardinality columns you never filter on in ORDER BY
sql
-- Good: filter by tenant, then by time ranges
ORDER BY (tenant_id, event_type, created_at)

-- Bad: UUID first means every query scans the full index
ORDER BY (event_id, created_at)  -- event_id is random UUID
Step 3: Write the Table DDL

Start from the append-only event skeleton below, then adapt the engine and sort key to your access pattern. Full DDL for the three canonical shapes — event analytics (MergeTree), user profiles (ReplacingMergeTree), and daily aggregation (AggregatingMergeTree) — plus column codec choices is in schema examples.

sql
CREATE TABLE analytics.events (
    event_id     UUID DEFAULT generateUUIDv4(),
    tenant_id    UInt32,
    event_type   LowCardinality(String),
    user_id      UInt64,
    properties   String CODEC(ZSTD(3)),  -- JSON blob, compress well
    created_at   DateTime64(3) DEFAULT now64(3)
)
ENGINE = MergeTree()
ORDER BY (tenant_id, event_type, toDate(created_at), user_id)
PARTITION BY toYYYYMM(created_at)
TTL created_at + INTERVAL 1 YEAR
SETTINGS index_granularity = 8192;
Step 4: Choose a Partition Expression

toYYYYMM(date) (monthly) is the right default for most time-series tables — target 10-1000 parts per partition. Each partition creates separate parts on disk, so over-partitioning (e.g., by user_id) creates millions of tiny parts and kills performance. Full partition matrix and the Node.js apply path are in partitioning and applying schema.

Show full SKILL.md (226 more words)Show less

Output

Applying this skill produces:

  • Table DDL — a CREATE TABLE statement with an engine, ORDER BY sort key, PARTITION BY expression, per-column codecs, and (optionally) a TTL clause.
  • A rationale for each decision — why this engine, why this sort-key order, why this partition granularity — so the schema is reviewable, not cargo-culted.
  • Optional apply script — a @clickhouse/client command() call that runs the DDL from application code (see the reference), keeping schema in version control alongside the service.

Error Handling

ErrorCauseSolution
ORDER BY expression not in primary keyPRIMARY KEY != ORDER BYRemove explicit PRIMARY KEY or align
Too many parts (300+)Over-partitioningUse coarser partition expression
Cannot convert String to UInt64Wrong data typeMatch insert types to schema
TTL expression type mismatchTTL on non-date columnTTL must reference DateTime column

Examples

  • Append-only clickstream — MergeTree, sort key (tenant_id, event_type, toDate(created_at), user_id), monthly partitions, 1-year TTL.
  • Mutable user profiles (upserts) — ReplacingMergeTree(updated_at), ORDER BY user_id, read with FINAL for deduplicated rows.
  • Pre-aggregated daily rollups — AggregatingMergeTree targeting a materialized view, storing AggregateFunction(uniq, UInt64) state.

Full DDL for all three shapes plus column codec choices: schema examples. The Node.js apply path (client.command() with @clickhouse/client) and the full partition matrix: partitioning and applying schema.

Resources

Next Steps

For inserting and querying data — batch inserts, async inserts, and query patterns against these tables — see clickhouse-core-workflow-b.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/.curated/clickhouse-core-workflow-a of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/implementation.md
  • references/schema-examples.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clickhouse Core Workflow A next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Clickhouse Core Workflow A compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clickhouse Core Workflow A this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.6kAutomated safety check: PassMIT
Schema Design Advisorchmonitor/chmonitor300—~2.2kAutomated safety check: PassGPL-3.0
Modelersidequery/sidemantic129—~4.2kAutomated safety check: PassApache-2.0
Keeper Stress AnalysisClickHouse/ClickHouse50k—~4.7kAutomated safety check: PassApache-2.0
Perf ComparisonClickHouse/ClickHouse50k—~3.9kAutomated safety check: NotesApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0

Similar skills

  • Schema Design Advisor

    chmonitor/chmonitor

    Recommend table ORDER BY keys, partition strategies, column data-type right-sizing, codecs, skip indexes, and projections for ClickHouse tables.

    300 GitHub stars~2.2k tokensUpdated 5 days ago
    DatabasesAuto-check passed
  • Modeler

    sidequery/sidemantic

    Build, validate, and manage semantic models using Sidemantic.

    129 GitHub stars~4.2k tokensUpdated 4 days ago
    DatabasesAuto-check passed
  • Keeper Stress Analysis

    ClickHouse/ClickHouse

    Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.

    50k GitHub stars~4.7k tokensUpdated today
    DatabasesAuto-check passed
  • Perf Comparison

    ClickHouse/ClickHouse

    Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.

    50k GitHub stars~3.9k tokensUpdated today
    DatabasesAuto-check: notes
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • MUST USE when designing ClickHouse architectures, selecting between ingestion or modeling patterns, or translating best practices into workload-specific system designs.

    395 GitHub starsUsed in 2 repos~791 tokens
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Clickhouse Core Workflow A

What does Clickhouse Core Workflow A do?

Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning. Clickhouse Core Workflow A is an agent skill from jeremylongshore/tons-of-skills-marketplace. Design ClickHouse schemas with MergeTree engines, ORDER BY keys, and partitioning.

When should I use Clickhouse Core Workflow A?

Clickhouse Core Workflow A fits situations like: creating new tables; choosing an engine; designing sort keys; modeling data for analytical workloads on ClickHouse.

How do I install Clickhouse Core Workflow A in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-core-workflow-a -a claude-code`. Or copy the skill folder (skills/.curated/clickhouse-core-workflow-a in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clickhouse-core-workflow-a in your project. Claude Code loads it when a task matches its description.

How do I install Clickhouse Core Workflow A in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-core-workflow-a -a codex`. Or copy the skill folder (skills/.curated/clickhouse-core-workflow-a in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clickhouse-core-workflow-a in your project. Codex loads it when a task matches its description.

Can I use Clickhouse Core Workflow A in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-core-workflow-a -a cursor` (or -a -a, -a or -a for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-core-workflow-a, .gemini/skills/clickhouse-core-workflow-a, .github/skills/clickhouse-core-workflow-a and .opencode/skills/clickhouse-core-workflow-a in your project.

What does Clickhouse Core Workflow A need to run?

SKILL.md names no scripts, command-line tools or credentials: Clickhouse Core Workflow A is instructions for the agent only. Our summary lists: Node.js. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clickhouse Core Workflow A access the network?

SKILL.md names 1 domain. As links in the text: clickhouse.com. This is read from the text; nothing was executed.

Is Clickhouse Core Workflow A safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Clickhouse Core Workflow A use?

Clickhouse Core Workflow A is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clickhouse Core Workflow A use?

About 1.6k tokens (SKILL.md is roughly 6.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.1k tokens, read only when the agent opens those files.

What are the alternatives to Clickhouse Core Workflow A?

Skills that share tags, products or a category with Clickhouse Core Workflow A: Schema Design Advisor (chmonitor/chmonitor, 300 stars), Modeler (sidequery/sidemantic, 129 stars), Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars) and Perf Comparison (ClickHouse/ClickHouse, 50k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clickhouse Core Workflow A?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.