This skill provides intelligent O&M capabilities for Alibaba Cloud PolarDB-X distributed database, powered by the DAS (Database Autonomy Service) get-yao-chi-agent API via the aliyun CLI DAS plugin.
Architecture: Aliyun CLI -> DAS Plugin (Signature V3) -> get-yao-chi-agent API -> PolarDB-X Intelligent Diagnostics
CapabilityDescriptionInstance InformationInstance details, cluster configuration, version infoTopology InspectionCN/DN node distribution, shard topology, data node statusStorage InformationDisk usage, storage capacity, space growth trendsSQL OptimizationSlow SQL analysis, distributed execution plan interpretation, index suggestions, cross-shard query optimizationCluster Performance MonitoringQPS/TPS/connections/throughput and other core metrics analysisConnection & Session AnalysisConnection count monitoring, session troubleshooting, connection pool optimizationSecurity AuditWhitelist, SSL, security policy auditBackup Status CheckBackup completeness, retention policy, point-in-time recoveryInstance Health CheckInstance health status, running state verificationLog DiagnosticsError log analysis, slow log troubleshootingData Distribution AnalysisShard data skew detection, hotspot shard diagnosticsElastic Scaling DiagnosticsScale-out/in status, data migration progress, node load balancingParameter TuningKernel parameter interpretation, change impact assessment, configuration recommendationsHigh Availability & DRHA configuration assessment, disaster recovery architecture diagnostics, primary-standby statusExpiring Instance QuerySubscription instance expiration reminders, renewal status
Pre-check: Aliyun CLI >= 3.3.3 required Run
aliyun versionto verify >= 3.3.3. If not installed or version too low, runcurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bashto install/update, or see references/cli-installation-guide.md for installation instructions.
Pre-check: Aliyun CLI plugin update required [MUST] run
aliyun configure set --auto-plugin-install trueto enable automatic plugin installation. [MUST] runaliyun plugin updateto ensure that any existing plugins on your local machine are always up-to-date.
[MUST] CLI User-Agent — Every
aliyunCLI command invocation must include:--user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardbx-ai-assistant
[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-polardbx-ai-assistant"
[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
bash
# Install aliyun CLI
curl -fsSL https://aliyuncli.alicdn.com/install.sh | bash
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
No additional environment variables are required. This skill relies entirely on the aliyun CLI's existing credential configuration.
Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g.,
echo $ALIBABA_CLOUD_ACCESS_KEY_IDis FORBIDDEN)- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use
aliyun configure setwith literal credential values- ONLY use
aliyun configure listto check credential statusbash
aliyun configure listCheck the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
- Obtain credentials from Alibaba Cloud Console
- Configure credentials outside of this session (via
aliyun configurein terminal or environment variables in shell profile)- Return and re-run after
aliyun configure listshows a valid profile
Credentials are managed through aliyun CLI configuration — no additional AK/SK setup is needed:
bash
# Recommended: OAuth mode
aliyun configure --mode OAuth
# Alternative: AK mode (configure outside of agent session)
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 for the full list of required permissions.
[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
- Read
references/ram-policies.mdto get the full list of permissions required by this SKILL- Use
ram-permission-diagnoseskill to guide the user through requesting the necessary permissions- Pause and wait until the user confirms that the required permissions have been granted
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/OptionalDescriptionDefault ValuequeryRequiredNatural language query content (including region, instance info, etc.)---session-idOptionalSession ID for multi-turn conversation context---profileOptionalaliyun CLI profile namedefault
All intelligent O&M operations MUST be invoked through scripts/call_yaochi_agent.sh, which wraps the aliyun das get-yao-chi-agent (DAS plugin kebab-case command, supporting Signature V3) with streaming response parsing.
⚠️ CRITICAL RESTRICTION:
- DO NOT use direct
aliyun polardbxoraliyun rdsCLI commands for diagnostics, topology, or security audits.- DO NOT attempt to query instance details using
DescribeDBInstancesor similar APIs directly.- ONLY use the DAS plugin command:
aliyun das get-yao-chi-agent(wrapped bycall_yaochi_agent.sh).- If the script fails, check permissions via
ram-permission-diagnoseskill, DO NOT fallback to other product APIs.
bash
# Cluster Management
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "List PolarDB-X instances in Hangzhou region"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show detailed configuration of instance pxc-xxx"
# Topology Inspection
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show CN/DN node distribution of instance pxc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show shard topology of instance pxc-xxx"
# Performance Diagnostics
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Analyze performance of instance pxc-xxx in the last hour"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show slow SQL of instance pxc-xxx"
# SQL Optimization
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Optimize execution plan of this SQL on instance pxc-xxx"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Which cross-shard queries on instance pxc-xxx need optimization"
# Data Distribution
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Check whether data distribution of instance pxc-xxx is even"
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Are there any hotspot shards on instance pxc-xxx"
# Elastic Scaling
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show scale-out status of instance pxc-xxx"
# Parameter Tuning
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to tune CONN_POOL_MAX_POOL_SIZE parameter on instance pxc-xxx"
# Connection & Session
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "How to troubleshoot high connection count on instance pxc-xxx"
# Backup & Restore
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show backup status of instance pxc-xxx"
# Security Audit
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Check security configuration of instance pxc-xxx"
# High Availability & DR
bash $SKILL_DIR/scripts/call_yaochi_agent.sh "Show HA configuration of instance pxc-xxx"
# Multi-turn Conversation (use session ID returned from previous call)
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 instances" --profile myprofile
# Read from stdin
echo "List instances" | bash $SKILL_DIR/scripts/call_yaochi_agent.sh -
ScenarioExample QueryCluster ManagementShow node list of instance pxc-xxxTopologyHow many CN and DN nodes does instance pxc-xxx havePerformance DiagnosticsHow to troubleshoot high CPU usage on instance pxc-xxxSlow SQL AnalysisShow slow SQL of instance pxc-xxx in the last hourSQL OptimizationWhy is this SELECT statement slow on instance pxc-xxxData DistributionIs there data skew in shards of instance pxc-xxxElastic ScalingWhat is the scale-out progress of instance pxc-xxxParameter TuningHow to optimize connection pool parameters on instance pxc-xxxBackup & RestoreWhen was the latest backup of instance pxc-xxxStorage OptimizationWhat to do about rapid storage growth on instance pxc-xxxConnection TroubleshootingInstance pxc-xxx connection count is maxed outSecurity AuditCheck security configuration of instance pxc-xxxHigh AvailabilityIs the DR architecture of instance pxc-xxx reasonableExpiration ReminderWhich PolarDB-X instances are about to expire
See references/verification-method.md for detailed verification steps.
This skill focuses on query and diagnostics capabilities only. It does not create any resources, so no cleanup is needed.
The following operations are out of scope for this skill:
See references/related-apis.md for the full list of APIs and CLI commands.
pxc-. Always include the full instance ID in queries.--session-id to maintain context continuity in complex diagnostic scenarios.Throttling.UserConcurrentLimit error, wait for the previous query to complete before retrying.aliyun configure to manage credentials. Never hardcode AK/SK in scripts.ReferenceDescriptionreferences/cli-installation-guide.mdAliyun CLI installation and configuration guidereferences/related-apis.mdRelated APIs and CLI command listreferences/ram-policies.mdRAM permission policy listreferences/verification-method.mdSuccess verification methodsreferences/acceptance-criteria.mdAcceptance criteria