跳到正文
cccskills
免费在 GitHub 公开

aliyun-api-ref

Alibaba Cloud API reference for developing aero-cli. Use this skill when adding new cloud provider features, fixing API calls, or extending FC/RDS/Redis/OSS/DNS/VPC integrations. Contains SDK usage patterns, API signatures, and error handling conventions specific to this project.

中文简介正在准备中。当前显示原文说明。

集成工具Redis
查看安装方法

包含的文件(1)

  • SKILL.md6.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Alibaba Cloud API Development Reference

When to use this skill

Use this skill when:

  • Adding or modifying Alibaba Cloud API calls in src/providers/
  • Implementing new cloud service integrations (FC, RDS, Redis, OSS, DNS, VPC)
  • Debugging API errors or handling new error codes
  • Understanding SDK constructor patterns and authentication flow
  • Working with pagination, retry logic, or async polling patterns

Project Architecture

src/providers/       # Cloud service provider modules
  fc.ts              # Function Compute 3.0 (deploy, invoke, versions, aliases)
  infra.ts           # RDS Serverless (database provisioning)
  redis.ts           # Tair/Redis Serverless KV (cache provisioning)
  oss.ts             # Object Storage Service (static site deploy)
  domain.ts          # DNS + FC custom domain binding
  ssl.ts             # Let's Encrypt ACME + FC HTTPS binding
  vpc.ts             # VPC / VSwitch / SecurityGroup management
  logs.ts            # SLS log streaming
src/utils/
  sdk.ts             # Shared SDK constructor resolver + FC client factory
  retry.ts           # Exponential backoff retry wrapper
  config.ts          # Auth (AK/SK) and project config management
  errors.ts          # Error classification (conflict, not-found, etc.)

SDK Usage Patterns

Constructor Resolution

All Alibaba Cloud SDKs are loaded via resolveSdkCtor() to handle ESM/CJS interop:

import Vpc, * as $Vpc from '@alicloud/vpc20160428';
import { resolveSdkCtor } from '../utils/sdk';

const VpcClientCtor = resolveSdkCtor<Vpc>(Vpc, '@alicloud/vpc20160428');

Client Instantiation

Each provider creates its client with @alicloud/openapi-client Config:

import * as $OpenApi from '@alicloud/openapi-client';

const client = new VpcClientCtor(new $OpenApi.Config({
  accessKeyId: auth.ak,
  accessKeySecret: auth.sk,
  regionId,
  endpoint: `vpc.${regionId}.aliyuncs.com`
}));

Shared FC Client

FC client creation is centralized in utils/sdk.ts:

import { createSharedFcClient } from '../utils/sdk';

const { auth, client } = createSharedFcClient();
// or with explicit auth:
const { client } = createSharedFcClient(authConfig);

Authentication

Credentials are stored in ~/.ali-cli/auth.json (mode 0o600):

interface AuthConfig {
  accountId: string;  // Alibaba Cloud main account ID
  ak: string;         // AccessKey ID
  sk: string;         // AccessKey Secret
  region: string;     // Default region (e.g. cn-hangzhou)
}

Access via Config.requireAuth() or Config.getAuth().

Error Handling Conventions

Error Classification (utils/errors.ts)

// Check if error is a "resource already exists" conflict
isConflictError(err)  // matches: AlreadyExists, Conflict, Duplicate, Exist

// Format error message for display
formatErrorMessage(err)  // extracts .message from unknown error

Retry Pattern (utils/retry.ts)

import { withRetry } from '../utils/retry';

const result = await withRetry(
  () => client.someApiCall(request),
  { maxAttempts: 3, baseDelayMs: 1000 }
);

Retries on: Throttling, timeout, ECONNRESET, service unavailable.

Empty Catch Blocks

When intentionally ignoring errors, always add a comment explaining why:

} catch { /* role check may fail due to permissions, proceed to create attempt */ }

Pagination Pattern

Use bounded for loops with MAX_PAGES guard, never while(true):

const MAX_PAGES = 50;
for (let page = 0; page < MAX_PAGES; page += 1) {
  const response = await client.listSomething(new ListRequest({
    limit: 100,
    nextToken
  }));
  const rows = response.body?.items || [];
  results.push(...rows);
  nextToken = response.body?.nextToken;
  if (!nextToken || rows.length === 0) break;
}

API Quick Reference

Detailed API tables are in references/:

  • references/ref_fc_apis.md — Function Compute 3.0 (86 APIs, version 2023-03-30)
  • references/ref_rds_apis.md — RDS instance/database/account management
  • references/ref_redis_apis.md — Redis/Tair instance management (146 APIs, version 2015-01-01)
  • references/ref_oss_apis.md — Object Storage bucket/object operations
  • references/ref_dns_apis.md — Cloud DNS domain/record management (235 APIs, version 2015-01-09)

Key APIs Used by This Project

ProviderPrimary APIsSDK Package
FCCreateFunction, UpdateFunction, InvokeFunction, PublishFunctionVersion, UpdateAlias, CreateCustomDomain@alicloud/fc20230330
RDSCreateDBInstance, DescribeDBInstances, CreateAccount, CreateDatabase, DescribeAvailableZones@alicloud/rds20140815
RedisCreateTairInstance, DescribeInstances, CreateAccount, ResetAccountPassword@alicloud/r-kvstore20150101
OSSputBucket, put (object), list, getBucketInfoali-oss
DNSAddDomainRecord, UpdateDomainRecord, DeleteDomainRecord, DescribeSubDomainRecords@alicloud/alidns20150109
VPCDescribeVpcs, CreateVSwitch, DescribeVSwitches@alicloud/vpc20160428
ECSCreateSecurityGroup, AuthorizeSecurityGroup@alicloud/ecs20140526
SLSGetLogs@alicloud/sls20201230

Provider Implementation Checklist

When adding a new provider or extending an existing one:

  1. Use resolveSdkCtor() for SDK constructor resolution
  2. Create client with proper endpoint, connectTimeout, readTimeout
  3. Use withRetry() for API calls that may face transient failures
  4. Use bounded pagination (never while(true))
  5. Classify errors with isConflictError() where applicable
  6. Add comments to any intentionally empty catch blocks
  7. Store sensitive outputs (passwords, connection strings) in project.envs
  8. Mask credentials in CLI output via maskConnectionString()

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," or "hypothesis." For tracking implementation, see analytics-tracking.

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

Audit and improve web accessibility following WCAG 2.2 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

Audit and improve web accessibility following WCAG 2.1 guidelines. Use when asked to "improve accessibility", "a11y audit", "WCAG compliance", "screen reader support", "keyboard navigation", or "make accessible".

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates.

中文简介正在准备中。当前显示原文说明。

ComeOnOliver/skillshub642026年6月24日 更新

查看 ComeOnOliver 的全部技能

报告此技能的问题