← Back to Skills Marketplace
39
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install dbskiter-db-lock-analyzer
Description
数据库锁分析与死锁检测,支持当前锁分析、死锁检测、锁等待链追踪。 使用场景: - 用户说"看锁" → 执行 analyze - 用户说"死锁" → 执行 deadlocks - 用户说"阻塞" → 执行 chains - 用户说"终止事务" → 执行 kill <事务ID> 用法: - dbskiter --ou...
README (SKILL.md)
锁分析 Skill
何时使用
当用户提到以下关键词时,使用此skill:
| 用户说法 | 执行命令 | 说明 |
|---|---|---|
| "看锁" | dbskiter --output-mode=ai --database=\x3Cname> lock analyze |
分析当前锁情况 |
| "死锁" | dbskiter --output-mode=ai --database=\x3Cname> lock deadlocks |
检测死锁 |
| "阻塞" | dbskiter --output-mode=ai --database=\x3Cname> lock chains |
追踪锁等待链 |
| "锁报告" | dbskiter --output-mode=ai --database=\x3Cname> lock report |
生成锁分析报告 |
| "终止事务" | dbskiter --output-mode=ai --database=\x3Cname> lock kill \x3Cid> |
终止阻塞事务 |
核心命令
1. 分析当前锁
dbskiter --database=\x3C数据库名> lock analyze
输出:总锁数、等待中锁数、已授予锁数
2. 检测死锁
dbskiter --database=\x3C数据库名> lock deadlocks
输出:死锁数量、涉及事务、解决建议
3. 追踪锁等待链
dbskiter --database=\x3C数据库名> lock chains
输出:锁等待链数量、链深度、阻塞源头
4. 终止事务
dbskiter --database=\x3C数据库名> lock kill \x3Ctransaction_id>
注意:谨慎使用,会强制终止事务
锁类型
- TABLE:表锁
- ROW:行锁
- METADATA:元数据锁
数据库支持情况
| 数据库 | 锁分析 | 死锁检测 | 锁等待链 | 说明 |
|---|---|---|---|---|
| MySQL | 完整支持 | 支持 | 支持 | 完全可用 |
| PostgreSQL | 完整支持 | 支持 | 支持 | 完全可用 |
| Oracle | 完整支持 | 支持 | 支持 | 完全可用 |
AI决策流程
场景1:用户说"看看锁情况"
步骤1:执行 dbskiter --database=\x3Cname> lock analyze
步骤2:查看锁统计信息
步骤3:如果有等待锁,执行 dbskiter --database=\x3Cname> lock chains 查看阻塞链
步骤4:总结锁情况给用户
场景2:用户说"有死锁吗"
步骤1:执行 dbskiter --database=\x3Cname> lock deadlocks
步骤2:如果有死锁,列出涉及的事务和SQL
步骤3:给出解决建议(如终止某个事务)
场景3:用户说"有阻塞"
步骤1:执行 dbskiter --database=\x3Cname> lock chains
步骤2:分析阻塞链,找出阻塞源头
步骤3:建议终止阻塞源头事务或优化业务逻辑
Usage Guidance
This skill appears to do what it says (analyze locks, detect deadlocks, trace chains, and kill transactions), but it assumes a command-line tool named 'dbskiter' and database connectivity without declaring them. Before installing or enabling it: 1) Confirm you have a trusted 'dbskiter' binary on the agent host and verify its provenance/version; 2) Decide how database credentials will be provided (and ensure least privilege — read-only for analysis, separate privileged creds for any kill operations); 3) Consider adding safeguards (require explicit user confirmation before running any 'kill' command, restrict the skill to non-production databases, or log and audit its actions); 4) If you need to allow autonomous invocation, restrict the agent's ability to execute destructive commands or require explicit approval for transaction termination. If the maintainer can supply an explicit required-binaries list and clear credential/connection instructions, re-evaluate — currently the mismatch between declared requirements and runtime expectations is the main concern.
Capability Assessment
Purpose & Capability
The skill clearly targets database lock analysis, deadlock detection, and killing transactions — functionality that matches the name/description. However, the runtime instructions rely entirely on a CLI tool named 'dbskiter' (and its --database argument) even though the skill metadata lists no required binary or install mechanism. The dependency on that CLI should have been declared.
Instruction Scope
SKILL.md instructs the agent to run shell commands (dbskiter ... lock analyze/deadlocks/chains/kill) which will interact with databases and can be destructive (kill <transaction_id>). The instructions do not describe how authentication/connection to the database is obtained (no env vars, config paths, or credential guidance), and they give the agent discretion to run 'kill', which can terminate production transactions. The scope is narrowly relevant but lacks safeguards and context.
Install Mechanism
This is an instruction-only skill (no install spec), so nothing is written to disk by the skill itself. That is low-risk in itself, but because it expects an external executable (dbskiter) without providing provenance or an install method, you cannot verify the origin or trustworthiness of that CLI from the skill package alone.
Credentials
The skill requests no environment variables or credentials in metadata, yet it requires access to databases. Practical use will require DB connection credentials or environment configuration outside the skill. The lack of declared primary credential or guidance on where credentials come from is a mismatch and a potential security/operational risk (accidental use of privileged credentials, or unclear credential storage).
Persistence & Privilege
The skill is not always-enabled and does not request special platform persistence. It does allow normal autonomous invocation (platform default). Combined with the ability to run destructive 'kill' commands, autonomous invocation increases risk, but that is a platform-level default rather than a property unique to this skill.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install dbskiter-db-lock-analyzer - After installation, invoke the skill by name or use
/dbskiter-db-lock-analyzer - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of db-lock-analyzer skill.
- Supports database lock analysis, deadlock detection, and lock wait chain tracking.
- Command mappings for keywords like "看锁", "死锁", "阻塞", "终止事务", and "锁报告".
- Provides usage examples and supported database types: MySQL, PostgreSQL, Oracle.
- Includes step-by-step AI workflow for common locking issues.
Metadata
Frequently Asked Questions
What is 数据库锁分析与死锁检测?
数据库锁分析与死锁检测,支持当前锁分析、死锁检测、锁等待链追踪。 使用场景: - 用户说"看锁" → 执行 analyze - 用户说"死锁" → 执行 deadlocks - 用户说"阻塞" → 执行 chains - 用户说"终止事务" → 执行 kill <事务ID> 用法: - dbskiter --ou... It is an AI Agent Skill for Claude Code / OpenClaw, with 39 downloads so far.
How do I install 数据库锁分析与死锁检测?
Run "/install dbskiter-db-lock-analyzer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is 数据库锁分析与死锁检测 free?
Yes, 数据库锁分析与死锁检测 is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does 数据库锁分析与死锁检测 support?
数据库锁分析与死锁检测 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created 数据库锁分析与死锁检测?
It is built and maintained by magicCzc (@magicczc); the current version is v1.0.0.
More Skills