Run KaiwuDB inspection and health-check tasks. Use this skill for database health checks, metrics collection, anomaly detection, and inspection report genera...
--- name: kwdb-intelligent-inspection description: | Run KaiwuDB inspection and health-check tasks. Use this skill for database health checks, metrics collection, anomaly detection, and inspection report generation. triggers: - show me all database metrics - database metrics for my KWDB cluster - kwdb cluster metrics - check database health - inspect KWDB cluster - database health check - collect database metrics - kwdb inspection - 巡检 - 数据库指标 - 查看数据库指标 - 检查数据库健康 --- ## Critical Constraints (non-negotiable) ❝ **Never skip Step 1.** Collecting metrics before confirming node addresses, ports, and inspection scope with the user is forbidden. The inspection must not proceed until the user explicitly confirms the node addresses, ports, and inspection scope. ❞ ❝ **Never call a script without reading its usage doc first.** Before running any script under `scripts/`, you MUST read the corresponding `references/*-script-usage.md` file. This is the only way to know the correct parameters, defaults, and required arguments. Guessing parameters is forbidden. ❞ ❝ **Anomaly rules are user-driven.** If user does not request alerting, skip alerting. If user requests alerting without specific thresholds, apply default rules from `references/anomaly-rules.md`. If user provides custom thresholds, use those instead. ❞ ## Workflow ### Step 1: Confirm target and scope **Before collecting any metrics**, follow `references/inspection-requirements-confirmation.md` EXACTLY in order: 1. Parse user intent → confirm target (host, ports) 2. Probe connectivity → verify ports reachable (see `references/inspection-port-listening-reference.md`) 3. TLS mode detection → determine if inspection supported 4. Present scope menu → user confirms before proceeding ### Step 2: Collect metrics **MANDATORY: Read the script usage doc BEFORE calling any script.** - `references/ts-metrics-script-usage.md` — for `get_kwdb_ts_metrics.py` - `references/statements-script-usage.md` — for `get_kwdb_statements.py` Do not call any script without first reading its usage doc. Verify the parameter names, required arguments, and defaults match what you are about to pass. - **Port listener status**: Use Step 1 connectivity probe results. - **Most metrics**: Use `scripts/get_kwdb_ts_metrics.py` per `references/ts-metrics-script-usage.md`. - **Slow queries**: Use `scripts/get_kwdb_statements.py` per `references/statements-script-usage.md`. ### Step 3: Apply anomaly rules Apply anomaly judgment rules only when user requests alerting. See `references/anomaly-rules.md` for default rules and configurable rules. ### Step 4: Generate report Produce a Markdown inspection report with metric values, anomaly judgments, and data-source notes per `references/output-rules.md`. ## Anomaly Rules See `references/anomaly-rules.md` for default rules and configurable rules. ## Output Rules See `references/output-rules.md` — **do not deviate from these rules when producing any inspection report.** ## Limitations - **Windows is not supported**: This skill does not support Windows operating systems. - **TLS mode inspection is not supported**: This skill does not support inspecting KaiwuDB deployed with TLS mode enabled.
don't have the plugin yet? install it then click "run inline in claude" again.
restructured original workflow into implexa's 6-component format, made all decision logic explicit (alerting conditionals, tls and windows blocks, empty result handling, network errors), added edge cases (rate limits not applicable; script execution failures, timeout handling, missing reference docs), documented all external dependencies and script parameters as inputs, preserved author intent and procedure fidelity, replaced em-dashes with commas and colons throughout.
run automated health checks and metrics collection on a KaiwuDB cluster. use this skill when you need current database metrics, anomaly detection against configured thresholds, slow query identification, or a full inspection report. the skill confirms target nodes and inspection scope with you before collecting any data, reads script documentation before executing anything, and applies anomaly rules only when you request alerting.
kwdb cluster connectivity
external scripts and references (pre-staged in the execution environment)
scripts/get_kwdb_ts_metrics.py , time-series metrics collectorscripts/get_kwdb_statements.py , slow query detectorreferences/inspection-requirements-confirmation.md , scope confirmation workflowreferences/inspection-port-listening-reference.md , port connectivity probe referencereferences/ts-metrics-script-usage.md , parameter guide for metrics scriptreferences/statements-script-usage.md , parameter guide for statements scriptreferences/anomaly-rules.md , default and configurable anomaly thresholdsreferences/output-rules.md , report formatting rulesuser intent inputs (optional)
step 1: confirm target and scope
input: user request, cluster connectivity info
references/inspection-requirements-confirmation.md in fullreferences/inspection-port-listening-reference.md as reference)step 2: collect metrics
input: confirmed targets from step 1, anomaly alerting flag, custom thresholds (if any)
references/ts-metrics-script-usage.md in full before calling the scriptscripts/get_kwdb_ts_metrics.py with parameters matching the usage doc (verify parameter names, required args, defaults)references/statements-script-usage.md in full before calling the scriptscripts/get_kwdb_statements.py with parameters matching the usage doc (verify parameter names, required args, defaults)step 3: apply anomaly rules (conditional)
input: metric dataset from step 2, anomaly alerting flag
references/anomaly-rules.md and apply default rulesstep 4: generate report
input: metric dataset, anomaly list (if step 3 ran), confirmed scope
references/output-rules.md in fullreferences/output-rules.mdif user does not request alerting: skip step 3 entirely; proceed from step 2 to step 4 with no anomaly judgments.
if user requests alerting but provides no custom thresholds: read references/anomaly-rules.md and apply the default rules defined there.
if user provides custom anomaly thresholds: validate threshold format against references/anomaly-rules.md schema, then apply those thresholds in step 3 instead of defaults.
if target cluster has TLS mode enabled: stop immediately after step 1 with a message stating "TLS mode inspection is not supported by this skill". do not proceed to step 2.
if operating system is Windows: stop immediately with a message stating "Windows is not supported by this skill".
if port connectivity probe fails (step 1, substep 3): report the unreachable ports to the user and ask whether to retry, use alternative ports, or abort the inspection.
if a script call returns an empty result set (step 2): log that no metrics or slow queries were found; continue to step 4 and note empty results in the report.
if a script call fails with a network timeout or authentication error (step 2): report the error, suggest connection parameter validation, and offer retry.
if script usage documentation is missing or unreadable (step 2): stop immediately and report that the script reference is unavailable; do not guess parameters.
inspection report markdown
references/output-rules.mdanomaly list (if alerting enabled)
port listener status
slow query records
references/statements-script-usage.md)