.claude/skills/alicloud-redis/SKILL.md
Manage Alibaba Cloud Redis (Tair / R-KVStore) using the @alicloud/r-kvstore20150101 TypeScript SDK. Use when working with Redis or Tair instances, accounts, backups, security (whitelist/SSL/TDE/audit), parameters, monitoring, cluster scaling, direct connection, Tair Custom instances, and resource tagging. Covers all 157 APIs of the R-KVStore 20150101 version.
npx skillsauth add agents-infrastructure/licell alicloud-redisInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Manage Redis and Tair instances via the @alicloud/r-kvstore20150101 TypeScript SDK.
npm install @alicloud/r-kvstore20150101 @alicloud/openapi-core @darabonba/typescript
export ALIBABA_CLOUD_ACCESS_KEY_ID="<your-key-id>"
export ALIBABA_CLOUD_ACCESS_KEY_SECRET="<your-key-secret>"
See scripts/setup_client.ts for a reusable client factory, and references/quickstart.md for full setup including endpoints, instance types, architectures, Redis versions, pagination, and async polling.
import Client from '@alicloud/r-kvstore20150101';
import { Config } from '@alicloud/openapi-core';
const client = new Client(new Config({
accessKeyId: process.env.ALIBABA_CLOUD_ACCESS_KEY_ID,
accessKeySecret: process.env.ALIBABA_CLOUD_ACCESS_KEY_SECRET,
endpoint: 'r-kvstore.aliyuncs.com',
regionId: 'cn-hangzhou',
}));
| Domain | APIs | Key Operations | Reference | |--------|------|----------------|-----------| | Instance Management | 82 | createInstance, describeInstances, modifyInstanceSpec | references/instance.md | | Account Management | 7 | createAccount, grantAccountPrivilege, resetAccountPassword | references/account.md | | Backup & Recovery | 11 | createBackup, describeBackups, modifyBackupPolicy, restoreInstance | references/backup.md | | Security & Encryption | 23 | modifySecurityIps, modifyInstanceSSL, modifyInstanceTDE, modifyAuditLogConfig | references/security.md | | Parameter Management | 11 | describeParameters, createParameterGroup, modifyInstanceParameter | references/parameter.md | | Monitoring & Performance | 8 | describeHistoryMonitorValues, describeSlowLogRecords | references/monitoring.md | | Tair Custom Instance | 12 | createTairKVCacheCustomInstance, describeTairKVCacheCustomInstances | references/tair-custom.md | | Tag & Resource | 5 | tagResources, untagResources, listTagResources | references/tag-resource.md |
Most APIs require instanceId as the primary identifier:
import * as models from '@alicloud/r-kvstore20150101/dist/models';
const { body } = await client.describeInstanceAttribute(
new models.DescribeInstanceAttributeRequest({
instanceId: 'r-bp1xxxxxxxxxxxxx',
})
);
let pageNumber = 1;
let all: any[] = [];
while (true) {
const { body } = await client.describeInstances(new models.DescribeInstancesRequest({
regionId: 'cn-hangzhou', pageSize: 50, pageNumber,
}));
all.push(...(body.instances?.KVStoreInstance || []));
if (all.length >= (body.totalCount || 0)) break;
pageNumber++;
}
Many operations are async — poll instance status until target state:
while (true) {
const { body } = await client.describeInstanceAttribute(
new models.DescribeInstanceAttributeRequest({ instanceId })
);
const status = body.instances?.DBInstanceAttribute?.[0]?.instanceStatus;
if (status === 'Normal') break;
await new Promise(r => setTimeout(r, 5000));
}
R-KVStore supports Redis Community and Tair (DRAM/Persistent Memory/ESSD):
// Redis Community
const { body: redis } = await client.createInstance(new models.CreateInstanceRequest({
regionId: 'cn-hangzhou', instanceType: 'Redis', engineVersion: '7.0',
instanceClass: 'redis.master.small.default', chargeType: 'PostPaid',
password: process.env.REDIS_PASSWORD!, vpcId: 'vpc-xxx', vSwitchId: 'vsw-xxx',
}));
// Tair (Enhanced Redis)
const { body: tair } = await client.createTairInstance(new models.CreateTairInstanceRequest({
regionId: 'cn-hangzhou', instanceType: 'tair_rdb',
instanceClass: 'tair.rdb.2g', chargeType: 'PostPaid',
password: process.env.REDIS_PASSWORD!, vpcId: 'vpc-xxx', vSwitchId: 'vsw-xxx',
}));
Instance configuration is passed as a JSON string:
await client.modifyInstanceConfig(new models.ModifyInstanceConfigRequest({
instanceId,
config: JSON.stringify({
'maxmemory-policy': 'allkeys-lru',
'timeout': '300',
}),
}));
try {
await client.createInstance(request);
} catch (err: any) {
console.error(`Code: ${err.code}, Message: ${err.message}, RequestId: ${err.data?.RequestId}`);
}
createInstance → waitForNormal → createAccount → modifySecurityIps
createTairInstance → waitForNormal → describeClusterMemberInfo
modifyBackupPolicy → createBackup → describeBackups → restoreInstance
modifySecurityIps → modifyInstanceSSL → modifyInstanceTDE → modifyAuditLogConfig
describeClusterMemberInfo → addShardingNode / deleteShardingNode
allocateDirectConnection → describeDBInstanceNetInfo → releaseDirectConnection
describeParameterTemplates → createParameterGroup → modifyInstanceParameter
describeMonitorItems → describeHistoryMonitorValues → describeSlowLogRecords → createCacheAnalysisTask
See references/workflows.md for detailed workflow examples with full code.
Load the corresponding reference file for parameter details:
references/instance.mdreferences/account.mdreferences/backup.mdreferences/security.mdreferences/parameter.mdreferences/monitoring.mdreferences/tair-custom.mdreferences/tag-resource.mdEach reference file contains per-API documentation with method signatures and parameter tables.
See scripts/examples.ts for ready-to-use code covering:
tools
Deploy and manage Alibaba Cloud Serverless applications using the licell CLI. Covers deploy, release, functions, env vars, domains, DNS, logs, OSS, database, cache, and Supabase.
development
Manage Alibaba Cloud VPC networking using the @alicloud/vpc20160428 TypeScript SDK. Use when working with virtual private clouds, VSwitches, route tables, EIPs, NAT gateways, VPN gateways, Express Connect, BGP routing, network ACLs, flow logs, traffic mirroring, IPv6, HAVIP, gateway endpoints, and resource tagging. Covers all 396 APIs of the VPC 20160428 version.
tools
Manage Alibaba Cloud RDS using the @alicloud/rds20140815 TypeScript SDK. Use when working with relational database instances (MySQL, PostgreSQL, SQL Server, MariaDB), accounts, databases, backups, security, monitoring, parameters, read-only instances, database proxy, migration, cross-region DR, PostgreSQL extensions, RDS Custom instances, and resource tagging. Covers all 398 APIs of the RDS 20140815 version.
tools
# Alibaba Cloud OSS (Object Storage Service) Manage Alibaba Cloud OSS using the @alicloud/oss20190517 TypeScript SDK. Use when working with object storage buckets, objects, multipart uploads, bucket configurations (lifecycle, versioning, CORS, encryption, replication, WORM), live streaming channels, and static website hosting. Covers all 90 APIs of the OSS 2019-05-17 version. ## General Instructions - **SDK Package**: `@alicloud/oss20190517` (with `@alicloud/openapi-client`, `@alicloud/gatewa