Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Aws Patterns

ASecurity

Lambda best practices, S3 event patterns, SQS/SNS fanout, and DynamoDB access patterns for serverless AWS architectures.

530 stars
0 votes
0 copies
2 views
Added 5/29/2026
ai-agentstypescriptawsapi

Works with

cliapi

Security Analysis

A100/100

Scanned 5/29/2026

$npx -y skills add vibeeval/vibecosystem --skill aws-patterns --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Aws Patterns?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Aws Patterns
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vibeeval-aws-patterns/badge)](https://www.skillsdirectory.com/skills/vibeeval-aws-patterns)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
skill.md
---
name: aws-patterns
description: Lambda best practices, S3 event patterns, SQS/SNS fanout, and DynamoDB access patterns for serverless AWS architectures.
---

# AWS Patterns

Serverless and managed service patterns for AWS production workloads.

## Lambda Best Practices

```typescript
// Cold start optimization: keep handler thin, initialize outside handler
import { DynamoDBClient } from '@aws-sdk/client-dynamodb'
import { DynamoDBDocumentClient, GetCommand } from '@aws-sdk/lib-dynamodb'

// Initialized ONCE per container (reused across invocations)
const client = DynamoDBDocumentClient.from(new DynamoDBClient({}))

export const handler = async (event: APIGatewayProxyEvent) => {
  try {
    const userId = event.pathParameters?.id
    if (!userId) {
      return { statusCode: 400, body: JSON.stringify({ error: 'Missing user ID' }) }
    }

    const result = await client.send(new GetCommand({
      TableName: process.env.USERS_TABLE!,
      Key: { pk: `USER#${userId}`, sk: `PROFILE` }
    }))

    if (!result.Item) {
      return { statusCode: 404, body: JSON.stringify({ error: 'User not found' }) }
    }

    return {
      statusCode: 200,
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(result.Item)
    }
  } catch (err) {
    console.error('Handler error:', err)
    return { statusCode: 500, body: JSON.stringify({ error: 'Internal server error' }) }
  }
}
```

## S3 Event Processing

```typescript
// S3 → Lambda: process uploaded files
import { S3Client, GetObjectCommand } from '@aws-sdk/client-s3'

const s3 = new S3Client({})

export const handler = async (event: S3Event) => {
  for (const record of event.Records) {
    const bucket = record.s3.bucket.name
    const key = decodeURIComponent(record.s3.object.key.replace(/\+/g, ' '))
    const size = record.s3.object.size

    // Guard: skip non-image files or oversized uploads
    if (size > 10_000_000) {
      console.warn(`Skipping oversized file: ${key} (${size} bytes)`)
      continue
    }

    const response = await s3.send(new GetObjectCommand({ Bucket: bucket, Key: key }))
    const body = await response.Body!.transformToByteArray()

    await processImage(body, key)

    console.log(`Processed ${key} (${size} bytes)`)
  }
}
```

## SQS/SNS Fanout Pattern

```typescript
// SNS → multiple SQS queues (fanout to parallel consumers)

// Publisher: send to SNS topic
import { SNSClient, PublishCommand } from '@aws-sdk/client-sns'

const sns = new SNSClient({})

async function publishOrderEvent(order: Order): Promise<void> {
  await sns.send(new PublishCommand({
    TopicArn: process.env.ORDER_EVENTS_TOPIC!,
    Message: JSON.stringify(order),
    MessageAttributes: {
      eventType: { DataType: 'String', StringValue: 'order.created' },
      region: { DataType: 'String', StringValue: order.region }
    }
  }))
}

// Consumer: SQS Lambda (one per subscriber: email, analytics, inventory)
export const emailHandler = async (event: SQSEvent) => {
  for (const record of event.Records) {
    const order = JSON.parse(record.body) as Order

    try {
      await sendOrderConfirmation(order)
    } catch (err) {
      console.error(`Failed to send email for order ${order.id}:`, err)
      throw err  // Message returns to queue for retry (DLQ after maxReceiveCount)
    }
  }
}
```

## DynamoDB Single-Table Design

```typescript
// Access patterns drive table design, not entity relationships

// Table: pk (partition key) + sk (sort key) + GSI1PK + GSI1SK
// Entities: User, Order, OrderItem - all in one table

const AccessPatterns = {
  // Get user profile
  getUserProfile: (userId: string) => ({
    pk: `USER#${userId}`,
    sk: `PROFILE`
  }),

  // Get user's orders (sorted by date)
  getUserOrders: (userId: string) => ({
    pk: `USER#${userId}`,
    sk: { begins_with: 'ORDER#' }     // sk: ORDER#2025-01-15#orderId
  }),

  // Get order with items
  getOrderWithItems: (orderId: string) => ({
    pk: `ORDER#${orderId}`,
    sk: { begins_with: '' }            // sk: METADATA, ITEM#productId
  }),

  // Get orders by status (GSI1)
  getOrdersByStatus: (status: string) => ({
    GSI1PK: `STATUS#${status}`,
    GSI1SK: { begins_with: '' }        // GSI1SK: date#orderId
  })
}

// Write: transactional multi-item write
import { TransactWriteCommand } from '@aws-sdk/lib-dynamodb'

async function createOrder(order: Order): Promise<void> {
  const items = [
    // Order metadata
    {
      Put: {
        TableName: process.env.TABLE!,
        Item: {
          pk: `ORDER#${order.id}`,
          sk: 'METADATA',
          GSI1PK: `STATUS#${order.status}`,
          GSI1SK: `${order.createdAt}#${order.id}`,
          ...order
        }
      }
    },
    // User's order reference
    {
      Put: {
        TableName: process.env.TABLE!,
        Item: {
          pk: `USER#${order.userId}`,
          sk: `ORDER#${order.createdAt}#${order.id}`,
          orderId: order.id,
          total: order.total,
          status: order.status
        }
      }
    }
  ]

  await client.send(new TransactWriteCommand({ TransactItems: items }))
}
```

## Checklist

- [ ] Lambda: initialize SDK clients outside handler (reuse across invocations)
- [ ] Lambda: set memory based on profiling (more memory = more CPU = faster)
- [ ] Lambda: set timeout to 2x expected duration (not max 900s)
- [ ] SQS: configure Dead Letter Queue with maxReceiveCount: 3
- [ ] DynamoDB: design table around access patterns, not entities
- [ ] DynamoDB: use TransactWrite for multi-item atomicity
- [ ] S3: enable versioning and lifecycle rules for cost optimization
- [ ] SNS: use message attributes for subscriber filtering

## Anti-Patterns

- Initializing SDK clients inside Lambda handler (cold start penalty every time)
- Synchronous Lambda chains: A calls B calls C (use Step Functions)
- DynamoDB scan operations in production (always query with pk/sk)
- S3 event without idempotency: Lambda can be invoked multiple times per event
- Oversized Lambda packages (>50MB): use layers or container images
- Missing DLQ on SQS: failed messages silently disappear after retention period

Attribution

vibeevalvibeeval
View sourceSee grades on GitHubMore from vibeeval →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698431 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →