Agent skill

Clickhouse Managed Postgres Rca

by ClickHouse in ClickHouse/agent-skills

MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance.

Apache-2.0Auto-check passedDatabases

Install Clickhouse Managed Postgres Rca

skills CLI
$ npx skills add ClickHouse/agent-skills --skill clickhouse-managed-postgres-rca -a claude-code

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

GitHub CLI
$ gh skill install ClickHouse/agent-skills clickhouse-managed-postgres-rca --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/ClickHouse/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/clickhouse-managed-postgres-rca .claude/skills/clickhouse-managed-postgres-rca && 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-managed-postgres-rca
GitHub stars
544
Token cost
~1.2k tokens
SKILL.md length
613 words
Files
13
Skills in repo
2
Repo updated
First seen
Licence
Apache-2.0

At a glance

MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance.

  • Works in 6 steps: Discover the live API shape → Scrape Prom once for system gauges → Pull top slow query patterns → …
  • Investigating performance issues on a ClickHouse-managed Postgres instance
  • SKILL.md covers When to use, What you have access to, What you do NOT have and Workflow, plus 1 more section
  • Reaches api.clickhouse.cloud

What it does

Clickhouse Managed Postgres Rca is an agent skill from ClickHouse/agent-skills. MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance. Provides an evidence-based RCA workflow that scrapes the Prometheus endpoint for system signal, pulls per-digest evidence from the Slow Query Patterns API, and recommends (does not apply) a fix.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 13 other files (for example `AGENTS.md`, `README.md` and `metadata.json`).

It sits in Databases, covering Data warehousing, Query optimization and Web scraping. It works with ClickHouse, PostgreSQL and Prometheus. The repository describes itself as: The official Agent Skills for ClickHouse and ClickHouse Cloud. The licence is Apache-2.0.

When your agent uses it

  • Investigating performance issues on a ClickHouse-managed Postgres instance
  • Tasks that involve Data warehousing
  • Tasks that involve Query optimization

Example prompts

  • “/clickhouse-managed-postgres-rca”

Workflow steps

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

  1. Discover the live API shape
  2. Scrape Prom once for system gauges
  3. Pull top slow query patterns
  4. Triage: pick the right heuristic
  5. Reason, then recommend
  6. Do not apply the fix

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.clickhouse.cloud

    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.

Context cost

Clickhouse Managed Postgres Rca loads about 1.2k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 613 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~79
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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 ClickHouse/agent-skills at commit 356a8c1, republished under its Apache-2.0 licence (© ClickHouse). 613 words, ~1,224 tokens.

Download SKILL.mdSave it as .claude/skills/clickhouse-managed-postgres-rca/SKILL.md (or your agent's skills folder). This skill also uses 12 other files; get the full folder from GitHub.
name
clickhouse-managed-postgres-rca
description
MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance. Provides an evidence-based RCA workflow that scrapes the Prometheus endpoint for system signal, pulls per-digest evidence from the Slow Query Patterns API, and recommends (does not apply) a fix.
license
Apache-2.0
metadata.author
ClickHouse Inc
metadata.version
0.1.0

ClickHouse Managed Postgres RCA

When to use

Trigger whenever a user reports slowness, high CPU, low throughput, cache thrash, or any unexplained pain on a ClickHouse-managed Postgres instance.

What you have access to

Two APIs on https://api.clickhouse.cloud (HTTP Basic auth using a ClickHouse Cloud API key/secret pair):

  • Prometheus metrics — operation postgresInstancePrometheusGet under the Prometheus tag. Returns Prometheus exposition format. System and workload metrics for one Postgres service.
  • Slow Query Patterns — operation slowQueryPatternsGetList under the Postgres tag. Returns per-digest latency, IO, and call statistics for normalized query patterns. Beta.

Both endpoints require an organizationId and a serviceId as path parameters. The user must supply both, plus the API key/secret pair.

What you do NOT have

  • Query plans / EXPLAIN output.
  • Per-table scan-type counters (seq_scan / idx_scan).
  • Autovacuum or last-ANALYZE timestamps.

Reason from IO and timing signals, not from a plan tree.

Workflow

Six steps, in order. Do not skip ahead.

Steps 2 and 3 only share auth — no data dependency between them. Run them in parallel (background curls, & + wait) to cut wall time from sequential ~2s to ~1s.

1. Discover the live API shape

These endpoints are Beta — paths, params, and JSON field names can shift. Follow rules/openapi-discovery.md to:

  1. Fetch the OpenAPI spec from https://api.clickhouse.cloud/v1.
  2. Locate the two operations by operationId:
    • postgresInstancePrometheusGet (Prometheus tag)
    • slowQueryPatternsGetList (Postgres tag)
  3. Resolve their path templates, required query parameters, and (for the slow-query endpoint) the response schema.
  4. Build a session-scoped role map from the schema property descriptions: { semantic role → actual field name }.

Use the resolved names in every subsequent request and citation. Never hardcode field names from memory.

2. Scrape Prom once for system gauges

Follow rules/prometheus-scrape.md. One scrape, no wait. You're after gauges (current values) that don't need a delta: CacheHitRatio, ActiveConnections, MemoryUsedPercent, FilesystemUsedPercent.

A CacheHitRatio well below ~95% on a workload that should fit in cache is a real signal on its own. Climbing ActiveConnections toward the pool ceiling is a real signal on its own. These don't need rate-of-change.

A second scrape for counter deltas is opt-in, used only when Step 4 triage points at write-congestion (where deadlock and rollback rates matter and the Slow Query Patterns API can't substitute). For the read-path case (the most common RCA shape) the single scrape is enough.

Show full SKILL.md (240 more words)Show less
3. Pull top slow query patterns

Request the slow query patterns. Follow rules/slow-query-patterns-fields.md for the fields that matter and how to read them. This is the primary diagnostic — it returns per-pattern accumulated totals (call count, runtime, blocks, rows) over the window you request, which is the "rate-of-change" data you'd otherwise derive from two Prom scrapes — but per query and without waiting.

If no patterns return a meaningful totalDurationUs, the report may be overstated or the issue isn't query-shaped. Stop and tell the user what you looked at.

4. Triage: pick the right heuristic

Follow rules/triage.md. Match the combined Prom + slow-query signal to one of the heuristic shapes. Each shape points to a specific heuristic file:

  • rules/heuristic-full-scan.md — read-path full scan.
  • rules/heuristic-hot-loop.md — N+1 / hot loop from the app.
  • rules/heuristic-write-congestion.md — deadlocks, slow writes, high rollback rate.

If the signal does not match any shape cleanly, do not invent a hypothesis. Surface the top patterns and ask the user which workload they recognize. New heuristics are welcome as PRs.

5. Reason, then recommend

Use the format in rules/output-template.md. Always include: symptom, evidence, hypothesis (noting any alternative cause you cannot rule out from this surface alone), short-term fix, and long-term follow-ups.

6. Do not apply the fix

Follow rules/recommend-only.md. Never run DDL. Never call pg_cancel_backend or pg_terminate_backend. Write the recommendation, explain why, and let the human apply it.

Full Compiled Document

For the complete guide with every rule expanded in a single context load: AGENTS.md.

© ClickHouse, Apache-2.0. 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 12 other files in skills/clickhouse-managed-postgres-rca of ClickHouse/agent-skills.

  • SKILL.md
  • AGENTS.md
  • README.md
  • metadata.json
  • rules/heuristic-full-scan.md
  • rules/heuristic-hot-loop.md
  • rules/heuristic-write-congestion.md
  • rules/openapi-discovery.md
  • rules/output-template.md
  • rules/prometheus-scrape.md
  • rules/recommend-only.md
  • rules/slow-query-patterns-fields.md
  • rules/triage.md

Open the folder on GitHubat commit 356a8c1

Compare with similar skills

Clickhouse Managed Postgres Rca 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 Managed Postgres Rca compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clickhouse Managed Postgres Rca this skillClickHouse/agent-skills544—~1.2kAutomated safety check: PassApache-2.0
Profiling Slow API EndpointsPostHog/posthog-foss721—~1kAutomated safety check: PassMIT
Querying Production Databases Via MetabasePostHog/posthog-foss721—~2.8kAutomated safety check: PassMIT
Analyzing Experiment Precompute CanaryPostHog/posthog-foss721—~3.5kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Observal AdminObserval/Observal4.1k—~774Automated safety check: PassApache-2.0

Similar skills

  • Profiling Slow API Endpoints

    PostHog/posthog-foss

    Official

    Profiles slow PostHog API endpoints when the main cost is in Postgres or Python.

    721 GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed
  • Official

    Runs read-only production database analysis through PostHog's internal Metabase instances.

    721 GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Official

    Analyze the experiment precompute result-consistency canary across prod-US and prod-EU, deep-dive any issues, and produce an actionable report.

    721 GitHub stars~3.5k tokensUpdated today
    DevOps & CloudAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Observal Admin

    Observal/Observal

    Administers Observal users, settings, diagnostics, review queues, security events, audit logs, SAML, SCIM, the local Observal server, its upgrades and rollback, and its own PostgreSQL and ClickHouse…

    4.1k GitHub stars~774 tokensUpdated today
    DatabasesAuto-check passed
  • Clickhouse System Queries

    FrankChen021/datastoria

    Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries.

    327 GitHub stars~731 tokensUpdated 2 mo ago
    DatabasesAuto-check passed

More from ClickHouse/agent-skills

  • ClickHouse RowBinary for Node.js

    ClickHouse/agent-skills

    Generates TypeScript or JavaScript readers and writers for ClickHouse's RowBinary formats over HTTP in Node.js, after checking that RowBinary suits the data.

    544 GitHub stars~1.3k tokensUpdated 8 days ago
    Auto-check passed

Categories

Questions about Clickhouse Managed Postgres Rca

What does Clickhouse Managed Postgres Rca do?

MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance. Clickhouse Managed Postgres Rca is an agent skill from ClickHouse/agent-skills. MUST USE when investigating performance issues on a ClickHouse-managed Postgres instance.

When should I use Clickhouse Managed Postgres Rca?

Clickhouse Managed Postgres Rca fits situations like: investigating performance issues on a ClickHouse-managed Postgres instance; tasks that involve Data warehousing; tasks that involve Query optimization.

How do I install Clickhouse Managed Postgres Rca in Claude Code?

Run `npx skills add ClickHouse/agent-skills --skill clickhouse-managed-postgres-rca -a claude-code`. Or copy the skill folder (skills/clickhouse-managed-postgres-rca in ClickHouse/agent-skills) into .claude/skills/clickhouse-managed-postgres-rca in your project. Claude Code loads it when a task matches its description.

How do I install Clickhouse Managed Postgres Rca in Codex?

Run `npx skills add ClickHouse/agent-skills --skill clickhouse-managed-postgres-rca -a codex`. Or copy the skill folder (skills/clickhouse-managed-postgres-rca in ClickHouse/agent-skills) into .agents/skills/clickhouse-managed-postgres-rca in your project. Codex loads it when a task matches its description.

Can I use Clickhouse Managed Postgres Rca 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 ClickHouse/agent-skills --skill clickhouse-managed-postgres-rca -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-managed-postgres-rca, .gemini/skills/clickhouse-managed-postgres-rca, .github/skills/clickhouse-managed-postgres-rca and .opencode/skills/clickhouse-managed-postgres-rca in your project.

What does Clickhouse Managed Postgres Rca need to run?

SKILL.md names no scripts, command-line tools or credentials: Clickhouse Managed Postgres Rca is instructions for the agent only.

Does Clickhouse Managed Postgres Rca access the network?

SKILL.md names 1 domain. In commands or code: api.clickhouse.cloud; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Clickhouse Managed Postgres Rca 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 Managed Postgres Rca use?

Clickhouse Managed Postgres Rca is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clickhouse Managed Postgres Rca use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Clickhouse Managed Postgres Rca?

Skills that share tags, products or a category with Clickhouse Managed Postgres Rca: Profiling Slow API Endpoints (PostHog/posthog-foss, 721 stars), Querying Production Databases Via Metabase (PostHog/posthog-foss, 721 stars), Analyzing Experiment Precompute Canary (PostHog/posthog-foss, 721 stars) and Chdb SQL (vemetric/vemetric, 394 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clickhouse Managed Postgres Rca?

ClickHouse (a GitHub organization) maintains it in ClickHouse/agent-skills, which has 544 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on September 29, 2026.

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