Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill serverless명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | serverless |
| description | | Use when this capability is needed. |
import { APIGatewayProxyHandlerV2 } from 'aws-lambda';
export const handler: APIGatewayProxyHandlerV2 = async (event) => {
const body = JSON.parse(event.body || '{}');
// Initialize clients OUTSIDE handler (reused across warm invocations)
const result = await processRequest(body);
return {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(result),
};
};
// DB connections, SDK clients — init outside handler
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
const ddb = DynamoDBDocumentClient.from(new DynamoDBClient({}));
// SQS handler
import { SQSHandler } from 'aws-lambda';
export const sqsHandler: SQSHandler = async (event) => {
for (const record of event.Records) {
const body = JSON.parse(record.body);
await processMessage(body);
}
// Failed messages: use partial batch response
};
// Scheduled (cron)
import { ScheduledHandler } from 'aws-lambda';
export const cronHandler: ScheduledHandler = async () => {
await dailyCleanup();
};
// sst.config.ts
export default $config({
app(input) { return { name: 'my-app', home: 'aws' }; },
async run() {
const api = new sst.aws.ApiGatewayV2('Api');
api.route('POST /orders', 'src/functions/orders.handler');
const table = new sst.aws.Dynamo('Orders', {
fields: { pk: 'string', sk: 'string' },
primaryIndex: { hashKey: 'pk', rangeKey: 'sk' },
});
// Link resources (auto-grants IAM permissions)
api.route('GET /orders/{id}', {
handler: 'src/functions/get-order.handler',
link: [table],
});
},
});
# serverless.yml
service: my-service
provider:
name: aws
runtime: nodejs20.x
environment:
TABLE_NAME: !Ref OrdersTable
functions:
createOrder:
handler: src/handlers/orders.create
events:
- httpApi: 'POST /orders'
processQueue:
handler: src/handlers/queue.process
events:
- sqs:
arn: !GetAtt OrderQueue.Arn
batchSize: 10
resources:
Resources:
OrdersTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: ${self:service}-orders
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- { AttributeName: pk, AttributeType: S }
KeySchema:
- { AttributeName: pk, KeyType: HASH }
| Technique | Impact |
|---|---|
| Minimize bundle size (tree-shake, no large SDKs) | High |
| Initialize clients outside handler | High |
Use ARM64 (arm64 architecture) | Medium |
| Provisioned concurrency for critical paths | High (costs more) |
| Avoid VPC unless required | Medium |
// Bundle optimization: import only what you need
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'; // Not all of aws-sdk
| Anti-Pattern | Fix |
|---|---|
| Init DB/SDK inside handler | Move to module scope (reused across warm calls) |
| Monolithic function (does everything) | One function per concern |
| No timeout configuration | Set function timeout (default 3s is often too low) |
| Large deployment package | Tree-shake, exclude dev deps, use layers |
| Synchronous chaining (Lambda → Lambda) | Use SQS/SNS/Step Functions |
| No dead letter queue | Configure DLQ for async invocations |
Source: claude-dev-suite/claude-dev-suite — distributed by TomeVault.
SOC 직업 분류 기준