Install
openclaw skills install @sdk-team/alibabacloud-sre-toolkitAlibaba Cloud SRE skill for cloud infrastructure diagnosis, health inspection, capacity planning, incident response, and security audit, including scenarios where STAROps is unavailable and CLI fallback diagnosis is required. When users ask about ECS, ACK clusters, Pod issues, resource utilization, or fault troubleshooting, load this skill. Provides actionable SRE analysis reports and remediation recommendations via STAROps digital employees. Triggers: "sre-init", "sre-observability", "sre-incident", "sre-capacity", "sre-architecture", "sre-security", "巡检", "诊断", "容量规划", "故障排查", "安全审计", "健康巡检", "CrashLoopBackOff", "扩缩容", "资源利用率" Keywords: SRE operations, intelligent diagnostics, observability, monitoring, performance optimization, HA architecture, STAROps, Alibaba Cloud, ECS, ACK, Pod diagnostics, resource utilization, root cause analysis, scaling recommendations
openclaw skills install @sdk-team/alibabacloud-sre-toolkitBefore ANY aliyun CLI or starops_manager.py command, verify ALL steps completed:
env-check executed?list-accounts executed?init executed?If ANY answer is NO → STOP. Execute missing step(s) first. Applies universally — single-account mode, multi-account mode, CLI fallback, even when environment "looks ready".
EXECUTION LOCK: Before executing ANY diagnostic, planning, or aliyun CLI command, you MUST verify that .aliyun-sre/execution-trace.jsonl contains valid records for env-check, list-accounts, AND init. If any record is missing, STOP immediately and execute the missing step(s). Do NOT proceed to aliyun CLI or starops_manager.py until all three steps are logged. Violation of this lock invalidates the entire session.
Additional absolute prohibitions:
aliyun CLI as primary diagnosis when STAROps is availablelist-accounts because "only one account" or "environment looks ready"openssl rand, uuidgen, etc.) — only session_manager.py init generates valid session IDslist-accountsLT****) or replaced with [REDACTED]aliyun CLI. The ONLY permitted aliyun CLI API patterns are read-only queries:
Describe*, List*, Get*, get-caller-identityCreate*, Delete*, Modify*, Add*, Remove*, Set*, Update*, Stop*, Start*, Restart*, Attach*, Detach*, Allocate*, Release*, Put*, PUT (HTTP method), POST (HTTP method to cloud product endpoints), Apply*, Bind*, Unbind*, Grant*, Revoke*aliyun cs PUT /api/v2/clusters/... and RPC calls like aliyun slb add-access-control-list-entryEval Validation Mapping (direct causes of skill validation failure):
env-check / list-accounts / init → Step pass rate failsaliyun CLI as primary diagnosis when STAROps available → Forbidden action detectedaliyun CLI) → Forbidden action detected (read-only violation)Alibaba Cloud SRE intelligent operations skill. Completes the full workflow via STAROps digital employees: env-check → [uid-select] → init → triage → diagnose → plan → self-validate → report.
Supported Environments: LLM frameworks (Eino / LangChain / LlamaIndex) and Agent runtimes (Qoder / Claude Code / Codex / Cursor, etc.).
The diagnostic/inspection workflow is read-only. No cloud resource write operations during diagnosis. Onboarding configuration (first-time setup) includes user-triggered CreateDigitalEmployee/DeleteDigitalEmployee actions. All remediation requires manual user execution.
⚠️ WARNING: These 5 steps are NON-NEGOTIABLE and MUST be executed in exact order. Substituting any step with direct
aliyunCLI calls or skipping to Step 4/5 without completing Steps 1-3 is a critical workflow violation that invalidates the entire session.
For ANY SRE query, execute in exact order BEFORE any other action:
# Step 1: Environment check (always first)
python3 <skill-root>/scripts/session_manager.py env-check --cwd "$PWD"
# Step 2: List accounts (MUST — even single-account mode)
python3 <skill-root>/scripts/session_manager.py list-accounts --cwd "$PWD"
# Step 3: Initialize session
python3 <skill-root>/scripts/session_manager.py init --cwd "$PWD" --uid "<selected-UID>"
# Step 4: Create STAROps Thread (when STAROps available)
python3 <skill-root>/scripts/starops_manager.py create-thread --employee-id "<id>" --config "<config.json>" --uid "<uid>"
# Step 5: Send diagnostic query (SSE streaming)
python3 <skill-root>/scripts/starops_manager.py chat "<thread-id>" "<diagnostic-prompt>" --config "<config.json>" --uid "<uid>" --stream
These are NON-NEGOTIABLE. Do not substitute with direct aliyun CLI calls.
Default path is always STAROps. CLI fallback is ONLY permitted when:
| # | Condition | Action |
|---|---|---|
| 1 | User explicitly states STAROps unavailable | Skip STAROps → CLI fallback |
| 2a | env-check starops.available=false AND Smart Discovery fails due to network errors (Connection Refused / TCP Timeout) | Skip STAROps → CLI fallback |
| 2b | env-check starops.available=false due to configuration missing only | MUST enter Smart Discovery — CLI fallback FORBIDDEN |
| 3 | User explicitly requests CLI diagnosis | Skip STAROps → CLI fallback |
| 4 | 2 consecutive network-level failures after retry (Step 6) | CLI fallback |
NOT CLI fallback triggers (require retry, not fallback): SSE timeout, HTTP 409, HTTP 5xx, HTTP 401/403.
CLI fallback STILL requires: env-check → list-accounts → init → update --status triaged before any aliyun CLI call.
Hard Rule: CLI fallback is ONLY permitted after Steps 1–3 are completed AND STAROps retry protocol (Step 6) is fully exhausted. Direct CLI usage without prior STAROps attempt is strictly forbidden.
Pre-checks:
aliyun version. Install: download, review, then run the official setup script per references/cli-installation-guide.md. Update (>=3.3.5): aliyun upgrade.pip3 install -r scripts/requirements.txtAll API calls via aliyun CLI or starops_manager.py:
starops_manager.py (ACS3-HMAC-SHA256 signing, read-only credential resolution by profile).aliyun CLI.Safety: STAROps
CreateThread/CreateChatcreate diagnostic sessions only (not cloud resource changes).CreateDigitalEmployee/DeleteDigitalEmployeeare onboarding-only operations.
Security Rules: NEVER read/echo/print AK/SK values. NEVER ask user to input AK/SK. NEVER use
aliyun configure setwith literal credentials. ONLY usealiyun configure listto check status.No telemetry or external tracing: This skill does NOT send session data, diagnostics, or cloud resource information to any external service. No telemetry, tracing plugins, or data collection is included. STAROps diagnostic queries stay within the STAROps service endpoint (
*.aliyuncs.com). Any agent runtime configuration (e.g.,.claude/settings.json,.qwen/settings.json) that enables external tracing plugins must be disclosed and is NOT part of this skill. Specifically,langfuse-tracing@Aliyun-Security-Scan-Marketfound in.claude/settings.jsonis injected by the security scanning infrastructure during audit runs and is NOT authored, shipped, or controlled by this skill.
aliyun configure list
If no valid profile exists → STOP. Guide user to obtain credentials from Alibaba Cloud Console and configure outside this session.
Credential source matches selected profile: "single session, single UID, single digital employee" model. starops_manager.py resolves credentials read-only by --uid. Env var fallback: ALIBABA_CLOUD_ACCESS_KEY_ID/ALIBABA_CLOUD_ACCESS_KEY_SECRET (profiles take priority).
Diagnostic workflow is read-only. Requires STAROps CreateThread/CreateChat + read-only Describe*/List*/Get* permissions. Onboarding additionally requires CreateDigitalEmployee/DeleteDigitalEmployee (user-triggered only). See references/ram-policies.md.
[MUST] Permission Failure Handling: On any permission error: 1) Read
references/ram-policies.mdfor required permissions, 2) Useram-permission-diagnoseskill to guide user, 3) Wait for user confirmation before continuing.
ALL user-customizable parameters (RegionId, instance names, CIDR blocks, etc.) MUST be confirmed with user. Do NOT assume default values.
User-Agent: Every aliyun CLI API command MUST include --user-agent AlibabaCloud-Agent-Skills/alibabacloud-sre-toolkit/{session-id}. Local utility commands (configure, plugin, version) excluded. Session ID comes from init output — never generate manually.
Execution Trace: Every session_manager.py/starops_manager.py call appends a JSONL record to .aliyun-sre/execution-trace.jsonl (timestamp, script, subcommand, args, session ID, exit code).
Triggered when env-check shows failures or via sre-init. Wizard steps:
| Step | Check | Action |
|---|---|---|
| 1 | aliyun CLI >= 3.3.3 | Install via references/cli-installation-guide.md |
| 2 | Valid credentials | Guide aliyun configure (no AK/SK echo/input) |
| 3 | Python deps | pip3 install -r <skill-root>/scripts/requirements.txt |
| 4 | STAROps setup | Smart Discovery or manual account-add/configure-set |
Credential management (user-triggered): configure credentials via aliyun configure first, then account-add + create-employee (add), delete-employee + account-delete (remove). Completion: re-run env-check until pass. See references/initialization-guide.md.
| Scenario | Trigger | Output |
|---|---|---|
observability-monitoring | Metric analysis, log query, health inspection, alert insight | Inspection report + monitoring recommendations |
incident-response | Root cause analysis, emergency remediation, rollback | Diagnostic report + emergency plan |
capacity-planning | Resource utilization, capacity assessment, performance bottleneck | Capacity report + optimization recommendations |
architecture-reliability | HA assessment, architecture review, reliability improvement | Architecture review + improvement plan |
security-audit | Operation audit, risk identification, compliance check | Audit report + remediation recommendations |
Routing: fault/exception/Pod error → incident-response; metrics/logs/health → observability-monitoring; utilization/capacity → capacity-planning; HA/reliability → architecture-reliability; audit/compliance → security-audit; ambiguous → default observability-monitoring.
Located in <skill-root>/scripts/:
session_manager.py — Session lifecycle and Profile management (references/session-management.md)starops_manager.py — STAROps API CLI: CreateChat (SSE), CreateThread, ListDigitalEmployees, etc. (references/starops-api.md)requirements.txt — Python dependenciesShell state is not preserved across calls — each Bash invocation must use full absolute paths.
STAROps config at <project-root>/.starops/config.json. Uses accounts array (uid -> profile -> employeeId, workspace optional). Credentials never persisted (managed by aliyun CLI, resolved read-only). See references/starops-config.md.
python3 <skill-root>/scripts/session_manager.py env-check --cwd "$PWD"
Checks CLI/credentials, STAROps config, accounts cross-validation, Python deps.
"status": "pass" → proceed to Step 2"status": "fail" → stop. Display remediation, fix, re-run env-check. Do not proceed until passed.Hard Block:
env-checkis the only acceptable environment verification. Do NOT substitute withwhich aliyun,pip list, etc.
list-accountsMUST be called unconditionally regardless ofcredential_mode(single/multi/none).
Single-account mode (credential_mode: "single"):
list-accounts (MUST for visibility and session context)Multi-account mode (credential_mode: "multi"):
list-accounts — display UID/profile/employeeId/workspacelist-accountslist-accounts returns no registered UIDs)env-check profiles[] — user confirms selectionaliyun sts get-caller-identity --profile "<selected>" → extract AccountIdstarops_manager.py list-employees --profile "<selected>" → parse digitalEmployees[]name → employeeId)session_manager.py account-add --cwd "$PWD" --uid "<UID>" --employee-id "<id>" --profile "<profile>"env-check → proceed after passpython3 <skill-root>/scripts/session_manager.py init --cwd "$PWD" --uid "<selected UID>"
Resolves profile/employeeId/workspace from config, writes status.json. Record returned session ID and sre_dir path.
Hard Block: Session IDs MUST come from
init. Never useopenssl rand/uuidgen/date/hardcoded values. Pre-init ID generation is strictly prohibited — any--user-agentwith a pre-init ID is a workflow violation.
Query digital employee capabilities when STAROps is configured.
1. Check cache (key = uid|employeeId|workspace, TTL=86400s):
python3 <skill-root>/scripts/session_manager.py starops-cap-cache-get \
--uid "<uid>" --employee-id "<employeeId>" [--workspace "<ws>"] --cwd "$PWD"
capabilities_text, proceed to Step 52. Query capabilities (only on cache miss):
starops_manager.py create-thread (idempotencyKey per references/starops-api.md)session_manager.py update --session "<id>" --cwd "$PWD" --status "<status>" --thread-id "<threadId>"python3 <skill-root>/scripts/starops_manager.py chat "<thread-id>" "Please list all your currently available diagnostic skills" --config "<config.json>" --uid "<uid>" --stream
echo "<capabilities_text>" | python3 <skill-root>/scripts/session_manager.py starops-cap-cache-set \
--uid "<uid>" --employee-id "<employeeId>" [--workspace "<ws>"] \
--capabilities-text-stdin --skills-count <N> --skills-list '<JSON_ARRAY>' --cwd "$PWD"
Streaming: Add
--streamfor real-time thinking (stderr). Add--jsonfor{thinking, answer}. Agent runtimes should use background execution + polling (3-5s intervals viaGetTerminalOutput). Frameworks can importstream_chat()withon_eventcallback.
If STAROps completely unavailable (network error, not permission error) → mark Available: false, skip. Permission errors (401/403) → follow Permission Failure Handling.
Determine scenario (see table above). Collect context → identify affected resources → list symptoms → form hypothesis. Generate triage-summary.md.
python3 <skill-root>/scripts/session_manager.py update \
--session "<session-id>" --cwd "$PWD" --status "triaged"
Delegates diagnostic tasks to STAROps via prompts — does not directly call cloud product APIs.
1. Send diagnostic task to STAROps:
status.json for existing threadId before creating new one. Reuse if present.python3 <skill-root>/scripts/starops_manager.py chat "<thread-id>" "<diagnostic prompt>" --config "<config.json>" --uid "<uid>" --stream
threadId and --uid.2. STAROps retry protocol (MUST exhaust before CLI fallback):
| Failure Type | Action |
|---|---|
| SSE timeout (>120s) / empty response / "exited with no output" | Wait 30s, retry same threadId (max 2 retries). Do NOT create new threadId. |
| HTTP 409 Conflict | Create new threadId, retry chat (max 2 retries) |
| HTTP 401/403 | Follow Permission Failure Handling. Never fall back to CLI. |
| HTTP 500/502/503 | Wait 30s, retry same threadId (max 2 retries) |
| Connection Refused / TCP Timeout | Retry once after 30s. If still fails → CLI fallback |
Retry procedure (strict order):
chat with same threadIdHard Block: SSE timeout, HTTP 409/5xx are NOT "unavailable". Falling back to CLI without exhausting retries is a workflow violation.
3. CLI fallback (only after STAROps verified unavailable):
env-check, list-accounts, init MUST already be executedtriaged before CLI callsDescribe*/List*/Get* only) with --user-agent. ANY write operation (Create*/Delete*/Modify*/Add*/Set*/Update*/Stop*/Restart*/PUT/POST) is a ZERO-TOLERANCE violation — output remediation as text only4. Record results: Write to .aliyun-sre/<session>/observations/ (step/tool/expected/actual/hypothesis_match/key_findings/unanswered_questions).
Every remediation step MUST include
Safety: "requires manual user execution".
Generate plan/solution.md: Basic Information table, Technical Design (mermaid diagrams, impact/observation/loss-stop plans), Remediation Steps (reasoning/purpose/safety/command/expected result/verification), Verification Plan, Emergency Plan (rollback), Success Criteria.
python3 <skill-root>/scripts/session_manager.py update \
--session "<session-id>" --cwd "$PWD" --status "planned"
Check: security compliance (read-only/manual), coverage completeness (every symptom has diagnostic result), solution quality (diagrams, plans, actionable verification). Auto-correct max 1 iteration.
python3 <skill-root>/scripts/session_manager.py update \
--session "<session-id>" --cwd "$PWD" --status "validated"
Written to .aliyun-sre/<session>/ (bound to one UID):
diagnostic-report.md (incident-response): problem overview, diagnostic process, root cause, solutioninspection-report.md (inspection-governance): scope, results table, findings, summaryPre-output Checklist: 1) Report file exists, 2) All remediation steps have "requires manual user execution", 3) Status advanced via
update --status, 4) Scan all report content for unmasked credentials (AK/SK, tokens, secrets); if found, replace with[REDACTED]before finalizing. Fix any failures BEFORE outputting.
python3 <skill-root>/scripts/session_manager.py update \
--session "<session-id>" --cwd "$PWD" --status "executed"
Output: report path, solution path, key findings, follow-up recommendations.
Session MUST reach
executedstatus.triaged= report skipped;planned= self-validation skipped.
pending → triaged → planned → validated → executed
inspection-governance skips planned/validated (triaged → executed directly). See references/session-management.md.
Confirm by scenario: report generated, state machine at executed, conclusions based on actual data. See references/verification-method.md.
python3 <skill-root>/scripts/session_manager.py cleanup --cwd "$PWD"
Remove expired sessions (TTL=300s default).
aliyun CLI is restricted to Describe*/List*/Get* queries ONLY. Write operations (Create*/Delete*/Modify*/Add*/Set*/Update*/Stop*/Restart*/PUT/POST to cloud endpoints) are NEVER executed — remediation is output as text marked "requires manual user execution". Onboarding has user-triggered write actions (CreateDigitalEmployee/DeleteDigitalEmployee) via starops_manager.py only.create-thread + chat. CLI fallback only when completely unavailable (network error). Permission errors → Permission Failure Handling.| Reference | Description |
|---|---|
| references/starops-config.md | STAROps configuration and Profile management |
| references/session-management.md | Session lifecycle management |
| references/starops-api.md | STAROps API specification |
| references/cli-installation-guide.md | Aliyun CLI installation guide |
| references/ram-policies.md | RAM permission list |
| references/related-commands.md | Command quick reference |
| references/acceptance-criteria.md | Acceptance criteria |
| references/verification-method.md | Verification method |
| references/initialization-guide.md | Initialization guide (Onboarding) |