[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CY6CQFQ4MM472E16BJC7KB":3,"skill-same:01M6CY6CQFQ4MM472E16BJC7KB":127},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":28,"publishedAt":49,"linkOnly":50,"markdownContent":51,"markdownBody":52,"frontMatter":53,"refName":78,"commitSha":79,"skillDirectory":80,"forksCount":81,"repositoryHtmlUrl":82,"repositoryHomepageUrl":83,"ownerHtmlUrl":84,"ownerBlogUrl":85,"ownerDescription":86,"updatedAt":87,"install":88,"resources":100},"01M6CY6CQFQ4MM472E16BJC7KB","aws-serverless-eda",null,"AWS serverless and event-driven architecture expert based on Well-Architected Framework. Use when building serverless APIs, Lambda functions, REST APIs, microservices, or async workflows. Covers Lambda with TypeScript\u002FPython, API Gateway (REST\u002FHTTP), DynamoDB, Step Functions, EventBridge, SQS, SNS, and serverless patterns. Essential when user mentions serverless, Lambda, API Gateway, event-driven, async processing, queues, pub\u002Fsub, or wants to build scalable serverless applications with AWS best practices.","eric861129\u002FSKILLS_All-in-one","eric861129","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F74950944?v=4","01M6CXHDYEYRPFGGV4EFXCSYCF","ChiYu-Huang","01M6CXHE2J5CN1EBTY0FKV3ZKW",52,"MIT","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002FSKILL.md",[18,23],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000023","Skill与智能体开发","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"eda","aws","aws serverless","serverless","aws serverless eda","Bash","get","aws sqs","aws sns","aws lambda","query","expert","text","MCP","api","lambda","eventbridge","architecture","workflows","typescript","2026-11-10 10:12:30",false,"---\nname: aws-serverless-eda\ndescription: AWS serverless and event-driven architecture expert based on Well-Architected Framework. Use when building serverless APIs, Lambda functions, REST APIs, microservices, or async workflows. Covers Lambda with TypeScript\u002FPython, API Gateway (REST\u002FHTTP), DynamoDB, Step Functions, EventBridge, SQS, SNS, and serverless patterns. Essential when user mentions serverless, Lambda, API Gateway, event-driven, async processing, queues, pub\u002Fsub, or wants to build scalable serverless applications with AWS best practices.\ncontext: fork\nskills:\n  - aws-mcp-setup\n  - aws-cdk-development\nallowed-tools:\n  - mcp__aws-mcp__*\n  - mcp__awsdocs__*\n  - mcp__cdk__*\n  - Bash(sam *)\n  - Bash(aws lambda *)\n  - Bash(aws apigateway *)\n  - Bash(aws apigatewayv2 *)\n  - Bash(aws dynamodb *)\n  - Bash(aws stepfunctions *)\n  - Bash(aws events *)\n  - Bash(aws sqs *)\n  - Bash(aws sns *)\n  - Bash(aws sts get-caller-identity)\nhooks:\n  PreToolUse:\n    - matcher: Bash(sam deploy*)\n      command: aws sts get-caller-identity --query Account --output text\n      once: true\n---\n\n# AWS Serverless & Event-Driven Architecture\n\nThis skill provides comprehensive guidance for building serverless applications and event-driven architectures on AWS based on Well-Architected Framework principles.\n\n## AWS Documentation Requirement\n\nAlways verify AWS facts using MCP tools (`mcp__aws-mcp__*` or `mcp__*awsdocs*__*`) before answering. The `aws-mcp-setup` dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.\n\n## Serverless MCP Servers\n\nThis skill leverages the CDK MCP server (provided via `aws-cdk-development` dependency) and AWS Documentation MCP for serverless guidance.\n\n> **Note**: The following AWS MCP servers are available separately via the Full AWS MCP Server (see `aws-mcp-setup` skill) and are not bundled with this plugin:\n> - AWS Serverless MCP — SAM CLI lifecycle (init, deploy, local test)\n> - AWS Lambda Tool MCP — Direct Lambda invocation\n> - AWS Step Functions MCP — Workflow orchestration\n> - Amazon SNS\u002FSQS MCP — Messaging and queue management\n\n## When to Use This Skill\n\nUse this skill when:\n- Building serverless applications with Lambda\n- Designing event-driven architectures\n- Implementing microservices patterns\n- Creating asynchronous processing workflows\n- Orchestrating multi-service transactions\n- Building real-time data processing pipelines\n- Implementing saga patterns for distributed transactions\n- Designing for scale and resilience\n\n## AWS Well-Architected Serverless Design Principles\n\n### 1. Speedy, Simple, Singular\n\n**Functions should be concise and single-purpose**\n\n```typescript\n\u002F\u002F ✅ GOOD - Single purpose, focused function\nexport const processOrder = async (event: OrderEvent) => {\n  \u002F\u002F Only handles order processing\n  const order = await validateOrder(event);\n  await saveOrder(order);\n  await publishOrderCreatedEvent(order);\n  return { statusCode: 200, body: JSON.stringify({ orderId: order.id }) };\n};\n\n\u002F\u002F ❌ BAD - Function does too much\nexport const handleEverything = async (event: any) => {\n  \u002F\u002F Handles orders, inventory, payments, shipping...\n  \u002F\u002F Too many responsibilities\n};\n```\n\n**Keep functions environmentally efficient and cost-aware**:\n- Minimize cold start times\n- Optimize memory allocation\n- Use provisioned concurrency only when needed\n- Leverage connection reuse\n\n### 2. Think Concurrent Requests, Not Total Requests\n\n**Design for concurrency, not volume**\n\nLambda scales horizontally - design considerations should focus on:\n- Concurrent execution limits\n- Downstream service throttling\n- Shared resource contention\n- Connection pool sizing\n\n```typescript\n\u002F\u002F Consider concurrent Lambda executions accessing DynamoDB\nconst table = new dynamodb.Table(this, 'Table', {\n  billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, \u002F\u002F Auto-scales with load\n});\n\n\u002F\u002F Or with provisioned capacity + auto-scaling\nconst table = new dynamodb.Table(this, 'Table', {\n  billingMode: dynamodb.BillingMode.PROVISIONED,\n  readCapacity: 5,\n  writeCapacity: 5,\n});\n\n\u002F\u002F Enable auto-scaling for concurrent load\ntable.autoScaleReadCapacity({ minCapacity: 5, maxCapacity: 100 });\ntable.autoScaleWriteCapacity({ minCapacity: 5, maxCapacity: 100 });\n```\n\n### 3. Share Nothing\n\n**Function runtime environments are short-lived**\n\n```typescript\n\u002F\u002F ❌ BAD - Relying on local file system\nexport const handler = async (event: any) => {\n  fs.writeFileSync('\u002Ftmp\u002Fdata.json', JSON.stringify(data)); \u002F\u002F Lost after execution\n};\n\n\u002F\u002F ✅ GOOD - Use persistent storage\nexport const handler = async (event: any) => {\n  await s3.putObject({\n    Bucket: process.env.BUCKET_NAME,\n    Key: 'data.json',\n    Body: JSON.stringify(data),\n  });\n};\n```\n\n**State management**:\n- Use DynamoDB for persistent state\n- Use Step Functions for workflow state\n- Use ElastiCache for session state\n- Use S3 for file storage\n\n### 4. Assume No Hardware Affinity\n\n**Applications must be hardware-agnostic**\n\nInfrastructure can change without notice:\n- Lambda functions can run on different hardware\n- Container instances can be replaced\n- No assumption about underlying infrastructure\n\n**Design for portability**:\n- Use environment variables for configuration\n- Avoid hardware-specific optimizations\n- Test across different environments\n\n### 5. Orchestrate with State Machines, Not Function Chaining\n\n**Use Step Functions for orchestration**\n\n```typescript\n\u002F\u002F ❌ BAD - Lambda function chaining\nexport const handler1 = async (event: any) => {\n  const result = await processStep1(event);\n  await lambda.invoke({\n    FunctionName: 'handler2',\n    Payload: JSON.stringify(result),\n  });\n};\n\n\u002F\u002F ✅ GOOD - Step Functions orchestration\nconst stateMachine = new stepfunctions.StateMachine(this, 'OrderWorkflow', {\n  definition: stepfunctions.Chain\n    .start(validateOrder)\n    .next(processPayment)\n    .next(shipOrder)\n    .next(sendConfirmation),\n});\n```\n\n**Benefits of Step Functions**:\n- Visual workflow representation\n- Built-in error handling and retries\n- Execution history and debugging\n- Parallel and sequential execution\n- Service integrations without code\n\n### 6. Use Events to Trigger Transactions\n\n**Event-driven over synchronous request\u002Fresponse**\n\n```typescript\n\u002F\u002F Pattern: Event-driven processing\nconst bucket = new s3.Bucket(this, 'DataBucket');\n\nbucket.addEventNotification(\n  s3.EventType.OBJECT_CREATED,\n  new s3n.LambdaDestination(processFunction),\n  { prefix: 'uploads\u002F' }\n);\n\n\u002F\u002F Pattern: EventBridge integration\nconst rule = new events.Rule(this, 'OrderRule', {\n  eventPattern: {\n    source: ['orders'],\n    detailType: ['OrderPlaced'],\n  },\n});\n\nrule.addTarget(new targets.LambdaFunction(processOrderFunction));\n```\n\n**Benefits**:\n- Loose coupling between services\n- Asynchronous processing\n- Better fault tolerance\n- Independent scaling\n\n### 7. Design for Failures and Duplicates\n\n**Operations must be idempotent**\n\n```typescript\n\u002F\u002F ✅ GOOD - Idempotent operation\nexport const handler = async (event: SQSEvent) => {\n  for (const record of event.Records) {\n    const orderId = JSON.parse(record.body).orderId;\n\n    \u002F\u002F Check if already processed (idempotency)\n    const existing = await dynamodb.getItem({\n      TableName: process.env.TABLE_NAME,\n      Key: { orderId },\n    });\n\n    if (existing.Item) {\n      console.log('Order already processed:', orderId);\n      continue; \u002F\u002F Skip duplicate\n    }\n\n    \u002F\u002F Process order\n    await processOrder(orderId);\n\n    \u002F\u002F Mark as processed\n    await dynamodb.putItem({\n      TableName: process.env.TABLE_NAME,\n      Item: { orderId, processedAt: Date.now() },\n    });\n  }\n};\n```\n\n**Implement retry logic with exponential backoff**:\n```typescript\nasync function withRetry\u003CT>(fn: () => Promise\u003CT>, maxRetries = 3): Promise\u003CT> {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn();\n    } catch (error) {\n      if (i === maxRetries - 1) throw error;\n      await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));\n    }\n  }\n  throw new Error('Max retries exceeded');\n}\n```\n\n## Architecture Patterns\n\nFor detailed implementation patterns with full code examples, see the reference documentation:\n\n### Event-Driven Architecture Patterns\n**File**: `references\u002Feda-patterns.md`\n- Event Router with EventBridge (custom event bus, schema registry, rule-based routing)\n- Queue-Based Processing with SQS (standard\u002FFIFO, DLQ, Lambda consumers)\n- Pub\u002FSub Fan-Out with SNS + SQS (multi-consumer, filtering)\n- Saga Pattern with Step Functions (distributed transactions, compensating actions)\n- Event Sourcing with DynamoDB Streams (append-only event store, projections)\n\n### Serverless Architecture Patterns\n**File**: `references\u002Fserverless-patterns.md`\n- API-Driven Microservices (REST API + Lambda backend)\n- Stream Processing with Kinesis (real-time, batch windowing, bisect on error)\n- Async Task Processing with SQS (background jobs, concurrency control)\n- Scheduled Jobs with EventBridge (cron\u002Frate schedules)\n- Webhook Processing (signature validation, async queue forwarding)\n\n> **Important**: When using CDK code examples from references, avoid hardcoding resource names (e.g., `restApiName`, `eventBusName`). Let CDK generate unique names automatically to enable reusability and parallel deployments. See `aws-cdk-development` skill for details.\n\n## Best Practices\n\n### Error Handling\n\n**Implement comprehensive error handling**:\n\n```typescript\nexport const handler = async (event: SQSEvent) => {\n  const failures: SQSBatchItemFailure[] = [];\n\n  for (const record of event.Records) {\n    try {\n      await processRecord(record);\n    } catch (error) {\n      console.error('Failed to process record:', record.messageId, error);\n      failures.push({ itemIdentifier: record.messageId });\n    }\n  }\n\n  \u002F\u002F Return partial batch failures for retry\n  return { batchItemFailures: failures };\n};\n```\n\n### Dead Letter Queues\n\n**Always configure DLQs for error handling**:\n\n```typescript\nconst dlq = new sqs.Queue(this, 'DLQ', {\n  retentionPeriod: Duration.days(14),\n});\n\nconst queue = new sqs.Queue(this, 'Queue', {\n  deadLetterQueue: {\n    queue: dlq,\n    maxReceiveCount: 3,\n  },\n});\n\n\u002F\u002F Monitor DLQ depth\nnew cloudwatch.Alarm(this, 'DLQAlarm', {\n  metric: dlq.metricApproximateNumberOfMessagesVisible(),\n  threshold: 1,\n  evaluationPeriods: 1,\n  alarmDescription: 'Messages in DLQ require attention',\n});\n```\n\n### Observability\n\n**Enable tracing and monitoring**:\n\n```typescript\nnew NodejsFunction(this, 'Function', {\n  entry: 'src\u002Fhandler.ts',\n  tracing: lambda.Tracing.ACTIVE, \u002F\u002F X-Ray tracing\n  environment: {\n    POWERTOOLS_SERVICE_NAME: 'order-service',\n    POWERTOOLS_METRICS_NAMESPACE: 'MyApp',\n    LOG_LEVEL: 'INFO',\n  },\n});\n```\n\n## Using MCP Servers Effectively\n\nUse the CDK MCP server (via `aws-cdk-development` dependency) for construct recommendations and CDK-specific guidance when building serverless infrastructure.\n\nUse AWS Documentation MCP to verify service features, regional availability, and API specifications before implementing.\n\n## Additional Resources\n\nThis skill includes comprehensive reference documentation based on AWS best practices:\n\n- **Serverless Patterns**: `references\u002Fserverless-patterns.md`\n  - Core serverless architectures and API patterns\n  - Data processing and integration patterns\n  - Orchestration with Step Functions\n  - Anti-patterns to avoid\n\n- **Event-Driven Architecture Patterns**: `references\u002Feda-patterns.md`\n  - Event routing and processing patterns\n  - Event sourcing and saga patterns\n  - Idempotency and error handling\n  - Message ordering and deduplication\n\n- **Security Best Practices**: `references\u002Fsecurity-best-practices.md`\n  - Shared responsibility model\n  - IAM least privilege patterns\n  - Data protection and encryption\n  - Network security with VPC\n\n- **Observability Best Practices**: `references\u002Fobservability-best-practices.md`\n  - Three pillars: metrics, logs, traces\n  - Structured logging with Lambda Powertools\n  - X-Ray distributed tracing\n  - CloudWatch alarms and dashboards\n\n- **Performance Optimization**: `references\u002Fperformance-optimization.md`\n  - Cold start optimization techniques\n  - Memory and CPU optimization\n  - Package size reduction\n  - Provisioned concurrency patterns\n\n- **Deployment Best Practices**: `references\u002Fdeployment-best-practices.md`\n  - CI\u002FCD pipeline design\n  - Testing strategies (unit, integration, load)\n  - Deployment strategies (canary, blue\u002Fgreen)\n  - Rollback and safety mechanisms\n\n**External Resources**:\n- **AWS Well-Architected Serverless Lens**: https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002F\n- **ServerlessLand.com**: Pre-built serverless patterns\n- **AWS Serverless Workshops**: https:\u002F\u002Fserverlessland.com\u002Flearn?type=Workshops\n\nFor detailed implementation patterns, anti-patterns, and code examples, refer to the comprehensive references in the skill directory.\n","# AWS Serverless & Event-Driven Architecture\n\nThis skill provides comprehensive guidance for building serverless applications and event-driven architectures on AWS based on Well-Architected Framework principles.\n\n## AWS Documentation Requirement\n\nAlways verify AWS facts using MCP tools (`mcp__aws-mcp__*` or `mcp__*awsdocs*__*`) before answering. The `aws-mcp-setup` dependency is auto-loaded — if MCP tools are unavailable, guide the user through that skill's setup flow.\n\n## Serverless MCP Servers\n\nThis skill leverages the CDK MCP server (provided via `aws-cdk-development` dependency) and AWS Documentation MCP for serverless guidance.\n\n> **Note**: The following AWS MCP servers are available separately via the Full AWS MCP Server (see `aws-mcp-setup` skill) and are not bundled with this plugin:\n> - AWS Serverless MCP — SAM CLI lifecycle (init, deploy, local test)\n> - AWS Lambda Tool MCP — Direct Lambda invocation\n> - AWS Step Functions MCP — Workflow orchestration\n> - Amazon SNS\u002FSQS MCP — Messaging and queue management\n\n## When to Use This Skill\n\nUse this skill when:\n- Building serverless applications with Lambda\n- Designing event-driven architectures\n- Implementing microservices patterns\n- Creating asynchronous processing workflows\n- Orchestrating multi-service transactions\n- Building real-time data processing pipelines\n- Implementing saga patterns for distributed transactions\n- Designing for scale and resilience\n\n## AWS Well-Architected Serverless Design Principles\n\n### 1. Speedy, Simple, Singular\n\n**Functions should be concise and single-purpose**\n\n```typescript\n\u002F\u002F ✅ GOOD - Single purpose, focused function\nexport const processOrder = async (event: OrderEvent) => {\n  \u002F\u002F Only handles order processing\n  const order = await validateOrder(event);\n  await saveOrder(order);\n  await publishOrderCreatedEvent(order);\n  return { statusCode: 200, body: JSON.stringify({ orderId: order.id }) };\n};\n\n\u002F\u002F ❌ BAD - Function does too much\nexport const handleEverything = async (event: any) => {\n  \u002F\u002F Handles orders, inventory, payments, shipping...\n  \u002F\u002F Too many responsibilities\n};\n```\n\n**Keep functions environmentally efficient and cost-aware**:\n- Minimize cold start times\n- Optimize memory allocation\n- Use provisioned concurrency only when needed\n- Leverage connection reuse\n\n### 2. Think Concurrent Requests, Not Total Requests\n\n**Design for concurrency, not volume**\n\nLambda scales horizontally - design considerations should focus on:\n- Concurrent execution limits\n- Downstream service throttling\n- Shared resource contention\n- Connection pool sizing\n\n```typescript\n\u002F\u002F Consider concurrent Lambda executions accessing DynamoDB\nconst table = new dynamodb.Table(this, 'Table', {\n  billingMode: dynamodb.BillingMode.PAY_PER_REQUEST, \u002F\u002F Auto-scales with load\n});\n\n\u002F\u002F Or with provisioned capacity + auto-scaling\nconst table = new dynamodb.Table(this, 'Table', {\n  billingMode: dynamodb.BillingMode.PROVISIONED,\n  readCapacity: 5,\n  writeCapacity: 5,\n});\n\n\u002F\u002F Enable auto-scaling for concurrent load\ntable.autoScaleReadCapacity({ minCapacity: 5, maxCapacity: 100 });\ntable.autoScaleWriteCapacity({ minCapacity: 5, maxCapacity: 100 });\n```\n\n### 3. Share Nothing\n\n**Function runtime environments are short-lived**\n\n```typescript\n\u002F\u002F ❌ BAD - Relying on local file system\nexport const handler = async (event: any) => {\n  fs.writeFileSync('\u002Ftmp\u002Fdata.json', JSON.stringify(data)); \u002F\u002F Lost after execution\n};\n\n\u002F\u002F ✅ GOOD - Use persistent storage\nexport const handler = async (event: any) => {\n  await s3.putObject({\n    Bucket: process.env.BUCKET_NAME,\n    Key: 'data.json',\n    Body: JSON.stringify(data),\n  });\n};\n```\n\n**State management**:\n- Use DynamoDB for persistent state\n- Use Step Functions for workflow state\n- Use ElastiCache for session state\n- Use S3 for file storage\n\n### 4. Assume No Hardware Affinity\n\n**Applications must be hardware-agnostic**\n\nInfrastructure can change without notice:\n- Lambda functions can run on different hardware\n- Container instances can be replaced\n- No assumption about underlying infrastructure\n\n**Design for portability**:\n- Use environment variables for configuration\n- Avoid hardware-specific optimizations\n- Test across different environments\n\n### 5. Orchestrate with State Machines, Not Function Chaining\n\n**Use Step Functions for orchestration**\n\n```typescript\n\u002F\u002F ❌ BAD - Lambda function chaining\nexport const handler1 = async (event: any) => {\n  const result = await processStep1(event);\n  await lambda.invoke({\n    FunctionName: 'handler2',\n    Payload: JSON.stringify(result),\n  });\n};\n\n\u002F\u002F ✅ GOOD - Step Functions orchestration\nconst stateMachine = new stepfunctions.StateMachine(this, 'OrderWorkflow', {\n  definition: stepfunctions.Chain\n    .start(validateOrder)\n    .next(processPayment)\n    .next(shipOrder)\n    .next(sendConfirmation),\n});\n```\n\n**Benefits of Step Functions**:\n- Visual workflow representation\n- Built-in error handling and retries\n- Execution history and debugging\n- Parallel and sequential execution\n- Service integrations without code\n\n### 6. Use Events to Trigger Transactions\n\n**Event-driven over synchronous request\u002Fresponse**\n\n```typescript\n\u002F\u002F Pattern: Event-driven processing\nconst bucket = new s3.Bucket(this, 'DataBucket');\n\nbucket.addEventNotification(\n  s3.EventType.OBJECT_CREATED,\n  new s3n.LambdaDestination(processFunction),\n  { prefix: 'uploads\u002F' }\n);\n\n\u002F\u002F Pattern: EventBridge integration\nconst rule = new events.Rule(this, 'OrderRule', {\n  eventPattern: {\n    source: ['orders'],\n    detailType: ['OrderPlaced'],\n  },\n});\n\nrule.addTarget(new targets.LambdaFunction(processOrderFunction));\n```\n\n**Benefits**:\n- Loose coupling between services\n- Asynchronous processing\n- Better fault tolerance\n- Independent scaling\n\n### 7. Design for Failures and Duplicates\n\n**Operations must be idempotent**\n\n```typescript\n\u002F\u002F ✅ GOOD - Idempotent operation\nexport const handler = async (event: SQSEvent) => {\n  for (const record of event.Records) {\n    const orderId = JSON.parse(record.body).orderId;\n\n    \u002F\u002F Check if already processed (idempotency)\n    const existing = await dynamodb.getItem({\n      TableName: process.env.TABLE_NAME,\n      Key: { orderId },\n    });\n\n    if (existing.Item) {\n      console.log('Order already processed:', orderId);\n      continue; \u002F\u002F Skip duplicate\n    }\n\n    \u002F\u002F Process order\n    await processOrder(orderId);\n\n    \u002F\u002F Mark as processed\n    await dynamodb.putItem({\n      TableName: process.env.TABLE_NAME,\n      Item: { orderId, processedAt: Date.now() },\n    });\n  }\n};\n```\n\n**Implement retry logic with exponential backoff**:\n```typescript\nasync function withRetry\u003CT>(fn: () => Promise\u003CT>, maxRetries = 3): Promise\u003CT> {\n  for (let i = 0; i \u003C maxRetries; i++) {\n    try {\n      return await fn();\n    } catch (error) {\n      if (i === maxRetries - 1) throw error;\n      await new Promise(resolve => setTimeout(resolve, Math.pow(2, i) * 1000));\n    }\n  }\n  throw new Error('Max retries exceeded');\n}\n```\n\n## Architecture Patterns\n\nFor detailed implementation patterns with full code examples, see the reference documentation:\n\n### Event-Driven Architecture Patterns\n**File**: `references\u002Feda-patterns.md`\n- Event Router with EventBridge (custom event bus, schema registry, rule-based routing)\n- Queue-Based Processing with SQS (standard\u002FFIFO, DLQ, Lambda consumers)\n- Pub\u002FSub Fan-Out with SNS + SQS (multi-consumer, filtering)\n- Saga Pattern with Step Functions (distributed transactions, compensating actions)\n- Event Sourcing with DynamoDB Streams (append-only event store, projections)\n\n### Serverless Architecture Patterns\n**File**: `references\u002Fserverless-patterns.md`\n- API-Driven Microservices (REST API + Lambda backend)\n- Stream Processing with Kinesis (real-time, batch windowing, bisect on error)\n- Async Task Processing with SQS (background jobs, concurrency control)\n- Scheduled Jobs with EventBridge (cron\u002Frate schedules)\n- Webhook Processing (signature validation, async queue forwarding)\n\n> **Important**: When using CDK code examples from references, avoid hardcoding resource names (e.g., `restApiName`, `eventBusName`). Let CDK generate unique names automatically to enable reusability and parallel deployments. See `aws-cdk-development` skill for details.\n\n## Best Practices\n\n### Error Handling\n\n**Implement comprehensive error handling**:\n\n```typescript\nexport const handler = async (event: SQSEvent) => {\n  const failures: SQSBatchItemFailure[] = [];\n\n  for (const record of event.Records) {\n    try {\n      await processRecord(record);\n    } catch (error) {\n      console.error('Failed to process record:', record.messageId, error);\n      failures.push({ itemIdentifier: record.messageId });\n    }\n  }\n\n  \u002F\u002F Return partial batch failures for retry\n  return { batchItemFailures: failures };\n};\n```\n\n### Dead Letter Queues\n\n**Always configure DLQs for error handling**:\n\n```typescript\nconst dlq = new sqs.Queue(this, 'DLQ', {\n  retentionPeriod: Duration.days(14),\n});\n\nconst queue = new sqs.Queue(this, 'Queue', {\n  deadLetterQueue: {\n    queue: dlq,\n    maxReceiveCount: 3,\n  },\n});\n\n\u002F\u002F Monitor DLQ depth\nnew cloudwatch.Alarm(this, 'DLQAlarm', {\n  metric: dlq.metricApproximateNumberOfMessagesVisible(),\n  threshold: 1,\n  evaluationPeriods: 1,\n  alarmDescription: 'Messages in DLQ require attention',\n});\n```\n\n### Observability\n\n**Enable tracing and monitoring**:\n\n```typescript\nnew NodejsFunction(this, 'Function', {\n  entry: 'src\u002Fhandler.ts',\n  tracing: lambda.Tracing.ACTIVE, \u002F\u002F X-Ray tracing\n  environment: {\n    POWERTOOLS_SERVICE_NAME: 'order-service',\n    POWERTOOLS_METRICS_NAMESPACE: 'MyApp',\n    LOG_LEVEL: 'INFO',\n  },\n});\n```\n\n## Using MCP Servers Effectively\n\nUse the CDK MCP server (via `aws-cdk-development` dependency) for construct recommendations and CDK-specific guidance when building serverless infrastructure.\n\nUse AWS Documentation MCP to verify service features, regional availability, and API specifications before implementing.\n\n## Additional Resources\n\nThis skill includes comprehensive reference documentation based on AWS best practices:\n\n- **Serverless Patterns**: `references\u002Fserverless-patterns.md`\n  - Core serverless architectures and API patterns\n  - Data processing and integration patterns\n  - Orchestration with Step Functions\n  - Anti-patterns to avoid\n\n- **Event-Driven Architecture Patterns**: `references\u002Feda-patterns.md`\n  - Event routing and processing patterns\n  - Event sourcing and saga patterns\n  - Idempotency and error handling\n  - Message ordering and deduplication\n\n- **Security Best Practices**: `references\u002Fsecurity-best-practices.md`\n  - Shared responsibility model\n  - IAM least privilege patterns\n  - Data protection and encryption\n  - Network security with VPC\n\n- **Observability Best Practices**: `references\u002Fobservability-best-practices.md`\n  - Three pillars: metrics, logs, traces\n  - Structured logging with Lambda Powertools\n  - X-Ray distributed tracing\n  - CloudWatch alarms and dashboards\n\n- **Performance Optimization**: `references\u002Fperformance-optimization.md`\n  - Cold start optimization techniques\n  - Memory and CPU optimization\n  - Package size reduction\n  - Provisioned concurrency patterns\n\n- **Deployment Best Practices**: `references\u002Fdeployment-best-practices.md`\n  - CI\u002FCD pipeline design\n  - Testing strategies (unit, integration, load)\n  - Deployment strategies (canary, blue\u002Fgreen)\n  - Rollback and safety mechanisms\n\n**External Resources**:\n- **AWS Well-Architected Serverless Lens**: https:\u002F\u002Fdocs.aws.amazon.com\u002Fwellarchitected\u002Flatest\u002Fserverless-applications-lens\u002F\n- **ServerlessLand.com**: Pre-built serverless patterns\n- **AWS Serverless Workshops**: https:\u002F\u002Fserverlessland.com\u002Flearn?type=Workshops\n\nFor detailed implementation patterns, anti-patterns, and code examples, refer to the comprehensive references in the skill directory.\n",{"name":5,"hooks":54,"skills":60,"context":63,"description":7,"allowed-tools":64},{"PreToolUse":55},[56],{"once":57,"command":58,"matcher":59},true,"aws sts get-caller-identity --query Account --output text","Bash(sam deploy*)",[61,62],"aws-mcp-setup","aws-cdk-development","fork",[65,66,67,68,69,70,71,72,73,74,75,76,77],"mcp__aws-mcp__*","mcp__awsdocs__*","mcp__cdk__*","Bash(sam *)","Bash(aws lambda *)","Bash(aws apigateway *)","Bash(aws apigatewayv2 *)","Bash(aws dynamodb *)","Bash(aws stepfunctions *)","Bash(aws events *)","Bash(aws sqs *)","Bash(aws sns *)","Bash(aws sts get-caller-identity)","main","cbdd44aae21131521c09e42762e36178c790eacf","public\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda",13,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one","http:\u002F\u002Fhuangchiyu.com\u002FSKILLS_All-in-one\u002F","https:\u002F\u002Fgithub.com\u002Feric861129","https:\u002F\u002Fhuangchiyu.com\u002FChiYu-Blog\u002F","開發工程師，專注於 C#／.NET 系統現代化、AI-assisted engineering、開源工具與技術寫作。","2026-04-16 14:28:14",{"source":8,"skillName":5,"commands":89,"prompt":99,"zipAvailable":57},[90,93,96],{"tool":91,"command":92},"npx","npx skills add eric861129\u002FSKILLS_All-in-one --skill aws-serverless-eda",{"tool":94,"command":95},"bunx","bunx skills add eric861129\u002FSKILLS_All-in-one --skill aws-serverless-eda",{"tool":97,"command":98},"pnpm","pnpm dlx skills add eric861129\u002FSKILLS_All-in-one --skill aws-serverless-eda","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002FSKILL.md",[101,107,111,115,119,123],{"path":102,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fdeployment-best-practices.md","REFERENCE","参考文档",19664,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Fdeployment-best-practices.md",{"path":108,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Feda-patterns.md",24678,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Feda-patterns.md",{"path":112,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fobservability-best-practices.md",19049,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Fobservability-best-practices.md",{"path":116,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fperformance-optimization.md",16776,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Fperformance-optimization.md",{"path":120,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":121,"sourceHtmlUrl":122},"references\u002Fsecurity-best-practices.md",15257,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Fsecurity-best-practices.md",{"path":124,"resourceType":103,"resourceTypeDesc":104,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fserverless-patterns.md",20841,"https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FInfrastructure & Cloud\u002Faws-serverless-eda\u002Freferences\u002Fserverless-patterns.md",[128,156,186,210,235,255],{"skillNo":129,"name":130,"nameZh":6,"description":131,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":132,"categories":133,"keywords":135,"publishedAt":49},"01M6CZ1WR3KNVTKSWH4GNWT646","what-if-oracle","Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like \"what if...\", \"what would happen if...\", \"what are the possibilities\", \"explore scenarios\", \"scenario analysis\", \"possibility space\", \"what could go wrong\", \"best case \u002F worst case\", \"risk analysis\", \"contingency planning\", \"strategic options\", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fwhat-if-oracle\u002FSKILL.md",[134],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155],"oracle","what if oracle","go","run","planning","ux","futures","risk","analysis","explore","decision","branch","question","read","write","idea","exploration","options","stress-test","strategies",{"skillNo":157,"name":158,"nameZh":6,"description":159,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":160,"categories":161,"keywords":172,"publishedAt":49},"01M6CZ1QHGJE91A95MSN5EK5Q9","venue-templates","Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fvenue-templates\u002FSKILL.md",[162,165,168,169],{"categoryNo":163,"categoryName":164,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000018","写作与文案",{"categoryNo":166,"categoryName":167,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":170,"categoryName":171,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000036","内容创作者",[173,174,175,176,177,178,179,180,34,181,149,150,182,183,184,185],"templates","venue templates","research","guidelines","NeurIPS","ICML","LaTeX","science","access","edit","proposals","Academic","requirements",{"skillNo":187,"name":188,"nameZh":6,"description":189,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":190,"categories":191,"keywords":194,"publishedAt":49},"01M6CZ1KBQD2E5RTFB3BGVX7CD","the-fool","Use when challenging ideas, plans, decisions, or proposals using structured critical reasoning. Invoke to play devil's advocate, run a pre-mortem, red team, or audit evidence and assumptions.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fthe-fool\u002FSKILL.md",[192,193],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[195,196,138,197,46,139,198,199,200,201,202,203,204,205,183,206,207,40,208,209],"the fool","review","workflow","code","audit","forge","devil","team","designer","reviewer","challenge","stress test","evidence","poke","ideas",{"skillNo":211,"name":212,"nameZh":6,"description":213,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":214,"categories":215,"keywords":219,"publishedAt":49},"01M6CZ1ES826S7P1X3333E40TA","scientific-writing","Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA\u002FAMA\u002FVancouver), figures\u002Ftables, reporting guidelines (CONSORT\u002FSTROBE\u002FPRISMA), for research papers and journal submissions.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fscientific-writing\u002FSKILL.md",[216,217,218],{"categoryNo":163,"categoryName":164,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":170,"categoryName":171,"taxonomyType":26,"taxonomyTypeDesc":27},[220,221,176,222,223,224,225,226,34,227,149,150,182,228,229,230,231,232,233,234],"writing","scientific writing","core","reporting","deep research","Citations","Outlines","tool","use","never","structure","deep","full","stage","prisma",{"skillNo":236,"name":237,"nameZh":6,"description":238,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":239,"categories":240,"keywords":242,"publishedAt":49},"01M6CZ1B2JGJTB9FRD0TW4RXXE","scientific-brainstorming","Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fscientific-brainstorming\u002FSKILL.md",[241],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},[243,244,175,245,140,246,247,248,228,249,250,251,152,252,253,233,254],"brainstorming","scientific brainstorming","sessions","data","hypothesis","open","ideation","creative","do","connections","research ideation","generation",{"skillNo":256,"name":257,"nameZh":6,"description":258,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":259,"categories":260,"keywords":267,"publishedAt":49},"01M6CZ16JG8N7A2ZX04BGE8J2Y","research-lookup","Look up current research information using the Parallel Chat API (primary) or Perplexity sonar-pro-search (academic paper searches). Automatically routes queries to the best backend. Use for finding papers, gathering research data, and verifying scientific information.","https:\u002F\u002Fgithub.com\u002Feric861129\u002FSKILLS_All-in-one\u002Fblob\u002Fmain\u002Fpublic\u002FSKILLS\u002FWriting & Research\u002Fresearch-lookup\u002FSKILL.md",[261,264,265,266],{"categoryNo":262,"categoryName":263,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000010","后端与接口",{"categoryNo":166,"categoryName":167,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},[175,268,269,270,246,271,43,34,272,273,149,150,182,228,274,275,276,277,278,184],"lookup","research lookup","search","perplexity","parallel","openrouter","backend","up","look","queries","chat"]