aws-dynamodb
Build with Amazon DynamoDB for fast, scalable NoSQL storage. Design tables with partition and sort keys, create GSI and LSI for flexible queries, enable streams for change data capture, and apply single-table design patterns for efficient data modeling.
What this skill does
# AWS DynamoDB
Amazon DynamoDB is a fully managed NoSQL key-value and document database. It delivers single-digit millisecond latency at any scale with automatic scaling, built-in security, and zero operational overhead.
## Core Concepts
- **Table** — a collection of items (rows)
- **Partition Key (PK)** — required primary key for distributing data
- **Sort Key (SK)** — optional, enables range queries within a partition
- **GSI** — Global Secondary Index, alternate PK/SK for different access patterns
- **LSI** — Local Secondary Index, same PK but different SK (must be created at table creation)
- **Streams** — ordered log of item changes for event-driven processing
- **TTL** — automatic item expiration
## Creating Tables
```bash
# Create a table with partition key and sort key
aws dynamodb create-table \
--table-name Orders \
--attribute-definitions \
AttributeName=PK,AttributeType=S \
AttributeName=SK,AttributeType=S \
--key-schema \
AttributeName=PK,KeyType=HASH \
AttributeName=SK,KeyType=RANGE \
--billing-mode PAY_PER_REQUEST \
--tags Key=Env,Value=prod
```
```bash
# Create table with provisioned capacity and GSI
aws dynamodb create-table \
--table-name Orders \
--attribute-definitions \
AttributeName=PK,AttributeType=S \
AttributeName=SK,AttributeType=S \
AttributeName=GSI1PK,AttributeType=S \
AttributeName=GSI1SK,AttributeType=S \
--key-schema \
AttributeName=PK,KeyType=HASH \
AttributeName=SK,KeyType=RANGE \
--global-secondary-indexes '[{
"IndexName": "GSI1",
"KeySchema": [
{"AttributeName":"GSI1PK","KeyType":"HASH"},
{"AttributeName":"GSI1SK","KeyType":"RANGE"}
],
"Projection": {"ProjectionType":"ALL"},
"ProvisionedThroughput": {"ReadCapacityUnits":5,"WriteCapacityUnits":5}
}]' \
--provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
```
## Single-Table Design
```python
# Single-table design — store multiple entity types in one table
import boto3
from datetime import datetime
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('AppData')
# Store a customer
table.put_item(Item={
'PK': 'CUSTOMER#C001',
'SK': 'PROFILE',
'name': 'Alice Johnson',
'email': '[email protected]',
'GSI1PK': 'CUSTOMERS',
'GSI1SK': 'Alice Johnson',
'entity_type': 'Customer'
})
# Store an order for that customer
table.put_item(Item={
'PK': 'CUSTOMER#C001',
'SK': 'ORDER#2024-01-15#O001',
'total': 149.99,
'status': 'shipped',
'GSI1PK': 'ORDER#O001',
'GSI1SK': 'CUSTOMER#C001',
'entity_type': 'Order'
})
# Query all orders for a customer (sorted by date)
response = table.query(
KeyConditionExpression='PK = :pk AND begins_with(SK, :sk)',
ExpressionAttributeValues={':pk': 'CUSTOMER#C001', ':sk': 'ORDER#'}
)
```
## CRUD Operations
```bash
# Put an item
aws dynamodb put-item \
--table-name Orders \
--item '{
"PK": {"S": "CUSTOMER#C001"},
"SK": {"S": "ORDER#2024-01-15#O001"},
"total": {"N": "149.99"},
"status": {"S": "pending"}
}'
```
```bash
# Get an item by key
aws dynamodb get-item \
--table-name Orders \
--key '{"PK":{"S":"CUSTOMER#C001"},"SK":{"S":"ORDER#2024-01-15#O001"}}'
```
```bash
# Update an item with conditional expression
aws dynamodb update-item \
--table-name Orders \
--key '{"PK":{"S":"CUSTOMER#C001"},"SK":{"S":"ORDER#2024-01-15#O001"}}' \
--update-expression "SET #s = :new_status, updated_at = :ts" \
--condition-expression "#s = :old_status" \
--expression-attribute-names '{"#s":"status"}' \
--expression-attribute-values '{":new_status":{"S":"shipped"},":old_status":{"S":"pending"},":ts":{"S":"2024-01-16T10:00:00Z"}}'
```
```bash
# Delete an item
aws dynamodb delete-item \
--table-name Orders \
--key '{"PK":{"S":"CUSTOMER#C001"},"SK":{"S":"ORDER#2024-01-15#O001"}}'
```
## Queries and Scans
```bash
# Query with sort key condition
aws dynamodb query \
--table-name Orders \
--key-condition-expression "PK = :pk AND begins_with(SK, :prefix)" \
--expression-attribute-values '{":pk":{"S":"CUSTOMER#C001"},":prefix":{"S":"ORDER#2024"}}' \
--scan-index-forward false \
--limit 10
```
```bash
# Query a GSI
aws dynamodb query \
--table-name Orders \
--index-name GSI1 \
--key-condition-expression "GSI1PK = :pk" \
--expression-attribute-values '{":pk":{"S":"ORDER#O001"}}'
```
## Batch Operations
```python
# Batch write (up to 25 items)
import boto3
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table('AppData')
with table.batch_writer() as batch:
for i in range(100):
batch.put_item(Item={
'PK': f'PRODUCT#P{i:04d}',
'SK': 'DETAILS',
'name': f'Product {i}',
'price': round(9.99 + i * 0.5, 2)
})
```
## DynamoDB Streams
```bash
# Enable streams on a table
aws dynamodb update-table \
--table-name Orders \
--stream-specification StreamEnabled=true,StreamViewType=NEW_AND_OLD_IMAGES
```
```python
# Lambda handler for DynamoDB stream events
import json
def handler(event, context):
for record in event['Records']:
event_name = record['eventName'] # INSERT, MODIFY, REMOVE
new_image = record['dynamodb'].get('NewImage', {})
old_image = record['dynamodb'].get('OldImage', {})
if event_name == 'MODIFY':
old_status = old_image.get('status', {}).get('S')
new_status = new_image.get('status', {}).get('S')
if old_status != new_status:
print(f"Status changed: {old_status} -> {new_status}")
# Trigger downstream processing
```
## TTL (Time to Live)
```bash
# Enable TTL on an attribute
aws dynamodb update-time-to-live \
--table-name Sessions \
--time-to-live-specification Enabled=true,AttributeName=expires_at
```
```python
# Set TTL when writing items (epoch timestamp)
import time
table.put_item(Item={
'PK': 'SESSION#abc123',
'SK': 'DATA',
'user_id': 'U001',
'expires_at': int(time.time()) + 86400 # 24 hours from now
})
```
## Best Practices
- Design for access patterns first, not entity relationships
- Use single-table design to minimize the number of requests
- Use `begins_with` on sort keys for hierarchical data queries
- Enable on-demand (PAY_PER_REQUEST) for unpredictable workloads
- Use GSIs sparingly — each one duplicates data and costs extra
- Enable DynamoDB Streams + Lambda for event-driven reactions
- Use TTL to auto-expire temporary data (sessions, caches)
- Use condition expressions to prevent write conflicts
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.