Bisect a ClickHouse regression using pre-built master binaries from CI. Use when the user wants to find the commit that introduced a bug.
npx skills add https://github.com/ClickHouse/ClickHouse --skill bisect
Bisect a ClickHouse regression using utils/auto-bisect/bisect.sh, which downloads pre-built CI binaries and manages the bisect loop automatically.
$0 (required): Path to a SQL repro file (e.g., /tmp/repro.sql)$1 (optional): Good ref — a git tag, branch, or SHA known to be good (default: latest v*.1.1-* tag)$2 (optional): Bad ref — a git tag, branch, or SHA known to be bad (default: HEAD)utils/auto-bisect/bisect.sh orchestrates the full bisect:
helpers/download.sh fetches the release binary from CI S3env/<option>.sh installs configs and starts a ClickHouse server (configs go to utils/auto-bisect/data/etc/, never to /etc/)$COMMIT_SHA, $CH_PATH (binary), and $GIT_WORK_TREE in the environmentThe working tree is never checked out — BISECT_HEAD is written for each step so git history is untouched.
The test script receives these environment variables:
$COMMIT_SHA — full SHA of the commit being tested$CH_PATH — path to the downloaded binary (e.g., utils/auto-bisect/data/clickhouse)$GIT_WORK_TREE — path to the ClickHouse repositoryExit codes:
0 — good (bug not present)1 — bad (bug present)125 — skip (handled upstream by download.sh, not typically needed in the test itself)git rev-parse <ref> git tag -l 'v*' --sort=-creatordate | grep '\.1\.1-' | head -5
Pick the nearest v<MAJOR>.<MINOR>.1.1-* tag before the bad ref.
Create /tmp/bisect_test.sh. Use $CH_PATH for the binary — do not download it yourself, the framework handles that.
For clickhouse local repros (no server needed — use --env nothing):
#!/bin/bash
set -e
OUTPUT=$("$CH_PATH" local --multiquery 2>&1 <<'SQL'
-- paste repro SQL here
SQL
)
if echo "$OUTPUT" | grep -q "FAILURE_PATTERN"; then
exit 1 # bad
else
exit 0 # good
fi
For server-based repros (use --env single, the default):
#!/bin/bash
# Server is already running when this script is called.
# Use clickhouse-client on the default port (9000).
set -e
OUTPUT=$("$CH_PATH" client --multiquery 2>&1 <<'SQL'
-- paste repro SQL here
SQL
)
if echo "$OUTPUT" | grep -q "FAILURE_PATTERN"; then
exit 1
else
exit 0
fi
Failure pattern examples:
grep -q "LOGICAL_ERROR\|Code: [0-9]"OUTPUT to expected string[ "${PIPESTATUS[0]}" = "139" ]Before running the full bisect, verify the repro:
GOOD_SHA=$(git rev-parse <good-ref>)
BAD_SHA=$(git rev-parse <bad-ref>)
Optionally do a quick walker sanity check over just the two endpoints:
CH_PATH=/usr/local/bin/clickhouse /tmp/bisect_test.sh # should exit 0 on good
cd utils/auto-bisect
./bisect.sh \
--good <good-sha> \
--bad <bad-sha> \
--path /path/to/ClickHouse \
--test /tmp/bisect_test.sh \
--env nothing # or: single (default), replicateddb, sharedcatalog
Use --env nothing when the test uses clickhouse local (no server).
Use --env single (default) when the test needs a running server.
Walker mode — walk every commit linearly instead of bisecting (useful when you want to see the progression or the range is small):
./bisect.sh --good <sha> --bad <sha> --path ... --test ... --walker
# Or provide explicit commits:
./bisect.sh --path ... --test ... --walker --walker-commits "sha1 sha2 sha3"
# Or limit to N evenly-spaced steps:
./bisect.sh --good <sha> --bad <sha> --path ... --test ... --walker --walker-steps 10
Set a generous timeout (up to 10 min) — each step downloads ~200 MB.
After bisect completes, the output contains <sha> is the first bad commit.
git show --stat <bad-sha>
Report:
https://github.com/ClickHouse/ClickHouse/pull/<N>git show --statutils/auto-bisect/data/clickhouse and overwritten each step (not cached between steps — use walker if you want to re-test)bisect.sh uses --first-parent automaticallyutils/auto-bisect/data/etc/clickhouse-server/ — the host's /etc/clickhouse-* is never touchedBISECT_HEAD is used instead of git checkoutCH_CI_USER / CH_CI_PASSWORD and pass --privateLLM-driven hypothesis generation/testing on tabular data. Three methods: HypoGeniC (data-driven), HypoRefine (literature+data), Union. Iterative refinement, Redis caching, multi-hypothesis inference. Manual: hypothesis-generation; ideation: scientific-brainstorming.
This skill should be used when the user asks to \"automate SQL injection testing,\" \"enumerate database structure,\" \"extract database credentials using sqlmap,\" \"dump tables and columns...
Optimizes application performance across frontend, backend, queries, and databases. Use when performance requirements exist, when you suspect performance regressions, when Core Web Vitals or load times need improvement, when N+1 query patterns need fixing, or when profiling reveals bottlenecks.
QA an analysis before sharing -- methodology, accuracy, and bias checks. Use when reviewing an analysis before a stakeholder presentation, spot-checking calculations and aggregation logic, verifying a SQL query's results look right, or assessing whether conclusions are actually supported by the data.
End-to-end smoke test for the public Errors HTTP API (error groups). Seeds failed runs into ClickHouse so the error materialized views populate, then drives the real endpoints against the running webapp — list (with filters + pagination), retrieve, resolve/ignore/unresolve, the `filter[error]` runs filter, user attribution via the `trigger.dev mint-token` -> JWT exchange, and the 401/403/404 negatives. Use for "smoke test the errors API", "test the errors API e2e", "prove the errors endpoints work", or to re-verify after changes.
Strix SQL 注入测试手册,覆盖 union、blind、error-based 与 ORM 绕过技巧;触发名:strix-sql-injection
> Pull and interpret production experiment query-performance data from the staff-only slowest experiment queries, precompute read/build health, and preaggregation cache footprint. and response field semantics (exception codes, exposure paths, precompute skip reasons, job states). Use when investigating slow or failing experiment queries, precompute regressions, 307/159/241 errors, preaggregation table growth, or when asked how experiment query performance or the precompute rollout is doing in production.
Implement database backup strategies. Configure automated backups, retention, and recovery testing. Use when designing backup and recovery procedures.
Take clickhouse/bisect from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.