/alibabacloud-core:alibabacloud-mcp-core-script-generatefrom alibabacloud-core
Generates Alibaba Cloud RunScript-compatible Python scripts from natural-language requests. Uses MCP tools or HTTP metadata to discover API parameters before generating sandbox-safe automation code.
Ships in alibabacloud-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn a natural-language Alibaba Cloud request into one RunScript-compatible Python script.
The script must use await call_cli(...), assign the final value to result, and pass
check_sandbox.py validation before output. Do not execute the script unless the user asks.
call_cli()-based Python for the
RunScript sandbox — no SDK imports, no credentials, no local execution.alibabacloud-sdk-usage: generates typed/generic SDK code with
imports, credential providers, and dependency management for user projects.alibabacloud-find-skills first.Split the request into atomic cloud operations. For each operation, you must call at least one of the following methods to discover API parameters before writing any code:
Method A — MCP tools (preferred): call AlibabaCloud___SearchApis with a natural
language description, then AlibabaCloud___GetApiDefinition with the confirmed product,
action, and version. Batch search calls in one parallel round.
Method B — HTTP metadata (when MCP tools return errors):
The endpoint https://next.api.aliyun.com/meta/v1/products/{product}/versions/{version}/api-docs.json
contains all API definitions for a product. If WebFetch cannot extract the target
API (response too large), download the full JSON with curl and extract the target
API's parameters array using python3 -c "import json,sys; ..." or grep.
You must actually execute one of these methods — reading about them is not sufficient.
Only if your tool call returns an error may you fall back to best-known parameter names,
adding: # WARNING: API parameters not verified — confirm before use.
Generate one Python script body following the Sandbox Contract and Script Patterns below. Only whitelisted modules may be imported. When multiple tool calls are needed, batch them in parallel. Never repeat the same tool call with the same arguments.
Write to /tmp/aliyun-runscript.py and validate with the local sandbox checker
(<SKILL_DIR>/scripts/check_sandbox.py):
cat > /tmp/aliyun-runscript.py <<'PYEOF'
<script body here>
PYEOF
python3 <SKILL_DIR>/scripts/check_sandbox.py /tmp/aliyun-runscript.py
If validation fails, read the → fix suggestion for each violation, fix ONLY the listed
issues, and re-validate. Maximum 3 rounds. If violations persist, show them to the user.
After validation passes, output only the Python script body — no Markdown fences, headings, or explanatory text unless the user asks.
All rules below are enforced by scripts/check_sandbox.py (local pre-check) and remote validation.
See references/runscript-contract.md for full definitions with examples.
| Category | Rule |
|---|---|
| Imports | Only whitelisted modules may be imported: asyncio, collections, csv, dataclasses, datetime, decimal, enum, fractions, functools, itertools, json, math, re, statistics, string, time, typing, uuid. Do NOT import random, os, subprocess, requests, or any module not in this list. call_cli is pre-injected — do NOT import or define it. |
| API calls | Use ONLY call_cli(product, version, action, params). Pre-injected. No SDK clients, no HTTP requests, no subprocess. Parameter values must be plain strings/numbers — do NOT pass aliyun ... CLI command strings as parameter values. |
| Param values | Parameter values must be plain strings/numbers — do NOT pass aliyun ... CLI command strings as parameter values. Query APIs to fetch exact values when unsure. |
| Output | Assign final data to result (dict or list). No print(). |
| Concurrency | Parallel API calls must use asyncio.gather(return_exceptions=True). Thread/process-based concurrency (threading, multiprocessing, concurrent.futures) is not in the whitelist and will fail validation. |
| Forbidden | os, subprocess, socket, requests, eval, exec, compile, getattr, setattr, globals, input, breakpoint, __import__, threading, multiprocessing, concurrent.futures, dunder chains. |
| Blocked APIs | Credential-returning APIs (ram.ListAccessKeys, sts.AssumeRole, kms.GetSecretValue). CLI meta products (configure, plugin, ossutil). |
| Structure | call_cli must be reachable from module-level execution. Do NOT wrap all calls in an uninvoked async def — either write await call_cli(...) at top level, or define a function and call it: async def main(): ... \n await main(). |
| Numbers | Do NOT use leading zeros in numeric literals (e.g., 01, 010). Write 1, 10 instead. IP addresses and CIDR blocks must be strings: "10.0.0.0/8", not bare numbers. |
| Strings | Use f-strings or .format() only with constant format strings. Do NOT build call_cli arguments dynamically via str.format(variable) or % formatting with non-constant args. |
| Sleep | time.sleep() argument MUST be ≤ 30. For longer waits, use a loop: for _ in range(N): time.sleep(30). |
| Output format | Output ONLY Python code. Do NOT output prose, explanations, or markdown before or after the code. If you must add context, use Python comments inside the script — but avoid comments unless absolutely necessary. |
| Other | Write/delete/update ops execute directly — the RunScript runtime intercepts write operations and presents them to the user for approval (HITL) before execution. The script itself should not add confirmation prompts. |
Sequential (dependent calls):
vpc = await call_cli(product="Vpc", version="2016-04-28", action="CreateVpc", params={"RegionId": region_id, "CidrBlock": "10.0.0.0/8"})
vsw = await call_cli(product="Vpc", version="2016-04-28", action="CreateVSwitch", params={"VpcId": vpc["VpcId"], "CidrBlock": "10.0.0.0/16", "ZoneId": "cn-hangzhou-a"})
result = {"VpcId": vpc["VpcId"], "VSwitchId": vsw["VSwitchId"]}
Pagination (list tasks):
items, page = [], 1
while True:
resp = await call_cli(product="Ecs", version="2014-05-26", action="DescribeInstances", params={"RegionId": region_id, "PageNumber": page, "PageSize": 100})
batch = resp.get("Instances", {}).get("Instance", [])
items.extend(batch)
if len(batch) < 100:
break
page += 1
result = items
Parallel (independent calls):
responses = await asyncio.gather(*[
call_cli(product="Ecs", version="2014-05-26", action="DescribeInstances", params={"RegionId": rid})
for rid in region_ids
], return_exceptions=True)
result = {rid: r if isinstance(r, dict) else {"error": str(r)} for rid, r in zip(region_ids, responses)}
alibabacloud-core server for API discovery.region_id) or a string placeholder
like "<your-vpc-name>".references/runscript-contract.md — full rule definitions and additional patterns.
Read only when validation fails repeatedly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub aliyun/alibabacloud-agent-toolkit --plugin alibabacloud-core10 skills in this plugin
/alibabacloud-cli-cost-estimationPre-execution cost estimation for Alibaba Cloud CLI operations. Use this skill whenever a user asks "how much will this cost", before executing any chargeable operation (create / resize / renew / bandwidth change), or when planning a multi-step workflow whose total cost should be known up front. Covers the --estimate-cost flag (quote without executing), --estimate-cost-context (usage assumptions and future-state overrides for multi-step workflows), reading the quote JSON correctly (pricingMode, pricingUnit, delta amounts), and reconciling quotes against actual bills.
/alibabacloud-cli-guidanceGuide for Alibaba Cloud CLI (aliyun) command syntax, plugin system, parameter naming, and best practices. Use this skill to generate correct CLI commands, understand plugin vs built-in command differences, structured parameter syntax, output filtering, pagination, and error troubleshooting. This skill is a CLI knowledge reference — when MCP tools (AlibabaCloud___CallCLI, etc.) are available, always prefer MCP tools for execution rather than running aliyun commands locally in the shell.
/alibabacloud-find-skillsUse this skill when users want to search, discover, browse, or find Alibaba Cloud (阿里云) agent skills. Triggers include: "find a skill for X", "search alicloud skills", "阿里云有什么 skill","阿里云", "搜索阿里云技能", "有没有管理 ECS/RDS/OSS 的 skill", "阿里云 skills 有哪些类目", "帮我找一个 skill", "browse alicloud skills", "list alicloud skill categories", "is there an alicloud skill that can...", "what alicloud skills are available", "XX Skill 的内容是什么", "我想了解阿里云 XX Skill 具体做什么","帮我安装阿里云 Skill","使用阿里云相关的skill", "阿里云 agent skill 市场", "搜一下阿里云的 skill", "建一个数据分析项目有没有相关 skill".
/alibabacloud-sdk-usageGenerate or modify code that calls Alibaba Cloud OpenAPIs. Use when the user asks for Alibaba Cloud SDK code, API parameters, endpoints, SDK dependencies, typed product SDK calls, or generic OpenAPI calls.
/alibabacloud-suggest-cliSuggest Alibaba Cloud `aliyun` CLI command strings from natural-language cloud operation requests, ready to pass as the `command` argument of the MCP `CallCLI` tool. Use when the user asks for the CLI command to do something, wants to manage cloud resources via aliyun, or asks "how do I do X with the aliyun CLI". Use `unifiedCli` from GenerateCLICommand (fallback to `cli` when empty) verbatim as the CallCLI command — no manual rewriting. Passes check_cli.py static validation. Suggest only — do not execute unless asked.
/alibabacloud-terraform-code-generationUse when the user wants Terraform HCL for Alibaba Cloud (Alicloud) infrastructure —
new project or extending an existing one. Covers VPC, ECS, ApsaraDB RDS, OSS,
SLB / ALB, Function Compute v3, ACK, and any other `alicloud_*` resource via the
provider documentation and IaCService metadata. IaCService API calls should use
the CallCLI-compatible tool exposed by the alibabacloud-core MCP server. For AWS → Alicloud migration,
importing existing resources into state, or remote plan/apply execution, use
a different skill.
Triggers: "write terraform for alicloud", "generate alibaba cloud terraform",
"alicloud HCL", "create alibaba cloud vpc/ecs/rds", "生成阿里云 Terraform",
"阿里云 HCL", "用 Terraform 部署阿里云", "alicloud provider", "aliyun/alicloud",
"terraform-provider-alicloud".
2 plugins in one repository ship this exact skill · first indexed Aug 12, 2026
Other plugins' skills for the same job