aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage

Claude Code and agent skill by aliyun/alibabacloud-aiops-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Manage the full lifecycle of Alibaba Cloud PAI DSW (Data Science Workshop) instances — create, update, query, list, start, stop, and look up ECS specs. Triggers: PAI DSW, DSW instance, create instance, start instance, stop instance, update instance, query instance, instance list, ECS spec, CreateInstance, UpdateInstance, GetInstance, ListInstances, StartInstance, StopInstance, ListEcsSpecs

Install

npx vskill@latest install aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage

SKILL.md

The same SKILL.md was published earlier as aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage.

PAI DSW Instance Management

Manage the full lifecycle of Alibaba Cloud PAI DSW (Data Science Workshop) instances — from provisioning through configuration changes, status monitoring, and start/stop operations. Also supports querying available ECS compute specs.

Architecture: PAI Workspace + DSW Instance + ECS Spec + Image + VPC + Dataset

API Version: pai-dsw/2022-01-01


Installation

Pre-check: Aliyun CLI >= 3.3.3 required
Run aliyun version to verify >= 3.3.3. If not installed or version too low,
run curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash to 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 true to enable automatic plugin installation.
[MUST] run aliyun plugin update to ensure that any existing plugins are always up-to-date.
bash
# macOS (recommended)
brew install aliyun-cli
# Verify version (>= 3.3.3)
aliyun version
# Enable automatic plugin installation
aliyun configure set --auto-plugin-install true
# Update existing plugins
aliyun plugin update
# Install pai-dsw plugin
aliyun plugin install --names pai-dsw

[MUST] CLI User-Agent — Every aliyun CLI command invocation must include: --user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-dsw-manage


Authentication

Pre-check: Alibaba Cloud Credentials Required
Security Rules:
- NEVER read, echo, or print AK/SK values (e.g., echo $ALIBABA_CLOUD_ACCESS_KEY_ID is FORBIDDEN)
- NEVER ask the user to input AK/SK directly in the conversation or command line
- NEVER use aliyun configure set with literal credential values
- ONLY use aliyun configure list to check credential status
```bash
aliyun configure list
```
Check the output for a valid profile (AK, STS, or OAuth identity).
If no valid profile exists, STOP here.
1. Obtain credentials from Alibaba Cloud Console
2. Configure credentials outside of this session (via aliyun configure in a terminal or environment variables in a shell profile)
3. Return and retry after aliyun configure list shows a valid profile

RAM Permissions

See `references/ram-policies.md` for the complete permission list and minimum-privilege policy.

[MUST] Permission Failure Handling: When any command or API call fails due to permission errors at any point during execution, follow this process:
1. Read references/ram-policies.md to get the full list of permissions required by this skill
2. Use the ram-permission-diagnose skill to guide the user through requesting the necessary permissions
3. Pause and wait until the user confirms that the required permissions have been granted

Parameter Confirmation

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.
ParameterRequiredDescriptionDefault
WorkspaceIdRequiredPAI workspace IDNone — user must provide
InstanceNameRequiredInstance name (letters, digits, underscores only; max 27 chars)None — user must provide
EcsSpecRequired (post-paid)ECS compute spec, e.g., ecs.c6.large. Query via list-ecs-specsNone
ImageIdMutually exclusive with ImageUrlImage ID from PAI consoleNone
ImageUrlMutually exclusive with ImageIdContainer image URL. See `references/common-images.md` for common official imagesNone
RegionIdRequiredRegion, e.g., cn-hangzhou, cn-shanghaiNone — user must confirm
AccessibilityOptionalVisibility scope: PUBLIC (all workspace users) or PRIVATEPRIVATE
InstanceIdRequired (update/get/start/stop)Instance ID (dsw-xxxxx format)None
VpcIdOptionalVPC ID for private network accessNone
VSwitchIdOptionalVSwitch ID within the VPCNone
SecurityGroupIdOptionalSecurity group IDNone
AcceleratorTypeRequired (spec query)Accelerator type: CPU or GPUNone — user must confirm
DatasetsOptionalDataset mounts in CLI list format: `DatasetId=<> MountPath=<> MountAccess=RORW`None — user must confirm, no default
--read-timeoutOptionalCLI read timeout in seconds (for long-running operations)10
--connect-timeoutOptionalCLI connection timeout in seconds10
How to get WorkspaceId: If the user doesn't know their workspace ID, run:
```bash
aliyun aiworkspace list-workspaces --region <region> --user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-dsw-manage
```
This returns all workspaces the user has access to. Select the appropriate one based on WorkspaceName or ask the user to confirm.

Core Workflow

Full command syntax and parameter details: `references/related-commands.md`.
1. Query Available ECS Specs

Run aliyun pai-dsw list-ecs-specs --accelerator-type <CPU|GPU> --region <region> to list available compute specs.

[MUST] Region confirmation: The --region parameter is required. Spec availability varies by region — always confirm the region with the user before querying.
[MUST] Determine accelerator type correctly:
- User mentions a spec name (e.g., ecs.hfc6.10xlarge): Query BOTH CPU and GPU types, then match InstanceType in results. Use the returned AcceleratorType field to confirm the classification.
- User specifies image type: GPU image URL (contains -gpu- or cu) → query GPU specs; CPU image URL → query CPU specs.
- User describes use case only: GPU for 大模型训练/深度学习, CPU for 数据分析/轻量任务. Always confirm with user if ambiguous.
- [IMPORTANT] Do NOT guess from spec name prefix — the naming convention is unreliable. Always verify via API response.
[MUST] Choose accelerator type based on user requirements:
- Default recommendation: GPU for 大模型训练/深度学习, CPU for 数据分析/轻量任务
- Match image type (strong indicator): If user specifies a GPU image URL (contains -gpu- or cu), query GPU specs. If CPU image, query CPU specs.
- Spec name requires verification: If user mentions a spec name, query both types and find the match in results
- Always confirm with user before querying if the use case is ambiguous and no spec name is provided

Key response fields:

  • InstanceType: Spec name (e.g., ecs.hfc6.10xlarge)
  • AcceleratorType: CPU or GPU — the actual classification from API
  • IsAvailable: PRIMARY indicator — true means the spec is available for pay-as-you-go/subscription
  • SpotStockStatus: SECONDARY indicator — only for spot instances: WithStock (available) or NoStock (unavailable)
  • CPU / Memory / GPU / GPUType: Hardware details
  • Price: Hourly price in CNY
[MUST] Availability check logic:
- For pay-as-you-go/subscription: Check IsAvailable == true
- For spot instances: Check IsAvailable == true AND SpotStockStatus == "WithStock"
- DO NOT use SpotStockStatus alone to judge availability — many specs have IsAvailable: true but SpotStockStatus: "NoStock"
- Example: ecs.hfc6.10xlarge with IsAvailable: true, SpotStockStatus: "NoStock" → Available for pay-as-you-go
2. Create Instance (check-then-act)
[MUST] Idempotency guarantee: The CreateInstance API does not support ClientToken, so idempotency is ensured via a check-then-act pattern. Before creating, you must call list-instances --instance-name <name> to check if the name already exists.

Step 2.1 — Check existence

bash
aliyun pai-dsw list-instances \
--instance-name <name> \
--region <region> \
--resource-id ALL \
--user-agent AlibabaCloud-Agent-Skills/alibabacloud-pai-dsw-manage

Decision logic:

  • TotalCount == 0 → Name is available, proceed to Step 2.2 to create
  • TotalCount >= 1 → [MUST] Verify exact name match:
  1. Iterate through the returned Instances array
  2. For each instance, compare its InstanceName field with the target name character by character (case-sensitive, exact string match)
  3. Exact match found (instance.InstanceName === targetName) → Name already exists:
  • Extract the InstanceId from the matching instance
  • Call get-instance --instance-id <id> to get full details
  • Compare key parameters (EcsSpec, ImageUrl, Accessibility, etc.)
  • Match → Return the existing InstanceId, do not recreate
  • Mismatch → Ask user to choose a different name
  1. No exact match found (no instance has InstanceName === targetName) → Name is available, proceed to Step 2.2 to create
[WARNING] Critical: Exact name match required
The --instance-name filter may return partial matches. For example:
- Query: --instance-name llm_train_001
- Response may include: llm_train_001, llm_train_001_v2, llm_train_001_backup
You MUST verify exact match by checking:
```
for instance in response.Instances:
if instance.InstanceName == targetName: # EXACT string equality
# Name already exists - DO NOT create
```
Do NOT assume name is available just because TotalCount > 0 but you "think" no exact match. If TotalCount >= 1, carefully check each instance's InstanceName field.

Step 2.2 — Provision

Run aliyun pai-dsw create-instance with required args: --workspace-id, --instance-name, --ecs-spec, --region, and either --image-url or --image-id.

[MUST] Region confirmation: The --region parameter is required and must be confirmed with the user. Do NOT use CLI default region without explicit user approval. Spec availability and pricing vary by region.
[MUST] Match EcsSpec with image type:
- GPU image URL (contains -gpu- or cu) → Must select a GPU spec (e.g., ecs.gn6v-c4g1.xlarge)
- CPU image URL (contains -cpu-) → Must select a CPU spec (e.g., ecs.c6.large)
- The spec type MUST match the image type, otherwise the instance will fail to start
- Use case (大模型训练/数据分析) is only a recommendation, image type is the definitive indicator
Dataset mounting (optional): If the user specifies a dataset to mount, use the --datasets parameter in CLI list format:
```bash
--datasets DatasetId=<dataset-id> MountPath=<mount-path> MountAccess=RO
```
[MUST] Dataset parameters require explicit user confirmation — do NOT assume or auto-generate dataset configurations.
Advanced usage (VPC, datasets): `references/related-commands.md`.

Response: {"InstanceId": "dsw-xxxxx", ...}

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
219
Repository forks
28
7-day trend score
27

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Aug 2026, 3 months ago.

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage/badge)](https://verified-skill.com/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-pai-dsw-manage)

Something wrong with this skill or its page? Tell us.