All Products
Search
Document Center

STAROps:STAROps Skill Integration

Last Updated:Aug 26, 2026

alibabacloud-starops-chat is an Agent Skill that lets you invoke STAROps Digital Employees from an AI agent in natural language to complete AIOps diagnostic tasks. Supported tasks include root cause analysis, application performance management (APM) metric queries, Tracing Analysis, and alert triage. After installation, the agent automatically wraps operations questions into STAROps OpenAPI calls and streams structured diagnostic conclusions.

Use cases

The following table lists typical scenarios and example prompts.

ScenarioDescriptionExample prompt
Service error root cause analysisAnalyzes root causes of errors for a specified service using multi-step reasoning across traces, logs, and metrics.Identify the root cause of errors in the inventory service.
Workspace and service queriesRetrieves service lists, counts, language distributions, and other metadata for the current workspace.How many APM services are in the current workspace?
APM metrics analysisAnalyzes request volume, error rates, latency, and other APM metrics with sorting and Top-N ranking by dimension.Which service has the highest request volume?
Service topology and classificationDisplays programming languages, upstream and downstream dependencies, and resource states in the service topology.Show me services grouped by programming language in the current workspace.
Multi-turn investigationContinues follow-up questions within the same thread based on prior diagnostic conclusions to progressively narrow the scope.Based on the notification service timeout identified earlier, check its error logs.

Supported agents

The alibabacloud-starops-chat Skill is built on the open Skill specification and is not bound to any specific agent. All major coding agents, such as Qwen Code, Claude Code, Codex, Qoder, and OpenClaw, can install and use the Skill directly.

Any custom agent that supports the Skill specification can also use the Skill. The specification requires the agent to provide the following capabilities:

  1. Parse the SKILL.md description file to retrieve the metadata, instructions, and tool definitions of the Skill.

  2. Support running the built-in scripts of the Skill through Bash tool calls.

  3. Inject environment variables and credentials as declared in SKILL.md.

    Custom agents that meet these requirements, such as agents built on LangChain, AutoGen, or Dify, can load the Skill by placing the Skill files in a recognized skills directory and then invoke STAROps diagnostics capabilities. Agents that do not support the Skill specification cannot use the Skill.

Prerequisites

  • The Alibaba Cloud STAROps service is activated, and you have Create a Digital Employee.

  • The Digital Employee has access to data sources such as APM, Simple Log Service (SLS), and UModel. Without connected data sources, diagnostics cannot produce valid conclusions because of a lack of evidence.

  • You have Alibaba Cloud account credentials with access to the target workspace and the following RAM permissions:

API nameActionResource
CreateThreadstarops:CreateThreadacs:starops:<region>:<uid>:digitalemployee/<employee_name>
CreateChatstarops:CreateChatacs:starops:<region>:<uid>:digitalemployee/<employee_name>
  • You have Install, update, and uninstall Alibaba Cloud CLI and configured credentials (recommended). The Skill resolves credentials through the Alibaba Cloud Credentials SDK default chain. For all supported credential methods, see Configure credentials.

  • Python 3 is installed on the local machine to run the built-in diagnostic scripts of the Skill.

Install the Skill

alibabacloud-starops-chat is published on Alibaba Cloud Skills and ClawHub. Follow the installation guide provided there to install the Skill.

After installation, install the Python dependencies required by the built-in diagnostic scripts of the Skill:

pip3 install -r scripts/requirements.txt

Run this command in the Skill root directory. The dependency file is in the scripts/ subdirectory, not the project root.

Configure environment variables

The Skill uses the following environment variables to locate the target Digital Employee and workspace. If your platform does not inject them automatically, set them manually before invoking the Skill:

VariableRequiredDescriptionHow to obtain
STAROPS_AGENT_EMPLOYEEYesDigital Employee IDSTAROps console > Digital Employees > Digital Employee ID
STAROPS_AGENT_WORKSPACEYesWorkspace identifierCMS 2.0 console > Select Workspace
STAROPS_AGENT_UIDYesAlibaba Cloud account UID that owns the workspaceAlibaba Cloud Management Console > Account Management > Account ID
STAROPS_AGENT_ENDPOINTNoCustom endpointDefault value: starops.cn-beijing.aliyuncs.com
STAROPS_AGENT_REGIONNoRegionDefault value: cn-beijing

To set the required variables manually, run the following commands:

export STAROPS_AGENT_EMPLOYEE="<Digital Employee ID>"
export STAROPS_AGENT_WORKSPACE="<workspace identifier>"
export STAROPS_AGENT_UID="<Alibaba Cloud account UID>"

To confirm that all required variables are set, run the pre-flight check script in SKILL.md.

Configure credentials

The Skill resolves credentials through the Alibaba Cloud Credentials SDK default chain. No Skill-specific AccessKey variables are required. Configure credentials through the Alibaba Cloud CLI — the Skill reads them automatically.

Warning

To prevent credential leakage, do not paste your AccessKey ID or AccessKey Secret into agent conversations. Manage credentials through the Alibaba Cloud CLI configuration file. The Skill automatically reuses the CLI credential configuration.

Method 1 (recommended): Configure via Alibaba Cloud CLI

If the Alibaba Cloud CLI is not yet installed on your machine, install it first. For instructions, see Install Alibaba Cloud CLI. Then run the following command to configure credentials:

aliyun configure

Follow the prompts to enter your AccessKey ID, AccessKey Secret, and default Region ID. After configuration, the credentials are saved in ~/.aliyun/config.json, which the Skill reads automatically.

To verify that the CLI configuration is working, run the following command:

aliyun sts GetCallerIdentity

If the command returns your account UID and identity information, the credentials are configured correctly.

The Alibaba Cloud CLI supports multiple credential modes through the --mode parameter:

# AK mode (default)
aliyun configure --mode AK

# STS Token mode (temporary credentials)
aliyun configure --mode StsToken

# RAM Role (ECS instance role)
aliyun configure --mode EcsRamRole

# RAM Role ARN (role assumption)
aliyun configure --mode RamRoleArn

For details, see Configure and manage credentials.

Method 2: Configure via environment variables

If you prefer not to use the Alibaba Cloud CLI, you can set standard environment variables directly:

export ALIBABA_CLOUD_ACCESS_KEY_ID="<YOUR-ACCESS-KEY-ID>"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="<YOUR-ACCESS-KEY-SECRET>"

This method is suitable for CI pipelines and temporary debugging. It is not recommended for production environments.

Method 3: Other credential sources

The Credentials SDK default chain also supports the following sources, in priority order from highest to lowest:

  1. Environment variables (ALIBABA_CLOUD_ACCESS_KEY_ID and ALIBABA_CLOUD_ACCESS_KEY_SECRET)

  2. Alibaba Cloud CLI configuration file (~/.aliyun/config.json)

  3. Security Token Service (STS) token

  4. RAM role (ECS or container instance metadata)

    For local development environments where instance metadata lookup is not needed, set export ALIBABA_CLOUD_ECS_METADATA_DISABLED=true to avoid unnecessary timeout delays.

Invoke the STAROps Agent

After installation and configuration, describe your operations and diagnostic needs to the agent to trigger the Skill. The agent automatically runs the following process:

  1. Checks that the environment variables and the credential chain are ready.

  2. Calls CreateThread to create a session thread, and returns a threadId and a link to the STAROps console.

  3. Calls CreateChat to send your question and subscribes to the SSE streaming response.

  4. Streams the tool calling status ([tool:started] / [tool:running] / [tool:done]) and diagnostic report fragments to stderr in real time.

  5. Outputs the final diagnostic conclusion to stdout between === STAROPS ANSWER BEGIN === and === STAROPS ANSWER END ===.

    On first invocation, the agent guides you through installing the Python dependencies and configuring the environment variables.

Prompt best practices

The STAROps Agent is a long-task reasoning engine. A single diagnostic session can take several minutes and trigger multiple internal tool calls. The completeness of your prompt directly affects the quality of the diagnosis. Include the following information in your prompts:

  • The target workspace and service name (or application, component, or APM service)

  • A clear diagnostic intent, such as "analyze the root cause", "list the potential impact scope", or "provide immediate remediation suggestions"

  • A time range, such as "last 30 minutes" or "2026-05-19 10:00 to 11:00, UTC+8"

  • Any existing clues, such as alert content, TraceID, error keywords, or SLS Project/Logstore

  • The expected decision, such as "whether to scale up", "whether to roll back the release", or "whether to contact the upstream team"

    To maintain thread context continuity, follow these two rules:
  • Reuse the threadId returned from the first call for all follow-up questions in a single investigation. Creating a new thread discards all previous diagnostic evidence and intermediate conclusions.

  • Always run the invocation script with --pipe. Without this flag, the output does not include the === STAROPS ANSWER BEGIN === separator, and downstream parsing becomes unreliable.

Scenario 1: Query the number of APM services

Prompt

How many APM services are in the current workspace?

Example agent output

The current workspace rca-benchmark contains 49 APM services.

Language distribution overview:

| Language | Count |
|------|------|
| Java | Most (ad, fraud-detection, accounting, etc.) |
| Go | Several (product-catalog, checkout, etc.) |
| Node.js | Several (frontend, frontend-web, etc.) |
| .NET | Several (cart, accounting, etc.) |
| Python / Rust / PHP / Ruby / C++ | A few each |

These services cover the complete link of e-commerce and financial scenarios, including core
microservices such as frontend, product-catalog, cart, checkout, payment, shipping, and
fraud-detection.

Scenario 2: View service distribution by language

Prompt

Show me services grouped by programming language in the current workspace.

Example agent output

The current workspace rca-benchmark contains 49 APM services, grouped by programming language:

| Language | Count | Services |
|------|---------|---------|
| Java | 28 | ad, fraud-detection, inventory, loyalty, review, promotion, wishlist, notification, warehouse, risk-scoring, search, pricing, user-profile, refund, coupon, order, audit-trail, payment-router, ... |
| Golang | 3 | product-catalog, flagd, checkout |
| Node.js | 3 | frontend, payment, loadgenerator |
| .NET | 2 | cart, accounting |
| Python | 1 | recommendation |
| C++ | 1 | currency |
| Rust | 1 | shipping |
| PHP | 1 | quote |
| Ruby | 1 | email |
| WebJS | 1 | frontend-web |
| Not specified | 2 | image-provider, frontend-proxy |

A total of 10 programming languages are represented. Java services account for the largest
share (28 services) and are the primary backend development language.

Scenario 3: Identify the root cause of service errors

Prompt

Identify the root cause of errors in the inventory service.

Example agent output

## Root Cause Analysis Report: inventory Service 5xx Errors

### Conclusion

Root cause: The inventory service timed out (5 seconds) when calling the downstream
notification service, causing cascading 5xx errors.

### Evidence Chain

#### 1. Trace Analysis

61 error traces were diagnosed and analyzed. All errors point to the same step:

| Error Span | Service | Duration | Diagnosis |
|-----------|------|------|----------|
| notification POST | notification | ~5000ms | error_and_slow |
| checkout orders publish | checkout | 1366-1927ms | slow |

Call path:
frontend-proxy -> frontend -> checkout -> inventory -> notification (5s timeout)

In all error traces, the POST call to the notification service takes about 5000ms
(reaching the timeout threshold), and statusCode=2 indicates an error.

#### 2. Related Alerts

Alerts triggered in the last 30 minutes:
- [Health Rule] latency_avg_threshold_critical (CRITICAL): average latency of the checkout service is 3.6 seconds
- Slow frontend interface response alert (CRITICAL): average response time of frontend service POST interfaces > 1000ms
- Container memory usage above 85% (CRITICAL): memory usage of the kafka container is 88.52%

#### 3. Resource Status of the notification Service

| Metric | Value | Status |
|------|-----|------|
| Pod status | Running | Normal |
| Memory usage/limit | 66.6% | Normal |
| Memory usage/request | 133.2% | Exceeds request value |

### Possible Causes

1. Downstream dependency issue of the notification service: high memory usage of the Kafka container (88.52%) may delay message processing.
2. Insufficient resources of the notification service: memory usage reaches 133% of the request value, which may trigger GC under traffic peaks.
3. Network connectivity issue: connections from inventory to notification may suffer from latency or connection pool exhaustion.

### Immediate Remediation Suggestions

1. Check the notification service logs and the Kafka cluster status.
2. Temporarily scale up the notification service (increase resources.limits.memory).
3. Configure more appropriate timeout and circuit breaker policies in the inventory service to prevent cascading impact.

Scenario 4: Multi-turn follow-up based on diagnostic conclusions

The STAROps Skill supports multi-turn interactions. By continuing within the same thread from the previous turn, you can progressively narrow the investigation scope.

Turn 1 prompt

Identify the root cause of errors in the inventory service.

Turn 2 prompt (same thread)

Based on the notification service timeout identified earlier, check the error logs of the
notification service itself for the last 30 minutes, and determine whether the issue is
internal to notification or caused by its downstream Kafka.

Turn 3 prompt (continue drilling down)

The memory usage of the Kafka container is 88.52%. Provide scale-up recommendations and a
temporary mitigation plan.

Multi-turn follow-up that reuses the same threadId allows the STAROps Agent to reason directly from the accumulated tool call results (metrics, traces, and logs). This avoids repeated data scans and keeps conclusions consistent.

Data security and privacy

The STAROps Skill calls STAROps Digital Employees through Alibaba Cloud OpenAPI. The process follows these security principles:

  • All requests are transmitted over HTTPS with ACS3-HMAC-SHA256 signing. Diagnostic data does not pass through third-party services.

  • Credentials (AccessKey, STS token, and RAM role) are resolved through the Alibaba Cloud Credentials default chain and never appear in agent conversations or script output.

  • The Skill only creates diagnostic threads and sends conversation requests. It does not directly modify cloud resources such as ECS, OSS, RDS, SLS, or RAM. Any remediation actions recommended by the STAROps Agent must still go through your normal change approval process.

  • When the script returns a 401 or 403 authentication error, the Skill stops immediately and reports the error to you. It does not retry with other credentials or fabricate diagnostic conclusions from prior knowledge.

Limits

The following limits apply to the Skill:

LimitDescription
Task durationA single diagnostic task times out after 30 minutes by default. If no SSE events are received for an extended period, the Skill raises an idle error based on --idle-timeout (default: 60 seconds).
Data sourcesDiagnostic quality of the STAROps Agent depends on the APM, SLS, and UModel data connected to the workspace. Data that is not connected or is missing cannot be analyzed.
Runtime environmentPython 3 is required, and dependencies must be installed via pip3 install -r scripts/requirements.txt.

FAQ

Do I need to create a thread in the console before using the Skill?

No. The Skill automatically creates a session thread through CreateThread on first invocation and prints the STAROPS_URL. You can use this URL to navigate directly to the STAROps console and view all messages and tool call records for that thread.

How do I configure Alibaba Cloud account credentials?

Run aliyun configure in the Alibaba Cloud CLI. The Skill automatically reads the credentials from ~/.aliyun/config.json. For other credential sources and their priority order, see Configure credentials.

Can I use a custom endpoint?

Yes. Set the environment variable STAROPS_AGENT_ENDPOINT=<domain> to specify a dedicated or private network endpoint.

What should I do if the diagnostic results are not specific enough?

Consider the following improvements:

  • Include key evidence in your prompt: the service name, time range, TraceID, and the original alert content.

  • Verify that the workspace has APM, SLS, and UModel data sources connected. Missing data sources prevent the STAROps Agent from gathering evidence.

  • Reuse --thread for multi-turn follow-up questions, so that the STAROps Agent can drill down from existing conclusions instead of starting a new session.

  • If STAROps returns (No assistant answer was returned.) or only a generic response, retry once using the same thread. If the issue persists, honestly inform the user that STAROps did not return valid diagnostic data. Do not fabricate conclusions from prior knowledge.

Troubleshooting

This section describes common errors and their resolutions.

HTTP 401 Unauthorized

The credential chain did not resolve an identity with STAROps permissions.

Resolution:

  • Verify that the Credentials default chain can resolve at least one of the following sources: STS token, RAM role, CLI profile, or instance metadata.

  • Verify that the RAM policy of the resolved identity includes starops:CreateThread and starops:CreateChat.

  • If you use an STS token, confirm that the token has not expired and that the assumed role includes the required permissions.

  • Grant the required permissions before you reissue the request.

HTTP 404 Not Found

One of the Digital Employee, workspace, or UID values does not match the actual resources.

Resolution:

Verify that STAROPS_AGENT_EMPLOYEE, STAROPS_AGENT_WORKSPACE, and STAROPS_AGENT_UID all correspond to the same set of actual resources. The UID must be the Alibaba Cloud account UID of the account that owns the workspace.

ConfigError: Missing required STAROps environment variables

One or more of STAROPS_AGENT_EMPLOYEE, STAROPS_AGENT_WORKSPACE, or STAROPS_AGENT_UID is not set or is empty.

Resolution:

Run the pre-flight check script in SKILL.md to confirm that all variables are set, and then retry.

CredentialError

The Alibaba Cloud Credentials SDK did not find any available credential source.

Resolution:

Configure credentials through one of the supported sources. The recommended method is the Alibaba Cloud CLI (aliyun configure). For details, see Configure credentials.

Idle timeout error

No SSE events were received within the --idle-timeout window. The STAROps Agent may be stuck.

Resolution:

Retry once with the same --thread. For complex tasks that are expected to be silent for extended periods, increase --idle-timeout accordingly.

ModuleNotFoundError

The Python dependencies are not installed.

Resolution:

Run pip3 install -r scripts/requirements.txt in the Skill root directory. The dependency file is in the scripts/ subdirectory, not the project root.