用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/miles990/claude-software-skills --skill cloud-platforms命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | cloud-platforms |
| description | AWS, GCP, Azure services and cloud-native development |
| domain | development-stacks |
| version | 1.0.0 |
| tags | ["aws","gcp","azure","serverless","lambda","s3","cloudflare"] |
| triggers | {"keywords":{"primary":["aws","gcp","azure","cloud","serverless","lambda","s3"],"secondary":["ec2","cloudflare","vercel","netlify","dynamodb","cloud function"]},"context_boost":["deploy","infrastructure","scale","hosting"],"context_penalty":["frontend","ui","design"],"priority":"high"} |
Cloud services, serverless architectures, and cloud-native development patterns for AWS, GCP, and Azure.
// lambda/handler.ts
import { APIGatewayProxyHandler, APIGatewayProxyResult } from 'aws-lambda';
export const handler: APIGatewayProxyHandler = async (event) => {
try {
const body = JSON.parse(event.body || '{}');
// Business logic
const result = await processRequest(body);
return {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
'Access-Control-Allow-Origin': '*',
},
body: JSON.stringify(result),
};
} catch (error) {
console.error('Handler error:', error);
return {
statusCode: error.statusCode || 500,
body: JSON.stringify({
error: error.message || 'Internal server error',
}),
};
}
};
// With middleware (middy)
import middy from '@middy/core';
import jsonBodyParser from '@middy/http-json-body-parser';
import httpErrorHandler from '@middy/http-error-handler';
import cors from '@middy/http-cors';
const baseHandler = async (event) => {
// event.body is already parsed
return {
statusCode: 200,
body: JSON.stringify({ data: event.body }),
};
};
export const handler = middy(baseHandler)
.use(jsonBodyParser())
.use(httpErrorHandler())
.use(cors());
import { S3Client, PutObjectCommand, GetObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
const s3 = new S3Client({ region: process.env.AWS_REGION });
// Upload file
async function uploadFile(key: string, body: Buffer, contentType: string) {
await s3.send(new PutObjectCommand({
Bucket: process.env.S3_BUCKET,
Key: key,
Body: body,
ContentType: contentType,
}));
return `https://${process.env.S3_BUCKET}.s3.amazonaws.com/${key}`;
}
// Generate presigned upload URL
async function getUploadUrl(key: string, contentType: string, expiresIn = 3600) {
const command = new PutObjectCommand({
: process..,
: key,
: contentType,
});
(s3, command, { expiresIn });
}
() {
command = ({
: process..,
: key,
});
(s3, command, { expiresIn });
}
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import {
DynamoDBDocumentClient,
PutCommand,
GetCommand,
QueryCommand,
UpdateCommand,
} from '@aws-sdk/lib-dynamodb';
const client = new DynamoDBClient({ region: process.env.AWS_REGION });
const docClient = DynamoDBDocumentClient.from(client);
// Single table design patterns
const TABLE_NAME = process.env.DYNAMODB_TABLE;
// Put item
async function createUser(user: User) {
await docClient.send(new PutCommand({
TableName: TABLE_NAME,
Item: {
PK: `USER#${user.id}`,
SK: `PROFILE#${user.id}`,
GSI1PK: `EMAIL#${user.email}`,
GSI1SK: `USER#`,
...user,
: ().(),
},
: ,
}));
}
() {
result = docClient.( ({
: ,
: {
: ,
: ,
},
}));
result.;
}
() {
result = docClient.( ({
: ,
: ,
: ,
: {
: ,
},
}));
result.?.[];
}
() {
docClient.( ({
: ,
: {
: ,
: ,
},
: ,
: ,
: {
: ,
},
: {
: status,
: ().(),
},
}));
}
import { SQSClient, SendMessageCommand, ReceiveMessageCommand } from '@aws-sdk/client-sqs';
import { SNSClient, PublishCommand } from '@aws-sdk/client-sns';
const sqs = new SQSClient({ region: process.env.AWS_REGION });
const sns = new SNSClient({ region: process.env.AWS_REGION });
// Send to SQS
async function queueJob(job: Job) {
await sqs.send(new SendMessageCommand({
QueueUrl: process.env.SQS_QUEUE_URL,
MessageBody: JSON.stringify(job),
MessageAttributes: {
type: {
DataType: 'String',
StringValue: job.type,
},
},
}));
}
// Publish to SNS
async function publishEvent(: , : ) {
sns.( ({
: ,
: .(event),
: {
: {
: ,
: event.,
},
},
}));
}
= () => {
( record event.) {
job = .(record.);
(job);
}
};
import { HttpFunction, CloudEvent } from '@google-cloud/functions-framework';
// HTTP function
export const httpHandler: HttpFunction = async (req, res) => {
res.set('Access-Control-Allow-Origin', '*');
if (req.method === 'OPTIONS') {
res.status(204).send('');
return;
}
try {
const result = await processRequest(req.body);
res.json(result);
} catch (error) {
console.error('Error:', error);
res.status(500).json({ error: 'Internal error' });
}
};
// Pub/Sub triggered function
export const pubsubHandler = async (event: CloudEvent<{ message: { data: string } }>) => {
const data = JSON.parse(
Buffer.(event..., ).()
);
(data);
};
= () => {
file = event.;
.();
(file., file.);
};
import { Firestore, FieldValue } from '@google-cloud/firestore';
const db = new Firestore();
// Create document
async function createUser(user: User) {
const docRef = db.collection('users').doc(user.id);
await docRef.set({
...user,
createdAt: FieldValue.serverTimestamp(),
});
}
// Query with filters
async function getActiveUsers(limit = 10) {
const snapshot = await db.collection('users')
.where('status', '==', 'active')
.orderBy('createdAt', 'desc')
.limit(limit)
.get();
return snapshot.docs.map(doc => ({ id: doc.id, ...doc.data() }));
}
() {
db.( (t) => {
fromRef = db.().(fromId);
toRef = db.().(toId);
fromDoc = t.(fromRef);
fromBalance = fromDoc.()?. || ;
(fromBalance < amount) {
();
}
t.(fromRef, { : .(-amount) });
t.(toRef, { : .(amount) });
});
}
() {
db.().(userId).( {
(doc.) {
({ : doc., ...doc.() } );
}
});
}
service: my-api
provider:
name: aws
runtime: nodejs18.x
region: ${opt:region, 'us-east-1'}
stage: ${opt:stage, 'dev'}
environment:
TABLE_NAME: ${self:service}-${self:provider.stage}
BUCKET_NAME: ${self:service}-uploads-${self:provider.stage}
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- !GetAtt DynamoDBTable.Arn
- !Join ['/', [!GetAtt DynamoDBTable.Arn, 'index/*']]
- Effect: Allow
Action:
[, [ , ]]
// worker.ts
export interface Env {
KV: KVNamespace;
DB: D1Database;
BUCKET: R2Bucket;
}
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const url = new URL(request.url);
// Router
if (url.pathname.startsWith('/api/')) {
return handleAPI(request, env);
}
// Static assets from R2
if (url.pathname.startsWith('/assets/')) {
const key = url.pathname.slice(8);
const object = await env.BUCKET.get(key);
if (!object) {
return new Response('Not found', { status: 404 });
}
return (., {
: {
: .?. || ,
: ,
},
});
}
(, { : });
},
};
() {
url = (request.);
(url. === ) {
key = url..();
(request. === ) {
value = env..(key);
.({ value });
}
(request. === ) {
{ value, ttl } = request.();
env..(key, value, { : ttl });
.({ : });
}
}
(url. === ) {
(request. === ) {
{ results } = env..(
).();
.(results);
}
(request. === ) {
{ name, email } = request.();
result = env..(
).(name, email).();
.(result, { : });
}
}
(, { : });
}