alibabacloud-ram-permission-diagnose
Alibaba Cloud RAM permission diagnosis and repair assistant. When an agent encounters any permission-related error while operating Alibaba Cloud resources (403, NoPermission, Forbidden, AccessDenied, InvalidSecurityToken, etc.), or when the user describes an Alibaba Cloud RAM permission issue, use this skill immediately. Do not wait for the user to explicitly request it — proactively start the diagnostic process whenever a permission error appears. Also applies when: a developer encounters permission issues while writing Alibaba Cloud SDK code, the user asks how to configure minimum permissions for an operation, or the user wants to know which permissions the current identity is missing.
What this skill does
# RAM Permission Diagnosis and Repair ## 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. At the **start** of the Core Workflow (before any CLI invocation): **[MUST] Enable AI-Mode** — AI-mode is required for Agent Skill execution. Run the following commands before any CLI invocation: ```bash aliyun configure ai-mode enable aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose" ``` **[MUST] Disable AI-Mode at EVERY exit point** — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed. AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running. ```bash aliyun configure ai-mode disable ``` **[MUST] CLI User-Agent** — Every `aliyun` CLI command invocation must include: `--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose` > **Execution constraint**: When executing `aliyun` CLI commands directly (not generating commands for the user to copy), always append `--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose`. Do not add this flag to commands shown to users in Path B output or Path C console guidance. ## Overview When a RAM permission error is detected, run through these steps: 1. **Quick Analysis** — parse raw error fields (no tool calls), output a brief summary, ask the user to choose analysis depth 2. **Deep Analysis** — *(only if user selects path B)* decode if needed, run gap analysis, classify root cause 3. **Generate Recommendations** — least-privilege authorization plan 4. **Execute Repair** — present repair options and wait for user to choose **Permission level (L0–L3)** is the agent's internal routing state, inferred implicitly from API call results during the flow. It determines diagnostic depth and available repair paths. Never declare or describe the level to the user. See `references/diagnose-flow.md` for level definitions. --- ## Step 1: Quick Analysis Parse raw error fields without any tool calls, then let the user decide how deep to go. ### 1a. Extract from raw error - `error_code`: e.g., `NoPermission`, `Forbidden`, `InvalidSecurityToken` - `missing_action`: e.g., `ecs:StopInstance` - `principal_type`: `SubUser` / `AssumedRoleUser` / `RootUser` (from `AuthPrincipalType`) - `principal_display_name`: UserId or role:session (from `AuthPrincipalDisplayName`) - `no_permission_type`: `ImplicitDeny` or `ExplicitDeny` (from `NoPermissionType`) - `policy_type`: e.g., `AccountLevelIdentityBasedPolicy`, `AssumeRolePolicy` (from `PolicyType`) - `encoded_message`: retain `EncodedDiagnosticMessage` if present, for use in Step 2 if needed ### 1b. Output brief summary Based on the extracted fields, output a concise summary: who is affected, what action is missing, initial root cause inference. ### 1c. Present depth choice and wait for selection Present the following and **wait for the user to select — do not proceed until a choice is made**: - **A. Quick path** *(recommended when: ImplicitDeny + all key fields present + common service)* — skip Step 2, generate recommendations directly from raw fields and built-in knowledge - **B. Deep path** *(recommended when: ExplicitDeny, missing fields, or unfamiliar service)* — run full Step 2 analysis for a more precise result. > Requires two optional permissions: `ram:DecodeDiagnosticMessage` (decode encoded errors) and system policy `AliyunRAMReadOnlyAccess` (gap analysis). Missing permissions limit specific capabilities but the flow continues. - **Skip** — stop here; output manual troubleshooting links Mark the recommended option clearly and briefly explain why. **If user selects A**: proceed to Step 3. Note in the recommendation that it is based on quick analysis; the user can request deep analysis at any time. **If user selects B**: proceed to Step 2. **If user selects Skip**: output error summary, links to RAM documentation (`https://help.aliyun.com/document_detail/93733.html`) and RAM console (`https://ram.console.aliyun.com/policies`), and a note on how to restart diagnosis. **Edge case — ExplicitDeny with path A forced**: if `NoPermissionType = ExplicitDeny` and the user still selects A, explain that the specific Deny policy cannot be identified without deep analysis, and provide a limited recommendation with explicit uncertainty noted. --- ## Step 2: Deep Analysis *Entered only when the user selects path B in Step 1.* First attempt classification using the raw fields from Step 1. `DecodeDiagnosticMessage` is a supplement — invoke it only when raw data is insufficient to classify with confidence. **Decode when raw data alone cannot resolve the root cause**: e.g., `ExplicitDeny` is present (need `MatchedPolicies`), `AccessDeniedDetail` was absent, or `PolicyType` is missing. For cases where `NoPermissionType`, `AuthAction`, `AuthPrincipalType`, and `PolicyType` are all available and point to a clear root cause, skip decode and proceed directly. Transcribe `EncodedDiagnosticMessage` from the raw error and call: ```bash aliyun ram decode-diagnostic-message --encoded-diagnostic-message "<transcribed-value>" ``` If the call returns `EntityNotExist`, re-run the original failing command and save its output to a temp file (use the system temp dir; name the file after the command context, e.g. `/tmp/aliyun_ecs_stopinstance.txt`). Extract `EncodedDiagnosticMessage` from the file and retry the decode. If the field is not found in the file, mark as L0 and continue. If `SubUser` identity needs UserName resolution before gap analysis, see `references/diagnose-flow.md` → Identity Resolution. If resolution fails, mark as L0 and continue. Root cause categories: - **MissingAction** — identity policy lacks the required Action (most common) - **ExplicitDeny** — a Deny statement blocks access (may be identity policy or CP control policy) - **TrustPolicy** — role trust policy does not allow the caller to assume the role - **STSInsufficient** — STS temporary credential lacks permission; root cause is on the originating Role - **TokenExpired** — STS token has expired - **SLRMissing** — service-linked role has not been created - **ResourcePolicy** — resource-side policy (e.g., OSS Bucket Policy) is restricting access For gap analysis trigger rules and per-root-cause handling details, see `references/diagnose-flow.md`. **Gap analysis** (when triggered): query current policies attached to the identity, then compare against the required Action. Use `ListPoliciesForUser` (SubUser), `ListPoliciesForRole` (AssumedRoleUser), or `ListControlPolicies` (RootUser). For Custom policies, fetch the policy document with `GetPolicyVersion`. System policies: use built-in knowledge, do not call `GetPolicyVersion`. **When permissions are insufficient**: if `DecodeDiagnosticMessage` fails (L0) or policy queries fail (L1), inform the user of the limitation and provide ready-to-use permission request materials for a RAM admin — two independent options: ① decode permission (`ram:DecodeDiagnosticMessage`) as a custom policy; ② RAM read access via system policy `AliyunRAMReadOnlyAccess` (covers gap analysis). Either or both can be requested independently. Then continue to Step 3 without waiting. --- ## Step 3: Generate Recommendations Before generating,
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.