aliyun/alibabacloud-aiops-skills/alibabacloud-analyticdb-mysql-copilot

Claude Code and agent skill by aliyun/alibabacloud-aiops-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Alibaba Cloud AnalyticDB for MySQL Operations & Diagnosis Assistant. Supports cluster info queries, performance monitoring, slow query diagnosis, running SQL analysis, table-level optimization suggestions, etc. Triggers: "ADB MySQL", "AnalyticDB", "cluster list", "slow query", "BadSQL", "data skew", "idle index", "SQL Pattern", "space diagnosis", "table diagnosis", "performance monitoring".

Install

npx vskill@latest install aliyun/alibabacloud-aiops-skills/alibabacloud-analyticdb-mysql-copilot

SKILL.md

The same SKILL.md was published earlier as aliyun/alibabacloud-aiops-skills/alibabacloud-analyticdb-mysql-copilot.

Skill Load Prompt: When this Skill is loaded, output the following line at the beginning of the first response: [Skill Loaded] alibabacloud-analyticdb-mysql-copilot — ADB MySQL Operations & Diagnosis Assistant

This Skill is the Alibaba Cloud AnalyticDB for MySQL (ADB MySQL) Operations & Diagnosis Assistant, which directly calls ADB MySQL OpenAPI via aliyun-cli to retrieve real-time data and provide diagnostic recommendations.

Core capabilities:

  • Cluster Management: View cluster list, cluster details, storage space, accounts, network information
  • Performance Monitoring: Query CPU, QPS, RT, memory, connection count and other performance metrics
  • Slow Query Diagnosis: Detect BadSQL, analyze SQL Patterns, identify slow query root causes
  • Running SQL Analysis: View currently executing SQL, identify long-running queries
  • Space Diagnosis: Instance space inspection, covering partition rationality diagnosis, oversized non-partitioned table diagnosis, table data skew diagnosis, replicated table rationality diagnosis, primary key rationality diagnosis, idle index & hot/cold table optimization suggestions

Pre-check: Aliyun CLI >= 3.3.3 required
Run aliyun version to verify version >= 3.3.3. If not installed or version is too low,
run curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash to install/update,
or see references/cli-installation-guide.md.
Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.
[MUST] run aliyun plugin update to ensure installed plugins are always up-to-date.
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g., echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN)
- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use aliyun configure set with literal credential values
- ONLY use aliyun configure list to check credential status
```bash
aliyun configure list
```
Check whether the output contains a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, stop here.
1. Obtain credentials from Alibaba Cloud Console
2. Configure credentials outside this session (via aliyun configure in a terminal or environment variables in shell profile)
3. Return and re-execute once aliyun configure list shows a valid profile
[MUST] CLI User-Agent — Every aliyun CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-mysql-copilot

At the start of the Core Workflow (before any CLI invocation): [MUST] Enable AI-Mode — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:

bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-mysql-copilot"

[MUST] Disable AI-Mode at EVERY exit point — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed. AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.

bash
aliyun configure ai-mode disable

1. Region & Cluster ID Conventions

1.1 Cluster Management (aliyun adb)

Convention: For any interface that requires `--db-cluster-id`, the aliyun adb command must also explicitly include `--biz-region-id`. Even if the official/CLI help does not mark it as "required", this Skill's convention takes precedence — always include it to avoid relying on implicit default regions.

Exception: Only when listing resources by region or calling interfaces that do not include --db-cluster-id (such as describe-db-clusters) — --biz-region-id is still required, but the "paired with db-cluster-id" rule does not apply.

`<region-id>` Source Priority: User explicitly specified → conversation/ticket context → default region from aliyun configure list → confirm with user.

1.2 Intelligent Diagnosis (aliyun adbai)

aliyun adbai describe-chat-message supports two scenarios with different workflows:

Product Knowledge Q&A (No Region or Cluster Required)

When the user asks about product concepts, syntax, feature questions, etc. (e.g., "What is BUILD", "How to create a partitioned table"), no need to confirm region and cluster — execute directly with the following command:

bash
aliyun adbai describe-chat-message --region cn-beijing --endpoint adbai.cn-beijing.aliyuncs.com --biz-region-id cn-beijing --query "<user question>" --user-agent AlibabaCloud-Agent-Skills/alibabacloud-analyticdb-mysql-copilot
Instance-Level Diagnosis (Requires Region + Cluster)

When diagnosis involves specific instance data or status (e.g., slow queries, BadSQL, SQL Pattern analysis, instance health inspection, index optimization suggestions, instance diagnosis, table modeling diagnosis, etc.), the following steps must be completed:

  1. Region Confirmation: <region-id> source priority is: user explicitly specified → conversation/ticket context → default region from aliyun configure list → confirm with user. If user confirmation is needed, must read `references/region-list.md` and present options as option cards — forbidden to require manual region ID input.
  2. Cluster ID Validation: Before calling aliyun adbai, must first execute aliyun adb describe-db-clusters --api-version 2021-12-01 --biz-region-id <region-id> --region <region-id>, and search for the user's cluster ID in the returned Items.DBCluster[]:
  • Match found → validation passed
  • Empty list or no match → do not proceed, display actual clusters as option cards for user to select
  • User did not provide cluster ID → display cluster list as option cards (≤10 options) for user to select
  1. Pre-Execution Confirmation: After parameter validation, present the operation to be executed as option cards (e.g., "Continue" / "Cancel") for user confirmation — forbidden to require manual confirmation input.
  2. Mandatory Checklist (all conditions must be met before execution, none can be omitted):
  • [ ] biz-region-id confirmed by user
  • [ ] cluster-id confirmed by user and exists in describe-db-clusters returned list
  • [ ] Pre-execution confirmation obtained from user
  1. Region Routing Rules (P0): The aliyun adbai service endpoint is not deployed in every region. For all `aliyun adbai` calls, `--region` and `--endpoint` must be forcibly overridden according to the following routing table mapping, even if the user has specified a region — do not use the user's specified values:
biz-region-id--region--endpoint
cn-hangzhou, cn-shanghai, cn-beijing, cn-shenzhen, cn-hongkong, cn-qingdao, cn-heyuan, cn-chengdu, cn-guangzhou, cn-zhangjiakou, cn-wulanchabu, cn-huhehaote, cn-shanghai-cloudspe, cn-hangzhou-finance, cn-beijing-finance-1, cn-shenzhen-finance-1, cn-shanghai-finance-1cn-beijingadbai.cn-beijing.aliyuncs.com
ap-southeast-1, ap-southeast-3, ap-southeast-5, ap-southeast-6, ap-southeast-7, ap-northeast-1, ap-northeast-2, eu-central-1, eu-west-1, me-east-1, me-central-1, na-south-1ap-southeast-1adbai.ap-southeast-1.aliyuncs.com
us-east-1, us-west-1us-west-1adbai.us-west-1.aliyuncs.com

Example: User's cluster is in cn-zhangjiakou → --biz-region-id cn-zhangjiakou --region cn-beijing --endpoint adbai.cn-beijing.aliyuncs.com

All sections below and examples in references/*.md that contain --db-cluster-id without --biz-region-id are automatically supplemented per this section's convention; this is not repeated in each reference — this section takes precedence.

2. Scenario Routing

Product Boundary: This Skill only applies to AnalyticDB for MySQL (ADB MySQL), cluster IDs typically start with am-xxx or amv-xxx. If the user mentions other Alibaba Cloud products (e.g., Elasticsearch, RDS MySQL, PolarDB, ClickHouse, etc.), clearly inform the user that this Skill does not apply and stop execution.

🚨🚨🚨 MUST | P0 | NON-NEGOTIABLE — Mandatory Enforcement Rules (Violation = Failure) 🚨🚨🚨
The following rules have the highest priority and must be enforced unconditionally — they must not be violated under any circumstances:
### Rule 1: Mandatory API Invocation
When a user request matches the following scenarios, must immediately execute the corresponding API call — skipping is prohibited:
| User Request Keywords | MUST-Call API | Prohibited Behavior |
|---------------|---------------|----------|
| "cluster list", "instance list", "all clusters", "list clusters" | describe-db-clusters | ❌ Not calling API, giving advice directly |
| "data skew", "BadSQL", "slow SQL detection", "running SQL", "idle index", "SQL Pattern", "space diagnosis", "health inspection", "instance diagnosis", "slow query", "RT increase", "cluster stall" and other diagnosis keywords | DescribeChatMessage | ❌ Not calling API, only giving advice/explaining concepts |
### Rule 2: Mandatory Command String Output (First Line of Response)
MUST: Every ADB OpenAPI call, must explicitly output the executed command string at the [first line] or [beginning] of the response.
Mandatory Format (must be strictly followed):
```
Command executed: aliyun adb <command-name> --api-version 2021-12-01 --biz-region-id <region-id> [--db-cluster-id <cluster-id>] [other parameters]
or
Command executed: aliyun adbai describe-chat-message --region <mapped-region> --endpoint <mapped-endpoint> --biz-region-id <region-id> --query "<user question>"
[Then diagnostic results, tables, etc.]
```
Correct Examples:
```
Command executed: aliyun adb describe-db-clusters --api-version 2021-12-01 --biz-region-id cn-zhangjiakou --region cn-zhangjiakou
Query complete! There are 2 ADB MySQL clusters in the Zhangjiakou region...
```
```
Command executed: aliyun adbai describe-chat-message --region cn-beijing --endpoint adbai.cn-beijing.aliyuncs.com --biz-region-id cn-zhangjiakou --query "amv-xxx slow query diagnosis for the last 3 hours"
Diagnosis complete! Found the following issues...
```
Incorrect Examples (violation = failure):
```
❌ Query complete! There are 2 clusters in the Zhangjiakou region... (command string not output)
❌ I called the API to query the cluster list... (complete command not output)
❌ Command executed... (specific command content not output)
❌ aliyun adb describe-db-clusters --biz-region-id cn-zhangjiakou --region cn-zhangjiakou (missing --api-version 2021-12-01)
```
### Rule 3: Prohibited Evasion Behaviors
NON-NEGOTIABLE: The following behaviors are absolutely prohibited:
- ❌ Not calling API and directly giving general advice or concept explanations
- ❌ Calling API but not outputting the complete command string at the beginning of the response
- ❌ Using vague expressions like "We suggest you...", "You can try..." instead of actual diagnosis
- ❌ Only outputting documentation content without executing actual operations
- ❌ Placing the command string in the middle or end of the response
- ❌ Calling aliyun adb commands without --api-version 2021-12-01 (would default to the old version 2019-03-15)
Violating the above rules = task failure, no exceptions

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
216
Repository forks
27
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-analyticdb-mysql-copilot/badge)](https://verified-skill.com/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-analyticdb-mysql-copilot)

Something wrong with this skill or its page? Tell us.