Add database

From schuettc/claude-code-plugins · View interactive version

Add database is an AI agent skill from the GitHub repository schuettc/claude-code-plugins. Adds DynamoDB database persistence to the application. Use when the app needs data storage or persistence.

How to use this skill

Skill file

Add Database — DynamoDB Persistence

You are adding DynamoDB to replace the app's current data storage (in-memory, JSON files, etc.).

Prerequisites

What To Do

Phase 1: Explore

Examine how the app currently stores data (in-memory arrays, JSON files, SQLite, etc.). Identify all data entities and their relationships.

Phase 2: Plan

Present the proposed table design:

Table: Items
├── Partition Key: id (String)
├── Sort Key: (if needed based on access patterns)
├── Attributes: name, description, createdAt, updatedAt
└── Billing: Pay-per-request

Explain the key concepts before asking questions:

Ask the user:

  1. "Does this table design capture all your data?"
  2. "Will you only look things up by ID, or do you also need to find things by user, date, category, etc.?"
  3. "Is any data temporary and could be auto-deleted after a certain time?"

Phase 3: Execute

  1. Create infrastructure/lib/database-stack.ts
  1. Update Lambda handlers to use DynamoDB:
  1. Update CDK stack with least-privilege permissions:

Phase 4: Verify

  1. Run cd infrastructure && npx cdk synth to verify compilation
  2. Show the user: table definition, updated handler, IAM permissions granted
  3. Update .migration/plan.md to mark add-database as complete

Important Notes

Best Practices

Security

Cost

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.