用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/G1Joshi/Agent-Skills --skill serverless命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | serverless |
| description | Serverless architecture with FaaS and BaaS. Use for cloud functions. |
Serverless is a cloud-native development model for building and running applications without managing servers. The cloud provider handles the routine work of provisioning, maintaining, and scaling the server infrastructure.
// AWS Lambda Handler (Node.js)
export const handler = async (event) => {
console.log("Event received:", JSON.stringify(event));
const name = event.queryStringParameters?.name || "World";
return {
statusCode: 200,
body: JSON.stringify({ message: `Hello, ${name}!` }),
};
};
# serverless.yml (Serverless Framework)
service: my-api
provider:
name: aws
runtime: nodejs20.x
functions:
hello:
handler: handler.hello
events:
- httpApi:
path: /hello
method: get
Upload code (Function), define triggers (HTTP, Queue, DB, Timer). Run only when triggered.
The latency incurred when a function is invoked after being idle (container spinning up).
Functions are ephemeral. Store state in external managed services (Redis, DynamoDB, S3).
One event triggers multiple parallel functions (e.g., Upload -> [Resize, Analyze, Back up]).
Migrating a monolith by gradually replacing endpoints with serverless functions routed via API Gateway.
Do:
Don't:
| Error | Cause | Solution |
|---|---|---|
Timeout | Function took too long. | Increase timeout setting; optimize code; move to async pattern. |
OOM (Out of Memory) | Processing large files. | Increase RAM (allocates more CPU too); stream data instead of loading all in memory. |