This Skill focuses on Alibaba Cloud PolarDB MySQL/PostgreSQL database intelligent O&M. It invokes the Yaochi Agent v2 backend through the get-yao-chi-agent API and the aliyun CLI DAS plugin.
Architecture: Codex Skill -> scripts/call_yaochi_agent.sh -> Aliyun CLI -> DAS Plugin (Signature V3) -> get-yao-chi-agent API -> Yaochi Agent v2 -> PolarDB Skill/MCP/DAS/RAG capabilities
Scope: PolarDB only. Do not use this Skill for non-PolarDB product O&M requests unless the user's request is explicitly about PolarDB integration or comparison.
CapabilityDescriptionInstance query and filteringNatural-language filtering for PolarDB clusters by ID, engine, version, status, pay type, zone, architecture, tags, name, creation window, or expiration windowInstance status inspectionRuntime status, node health, version, lock/migration state, endpoint state, pay type, and expiration checksCluster resource inspectionCPU, memory, connections, IOPS, storage, Serverless PCU behavior, capacity pressure, and trend analysisConnection and session inspectionConnection usage, active sessions, idle transaction risk, connection trend, and connection pool suggestionsProxy performance inspectionProxy CPU, QPS, connection stability, response time, endpoint/routing information, and read/write split signal checksBackup inspectionBackup policy, backup records, backup task status, log backup/PITR capability, and backup success/failure riskSecurity inspectionWhitelist, public exposure risk, SSL/TDE, account security posture, and SQL audit configurationHigh availability and disaster recoveryMulti-zone/HA posture, hot standby state, GDN/migration signals, HA switch records, and DR readinessLog diagnosticsError log and slow log volume, pattern analysis, and operational recommendationsServerless inspectionPCU min/max configuration, scaling behavior, auto-pause posture, and workload-resource fitParameter explanationPolarDB MySQL/PostgreSQL parameter meaning, defaults, risk, best practices, and restart/effective-scope notesParameter change assessmentParameter modification log explanation, multi-parameter impact assessment, and change-risk suggestionsIMCI parameter explanationPolarDB MySQL IMCI columnar index parameter explanation and usage guidanceKernel and proxy version diagnosticsDB kernel/proxy version gap analysis, release-note based risk assessment, high-risk fixed bug checks, and upgrade suggestionsHA switchover and event analysisHA switchover root cause, related performance/log evidence, event impact, and follow-up mitigationStorage diagnosticsStorage composition, growth trend, abnormal usage, cold data/archive signals, and cleanup or capacity adviceSQL performance diagnosticsSlow SQL, execution plan, lock/blocking, and index optimization diagnostics when supported by backend and permissions
The local Skill does not call PolarDB MCP tools directly. It sends a natural-language query to Yaochi Agent v2. The backend is responsible for:
When answering users, treat the backend output as the source of truth. Do not invent cluster status, metrics, logs, risk levels, or document links that are not present in the response.
[MUST] User-Agent template — Every Alibaba Cloud CLI, SDK, or Terraform invocation made by this Skill must use:
AlibabaCloud-Agent-Skills/alibabacloud-polardb-ai-assistant/{session-id}
[MUST] Session-id rule — Generate one observability session ID at the start of each Skill execution session, reuse the same value across all Alibaba Cloud CLI, SDK, and Terraform calls in that session, and do not regenerate it for retries or multi-step workflows. The session ID must be a 32-character lowercase hexadecimal string.
bash
export ALIBABACLOUD_AGENT_SKILL_SESSION_ID="${ALIBABACLOUD_AGENT_SKILL_SESSION_ID:-$(openssl rand -hex 16)}"
[MUST] CLI User-Agent — Every aliyun CLI command invocation must include:
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardb-ai-assistant/${ALIBABACLOUD_AGENT_SKILL_SESSION_ID}
Pre-check: Aliyun CLI >= 3.3.3 required Run
aliyun versionto verify >= 3.3.3. If not installed or version too low, download the installer, review it, then run it locally to update, or see references/cli-installation-guide.md for installation instructions. Then [MUST] runaliyun configure set --auto-plugin-install trueto enable automatic plugin installation. Then [MUST] runaliyun plugin updateto ensure that any existing plugins on your local machine are always up-to-date.
bash
# Install aliyun CLI after reviewing the downloaded installer
curl -fsSL https://aliyuncli.alicdn.com/setup.sh -o /tmp/aliyun-cli-setup.sh
less /tmp/aliyun-cli-setup.sh
bash /tmp/aliyun-cli-setup.sh
aliyun version # Verify >= 3.3.3
# Enable automatic plugin installation
aliyun configure set --auto-plugin-install true
# Install DAS plugin (get-yao-chi-agent requires plugin for Signature V3 support)
aliyun plugin install --names aliyun-cli-das
# Install jq (for JSON response parsing)
# macOS:
brew install jq
# Ubuntu/Debian:
# sudo apt-get install jq
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, instance names, CIDR blocks, passwords, domain names, resource specifications, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
ParameterRequired/OptionalDescriptionDefaultqueryRequiredNatural language query content (including region, cluster info)---session-idOptionalSession ID for multi-turn conversation---profileOptionalaliyun CLI profile namedefault
Credentials use existing aliyun CLI configuration, no additional AK/SK setup required:
bash
# Recommended: OAuth mode
aliyun configure --mode OAuth
# Or: AK mode
aliyun configure set \
--mode AK \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--region cn-hangzhou
# Cross-account access: RamRoleArn mode
aliyun configure set \
--mode RamRoleArn \
--access-key-id <your-access-key-id> \
--access-key-secret <your-access-key-secret> \
--ram-role-arn acs:ram::<account-id>:role/<role-name> \
--role-session-name yaochi-agent-session \
--region cn-hangzhou
See references/ram-policies.md
All intelligent O&M operations are invoked through scripts/call_yaochi_agent.sh, which wraps aliyun das get-yao-chi-agent (DAS plugin kebab-case command, supports Signature V3) with streaming response parsing.
bash
# Cluster management
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List PolarDB clusters in Hangzhou region"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show detailed configuration of cluster pc-xxx"
# Performance diagnostics
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Analyze cluster pc-xxx performance in the last hour"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show slow SQL of cluster pc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Diagnose lock blocking and index risks for PolarDB PostgreSQL cluster pc-xxx"
# Parameter tuning
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to tune innodb_buffer_pool_size for cluster pc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Explain loose_polar_log_bin parameter"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Compare parameters between pc-xxx and pc-yyy"
# Primary-standby switchover diagnostics
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Analyze recent primary-standby switchover cause for cluster pc-xxx"
# Connection and session
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to troubleshoot high connection count in cluster pc-xxx"
# Backup recovery
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show backup status of cluster pc-xxx"
# Inspection
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Generate a health inspection report for cluster pc-xxx"
# Multi-turn conversation (use session ID from previous response)
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Continue analysis" --session-id "<session-id>"
# Specify profile
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List clusters" --profile myprofile
# Read from stdin
echo "List clusters" | bash $SKILL_DIR/scripts/call_yaochi_agent.sh -
If call_yaochi_agent.sh fails, do not summarize it as only Error: SDKError.
Surface the structured error block from stderr to the user, especially:
text
[YaoChi Agent Error]
ErrorCode: <aliyun error code>
ErrorMessage: <full error description>
AuthAction: <required RAM action, when returned>
RequestId: <request id, when returned>
Suggestion: <specific fix>
Reference: <local skill reference>
Troubleshooting: <Aliyun troubleshooting link>
For permission errors such as Forbidden.RAM, check AuthAction first and guide
the user to grant that RAM action or the policies in
references/ram-policies.md. For credential,
throttling, timeout, or plugin errors, use the Suggestion and
references/verification-method.md to give
the next concrete fix.
Throttling.UserConcurrentLimit means the account has exceeded the Yaochi Agent
concurrent request limit. Current production verification shows at most 2
concurrent sessions per account; wait for an existing request to finish before
retrying.
For diagnosis and inspection questions, keep the answer evidence-driven:
For high-risk or change-related requests:
ScenarioExample QuestionCluster ManagementList nodes and endpoints of cluster pc-xxxInstance QueryList PolarDB MySQL 8.0 prepaid clusters in BeijingHealth InspectionGenerate a health inspection report for cluster pc-xxxPerformance DiagnosticsTroubleshoot high CPU usage in cluster pc-xxxSlow SQL AnalysisShow slow SQL in cluster pc-xxx in the last hourParameter TuningWhat does loose_polar_log_bin parameter meanParameter ChangeExplain parameter changes of pc-xxx in the last 3 daysParameter ComparisonCompare parameter differences between pc-xxx and pc-yyyIMCI ParametersHow to configure IMCI related parameters for cluster pc-xxxHA SwitchoverAnalyze recent primary-standby switchover cause for cluster pc-xxxBackup RecoveryWhen was the latest backup of cluster pc-xxxStorage OptimizationWhat to do if storage usage of cluster pc-xxx grows too fastConnection TroubleshootingCluster pc-xxx connections are fullSecurity AuditCheck security configuration of cluster pc-xxxVersion RiskAnalyze DB kernel and proxy version risk for pc-xxxEvent AnalysisAnalyze PolarDB event impact for pc-xxx
See references/verification-method.md
This Skill focuses on query and diagnostics capabilities, does not create any resources, no cleanup required.
The following operations are NOT within the scope of this Skill:
The Skill may explain these operations, assess risk, and guide the user through the required checks, but it must not claim that a change was executed unless the backend response explicitly confirms it.
See references/related-apis.md
pc-; include the full cluster ID in queries when available.--session-id for complex diagnostic scenarios to maintain context continuity.Throttling.UserConcurrentLimit error, wait for previous query to complete and retry.aliyun configure to manage credentials, never hardcode AK/SK in scripts.ReferenceDescriptionreferences/cli-installation-guide.mdAliyun CLI installation and configuration guidereferences/related-apis.mdRelated API and CLI command listreferences/ram-policies.mdRAM permission policy listreferences/verification-method.mdSuccess verification methodsreferences/acceptance-criteria.mdAcceptance criteria