aliyun/alibabacloud-aiops-skills/alibabacloud-oss-media-process
Claude Code and agent skill by aliyun/alibabacloud-aiops-skills
- community
Checking that the SKILL.md file is still in the repository.
Process images, audio, and video files stored in Alibaba Cloud OSS. Supports 14+ image operations (resize, crop, rotate, watermark, blur, format conversion, etc.), image-intelligent features via IMM (blind watermark, face/body/car detection, QR recognition, labeling, scoring), and audio/video processing (transcoding, screenshot, animation, sprite sheet, concatenation, metadata extraction, HLS streaming). Results can be returned as signed URL, downloaded locally, or saved as new OSS object. Also supports plain file upload/download. Use when the user needs to process or transform media files in OSS, such as generating thumbnails, transcoding video, extracting audio, adding watermarks, detecting faces, compressing images, or converting formats. Triggers on media processing requests in English or Chinese (resize, crop, thumbnail, transcode, video convert, audio convert, watermark, face detection, 缩略图, 裁剪, 压缩, 转码, 视频转换, 音频处理, 水印, 盲水印, 人脸检测, 截帧, 拼接).
Install
npx vskill@latest install aliyun/alibabacloud-aiops-skills/alibabacloud-oss-media-processSKILL.md
The same SKILL.md was published earlier as aliyun/alibabacloud-aiops-skills/alibabacloud-oss-media-process.
Alibaba Cloud OSS Media Processing
Process images, audio, and video files stored in Alibaba Cloud OSS using native OSS media processing capabilities. Synchronous processing returns immediate results via x-oss-process; asynchronous processing handles long-running jobs via x-oss-async-process with polling.
Default language: 默认中文回复。Only use English when the user explicitly writes in English.
Quick Start
Working directory
All script commands run from the skill package root. Use full absolute paths to invoke scripts:
Do not cd into the directory and use relative paths. If a script fails with "No such file or directory", use Glob to find **/alibabacloud-oss-media-process/scripts/process.py and use its full path.
Setup workspace output directory (run once per session):
All --output-path arguments MUST use $WORKSPACE_OUTPUT/<filename> — files saved inside the skill directory will NOT be renderable.
Credentials (Aliyun CLI)
This skill uses Aliyun CLI for credential management. Python scripts auto-discover credentials via the alibabacloud-credentials default chain (supporting ~/.aliyun/config.json, environment variables, ECS instance roles, etc.).
Security rules:
- Never read, echo, print,
cat, or dump~/.aliyun/config.json, credential files, or any raw command output that containsaccess_key_id,access_key_secret,sts_token,AccessKeyId,AccessKeySecret, orSecurityTokenvalues. - Never ask the user to input AK/SK directly in the conversation or command line
- Guide users to use
aliyun configureto set up credentials securely - Never write
AccessKeyId,AccessKeySecret, orSecurityTokeninto any temporary Python/Shell script, here-doc, env export, or intermediate file. All credentials must be discovered through Aliyun CLI or the SDK default credential chain. - For credential diagnostics, use
aliyun configure list,python scripts/load_env.py, or other non-secret checks. If you must inspect configuration structure, only inspect non-sensitive fields and do not print secret or token values to the transcript. - Treat full presigned URLs as sensitive whenever they contain signing parameters such as
OSSAccessKeyId,accessKeyId,x-oss-credential,Signature,x-oss-signature,security-token,SecurityToken, orsts_token. Do not print these full URLs into the conversation transcript, command echo, markdown summary, or ordinary log files. - When a signed URL is needed for user consumption, distinguish between delivery and display: it is acceptable to generate a usable signed URL, but unless the runtime provides a secure private-output channel that does not enter the transcript or logs, only display a redacted URL or an OSS path in normal user-facing text.
Prerequisites
| Step | Action | Command | ||
|---|---|---|---|---|
| 1 | Install Aliyun CLI (>=3.3.3) | `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` | |
| 2 | Configure credentials | aliyun configure | ||
| 3 | Run blocking preflight check 1 | python scripts/load_env.py | ||
| 4 | Run blocking preflight check 2 | aliyun configure list | ||
| 5 | Enable plugins | aliyun configure set --auto-plugin-install true && aliyun plugin update | ||
| 6 | Install Python deps | pip install -r scripts/requirements.txt | ||
| 7 | Set bucket/region (choose one) | export ALIBABA_CLOUD_OSS_BUCKET=<b> ALIBABA_CLOUD_OSS_REGION=<r> (add to ~/.bashrc/~/.zshrc for persistence), or pass --bucket <b> --region <r> on every command |
Blocking preflight policy:
python scripts/load_env.pymay report missing SDKs, missing credentials, missing bucket/region, or RAM permission problems.aliyun configure listmust show a usable configured CLI profile.- Treat preflight results as stale after any environment or runtime change. If you install Python packages, run
aliyun configure, change env vars, edit shell profiles, switch users, or otherwise modify credential/runtime state, you must rerun bothpython scripts/load_env.pyandaliyun configure listbefore the nextpython scripts/process.py ...command. - If either command fails these checks, stop immediately.
- Do not run
python scripts/process.py .... - Do not retry media processing.
- Do not simulate a successful result.
- Return only configuration guidance until both checks pass.
AI-Mode
Enable at session start:
Disable on every exit: success, failure, error, cancellation, or session end:
Preflight then Execute
When the user requests a media operation (resize, detect faces, watermark, etc.), apply the blocking preflight policy above before running any python scripts/process.py ... command. process.py also performs a runtime dependency preflight and exits with pip install -r scripts/requirements.txt guidance if required SDKs are missing. If you change the environment after a failed attempt (for example by installing dependencies, editing env vars, or re-running aliyun configure), do not assume the earlier preflight still holds — rerun the full blocking preflight first.
First-time setup
Direct users to run aliyun configure to set up credentials, then verify with:
Python scripts use the alibabacloud-credentials SDK to auto-discover credentials from the Aliyun CLI config. Bucket and region are read from the ALIBABA_CLOUD_OSS_BUCKET / ALIBABA_CLOUD_OSS_REGION environment variables, or from --bucket / --region CLI flags. load_env.py scans shell config files (~/.bashrc, ~/.zshrc) for these exports and loads them into os.environ.
Recommended Workflow
Follow this numbered workflow for every request:
- Prepare
Confirm the bucket and region are available through --bucket / --region or the ALIBABA_CLOUD_OSS_BUCKET / ALIBABA_CLOUD_OSS_REGION environment variables. Apply the blocking preflight policy before any media command. Create $WORKSPACE_OUTPUT once per session for all local downloads.
- Choose the source
Use --source for an existing OSS object key. Use --uri for a local file path or HTTP(S) URL that should be uploaded temporarily before processing.
- Decide the execution path
Use python scripts/process.py for all media processing and file operations. If the request involves video, audio, HLS, or image-intelligent features, run python scripts/imm_admin.py auto-setup --bucket <b> --region <r> first to ensure IMM bucket binding exists.
- Execute
Build exactly one valid operation chain. Prefer --output-mode download --output-path $WORKSPACE_OUTPUT/<name> for sync image outputs, --output-mode save --target-key <key> for async media outputs, and --output-mode url when the result is meant to be consumed remotely.
- Verify
Read the returned JSON. Check success, request_id, task_id (async only), target_key, local path, and any validation_warnings. If the command downloaded a local file, present the absolute path to the user. Only report a local output path after the file was actually written to $WORKSPACE_OUTPUT and the returned absolute path matches the real downloaded file. Do not claim that a file was saved to outputs/... or any other local path unless it truly exists there. If you need to record task_id, request_id, target_key, generated_keys, or similar fields in logs, notes, or output files, extract them directly from the process.py JSON response. Do not transcribe, rewrite, or manually retype these values. If the user or eval explicitly requires verification of any machine-verifiable output property (for example codec, bitrate, sample rate, channel count, duration, resolution, frame rate, width, height, or format), prefer running one additional read-only verification step against a persisted OSS output object before finalizing the summary. Use audio/info or video/info for audio/video outputs, and use a separate --operations info command for image outputs. Do not download the file locally just for this purpose. For image width, height, format, and file-size verification, treat OSS-side --operations info on the saved target object as the default and preferred verification path. info is a standalone read-only image metadata operation, not a follow-up segment that should be appended to a basic image processing chain. Do not switch to local image-library inspection when info can answer the question. If a read-only verification step was performed and its result differs from the requested value, report the actual verified output value. Do not substitute the request value, and do not claim the request was fully satisfied when the verification result shows otherwise. If no read-only verification step was performed, do not describe machine-verifiable output properties as independently confirmed. Do not assume local verification tools such as PIL/Pillow, ffprobe, or similar utilities are installed. If a tool is unavailable, do not claim that you performed the corresponding local pixel-level or media-property verification. For image-property verification in particular, do not introduce ad hoc local-library checks such as PIL/Pillow unless the workflow explicitly requires a local-file-only inspection and OSS-side info cannot provide the property. In normal skill usage and evals, prefer OSS-side verification and avoid emitting local PIL/Pillow commands entirely. If the workflow returns only a signed URL and does not persist a reusable OSS target object, do not claim that you performed a follow-up info check on the final output object unless such an object actually exists. In that case, either save the result to OSS first and verify the saved object, or state that only the immediate processing result was available and no persisted-object verification was performed. Before sending the final user-facing summary, follow the Language rule in Result Presentation.
- Recover
If the command fails, use the Error Recovery table below. Retry only after correcting the concrete cause, such as missing IMM binding, bad parameters, or insufficient RAM permissions.
Quick Decision Guide
All processing goes through process.py
Image, video, and audio operations MUST be executed via python scripts/process.py --operations "...". The agent must not write its own SDK or CLI calls to bypass process.py or imm_admin.py for video/audio/image processing. Underlying SDK or API requests triggered internally by these scripts (including IMM requests such as CreateMediaConvertTask) are expected implementation behavior and do not count as direct agent-side SDK usage. The only intentional script-level IMM entry points are imm_admin.py for project setup and blindwatermark-extract for async watermark extraction.
Never create your own Python scripts or wrappers to bypass process.py. When process.py doesn't support a feature, check SKILL.md and references/ documentation, use --dry-run to preview, and report to the user if it truly cannot be done.
IMM setup (before IMM-dependent ops)
Before running video, audio, HLS, or image-intelligent operations, first run imm_admin.py auto-setup to ensure the bucket is bound to an IMM project. Pass --imm-project <project_name> only for blindwatermark-extract, or if you intentionally want to override the optional ALIBABA_CLOUD_IMM_PROJECT fallback used by that operation.
Source selection
- OSS object →
--source object-key - Local file or URL →
--uri /path/to/file(auto-uploads, processes, cleans up)
Sync vs Async (auto-detected)
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
- SKILL.md in the repositoryCheckingskills/storage/oss/alibabacloud-oss-media-process/SKILL.md
Popularity
- Repository stars
- 256
- Repository forks
- 30
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 27 Sep 2026, 2 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
[](https://verified-skill.com/skills/aliyun/alibabacloud-aiops-skills/alibabacloud-oss-media-process)