SQL Optimization Patterns
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
Comprehensive TiDB cluster inspection. An agent skill from openocta/openocta_skills.
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install openocta/openocta_skills tidb-cluster-inspector --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/tidb_cluster_inspector .claude/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.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/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .claude/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspectorType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install openocta/openocta_skills tidb-cluster-inspector --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/tidb_cluster_inspector .agents/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .agents/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install openocta/openocta_skills tidb-cluster-inspector --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/tidb_cluster_inspector .cursor/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .cursor/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/openocta/openocta_skills.git --path tidb_cluster_inspector--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install openocta/openocta_skills tidb-cluster-inspector --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/tidb_cluster_inspector .gemini/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .gemini/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install openocta/openocta_skills tidb-cluster-inspectorInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/tidb_cluster_inspector .github/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .github/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install openocta/openocta_skills tidb-cluster-inspector --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/openocta/openocta_skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/tidb_cluster_inspector .opencode/skills/tidb-cluster-inspector && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "tidb-cluster-inspector" agent skill from https://github.com/openocta/openocta_skills/tree/main/tidb_cluster_inspector into .opencode/skills/tidb-cluster-inspector/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "tidb-cluster-inspector", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
tidb-cluster-inspectorComprehensive TiDB cluster inspection. An agent skill from openocta/openocta_skills.
Tidb Cluster Inspector is an agent skill from openocta/openocta_skills. Comprehensive TiDB cluster inspection. Checks cluster topology, node health, slow queries, hot regions, TiKV storage status, PD scheduling, leader skew, and TopSQL drain (latency / execution count / memory). Outputs a full inspection report with prioritized findings. Compatible with TiDB v4.0+.
Its SKILL.md is about 2.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `README.md` and `mate.json`).
It sits in Databases, covering Query optimization. It works with TiDB. The repository describes itself as: 本仓库用于汇集第三方贡献的 OpenOcta 技能(Skill)资源,便于分享、版本管理与分发。 The licence is MIT.
8 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 6ac4479. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
db_querydb_get_statusdb_get_variableFrom allowed-tools in the SKILL.md frontmatter.
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.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Tidb Cluster Inspector loads about 2.9k tokens when it runs. Until then it costs about 80 tokens; SKILL.md has 678 words of instructions outside code blocks.
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.
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.
The full file from openocta/openocta_skills at commit 6ac4479, republished under its MIT licence (© openocta). 678 words, ~2,924 tokens.
.claude/skills/tidb-cluster-inspector/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.TiDB clusters have a complex distributed architecture (TiDB + PD + TiKV) where issues in any component can cascade. This skill performs a systematic inspection across all layers:
| Tool | Purpose |
|---|---|
db_query | Query TiDB system tables |
db_get_status | Get server metrics |
db_get_variable | Get configuration |
SELECT on information_schema.*-- All nodes: type, address, version, status, uptime
SELECT
TYPE AS role, INSTANCE AS address,
VERSION AS version, STATUS AS status,
START_TIME AS start_time
FROM information_schema.cluster_info
ORDER BY TYPE, INSTANCE;Verify:
-- Per-node server info
SELECT
TYPE, INSTANCE, VERSION,
TIMESTAMPDIFF(HOUR, START_TIME, NOW()) AS uptime_hours
FROM information_schema.cluster_info
WHERE STATUS != 'Up' OR STATUS IS NULL;Alert conditions:
STATUS != 'Up' → critical-- TiDB v4.0+: slow query from system table
SELECT
Txn_start, Query_time, Parse_time, Compile_time,
Process_time, Wait_time, Backoff_time,
Request_count, Coprocessor_involved_count,
LEFT(Query, 300) AS sql_fragment
FROM information_schema.slow_query
WHERE Time > DATE_SUB(NOW(), INTERVAL 1 HOUR)
ORDER BY Query_time DESC
LIMIT 20;
-- TiDB v6.0+: cluster-wide slow query
SELECT * FROM information_schema.cluster_slow_query
WHERE Time > DATE_SUB(NOW(), INTERVAL 1 HOUR)
ORDER BY Query_time DESC LIMIT 20;-- Current hot regions: which tables/indexes are hot, read vs write, and how hot.
-- Columns verified against TiDB information_schema.TIDB_HOT_REGIONS (v4.0+).
SELECT
DB_NAME,
TABLE_NAME,
INDEX_NAME,
TYPE AS hot_type, -- 'read' or 'write'
MAX_HOT_DEGREE AS hot_degree, -- >0 means hot; higher = hotter
FLOW_BYTES, -- bytes read + written in the region
REGION_COUNT
FROM information_schema.TIDB_HOT_REGIONS
ORDER BY MAX_HOT_DEGREE DESC, FLOW_BYTES DESC
LIMIT 20;Interpretation:
MAX_HOT_DEGREE > 0 → region is a hotspot; the higher the degree the hotterTYPE = 'read' → read hotspot: add a covering/composite index or scatter the region to reduce point readsTYPE = 'write' → write hotspot: usually auto-increment or sequential inserts; consider region pre-splittingpd-ctl or a dedicated tool such as tidba split); it is out of scope for this read-only skill — only recommend it-- Per-store storage and region distribution
SELECT
STORE_ID,
ADDRESS,
STORE_STATE_NAME AS state,
CAPACITY,
AVAILABLE,
USED_SIZE,
ROUND(USED_SIZE / CAPACITY * 100, 2) AS usage_pct,
REGION_COUNT,
LEADER_COUNT
FROM information_schema.tikv_store_status
ORDER BY STORE_ID;Alert conditions:
state != 'Up' → critical-- Check PD scheduling configuration
SHOW CONFIG WHERE TYPE = 'pd' AND NAME LIKE '%schedule%';
SHOW CONFIG WHERE TYPE = 'pd' AND NAME LIKE '%replicate%';Key configs:
schedule.leader-schedule-limit — Leader balance speedschedule.region-schedule-limit — Region balance speedschedule.enable-cross-table-merge — Region merge optimization-- Leader concentration per TiKV store (cluster-level, lightweight — no full
-- region scan). leader_share_pct should be roughly even across TiKV nodes.
SELECT
STORE_ID,
ADDRESS,
REGION_COUNT,
LEADER_COUNT,
ROUND(LEADER_COUNT / NULLIF(REGION_COUNT, 0) * 100, 2) AS leader_pct_of_store,
ROUND(
LEADER_COUNT /
(SELECT SUM(LEADER_COUNT) FROM information_schema.TIKV_STORE_STATUS) * 100,
2
) AS leader_share_pct
FROM information_schema.TIKV_STORE_STATUS
ORDER BY leader_share_pct DESC;Alert conditions:
leader_share_pct far exceeds the others → PD leader scheduling skewschedule.leader-schedule-limit and each store's weight / labels configTIKV_REGION_STATUS (one row per region — expensive on large clusters; always scope with WHERE DB_NAME = '...' AND TABLE_NAME = '...')Rank SQL by drain across the cluster using the statement summary. All latency
fields are in nanoseconds (SUM_LATENCY / 1e9 → seconds, / 1e6 → ms).
8a — Top 10 by total latency (which SQL drains the most cluster time):
SELECT
DIGEST_TEXT,
SCHEMA_NAME,
STMT_TYPE,
EXEC_COUNT,
ROUND(SUM_LATENCY / 1e9, 3) AS total_latency_s,
ROUND(AVG_LATENCY / 1e6, 2) AS avg_latency_ms,
ROUND(MAX_LATENCY / 1e6, 2) AS max_latency_ms
FROM information_schema.CLUSTER_STATEMENTS_SUMMARY
WHERE EXEC_COUNT > 0
ORDER BY SUM_LATENCY DESC
LIMIT 10;8b — Top 10 by execution count (high-frequency queries):
SELECT
DIGEST_TEXT,
SCHEMA_NAME,
EXEC_COUNT,
ROUND(AVG_LATENCY / 1e6, 2) AS avg_latency_ms
FROM information_schema.CLUSTER_STATEMENTS_SUMMARY
WHERE EXEC_COUNT > 0
ORDER BY EXEC_COUNT DESC
LIMIT 10;8c — Top 10 by memory (OOM risk):
SELECT
DIGEST_TEXT,
SCHEMA_NAME,
EXEC_COUNT,
SUM_MEMORY,
ROUND(AVG_MEM / 1024 / 1024, 2) AS avg_mem_mb
FROM information_schema.CLUSTER_STATEMENTS_SUMMARY
WHERE EXEC_COUNT > 0
ORDER BY SUM_MEMORY DESC
LIMIT 10;8d — Diagnostic TOP 5 (the single biggest combined drain):
SELECT
DIGEST_TEXT,
SCHEMA_NAME,
STMT_TYPE,
EXEC_COUNT,
ROUND(SUM_LATENCY / 1e9, 3) AS total_latency_s,
ROUND(AVG_LATENCY / 1e6, 2) AS avg_latency_ms,
ROUND(SUM_MEMORY / 1024 / 1024, 2) AS total_mem_mb
FROM information_schema.CLUSTER_STATEMENTS_SUMMARY
WHERE EXEC_COUNT > 0
ORDER BY SUM_LATENCY DESC
LIMIT 5;Empty result guard — if the queries above return no rows, statement summary is disabled, so recommend enabling it:
SELECT @@tidb_enable_stmt_summary AS enabled; -- expected ON (default since v4.0)
-- SET GLOBAL tidb_enable_stmt_summary = ON; -- requires SUPER privilege; recommend to DBAThis skill is a read-only SQL inspection. Some TiDB operational capabilities are not reachable via SQL — they require the PD HTTP API, write access, or a dedicated feature. For those, point the DBA to the right tool instead of attempting them here:
| Capability | Why not in this skill | Where to do it |
|---|---|---|
Region pre-splitting (tidba split) | Write operation via PD | pd-ctl / SPLIT TABLE DDL / tidba split |
Runaway SQL throttle/kill (tidba runaway) | Resource-group write op | RESOURCE GROUP + runaway watches |
Majority-DOWN region detection (tidba region replica) | Needs PD region-peer API | pd-ctl / tidba region replica |
Native CPU-ranked TopSQL (tidba topsql cpu) | Needs TiDB TopSQL feature (tidb_enable_top_sql) | TopSQL / TiDB Dashboard |
The four enhanced steps above (hot region, leader skew, TopSQL latency/exec/memory) cover the read-only diagnosis surface. This skill approximates "CPU drain" via total latency, which is the standard proxy when the TopSQL feature is not enabled.
🔍 TiDB Cluster Inspection Report
══════════════════════════════════
📋 Cluster Overview
Topology: {tidb_count} TiDB + {pd_count} PD + {tikv_count} TiKV
TiDB Version: {version}
Inspection Time: {timestamp}
✅ Node Health
| Role | Address | Version | Status | Uptime |
|------|---------|---------|--------|--------|
| TiDB | ... | 4.0.11 | Up | 187d |
| PD | ... | 4.0.11 | Up | 327d |
| TiKV | ... | 4.0.11 | Up | 4d |
⚠️ Slow Queries TOP 5
| Duration | Scan Rows | SQL |
|----------|-----------|-----|
⚡ TopSQL TOP 5 (by total latency)
| SQL (digest) | Schema | Execs | Total Latency | Avg Latency |
|--------------|--------|-------|---------------|-------------|
🔥 Hot Regions
| DB | Table | Type | Flow Bytes |
|----|-------|------|------------|
⚖️ Leader Skew (per TiKV store)
| Store | Leader Share% | Note |
|-------|---------------|------|
💾 TiKV Storage
| Store | Capacity | Used | Usage% | Regions | Leaders |
|-------|----------|------|--------|---------|---------|
⚙️ PD Config
Leader Schedule: {enabled}
Region Schedule: {enabled}
💡 Findings & Recommendations
{Prioritized action items}User: "Inspect my TiDB cluster"
AI Response:
🔍 TiDB Cluster Inspection
Topology: 3 TiDB + 3 PD + 3 TiKV = 9 nodes
Version: v4.0.11 ✅ (consistent)
✅ All 9 nodes Up
🔥 Hot Regions: 5 found
order_service.order_detail (read, 9.5MB flow)
→ Check index on order_detail
💾 TiKV Storage: 3 stores
All < 50% usage ✅
Leaders balanced ✅
💡 Recommendation: Investigate read hotspot on order_service
order_detail table — consider adding composite index.| Frequency | Scope | Focus |
|---|---|---|
| Daily | Slow queries + hot regions | Performance |
| Weekly | Full 8-step inspection | Health check |
| Monthly | Storage trends + capacity | Planning |
-- Enable slow query log
SET GLOBAL tidb_enable_slow_log = ON;
SET GLOBAL tidb_slow_log_threshold = 200; -- 200ms
-- Hot region scatter (execute via pd-ctl)
-- pd-ctl scheduler add scatter-range {table_name}
-- Region merge for small tables
SET GLOBAL tidb_merge_partial_ddl = ON;| Action | Query |
|---|---|
| Cluster info | SELECT * FROM information_schema.cluster_info |
| Slow queries | SELECT * FROM information_schema.slow_query ORDER BY Query_time DESC |
| Hot regions | SELECT * FROM information_schema.TIDB_HOT_REGIONS |
| TiKV stores | SELECT * FROM information_schema.tikv_store_status |
| PD config | SHOW CONFIG WHERE TYPE='pd' |
| TopSQL drain | SELECT DIGEST_TEXT, EXEC_COUNT, SUM_LATENCY FROM information_schema.CLUSTER_STATEMENTS_SUMMARY ORDER BY SUM_LATENCY DESC LIMIT 10 |
| Table stats | SHOW STATS_META WHERE table_name='...' |
Use this skill for systematic TiDB cluster health inspection across all components.
© openocta, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files in tidb_cluster_inspector of openocta/openocta_skills.
Open the folder on GitHubat commit 6ac4479
Tidb Cluster Inspector 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Tidb Cluster Inspector this skillopenocta/openocta_skills | 166 | — | ~2.9k | Automated safety check: Pass | MIT | |
| SQL Optimization Patternsynulihao/AgentSkillOS | 617 | 11 repos | ~3.3k | Automated safety check: Pass | None | |
| Cloud Trace Queryinggoogle/skills | 21k | — | ~1.7k | Automated safety check: Pass | Apache-2.0 | |
| Query Engine Designrevfactory/claude-code-harness | 120 | — | ~474 | Automated safety check: Pass | None | |
| Query Plan Snapshot CLIeclipse-rdf4j/rdf4j | 420 | — | ~1.5k | Automated safety check: Pass | BSD-3-Clause | |
| Wp Acf And Content Modelingjorgerosal/wordpress-skills | 102 | — | ~3.2k | Automated safety check: Pass | MIT |
ynulihao/AgentSkillOS
Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries.
google/skills
Query Cloud Trace spans, filter by latency thresholds or error status, correlate distributed traces with Cloud Logging, and diagnose latency bottlenecks across Google Cloud services.
revfactory/claude-code-harness
SQL query engine design and implementation guide. An agent skill from revfactory/claude-code-harness.
eclipse-rdf4j/rdf4j
Use QueryPlanSnapshotCli to capture and compare RDF4J query plans, then assess likely performance improvements/regressions from execution verification and semantic plan diffs.
jorgerosal/wordpress-skills
WordPress ACF and content modeling review. An agent skill from jorgerosal/wordpress-skills.
affaan-m/ECC
JPA/Hibernate patterns for entity design, relationships, query optimization, transactions, auditing, indexing, pagination, and pooling in Spring Boot.
openocta/openocta_skills
对远程多实例MySQL数据库执行全方位深度巡检,覆盖基础健康、连接负载、性能慢查询、索引冗余、主从复制、容量空间、账号安全、配置风险八大维度,全自动完成巡检扫描、风险识别、问题定级、优化建议、报告归档与飞书推送,适用于生产/测试所有运行中MySQL实例常态化合规巡检。适用场景:用户要求进行 MySQL 全链路健康检查、MySQL 综合巡检、MySQL 风险扫描、MySQL 性能审计、MySQL…
openocta/openocta_skills
Linux 与网络设备只读健康巡检;直接运行 scripts/patrol.sh,配置由平台侧信道注入,Agent 不读取环境变量
openocta/openocta_skills
分析微信公众号后台数据,包括文章阅读量、评论、点赞等统计。当用户需要分析微信公众号数据、导出公众号文章统计报表时调用此技能。
openocta/openocta_skills
Full-chain MySQL deadlock analysis. An agent skill from openocta/openocta_skills.
openocta/openocta_skills
Replication lag root cause analysis with automated resolution workflow.
openocta/openocta_skills
Slow query diagnosis with root cause analysis and index optimization recommendations.
Works with
Categories
Comprehensive TiDB cluster inspection. An agent skill from openocta/openocta_skills. Tidb Cluster Inspector is an agent skill from openocta/openocta_skills. Comprehensive TiDB cluster inspection.
Tidb Cluster Inspector fits situations like: tasks that involve Query optimization.
Run `npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a claude-code`. Or copy the skill folder (tidb_cluster_inspector in openocta/openocta_skills) into .claude/skills/tidb-cluster-inspector in your project. Claude Code loads it when a task matches its description.
Run `npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a codex`. Or copy the skill folder (tidb_cluster_inspector in openocta/openocta_skills) into .agents/skills/tidb-cluster-inspector in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openocta/openocta_skills --skill tidb-cluster-inspector -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/tidb-cluster-inspector, .gemini/skills/tidb-cluster-inspector, .github/skills/tidb-cluster-inspector and .opencode/skills/tidb-cluster-inspector in your project.
SKILL.md names no scripts, command-line tools or credentials: Tidb Cluster Inspector is instructions for the agent only. Its frontmatter pre-approves these tools: db_query, db_get_status, db_get_variable.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Tidb Cluster Inspector is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Tidb Cluster Inspector: SQL Optimization Patterns (ynulihao/AgentSkillOS, 617 stars), Cloud Trace Querying (google/skills, 21k stars), Query Engine Design (revfactory/claude-code-harness, 120 stars) and Query Plan Snapshot CLI (eclipse-rdf4j/rdf4j, 420 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
openocta (a GitHub user) maintains it in openocta/openocta_skills, which has 166 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on June 22, 2026.
Source: openocta/openocta_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.