Coding

alibabacloud-devops

Try it

Automate Alibaba Cloud Yunxiao DevOps tasks — create and run pipelines, manage code repositories and merge requests, track work items and sprints, create test cases, manage artifacts, and drive application release workflows across 8 Yunxiao products. Triggers: "Yunxiao", "DevOps", "pipeline", "code repository", "merge request", "work item", "sprint", "test case", "application delivery", "artifact repository", "Codeup", "Flow", "Projex", "AppStack", "Packages", "Testhub"

What it does

Automate Alibaba Cloud Yunxiao DevOps tasks — create and run pipelines, manage code repositories and merge requests, track work items and sprints, create test cases, manage artifacts, and drive application release workflows across 8 Yunxiao products. Triggers: "Yunxiao", "DevOps", "pipeline", "code repository", "merge request", "work item", "sprint", "test case", "application delivery", "artifact repository", "Codeup", "Flow", "Projex", "AppStack", "Packages", "Testhub"

The skill document

Intelligent DevOps Execution via Yunxiao Tools

This skill translates natural-language DevOps requests into Alibaba Cloud Yunxiao API calls. It supports three invocation channels: Alibaba Cloud CLI (aliyun devops), MCP Server, and mcporter CLI. It covers 8 Yunxiao products (~388 CLI commands, ~165 MCP tools).

1. Overview

  • Core flow: Intent classification → Ambiguity resolution → Product mapping → Reference reading → Tool execution → Result verification
  • Scope: CI/CD, code management, project collaboration, sprints/work items, artifacts, testing, application delivery

For the full product and tool catalog (MCP tools and CLI commands by product), see references/tool-catalog.md.


2. Prerequisites

[MUST] Execution order is mandatory. Steps in this section form a sequential decision tree. You MUST execute them in the numbered order below. Do NOT check Node.js, MCP, or mcporter availability until the CLI path (Steps 1–4) has been fully attempted and failed. Do NOT run any checks in parallel across subsections 2.1 and 2.2.

Token Security Rules (applies to ALL channels):

  • NEVER ask users to paste plaintext tokens in conversation or command line
  • NEVER read/print token values using echo or similar commands
  • ONLY verify token existence via check (see steps below for channel-specific env var names)
  • If token is not configured, STOP and guide user to Yunxiao Personal Access Token. Required scopes: Organization Management (R/W), Project Collaboration (R/W), Code Management (R/W), Pipeline (R/W), Packages (R/W), Application Delivery (R/W), Test Management (R/W).

2.1 CLI Channel Setup (Primary — MUST complete first)

The Alibaba Cloud CLI (aliyun devops) is the primary invocation channel. MCP Server and mcporter are fallbacks only. Full configuration guide: references/aliyun-cli-setup.md.

Step 1: CLI availability check

aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
  • Available → Go to Step 3
  • Not available → Go to Step 2 (attempt installation)

Step 2: [MUST] Attempt CLI installation

[MUST] If CLI is not found in Step 1, you MUST attempt installation before considering any fallback channel. Skipping this step is prohibited. Full installation guide: references/aliyun-cli-install.md.

  1. Detect OS and install:

    • macOS (Homebrew available):
      brew install aliyun-cli
      
    • macOS / Linux (no Homebrew):
      /bin/bash -c "$(curl -fsSL https://aliyuncli.alicdn.com/install.sh)"
      
    • Windows (PowerShell): Guide user to download and run the PowerShell install script. See references/aliyun-cli-install.md.
  2. Verify installation and re-check:

    aliyun version
    aliyun devops --help >/dev/null 2>&1 && echo "cli ready" || echo "cli not available"
    
    • Available → Go to Step 3
    • Still not available → Go to Section 2.2 Fallback

Step 3: Authentication and site type detection

Cloud DevOps (Yunxiao) uses Personal Access Token for authentication, not AK/SK profiles.

3a. Check token:

[ -n "$ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"

If token is missing, guide user to configure based on their site type:

Central site (default) — token + organization ID:

export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=
export ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID=

Region site — token + region API base URL:

export ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN=
export ALIBABA_CLOUD_YUNXIAO_API_BASE_URL=

[MUST] Never ask the user for an API base URL on the central site — it defaults to openapi-rdc.aliyuncs.com (for both the CLI and the MCP Server). The base URL is a region-site-only setting.

Recommend adding these to the user's shell profile (~/.bashrc, ~/.zshrc, etc.) for persistence.

3b. Detect site type:

After token is confirmed, detect the site type:

[ -n "$ALIBABA_CLOUD_YUNXIAO_API_BASE_URL" ] && echo "region site" || echo "central site (default)"
[ -n "$ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID" ] && echo "org id configured" || echo "org id missing"
  • ALIBABA_CLOUD_YUNXIAO_API_BASE_URL set → Region site: subsequent CLI calls do NOT use --organization-id; the API base URL is read from the environment variable automatically
  • Not set → Central site (default): subsequent CLI calls use --organization-id; if the org id is missing, guide user to set ALIBABA_CLOUD_YUNXIAO_ORGANIZATION_ID (it can be looked up via aliyun devops base-get-user-by-token)

[MUST] Remember the detected site type. All subsequent CLI calls in this session must use the corresponding parameter pattern. CLI parameters use kebab-case (e.g., --organization-id), not camelCase (--organizationId).

Step 4: [MUST] Disable the interactive plugin-install prompt

The devops commands live in the aliyun-cli-devops plugin, which is not bundled with a fresh CLI install. The first aliyun devops therefore prompts Do you want to install it? [Y/n]: and blocks until the command times out. Run this once per session, before any business command:

aliyun configure set --auto-plugin-install true

Skipping this step wastes the whole timeout budget of your first business call.

CLI ready — If Steps 1–4 all pass, CLI channel is ready. Skip Section 2.2 entirely and proceed to Section 3.

2.2 Fallback Channel Setup (ONLY when CLI is unavailable)

[GATE] You may ONLY enter this section if both conditions are true:

  1. Step 1 (CLI check) returned "cli not available"
  2. Step 2 (CLI installation attempt) was executed and failed

If you have not attempted Step 2, go back and execute it now. Do NOT proceed here.

2.2.1 Node.js/Docker Runtime Check

This skill invokes alibabacloud-devops-mcp-server@0.3.38 via npx or docker. Verify:

node --version   # Node.js 18+ recommended
npx --version

Recommended: Pre-install dependencies (avoid runtime downloads)

npm install -g alibabacloud-devops-mcp-server@0.3.38 mcporter@0.11.1 --registry=https://registry.npmmirror.com

2.2.2 Yunxiao Personal Access Token (for MCP/mcporter)

MCP/mcporter uses YUNXIAO_ACCESS_TOKEN (different from CLI's ALIBABA_CLOUD_YUNXIAO_ACCESS_TOKEN):

[ -n "$YUNXIAO_ACCESS_TOKEN" ] && echo "token configured" || echo "token missing"

If missing, guide user to obtain a token and inject as env var (see Token Security Rules at the top of Section 2).

2.2.3 MCP Server Setup

See references/mcp-setup.md for three connection modes (Stdio / Docker / SSE). Recommended — Stdio:

{
  "mcpServers": {
    "yunxiao": {
      "command": "npx",
      "args": ["-y", "alibabacloud-devops-mcp-server@0.3.38"],
      "env": {
        "YUNXIAO_ACCESS_TOKEN": ""
      }
    }
  }
}

Central site needs the token only — YUNXIAO_API_BASE_URL defaults to https://openapi-rdc.aliyuncs.com. Add it to env only for a region site.


3. Authorization Failure Handling

[MUST] When any tool call returns an authentication/authorization error:

  1. Consult references/token-scopes.md for the required token scope
  2. Guide user to add the scope in Yunxiao console under "Personal Access Token"
  3. Pause execution, wait for user confirmation before proceeding

Common error codes:

ErrorAction
401 Authentication failedCheck if token is valid/expired; prompt re-generation
403 Insufficient permissionsCheck token scopes (see token-scopes.md and references/ram-policies.md)
404 Resource not foundUse search_* / list_* to verify resource IDs
400 Parameter errorCheck field schema against MCP Schema
500 Server errorRetry up to 3 times with backoff

4. Parameter Confirmation

IMPORTANT — Before executing any tool call, all user-defined parameters (organizationId, projectId, repositoryId, pipelineId, branch names, work item subject, sprint dates, app/env names, etc.) must be confirmed with the user. Never call based on defaults or guesses.

Common required parameters by product:

ProductUniversal requiredTypical scenario parameters
AllorganizationId-
CodeuprepositoryIdsourceBranch / targetBranch / filePath
FlowpipelineIdbranch / runId / jobId
ProjexprojectIdworkitemTypeId / sprintId / subject
TesthubprojectIdtestcaseId / testPlanId
AppStackappNameenvName / changeOrderId

5. Core Execution Flow

User request → [Step 1] Intent classification → [Step 2] Ambiguity handling → [Step 3] Product mapping
             → [Step 4] Read product references → [Step 5] Execute tool calls → Return results

Step 1: Intent Classification

Core principle: Identify the core verb, not the noun.

ActionTypical verbsTool prefix
Createcreate, add, initialize, set upcreate_*
Queryview, get, list, search, findget_* / list_* / search_*
Updateupdate, modify, change, editupdate_*
Deletedelete, remove, clean updelete_* (requires confirmation)
Triggerrun, execute, trigger, start, deploycreate_pipeline_run / execute_*
Configureconfigure, set up, bind, associateupdate_* / create_*

Decision tree and examples: references/intent-classification.md.

Step 2: Ambiguity Handling

Core principle: If the instruction is vague or involves multi-product keywords, never guess — ask.

Ambiguity typeDetection conditionStrategy
ProductMulti-product keywords presentAsk which product
ActionAction unclearAsk for operation type
ObjectMissing identifiersAsk for resource name or ID
ParameterMissing key parametersAsk for missing values
ScopeOrg/project not specifiedAsk for org/project

Step 3: Product Mapping

Full mapping: references/product-mapping.md.

KeywordsProductMCP toolsetCLI prefix
Pipeline, build, deploy, CI/CDFlowpipeline-managementflow-
Code, repo, branch, commit, MR, reviewCodeupcode-managementcodeup-
Artifact, package, Maven, NPM, Docker imagePackagespackages-managementpackages-
Requirement, work item, sprint, bug, taskProjexproject-managementprojex-
Test case, test plan, test reportTesthubtest-managementtest-hub-
Application, orchestration, change order, releaseAppStackapplication-deliveryapp-stack-
Organization, member, department, role-organization-managementbase-
Current user info-basebase-

Ambiguity decision points:

  • "CI/CD full flow" → Build-only → Flow; app lifecycle → AppStack; both → ask
  • "Repository" → Code repo → Codeup; artifact repo → Packages; unclear → ask

Step 4: Read Product References

After determining the target product, must consult the Yunxiao documentation index at references/product-reference.md.

Step 5: Execute Tool Calls

Three invocation channels (functionally equivalent):

MethodScenarioPrerequisites
Alibaba Cloud CLI (aliyun devops)Shell environment availablealiyun installed with token configured
Platform-native MCPIDE/platform with MCP Serveruse_mcp_tool available
Terminal CLI (mcporter)Pure terminal, no MCP ServerNode.js 18+ installed

Channel selection: Choose based on availability — CLI configured → CLI; MCP integrated → MCP; Shell + Node.js only → mcporter.

Region Site Routing (mandatory): When the user specifies a Yunxiao instance address or token differing from current MCP config:

  • MUST prompt user to update MCP Server config (YUNXIAO_API_BASE_URL / YUNXIAO_ACCESS_TOKEN)
  • MUST NOT bypass MCP Server via mcporter — mcporter is only for when MCP Server is absent
  • URL with Region keywords (e.g., cn-shanghai) → Region edition; openapi-rdc.aliyuncs.com or unspecified → Central (default, no base URL config needed)

Method A: Alibaba Cloud CLI

aliyun devops  --  \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"

All aliyun devops commands must include --user-agent with the session-scoped UA value (see Section 7: Observability). When using environment variables for authentication, no additional auth parameters are needed. When using command-line parameters, append --yunxiao-access-token and --organization-id (central) or --api-base-url (region) to each command.

For command discovery by product prefix, use scripts/discover-commands.sh or see references/tool-catalog.md.

Method B: Platform-native MCP

use_mcp_tool(
  server_name: "yunxiao",
  tool_name: "",
  arguments: { "": "" }
)

Method C: mcporter CLI

npx -y mcporter@0.11.1 call --no-coerce --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38"  [key:"value" ...]

MUST always use --no-coerce to prevent auto type conversion of string enums.

Parameter rules: Use key:"value" format, space-separated. Do not pass JSON strings. Omit parameters for no-argument tools. Use scripts/mcporter-call.sh for convenience.

Get available tools:

npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema

[MUST] Tool selection must be based on dynamic discovery: Select from registered tool list, never fabricate tool names. Use mcporter list or references/tool-catalog.md.

[MUST] Never fabricate results: All tool calls must be actually executed with real return values.

Pre-execution checklist (mandatory):

  1. Obtain organizationId via aliyun devops base-get-user-by-token (MCP: get_current_organization_info)
  2. [Mandatory] Verify target resource exists via list_* / search_* / get_* — even if ID is provided
  3. All required parameters confirmed with user (Section 4)
  4. Delete operations require confirmation
  5. [Mandatory] Dynamic schema validation before first call to any unfamiliar tool:
    • Method B: Check platform tool registry
    • Method C: npx -y mcporter@0.11.1 list --stdio "npx -y alibabacloud-devops-mcp-server@0.3.38" --schema 2>&1 | grep -A 30 'function '
    • If schema returns a different tool name, use the schema's version
    • For Testhub: call test-hub-get-testcase-field-config (MCP: get_testcase_field_config) first — it reports which fields are required (assignedTo is) and yields the per-library option IDs that customFieldValues must carry (e.g. {"tc.priority": ""}; sending the label "P1" fails with 400 字段【优先级】所填值无效). testSteps must carry a content[] array — a payload using only stepContent / expectedResult (which is the read-back shape) fails with 500 unknown exception. See references/common-scenarios.md Scenario 6.
    • For Projex: call projex-list-workitem-types (MCP: list_work_item_types) first — never use hardcoded type IDs

Full tool catalog: references/tool-catalog.md. Scenario examples: references/common-scenarios.md.


6. Success Verification

[RECOMMENDED] After create_* / update_*, call the corresponding get_* to verify when budget permits. If API returned success with a resource ID, creation can be considered successful even without read-back.

Known API limitations: Some fields may differ between write and read-back — see references/verification-method.md.

OperationVerification command (CLI / MCP)Check
Create pipelineflow-get-pipeline (MCP: get_pipeline)pipelineId + name match
Run pipelineflow-get-latest-pipeline-run (MCP: get_latest_pipeline_run)status != FAIL
Create branchcodeup-get-branch (MCP: get_branch)Branch appears
Create MRcodeup-get-change-request (MCP: get_change_request)state = OPENED
Create work itemprojex-get-workitem (MCP: get_work_item)subject + workItemTypeId correct
Create sprintprojex-get-sprint (MCP: get_sprint)Date range matches

More: references/verification-method.md.


7. Observability

User-Agent Declaration (Mandatory)

[MUST] Every aliyun devops business command must carry the --user-agent flag for attribution and tracing. The UA value follows a fixed template that includes a per-session identifier.

UA Template:

--user-agent AlibabaCloud-Agent-Skills/alibabacloud-devops/{session-id}

Session-ID Generation Rule:

ItemRule
Format32-character lowercase hexadecimal string, e.g., f47ac10b58cc4372a5670e02b2c3d479
LifecycleGenerate once at the start of each skill invocation session; reuse the same value across all channels (CLI, MCP, mcporter) within that session
ConsistencyThe same {session-id} must be used for CLI --user-agent, MCP request metadata, and mcporter calls within one session
Generation methodpython3 -c "import uuid; print(uuid.uuid4().hex)" or uuidgen | tr -d '-' | tr '[:upper:]' '[:lower:]'

Usage — append to every aliyun devops command:

SESSION_ID=$(python3 -c "import uuid; print(uuid.uuid4().hex)")

aliyun devops  --  \
  --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-devops/${SESSION_ID}"

Important: The --user-agent flag is applied directly on each business command. Do NOT configure UA through any global mode-setting command — always pass it inline per invocation.


8. Best Practices

  1. Read before write: get_* before update_* / delete_* to confirm current state
  2. Pagination: List APIs paginate by default; pass page / perPage for large lists
  3. YAML first: Pipeline creation goes through flow-create-pipeline --name --content (YAML is mandatory). Before composing the YAML, collect the three organization-specific values that are always rejected if guessed — the repository's httpUrlToRepo (never webUrl), the Codeup service connection uuid (query with the lowercase filter --service-connection-type codeup; Codeup reproducibly returns an empty list, which is not proof the connection is missing), and a runsOn.group harvested from an existing pipeline (no API lists build clusters, and public/ often does not exist). The Codeup credential is a nested certificate object, not a bare serviceConnection key, and a build-only pipeline must omit ArtifactUpload. MCP's create_pipeline_from_description builds its YAML internally and cannot be corrected — on any yaml校验失败 / 服务连接[...]不存在 error, stop retrying it and switch to the CLI path. Verified template and preflight steps: references/common-scenarios.md Scenario 1.
  4. Smart search: flow-list-pipelines with timestamp parameters — --execute-start-time / --execute-end-time / --create-start-time / --create-end-time take millisecond epoch values (13 digits, e.g. $(($(date +%s) * 1000))). Passing seconds (10 digits) is not rejected by the API; it silently filters against 1970 and returns misleading results, so always multiply by 1000 and sanity-check the digit count. (MCP provides smart_list_pipelines supporting natural-language time ranges.)
  5. Read-only first: When uncertain, use list_* / search_* / get_*
  6. Fail fast: Two consecutive same-parameter failures → change approach. Report: methods tried, errors, root cause, next steps
  7. Budget discipline: Plan critical path first; debugging ≤3 steps; near limit (≤2 remaining) → stop and report
  8. Clean up: Delete experimental resources after use

9. Scenario Quick Reference

Full examples: references/common-scenarios.md.

ScenarioProductKey CLI commandsKey MCP tools
Create Java build pipelineFlowcodeup-get-repository (clone URL) → flow-list-service-connections --service-connection-type codeup (uuid; lowercase value, Codeup returns []) → flow-get-pipeline (harvest runsOn) → flow-create-pipelineflow-list-pipelinesget_repositorylist_service_connectionsget_pipelinecreate_pipeline_from_description (falls back to CLI on YAML validation failure)
Create MR with review commentCodeupcodeup-get-repositorycodeup-create-change-requestcodeup-list-change-request-patch-setscodeup-create-change-request-commentget_repositorycreate_change_requestlist_change_request_patch_setscreate_change_request_comment
Create sprint and add requirementProjexprojex-search-projectsprojex-create-sprintprojex-create-workitemsearch_projectscreate_sprintcreate_work_item
Run pipeline and view logsFlowflow-get-pipelineflow-create-pipeline-run (branch goes in --params '{"branchModeBranchs":""}'; there is no --branch flag) → flow-get-pipeline-run --pipeline-run-idflow-get-pipeline-job-run-log --job-id get_pipelinecreate_pipeline_runget_pipeline_runget_pipeline_job_run_log
Batch query artifactsPackagespackages-list-repositoriespackages-list-artifactslist_package_repositorieslist_artifacts
Create test casesTesthubtest-hub-get-testcase-field-config (required fields + option IDs) → test-hub-list-directoriestest-hub-create-testcasetest-hub-search-testcasesget_testcase_field_configlist_testcase_directoriescreate_testcasesearch_testcases
Application release workflowAppStackapp-stack-list-all-release-workflowsapp-stack-execute-change-request-release-stagelist_app_release_workflowsexecute_app_release_stage

10. Reference Index

Reference fileContent
references/aliyun-cli-install.mdAlibaba Cloud CLI installation guide (macOS/Linux/Windows)
references/mcp-setup.mdMCP Server connection modes and environment variables
references/intent-classification.mdIntent classification decision tree
references/product-mapping.mdKeyword → product mapping table
references/product-reference.mdYunxiao documentation index and key concepts
references/tool-catalog.md~165 MCP tools grouped catalog
references/token-scopes.mdToken authorization scopes and troubleshooting
references/common-scenarios.mdEnd-to-end workflow examples
references/verification-method.mdSuccess verification and read-back methods
references/acceptance-criteria.mdTool call correctness acceptance criteria
references/ram-policies.mdYunxiao permission model vs. standard Alibaba Cloud RAM

Related skills

Use when managing Alibaba Cloud DevOps (Yunxiao 2020) via OpenAPI/SDK, including project/repository/pipeline resource discovery, read-only inspection, and sa...

12 installs

Yunxiao Flow Pipeline Troubleshooting and Solutions. Used to diagnose pipeline execution failures and provide fix recommendations. Trigger scenarios: Pipelin...

3 installs

Deploy apps and AI agents to Alibaba Cloud ECS through a guided pre-check, deploy, and verify workflow.

14 installs

Alibaba Cloud OOS ChatOps Agent for natural-language cloud resource management and O&M operations. Supports querying ECS/RDS/VPC/SLB resources, executing ope...

Build and deploy applications to Alibaba Cloud ECS — Local build + script injection + InstallApplication async deployment. Triggers: build, deploy, CI/CD, co...

Automatically review latest Alibaba Cloud product docs and OpenAPI docs by product name, then output detailed prioritized improvement suggestions with eviden...

40 installs