aliyun/alibabacloud-aiops-skills/alibabacloud-ecs-code-deploy
Claude Code and agent skill by aliyun/alibabacloud-aiops-skills
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
基于 aliyun appmanager 一键把项目代码部署到阿里云 ECS 云服务器,覆盖环境预检、询价、部署、日志验证、失败诊断重试全流程。支持 App / AI Agent(LangChain / AutoGen / AgentScope / MCP / FastAPI / Flask / Spring Boot 等),新建或已有 ECS 实例,自动处理分组冲突、zip 解压、余额不足、地域参数透传、重复部署免初始化。触发词:部署到ECS、部署项目到ECS、部署到云服务器、把这个项目部署上去、上线到ECS、把仓库部署到ECS、当前目录部署、阿里云ECS部署、appmanager部署、aliyun appmanager、一键部署App、部署AI Agent、deploy to ECS、code deploy、deploy app、deploy agent、appmanager deploy、ECS code deploy、跑一下这个项目、把代码跑到ECS上、ECS上线。
Install
npx vskill@latest install aliyun/alibabacloud-aiops-skills/alibabacloud-ecs-code-deploySemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as aliyun/alibabacloud-aiops-skills/alibabacloud-ecs-code-deploy.
Deploy to Alibaba Cloud ECS via aliyun appmanager
Overview
aliyun appmanager is an Agent-friendly CLI tool for one-click deployment of applications (App) and AI Agents to Alibaba Cloud ECS. It supports non-interactive mode (--non-interactive), structured JSON output (--output json), and streaming NDJSON responses.
Default behavior: When user invokes /alibabacloud-ecs-code-deploy without specifying a project path or URL, deploy the current working directory project to Alibaba Cloud ECS. If user provides a git URL, clone it to the current directory first, then cd into the cloned directory and proceed with deployment.
EXECUTION ORDER: The Agent MUST follow the "Complete Deployment Workflow" section at the bottom of this document for the correct execution sequence. The Task sections below are organized by topic for reference — their numbering does NOT imply execution order.
MANDATORY: Create Todo List Before Starting
Before executing any step, the Agent MUST create a todo list with ALL of the following items. Do NOT omit any item. Do NOT start deployment until the todo list is created.
⛔ SCRIPT-FIRST RULE: Steps 1, 5, 6, 7 have a dedicated toolkit script at$SKILL_DIR/scripts/deploy_toolkit.py(where$SKILL_DIRis resolved in Step 0 below — works on Qoder, Claude Code, and any other platform). The Agent MUST run the corresponding subcommand DIRECTLY as the FIRST and ONLY action for that step — NEVER run manual CLI commands (likealiyun version, version checks, credential checks) BEFORE or INSTEAD of the script. The script already handles ALL checks internally. Manual commands are ONLY allowed as fallback if the script file itself does not exist.❌ WRONG (Step 1): Runaliyun version→ check version → run~/.aliyun/appmanager-venv/bin/python ...→ check version → THEN rundeploy_toolkit.py check✅ CORRECT (Step 1): Runpython3 "$SKILL_DIR/scripts/deploy_toolkit.py" check→ if exit 1, fix the issue it reports → if script file missing, THEN fall back to manual checks
Item 6 is NON-NEGOTIABLE. An Agent that skips log verification and directly outputs "deployment succeeded" has NOT completed this skill correctly. Ifdeploy_toolkit.py verifyexits 1 (failed), the Agent MUST fix the issue and re-deploy before proceeding to item 7.
Step 0 (MANDATORY): Resolve $SKILL_DIR — Cross-Platform Path
The toolkit script lives at<skill-root>/scripts/deploy_toolkit.py. Different platforms install skills to different locations (Qoder/Claude Code/Qwen/...). The Agent MUST resolve the absolute skill root once at session start and reuse it everywhere$SKILL_DIRappears below. Hardcoding any platform-specific path is FORBIDDEN.
See [references/skill-dir-resolution.md](references/skill-dir-resolution.md) for the full 10-candidate detection algorithm, the `export + test -f` verify snippet, and Pattern A / Pattern B / ⛔ Anti-pattern usage rules.
Quick recap (read the reference for details):
- ✅ Pattern A (persistent shell):
export SKILL_DIR="/abs/path"then laterpython3 "$SKILL_DIR/scripts/deploy_toolkit.py" <sub> - ✅ Pattern B (fresh shell per call): inline the absolute path —
python3 "/abs/path/scripts/deploy_toolkit.py" <sub> - ⛔ Anti-pattern:
SKILL_DIR=/path python3 "$SKILL_DIR/..."— outer shell expands$SKILL_DIRBEFORE the prefix assignment, producing/scripts/deploy_toolkit.pyand ENOENT. If you seepython3: can't open file '/scripts/deploy_toolkit.py', switch to Pattern A or B.
Task 1: Install Alibaba Cloud CLI
Primary action: Run python3 "$SKILL_DIR/scripts/deploy_toolkit.py" check — it checks CLI version + appmanager-cli version + credentials in one run. Only if the script file is missing, use the fallback in references/init-and-credentials.md.
MUST — Handling unmet environment prerequisites: Whencheckexits 1 because the aliyun CLI is missing or older than 3.3.19 (or appmanager-cli is missing/outdated), the Agent MUST NOT stop the workflow silently. The required flow is:1. CLI NOT installed → Auto-install directly without asking user — execute the install command (see snippet below or references/init-and-credentials.md for the right arch), then re-rundeploy_toolkit.py checkto confirm.2. CLI already installed → ASK the user first — show the detected version + the required version + the upgrade command, and ask for explicit consent (e.g. "aliyun CLI 3.3.4 is already installed but below the required >= 3.3.19 for appmanager; approve upgrade (overwrite-install into /usr/local/bin, requires sudo)?"). Never assume yes; never paste credentials.- On approval — execute the install/upgrade command, then re-rundeploy_toolkit.py checkto confirm.- On refusal — stop with the refusal as the reason. Do NOT continue with the older version (deployment will fail anyway).The toolkit'scheckoutput already includes an→ AGENT: DO NOT stop. ASK user ...line for each fixable issue — follow it verbatim (except for the "not installed" case, which is auto-handled).MUST — Upgrade method priority: brew-managed →brew upgrade(do NOT overwrite/usr/local/bin/again); sudo → overwrite/usr/local/bin/; no sudo →~/bin/+ PATH persist (Unix). Scoop/Choco →%USERPROFILE%\bin+ User PATH (Windows). Full priority rules → references/init-and-credentials.md § "CLI Install/Upgrade Method Priority". After install/upgrade, ALWAYS rerundeploy_toolkit.py checkto confirm; ifwhich -a aliyunstill shows the old binary first, fix PATH order — DO NOT repeat the same overwrite.
Observability (MANDATORY): User-Agent Injection
⛔ Every `aliyun` CLI call MUST carry this skill's User-Agent so all API requests are traceable in cloud-side logs. The Agent MUST export the UA env var ONCE at session start (right after Step 0), before anyaliyun/deploy_toolkit.pyinvocation.
Full UA template:
session-id unified rules:
- Generate ONCE per agent session:
SESSION_ID=$(uuidgen | tr '[:upper:]' '[:lower:]')— lowercase UUID (any lowercase-hex random token ≥ 16 chars is equivalent). - Reuse the SAME session-id for ALL CLI calls within the session — NEVER regenerate per command, otherwise one deployment scatters into untraceable fragments.
- Persist consistently with the Step 0 rules: Pattern A
export SESSION_ID=...(persistent shell) or inline the literal value (fresh shell per call).
Injection method (modern — env var):
⛔ The legacyaliyun configure ai-mode enable / set-user-agentmechanism is DEPRECATED — do NOT use it. Do NOT combineALIBABA_CLOUD_USER_AGENTwith ai-mode or per-command env prefixes for the same skill token: the CLI stacks these sources and produces duplicate UAs. Set the env var ONCE per session and leave it.
Task 2: Configure Credentials
deploy_toolkit.py check already validates credentials. Only if credentials are missing/invalid, see references/init-and-credentials.md for the default-credential-chain remediation flow.
⛔ PREFER OAuth OVER AK: OAuth is more secure and convenient (no long-term secret storage). The Agent MUST present OAuth as the first option. When the user agrees, the Agent runs the login command directly — but MUST first warn the user that the command opens a browser authorization page and blocks until the user completes authorization in the browser — then executealiyun configure --mode OAuth --profile oauthand verify withaliyun sts get-caller-identity --profile oauth.⛔ SA-2.12 — DO NOT collect AK/SK in chat: If the user prefers AK auth, give one ready-to-run command template with placeholders —aliyun configure set --profile default --mode AK --access-key-id <your-access-key-id> --access-key-secret <your-access-key-secret> --region cn-hangzhou— and ask the user to fill in their own AK/SK and run it in their own terminal. The Agent NEVER asks the user to paste AccessKey/Secret/STS-Token values into the chat, NEVER puts raw AK/SK in tool-call arguments or scripts, and NEVER echoes credential values. The default credential chain (ECS RAM Role / env vars / pre-existing~/.aliyun/config.json) is also honored. Full remediation flow → references/init-and-credentials.md.CRITICAL PROHIBITION: NEVER run standaloneappmanageroraliyun appmanager login.
Task 3: Initialize Project
Step 1 (MANDATORY): Read README.md FIRST
CRITICAL ORDERING RULE: Before scanning any project files, the Agent MUST readREADME.md(orREADME) in the project root. This is ALWAYS the first action in Task 3.
What to extract from README:
- Quick-start / deploy commands (e.g.
pip install -r requirements.txt && python main.py,npm install && npm start) - Official build/run commands, Docker deploy methods, port number, required environment variables
MANDATORY: Present README Methods to User and Follow Decision Tree
Step A: List what README provides to the user.
Step B: Select method by priority:
| Priority | Method Type | Action | |
|---|---|---|---|
| 1 (HIGHEST) | Native CLI / package manager install (npm install -g, pip install, go install) | Use directly | |
| 2 | Native build + run (pip install && python main.py, npm install && npm start) | Use, install runtime | |
| 3 | Script-based deploy (bash deploy.sh) | Must confirm non-interactive | |
| 4 (LOWEST) | Docker / docker-compose | Only when no higher priority exists; check China accessibility |
Step C: Execute based on scenario:
- README has native method (priority 1/2) → Use it directly as start script core. NEVER ignore README and build from scratch.
- README only has Docker → Check image accessibility (see references/script-templates.md "Docker Image Accessibility Check"). Warn user about China mirror risks.
- README has no deploy info / absent → Agent scans project files independently (only allowed case).
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
- SKILL.md in the repositoryCheckingskills/computing/computenest/alibabacloud-ecs-code-deploy/SKILL.md
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.
Extension points
hookPre/post lifecycle hooks
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
[](https://verified-skill.com/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-ecs-code-deploy)