This topic describes how to use Alibaba Cloud Flink Agent Skills to manage Realtime Compute for Apache Flink instances and workspaces with natural language on mainstream AI Agent platforms.
Skill overview
Realtime Compute for Apache Flink provides three Agent Skills on Alibaba Cloud Skill Hub. These Skills cover three categories of high-frequency scenarios: instance lifecycle management, workspace operations, and Flink expert knowledge. After integration, you can use natural language to create, query, deploy, operate, and troubleshoot Flink resources in clients that support the Agent Skills protocol, such as Claude Code, OpenClaw, Qoder, Cursor, and Gemini CLI. No manual OpenAPI calls or console operations are required.
|
Skill name |
Scenario |
Core capabilities |
|
Instance and namespace lifecycle management |
Query available regions and zones, create instances, query instance status, create and query namespaces, query resource tags |
|
|
Day-to-day workspace operations |
Create and validate SQL drafts, deploy and start or stop jobs, manage the full lifecycle of Session Clusters, diagnose jobs, query data tables, manage members and variables |
|
|
Flink expert knowledge |
Query product parameters and versions, billing information, generate Flink SQL (DDL, CDAS for full-database sync, risk control scenarios), checkpoint and savepoint restore guidance, job troubleshooting |
All three Skills call the Flink OpenAPI directly through the official Alibaba Cloud Python SDK. By default, credentials are loaded through the default credentials provider chain. Credentials are never passed as command-line arguments.
Prerequisites
Install Node.js and Python
Skills are installed through the npx skills CLI, which requires Node.js 18 or later. The internal scripts are implemented in Python and require Python 3.6 or later.
node --version # Requires >= 18
python3 --version # Requires >= 3.6
If not installed, choose the installation method for your operating system:
# macOS
brew install node python@3.9
# Ubuntu/Debian
sudo apt-get install nodejs npm python3 python3-pip
# CentOS/RHEL
sudo yum install nodejs python3 python3-pip
Configure Alibaba Cloud credentials
Skills obtain Alibaba Cloud AccessKey credentials through the default credentials provider chain. We recommend that you use environment variables to inject credentials, which avoids hardcoding credentials in command lines or scripts.
export ALIBABA_CLOUD_ACCESS_KEY_ID="your-access-key-id"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="your-access-key-secret"
export ALIBABA_CLOUD_REGION_ID="cn-beijing"
For production environments, we recommend that you use RAM roles or STS temporary credentials to prevent long-term AccessKey leaks.
Prepare RAM permissions
Grant the minimum required permissions to the RAM user that the Skills use. Do not use your Alibaba Cloud account AccessKey directly.
Permissions required by alibabacloud-flink-instance-manage
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"stream:CreateVvpInstance",
"stream:DescribeVvpInstances",
"stream:CreateVvpNamespace",
"stream:DescribeVvpNamespaces",
"stream:QueryTagVvpResources"
],
"Resource": [
"acs:stream:*:*:vvpinstance/*",
"acs:stream:*:*:vvpinstance/*/vvpnamespace/*"
]
}
]
}
Permissions required by alibabacloud-flink-workspace-ops
Workspace-level operations such as job deployment, Session Cluster management, and SQL validation require you to grant the RAM user a developer or administrator role for the corresponding workspace through the console member management. For more information about role permissions, see Manage workspace members.
Install and use Skills in Claude Code
This topic uses Claude Code as an example. For more Agent platform support, see the installation guide on the corresponding Skill page in the Alibaba Cloud Skills portal.
Install Skills
# Install to the current project (recommended for project-level sharing)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-flink-instance-manage --agent claude-code -y --full-depth
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-flink-workspace-ops --agent claude-code -y --full-depth
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-flink-knowledge --agent claude-code -y --full-depth
# Or install globally (append -g for all projects)
npx skills add aliyun/alibabacloud-aiops-skills --skill alibabacloud-flink-instance-manage --agent claude-code -y --full-depth -g
Project-level installation path: <project>/.claude/skills/. Global installation path: ~/.claude/skills/.
If npx skills add times out due to network issues when cloning the repository, you can clone the repository manually and install from the local path:
git clone https://github.com/aliyun/alibabacloud-aiops-skills.git ~/.agents/alibabacloud-aiops-skills
npx skills add ~/.agents/alibabacloud-aiops-skills/skills/analyticscomputing/sc/alibabacloud-flink-instance-manage --agent claude-code -y
npx skills add ~/.agents/alibabacloud-aiops-skills/skills/analyticscomputing/sc/alibabacloud-flink-workspace-ops --agent claude-code -y
npx skills add ~/.agents/alibabacloud-aiops-skills/skills/analyticscomputing/sc/alibabacloud-flink-knowledge --agent claude-code -y
Install Python dependencies for Skills
cd .claude/skills/alibabacloud-flink-instance-manage
pip3 install -r assets/requirements.txt
cd ../alibabacloud-flink-workspace-ops
pip3 install -r assets/requirements.txt
alibabacloud-flink-knowledge does not require additional Python dependencies. This Skill runs on a built-in knowledge base.
If pip reports a PEP 668 error on macOS, use a virtual environment or append the --break-system-packages parameter.
Verify the installation
Restart Claude Code and view the available Skill list to confirm that all three Flink Skills are recognized.
/skills
The output should include alibabacloud-flink-instance-manage, alibabacloud-flink-workspace-ops, and alibabacloud-flink-knowledge.
Usage examples
Describe your intent in natural language directly in the conversation. Claude Code automatically matches the corresponding Skill and executes the operation.
Instance management (alibabacloud-flink-instance-manage)
# Query all Flink instances in the China (Beijing) region
Query my Flink instances in cn-beijing
# Create a Flink instance
Create a Flink instance named demo-vvp in cn-beijing
# Query available zones
Which zones are available in cn-hangzhou?
Workspace operations (alibabacloud-flink-workspace-ops)
# Create a SQL draft
Create a SQL draft named hello-flink in workspace my-workspace with the content SELECT 1
# Deploy and start a job
Deploy the draft I just created and start the job
# Diagnose a job
Diagnose the recently failed job in workspace my-workspace
# Manage Session Clusters
Create a Session Cluster named dev-cluster in workspace my-workspace
Knowledge queries (alibabacloud-flink-knowledge)
# Query product parameters
What engine versions does Realtime Compute for Apache Flink support?
# Generate Flink SQL
Generate a CDAS SQL statement for full-database sync from MySQL CDC to Paimon
# Checkpoint restore guidance
How do I restore a job from a savepoint after an upgrade? What should I be aware of?
# Troubleshooting
What could cause a checkpoint timeout? How do I troubleshoot it?
For operations that modify resources, such as creation, deployment, start, stop, and deletion, the Skill automatically appends the --confirm safety confirmation parameter. For irreversible operations such as deletion, you must explicitly express the deletion intent in natural language before the Skill executes the operation.
FAQ
Q1: Skill does not take effect after installation
Verify that the Skill directory has been created (.claude/skills/alibabacloud-flink-instance-manage/SKILL.md exists) and that the client has been restarted to load the Skills.
Q2: ModuleNotFoundError when running a command
Python dependencies are not installed. Navigate to the Skill directory and run pip3 install -r assets/requirements.txt.
Q3: NoPermission or Forbidden error when running a command
Check whether the RAM user has been granted the minimum permission policy listed in the prerequisites, and whether the default credentials provider chain is loading the correct AccessKey for the RAM user.
Q4: Instance status does not change to RUNNING after creation
The Skill polls at a default interval of 30 seconds, with a maximum wait time of 10 minutes. If the timeout is exceeded, check the instance status manually in the console. If resources are insufficient, expand resources in the console before retrying.
Q5: Can I submit Flink JAR jobs through Skills?
No. The Skills currently cover only the full lifecycle of SQL jobs within workspaces. JAR job submission and deployment must be done through the console or by using the OpenAPI.
Q6: Is the parameter information returned by Knowledge Skill always accurate and up-to-date?
Knowledge Skill retrieves the latest parameter information from online documentation whenever possible. If the documentation fetch fails, the Skill returns a safety notice and guides you to the console for verification. For critical parameters such as billing and engine versions, the actual console display takes precedence.
Q7: What types of Flink SQL can Knowledge Skill generate?
The Skill supports generating DDL statements, full-database CDC sync statements (CDAS syntax), and risk control monitoring SQL. The generated SQL includes -- TODO: annotations to indicate connection information that you need to replace with actual values.