PolarDB Database AI Assistant This Skill focuses on Alibaba Cloud PolarDB MySQL/PostgreSQL database intelligent O&M, invoking the get-yao-chi-agent API through the aliyun CLI DAS plugin for diagnostics and analysis. Architecture : → → → PolarDB Intelligent Diagnostics Supported Capabilities | Capability | Description | |------------|-------------| | PolarDB Primary-Standby Switchover Analysis | Failover cause investigation, switchover log analysis, unexpected Failover diagnostics | | PolarDB Kernel Parameter Change Assessment | Impact assessment before parameter modification, change risk anal…

\\r'}\"\n [[ -z \"$line\" ]] && continue\n\n # Detect response format on first line\n if [[ \"$format_detected\" == false ]]; then\n if [[ \"$line\" =~ ^data: ]]; then\n is_sse=true\n debug_log \"Detected SSE format response\"\n elif echo \"$line\" | jq -e '.data' &>/dev/null 2>&1; then\n is_json_stream=true\n debug_log \"Detected streaming JSON format response (DAS plugin)\"\n else\n # Might be error response or plain JSON, buffer first\n error_buffer=\"$line\"\n # Check if error response\n local error_code\n error_code=$(echo \"$line\" | jq -r '.Code // empty' 2>/dev/null) || true\n if [[ -n \"$error_code\" ]]; then\n local error_msg\n error_msg=$(echo \"$line\" | jq -r '.Message // empty' 2>/dev/null) || true\n echo \"Error: ${error_msg:-Unknown error} (${error_code})\" >&2\n if [[ \"$error_code\" == *\"Throttling\"* ]] || [[ \"$error_code\" == *\"ConcurrentLimit\"* ]]; then\n echo \"Max 2 concurrent sessions per account. Please wait for previous query to complete.\" >&2\n fi\n return 1\n fi\n # Try to handle as plain JSON response\n local content\n content=$(echo \"$line\" | jq -r '.Content // .Data // empty' 2>/dev/null) || true\n if [[ -n \"$content\" ]]; then\n printf \"%s\" \"$content\"\n session_id=$(echo \"$line\" | jq -r '.SessionId // empty' 2>/dev/null) || true\n else\n # Cannot parse, output as-is\n echo \"$line\"\n fi\n format_detected=true\n continue\n fi\n format_detected=true\n fi\n\n # Process SSE format\n if [[ \"$is_sse\" == true ]]; then\n if [[ \"$line\" =~ ^data:\\ ?(.*) ]]; then\n local data=\"${BASH_REMATCH[1]}\"\n [[ \"$data\" == \"[DONE]\" || -z \"$data\" ]] && continue\n\n local chunk_content\n chunk_content=$(echo \"$data\" | jq -r '.Content // empty' 2>/dev/null) || true\n [[ -n \"$chunk_content\" ]] && printf \"%s\" \"$chunk_content\"\n\n local chunk_session\n chunk_session=$(echo \"$data\" | jq -r '.SessionId // empty' 2>/dev/null) || true\n [[ -n \"$chunk_session\" ]] && session_id=\"$chunk_session\"\n\n if [[ \"$DEBUG\" == \"true\" ]]; then\n local reasoning\n reasoning=$(echo \"$data\" | jq -r '.ReasoningContent // empty' 2>/dev/null) || true\n [[ -n \"$reasoning\" ]] && debug_log \"Reasoning: $reasoning\"\n fi\n fi\n fi\n\n # Process streaming JSON format\n if [[ \"$is_json_stream\" == true ]]; then\n local chunk_content\n chunk_content=$(echo \"$line\" | jq -r '.data.Content // empty' 2>/dev/null) || true\n [[ -n \"$chunk_content\" ]] && printf \"%s\" \"$chunk_content\"\n\n local chunk_session\n chunk_session=$(echo \"$line\" | jq -r '.data.SessionId // empty' 2>/dev/null) || true\n [[ -n \"$chunk_session\" ]] && session_id=\"$chunk_session\"\n\n if [[ \"$DEBUG\" == \"true\" ]]; then\n local reasoning\n reasoning=$(echo \"$line\" | jq -r '.data.ReasoningContent // empty' 2>/dev/null) || true\n [[ -n \"$reasoning\" ]] && debug_log \"Reasoning: $reasoning\"\n fi\n fi\n done\n\n # Output newline (end of content)\n echo \"\"\n\n # Output session ID (to stderr for multi-turn conversation)\n if [[ -n \"$session_id\" ]]; then\n echo \"\" >&2\n echo \"[SessionID] $session_id\" >&2\n fi\n}\n\n# --- Argument parsing ---\nwhile [[ $# -gt 0 ]]; do\n case \"$1\" in\n --session-id)\n SESSION_ID=\"$2\"\n shift 2\n ;;\n --profile)\n PROFILE=\"$2\"\n shift 2\n ;;\n --debug|-d)\n DEBUG=true\n shift\n ;;\n --help|-h)\n usage\n exit 0\n ;;\n -)\n QUERY=$(cat)\n shift\n ;;\n -*)\n echo \"Unknown option: $1\" >&2\n usage\n exit 1\n ;;\n *)\n QUERY=\"$1\"\n shift\n ;;\n esac\ndone\n\n# --- Input validation ---\n# Max query length (reasonable limit for natural language queries)\nMAX_QUERY_LENGTH=4000\n# Max session ID length\nMAX_SESSION_ID_LENGTH=128\n# Session ID format: alphanumeric, hyphens, underscores only\nSESSION_ID_PATTERN='^[a-zA-Z0-9_-]+

PolarDB Database AI Assistant This Skill focuses on Alibaba Cloud PolarDB MySQL/PostgreSQL database intelligent O&M, invoking the get-yao-chi-agent API through the aliyun CLI DAS plugin for diagnostics and analysis. Architecture : → → → PolarDB Intelligent Diagnostics Supported Capabilities | Capability | Description | |------------|-------------| | PolarDB Primary-Standby Switchover Analysis | Failover cause investigation, switchover log analysis, unexpected Failover diagnostics | | PolarDB Kernel Parameter Change Assessment | Impact assessment before parameter modification, change risk anal…

\n\nvalidate_input() {\n # Validate QUERY\n if [[ -z \"$QUERY\" ]]; then\n usage\n exit 1\n fi\n\n local query_length=${#QUERY}\n if [[ $query_length -gt $MAX_QUERY_LENGTH ]]; then\n echo \"Error: Query too long ($query_length chars). Maximum allowed: $MAX_QUERY_LENGTH\" >&2\n exit 1\n fi\n\n # Validate SESSION_ID if provided\n if [[ -n \"$SESSION_ID\" ]]; then\n local session_id_length=${#SESSION_ID}\n if [[ $session_id_length -gt $MAX_SESSION_ID_LENGTH ]]; then\n echo \"Error: Session ID too long ($session_id_length chars). Maximum allowed: $MAX_SESSION_ID_LENGTH\" >&2\n exit 1\n fi\n\n if [[ ! \"$SESSION_ID\" =~ $SESSION_ID_PATTERN ]]; then\n echo \"Error: Invalid session ID format. Only alphanumeric, hyphens, and underscores allowed.\" >&2\n exit 1\n fi\n fi\n\n # Validate PROFILE if provided (alphanumeric, hyphens, underscores, dots)\n if [[ -n \"$PROFILE\" ]]; then\n if [[ ! \"$PROFILE\" =~ ^[a-zA-Z0-9._-]+$ ]]; then\n echo \"Error: Invalid profile name format.\" >&2\n exit 1\n fi\n fi\n}\n\n# --- Validation ---\nvalidate_input\n\ncheck_dependencies\n\n# --- Build CLI command arguments ---\n# Use DAS plugin's kebab-case command, supports Signature V3\ncli_args=(das get-yao-chi-agent\n --query \"$QUERY\"\n --source \"$SOURCE\"\n --endpoint \"$ENDPOINT\"\n --read-timeout \"$READ_TIMEOUT\"\n --connect-timeout \"$CONNECT_TIMEOUT\"\n --user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardb-ai-assistant\n)\n\nif [[ -n \"$SESSION_ID\" ]]; then\n cli_args+=(--session-id \"$SESSION_ID\")\nfi\n\nif [[ -n \"$PROFILE\" ]]; then\n cli_args+=(--profile \"$PROFILE\")\nfi\n\n# --- Output query info ---\necho \"[Query] $QUERY\" >&2\nif [[ -n \"$SESSION_ID\" ]]; then\n echo \"[SessionID] $SESSION_ID\" >&2\nfi\necho \"============================================================\" >&2\necho \"[YaoChi Agent Response]\" >&2\n\ndebug_log \"Executing: aliyun ${cli_args[*]}\"\n\n# --- Execute and stream parse ---\n# Use pipe for real streaming output, avoid command substitution blocking\naliyun \"${cli_args[@]}\" 2>&1 | parse_sse_streaming\nexit_code=${PIPESTATUS[0]}\n\nif [[ $exit_code -ne 0 ]]; then\n # Non-zero exit but content already output via pipe, just log debug info\n debug_log \"aliyun CLI exit code: $exit_code (streaming response may return non-zero)\"\nfi\n","content_type":"application/x-sh; charset=utf-8","language":"bash","size":10364,"content_sha256":"0e37a19ceb6b5ab52ee6991f253e12f6723c7c71d535c840e3232964c7033eb3"}],"content_json":{"type":"doc","content":[{"type":"heading","attrs":{"level":1},"content":[{"text":"PolarDB Database AI Assistant","type":"text"}]},{"type":"paragraph","content":[{"text":"This Skill focuses on ","type":"text"},{"text":"Alibaba Cloud PolarDB MySQL/PostgreSQL database","type":"text","marks":[{"type":"strong"}]},{"text":" intelligent O&M, invoking the get-yao-chi-agent API through the aliyun CLI DAS plugin for diagnostics and analysis.","type":"text"}]},{"type":"paragraph","content":[{"text":"Architecture","type":"text","marks":[{"type":"strong"}]},{"text":": ","type":"text"},{"text":"Aliyun CLI","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"DAS Plugin (Signature V3)","type":"text","marks":[{"type":"code_inline"}]},{"text":" → ","type":"text"},{"text":"get-yao-chi-agent API","type":"text","marks":[{"type":"code_inline"}]},{"text":" → PolarDB Intelligent Diagnostics","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Supported Capabilities","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Capability","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Primary-Standby Switchover Analysis","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Failover cause investigation, switchover log analysis, unexpected Failover diagnostics","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Kernel Parameter Change Assessment","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Impact assessment before parameter modification, change risk analysis","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Kernel Parameter Explanation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parameter meaning explanation, configuration suggestions, performance impact analysis","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Kernel Parameter Explanation (IMCI)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"IMCI columnar engine related parameter explanation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Kernel Version Proxy Diagnostics","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Proxy layer troubleshooting, version compatibility diagnostics","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB Kernel Version Instance Diagnostics","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instance layer version issue diagnostics, upgrade suggestions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instance Query Filter","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"PolarDB instance search and filtering","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Proxy Performance Monitoring","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Proxy layer performance metrics analysis, connection routing diagnostics","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Serverless Configuration","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Serverless instance parameters and elastic scaling configuration","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"SQL Optimization Analysis","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Slow SQL analysis, index suggestions, execution plan interpretation","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Expiring Instance Query","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Subscription instance expiration reminder","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Backup Status Check","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Backup completion, retention policy, recovery point in time","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Storage Usage Diagnostics","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Storage consumption analysis, growth trends, space optimization suggestions","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security Configuration Audit","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Whitelist, SSL, security policy audit","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instance Status Check","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Instance health status, running status verification","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Log Diagnostics","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Error log analysis, slow log troubleshooting","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auto-Increment ID Overflow Detection","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Auto-increment ID exhaustion risk detection, primary key overflow warning","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Connection and Session Analysis","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Connection count monitoring, session issue troubleshooting, connection pool optimization","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cluster Performance Monitoring","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"QPS/TPS/connections/throughput and other core metrics analysis","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"High Availability and Disaster Recovery","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"HA configuration assessment, disaster recovery architecture diagnostics","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Installation","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"Pre-check: Aliyun CLI >= 3.3.3 required","type":"text","marks":[{"type":"strong"}]},{"text":" Run ","type":"text"},{"text":"aliyun version","type":"text","marks":[{"type":"code_inline"}]},{"text":" to verify >= 3.3.3. If not installed or version too low, run ","type":"text"},{"text":"curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash","type":"text","marks":[{"type":"code_inline"}]},{"text":" to update, or see ","type":"text"},{"text":"references/cli-installation-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/cli-installation-guide.md","title":null}}]},{"text":" for installation instructions. Then ","type":"text"},{"text":"[MUST]","type":"text","marks":[{"type":"strong"}]},{"text":" run ","type":"text"},{"text":"aliyun configure set --auto-plugin-install true","type":"text","marks":[{"type":"code_inline"}]},{"text":" to enable automatic plugin installation. Then ","type":"text"},{"text":"[MUST]","type":"text","marks":[{"type":"strong"}]},{"text":" run ","type":"text"},{"text":"aliyun plugin update","type":"text","marks":[{"type":"code_inline"}]},{"text":" to ensure that any existing plugins on your local machine are always up-to-date.","type":"text"}]}]},{"type":"paragraph","content":[{"text":"[MUST] CLI User-Agent","type":"text","marks":[{"type":"strong"}]},{"text":" — Every ","type":"text"},{"text":"aliyun","type":"text","marks":[{"type":"code_inline"}]},{"text":" CLI command invocation must include: ","type":"text"},{"text":"--user-agent AlibabaCloud-Agent-Skills/alibabacloud-polardb-ai-assistant","type":"text","marks":[{"type":"code_inline"}]}]},{"type":"paragraph","content":[{"text":"[MUST] Enable AI-Mode","type":"text","marks":[{"type":"strong"}]},{"text":" — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation:","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"aliyun configure ai-mode enable\naliyun configure ai-mode set-user-agent --user-agent \"AlibabaCloud-Agent-Skills/alibabacloud-polardb-ai-assistant\"","type":"text"}]},{"type":"paragraph","content":[{"text":"[MUST] Disable AI-Mode at EVERY exit point","type":"text","marks":[{"type":"strong"}]},{"text":" — 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.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"aliyun configure ai-mode disable","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Install aliyun CLI\ncurl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash\naliyun version # Verify >= 3.3.3\n\n# Enable automatic plugin installation\naliyun configure set --auto-plugin-install true\n\n# Install DAS plugin (get-yao-chi-agent requires plugin for Signature V3 support)\naliyun plugin install --names aliyun-cli-das\n\n# Install jq (for JSON response parsing)\n# macOS:\nbrew install jq\n# Ubuntu/Debian:\n# sudo apt-get install jq","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Parameter Confirmation","type":"text"}]},{"type":"blockquote","content":[{"type":"paragraph","content":[{"text":"IMPORTANT: Parameter Confirmation","type":"text","marks":[{"type":"strong"}]},{"text":" — 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.","type":"text"}]}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parameter","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required/Optional","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Default","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"query","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Required","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Natural language query content (including region, cluster info)","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--session-id","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optional","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Session ID for multi-turn conversation","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"-","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"--profile","type":"text","marks":[{"type":"code_inline"}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Optional","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"aliyun CLI profile name","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"default","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Authentication","type":"text"}]},{"type":"paragraph","content":[{"text":"Credentials use existing aliyun CLI configuration, ","type":"text"},{"text":"no additional AK/SK setup required","type":"text","marks":[{"type":"strong"}]},{"text":":","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Recommended: OAuth mode\naliyun configure --mode OAuth\n\n# Or: AK mode\naliyun configure set \\\n --mode AK \\\n --access-key-id \u003cyour-access-key-id> \\\n --access-key-secret \u003cyour-access-key-secret> \\\n --region cn-hangzhou\n\n# Cross-account access: RamRoleArn mode\naliyun configure set \\\n --mode RamRoleArn \\\n --access-key-id \u003cyour-access-key-id> \\\n --access-key-secret \u003cyour-access-key-secret> \\\n --ram-role-arn acs:ram::\u003caccount-id>:role/\u003crole-name> \\\n --role-session-name yaochi-agent-session \\\n --region cn-hangzhou","type":"text"}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"RAM Policy","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"references/ram-policies.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/ram-policies.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Core Workflow","type":"text"}]},{"type":"paragraph","content":[{"text":"All intelligent O&M operations are invoked through ","type":"text"},{"text":"scripts/call_yaochi_agent.sh","type":"text","marks":[{"type":"code_inline"}]},{"text":", which wraps ","type":"text"},{"text":"aliyun das get-yao-chi-agent","type":"text","marks":[{"type":"code_inline"}]},{"text":" (DAS plugin kebab-case command, supports Signature V3) with streaming response parsing.","type":"text"}]},{"type":"code_block","attrs":{"wrap":false,"language":"bash"},"content":[{"text":"# Cluster management\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"List PolarDB clusters in Hangzhou region\"\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Show detailed configuration of cluster pc-xxx\"\n\n# Performance diagnostics\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Analyze cluster pc-xxx performance in the last hour\"\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Show slow SQL of cluster pc-xxx\"\n\n# Parameter tuning\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"How to tune innodb_buffer_pool_size for cluster pc-xxx\"\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Explain loose_polar_log_bin parameter\"\n\n# Primary-standby switchover diagnostics\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Analyze recent primary-standby switchover cause for cluster pc-xxx\"\n\n# Connection and session\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"How to troubleshoot high connection count in cluster pc-xxx\"\n\n# Backup recovery\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Show backup status of cluster pc-xxx\"\n\n# Multi-turn conversation (use session ID from previous response)\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"Continue analysis\" --session-id \"\u003csession-id>\"\n\n# Specify profile\nbash $SKILL_DIR/scripts/call_yaochi_agent.sh \"List clusters\" --profile myprofile\n\n# Read from stdin\necho \"List clusters\" | bash $SKILL_DIR/scripts/call_yaochi_agent.sh -","type":"text"}]},{"type":"heading","attrs":{"level":3},"content":[{"text":"Example Questions","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Scenario","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Example Question","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cluster Management","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"List nodes of cluster pc-xxx","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Performance Diagnostics","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"How to troubleshoot high CPU usage in cluster pc-xxx","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Slow SQL Analysis","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Show slow SQL in cluster pc-xxx in the last hour","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Parameter Tuning","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"What does loose_polar_log_bin parameter mean","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"IMCI Parameters","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"How to configure IMCI related parameters for cluster pc-xxx","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Primary-Standby","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"How to handle high primary-standby delay in cluster pc-xxx","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Backup Recovery","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"When was the latest backup of cluster pc-xxx","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Storage Optimization","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"What to do if storage usage of cluster pc-xxx grows too fast","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Connection Troubleshooting","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Cluster pc-xxx connections are full","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Security Audit","type":"text"}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Check security configuration of cluster pc-xxx","type":"text"}]}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Success Verification","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"references/verification-method.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/verification-method.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Cleanup","type":"text"}]},{"type":"paragraph","content":[{"text":"This Skill focuses on ","type":"text"},{"text":"query and diagnostics","type":"text","marks":[{"type":"strong"}]},{"text":" capabilities, does not create any resources, no cleanup required.","type":"text"}]},{"type":"paragraph","content":[{"text":"The following operations are NOT within the scope of this Skill:","type":"text"}]},{"type":"bullet_list","content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Create/delete PolarDB clusters","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Change instance specifications","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Purchase/renew instances","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"API and Command Tables","type":"text"}]},{"type":"paragraph","content":[{"text":"See ","type":"text"},{"text":"references/related-apis.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/related-apis.md","title":null}}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Best Practices","type":"text"}]},{"type":"ordered_list","attrs":{"order":1,"listStyle":"number"},"content":[{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Cluster ID Format","type":"text","marks":[{"type":"strong"}]},{"text":": PolarDB cluster IDs typically start with ","type":"text"},{"text":"pc-","type":"text","marks":[{"type":"code_inline"}]},{"text":", include the full cluster ID in queries","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Region Specification","type":"text","marks":[{"type":"strong"}]},{"text":": Explicitly specify region in natural language queries (e.g., \"Hangzhou region\", \"Beijing region\") to improve query accuracy","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Multi-turn Conversation","type":"text","marks":[{"type":"strong"}]},{"text":": Use ","type":"text"},{"text":"--session-id","type":"text","marks":[{"type":"code_inline"}]},{"text":" for complex diagnostic scenarios to maintain context continuity","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Concurrency Limit","type":"text","marks":[{"type":"strong"}]},{"text":": Maximum 2 concurrent sessions per account, avoid initiating multiple parallel calls","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"High-risk Operations","type":"text","marks":[{"type":"strong"}]},{"text":": For operations involving parameter changes, primary-standby switchover, always remind users to verify in test environment first","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Throttling Handling","type":"text","marks":[{"type":"strong"}]},{"text":": If encountering ","type":"text"},{"text":"Throttling.UserConcurrentLimit","type":"text","marks":[{"type":"code_inline"}]},{"text":" error, wait for previous query to complete and retry","type":"text"}]}]},{"type":"list_item","content":[{"type":"paragraph","content":[{"text":"Credential Security","type":"text","marks":[{"type":"strong"}]},{"text":": Use ","type":"text"},{"text":"aliyun configure","type":"text","marks":[{"type":"code_inline"}]},{"text":" to manage credentials, never hardcode AK/SK in scripts","type":"text"}]}]}]},{"type":"heading","attrs":{"level":2},"content":[{"text":"Reference Links","type":"text"}]},{"type":"table","attrs":{"layout":null},"content":[{"type":"tr","content":[{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Reference","type":"text"}]}]},{"type":"th","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Description","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/cli-installation-guide.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/cli-installation-guide.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Aliyun CLI installation and configuration guide","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/related-apis.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/related-apis.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Related API and CLI command list","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/ram-policies.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/ram-policies.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"RAM permission policy list","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/verification-method.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/verification-method.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Success verification methods","type":"text"}]}]}]},{"type":"tr","content":[{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"references/acceptance-criteria.md","type":"text","marks":[{"type":"link","attrs":{"href":"references/acceptance-criteria.md","title":null}}]}]}]},{"type":"td","attrs":{"colspan":1,"rowspan":1,"colwidth":null,"alignment":""},"content":[{"type":"paragraph","content":[{"text":"Acceptance criteria","type":"text"}]}]}]}]},{"type":"hr","attrs":{"markup":"---"}}]},"metadata":{"date":"2026-06-05","name":"alibabacloud-polardb-ai-assistant","author":"@skillopedia","source":{"stars":133,"repo_name":"alibabacloud-aiops-skills","origin_url":"https://github.com/aliyun/alibabacloud-aiops-skills/blob/HEAD/skills/database/polardb/alibabacloud-polardb-ai-assistant/SKILL.md","repo_owner":"aliyun","body_sha256":"46557d433e0c58f466e4bda931002fba84ea39b56f0ffc4860b589113e1559e5","cluster_key":"04341a2ca1aa2b1320cc1cfd159eae326b68f24ad5b1e0e28bd4cd5941fae3fd","clean_bundle":{"format":"clean-skill-bundle-v1","source":"aliyun/alibabacloud-aiops-skills/skills/database/polardb/alibabacloud-polardb-ai-assistant/SKILL.md","attachments":[{"id":"a2092204-da65-5fb4-aa9d-54cf3c46382d","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/a2092204-da65-5fb4-aa9d-54cf3c46382d/attachment.md","path":"references/acceptance-criteria.md","size":6405,"sha256":"4d3fe7bdde79d86fd75167b7e78d32ba0a7400342d7897d98e159d3b3b03e594","contentType":"text/markdown; charset=utf-8"},{"id":"5e3a4279-6ff4-5670-aa30-970585ef5d1a","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/5e3a4279-6ff4-5670-aa30-970585ef5d1a/attachment.md","path":"references/cli-installation-guide.md","size":11625,"sha256":"57d54676301eb38dbe00fa421a214f9ac5a2f9b04208d0744808b99193d804b4","contentType":"text/markdown; charset=utf-8"},{"id":"4aa02d0b-2457-56d0-832f-15041f77ca48","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/4aa02d0b-2457-56d0-832f-15041f77ca48/attachment.md","path":"references/ram-policies.md","size":1722,"sha256":"ad074999233bab8cad47e83a16c91d59ebe37e791028d8ea70eded76aae5dbbf","contentType":"text/markdown; charset=utf-8"},{"id":"6f1d15c4-e953-564c-860d-b4bbfcd79b1c","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/6f1d15c4-e953-564c-860d-b4bbfcd79b1c/attachment.md","path":"references/related-apis.md","size":2270,"sha256":"c3043514d1a69146788658690227509f6d073c1b8743162f0bb48b64b79af2a5","contentType":"text/markdown; charset=utf-8"},{"id":"c824d608-a3ed-56bb-a8ae-1ad4c49284a8","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/c824d608-a3ed-56bb-a8ae-1ad4c49284a8/attachment.md","path":"references/verification-method.md","size":2503,"sha256":"fda625f909586ad69a601d2bc489db40cd3b8648d26ded89be63c5ac51015f3a","contentType":"text/markdown; charset=utf-8"},{"id":"d2a5dc77-dcbe-5446-a45a-920c0e2799c2","key":"uploads/10433ee7-ad12-4ae0-b34e-97553e46c6c8/d2a5dc77-dcbe-5446-a45a-920c0e2799c2/attachment.sh","path":"scripts/call_yaochi_agent.sh","size":10364,"sha256":"0e37a19ceb6b5ab52ee6991f253e12f6723c7c71d535c840e3232964c7033eb3","contentType":"application/x-sh; charset=utf-8"}],"bundle_sha256":"f5a87b4f073ecd79cd60718400e4325db2177ec5455a9fa5528bf40487064d79","attachment_count":6,"text_attachments":6,"attachment_storage":"skillopedia-attachments-v1","binary_attachments":0,"excluded_attachments":[]},"cluster_size":1,"skill_md_path":"skills/database/polardb/alibabacloud-polardb-ai-assistant/SKILL.md","import_metadata":{"date":"2026-06-05","author":"@skillopedia","version":"v1","category":"security","category_label":"Security"},"exact_dupes_collapsed_into_this":0},"version":"v1","category":"security","import_tag":"clean-skills-v1","description":"Alibaba Cloud PolarDB Database AI Assistant. For PolarDB MySQL/PostgreSQL cluster management, performance diagnostics, parameter tuning, slow SQL analysis, backup recovery, connection session analysis, primary-standby switchover diagnostics, security configuration audit, and other O&M operations.\nUse when user questions involve PolarDB, cluster IDs starting with pc-, kernel parameters, primary-standby switchover, IMCI columnar storage, etc.\n"}},"renderedAt":1782982033484}

PolarDB Database AI Assistant This Skill focuses on Alibaba Cloud PolarDB MySQL/PostgreSQL database intelligent O&M, invoking the get-yao-chi-agent API through the aliyun CLI DAS plugin for diagnostics and analysis. Architecture : → → → PolarDB Intelligent Diagnostics Supported Capabilities | Capability | Description | |------------|-------------| | PolarDB Primary-Standby Switchover Analysis | Failover cause investigation, switchover log analysis, unexpected Failover diagnostics | | PolarDB Kernel Parameter Change Assessment | Impact assessment before parameter modification, change risk anal…