Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
giuseppe-trisciuoglio avatar

Dynamodb Toolbox Patterns

  • 1.4k installs
  • 311 repo stars
  • Updated June 22, 2026
  • giuseppe-trisciuoglio/developer-kit

dynamodb-toolbox-patterns provides documented workflows for Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and tr

About

The dynamodb-toolbox-patterns skill provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction operations, and single-table design with computed keys. Use when implementing type-safe DynamoDB access layers with DynamoDB-Toolbox v2 in TypeScript services or serverless applications. # DynamoDB-Toolbox v2 Patterns (TypeScript) ## Overview This skill provides practical TypeScript patterns for using DynamoDB-Toolbox v2 with AWS SDK v3 DocumentClient. It focuses on type-safe schema modeling, `.build()` command usage, and production-ready single-table design. ## When to Use - Defining DynamoDB tables and entities with strict TypeScript inference - Modeling schemas with `item`, `string`, `number`, `list`, `set`, `map`, and `record` - Implementing `GetItem`, `PutItem`, `UpdateItem`, `DeleteItem` via `.build()` - Building query and scan access paths with primary keys and GSIs - Handling batch and transactional operations - Designing single-table systems with computed keys and entity patterns ## Instructions 1. **Start from access patterns**: identify read/write queries first, then.

  • Defining DynamoDB tables and entities with strict TypeScript inference
  • Modeling schemas with `item`, `string`, `number`, `list`, `set`, `map`, and `record`
  • Implementing `GetItem`, `PutItem`, `UpdateItem`, `DeleteItem` via `.build()`
  • Building query and scan access paths with primary keys and GSIs
  • Handling batch and transactional operations

Dynamodb Toolbox Patterns by the numbers

  • 1,352 all-time installs (skills.sh)
  • +55 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #176 of 1,048 Mobile Development skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

dynamodb-toolbox-patterns capabilities & compatibility

Capabilities
defining dynamodb tables and entities with stric · modeling schemas with `item`, `string`, `number` · implementing `getitem`, `putitem`, `updateitem`, · building query and scan access paths with primar · handling batch and transactional operations
Use cases
documentation
From the docs

What dynamodb-toolbox-patterns says it does

# DynamoDB-Toolbox v2 Patterns (TypeScript) ## Overview This skill provides practical TypeScript patterns for using DynamoDB-Toolbox v2 with AWS SDK v3 DocumentClient.
SKILL.md
It focuses on type-safe schema modeling, `.build()` command usage, and production-ready single-table design.
SKILL.md
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill dynamodb-toolbox-patterns

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1.4k
repo stars311
Security audit3 / 3 scanners passed
Last updatedJune 22, 2026
Repositorygiuseppe-trisciuoglio/developer-kit

How do I use dynamodb-toolbox-patterns for the task described in its SKILL.md triggers?

Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction operations, and single-table.

Who is it for?

Teams invoking dynamodb-toolbox-patterns when the user request matches documented triggers and prerequisites.

Skip if: Skip when cached docs are missing, the request is a negative trigger, or another sibling skill owns the workflow.

When should I use this skill?

Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction operations, and single-table design with computed

What you get

Step-by-step guidance grounded in dynamodb-toolbox-patterns documentation and reference files.

  • Entity schemas
  • Table build configurations
  • Query action patterns

By the numbers

  • Targets DynamoDB-Toolbox v2 APIs including Table `.build()` and Query actions
  • Bundles curated links across getting-started, tables, entities, and query docs

Files

SKILL.mdMarkdownGitHub ↗

DynamoDB-Toolbox v2 Patterns (TypeScript)

Overview

This skill provides practical TypeScript patterns for using DynamoDB-Toolbox v2 with AWS SDK v3 DocumentClient. It focuses on type-safe schema modeling, .build() command usage, and production-ready single-table design.

When to Use

  • Defining DynamoDB tables and entities with strict TypeScript inference
  • Modeling schemas with item, string, number, list, set, map, and record
  • Implementing GetItem, PutItem, UpdateItem, DeleteItem via .build()
  • Building query and scan access paths with primary keys and GSIs
  • Handling batch and transactional operations
  • Designing single-table systems with computed keys and entity patterns

Instructions

1. Start from access patterns: identify read/write queries first, then design keys. 2. Create table + entity boundaries: one table, multiple entities if using single-table design. 3. Define schemas with constraints: apply .key(), .required(), .default(), .transform(), .link(). 4. Use `.build()` commands everywhere: avoid ad-hoc command construction for consistency and type safety. 5. Add query/index coverage: validate GSI/LSI paths for each required access pattern. 6. Use batch/transactions intentionally: batch for throughput, transactions for atomicity. 7. Keep items evolvable: use optional fields, defaults, and derived attributes for schema evolution.

Examples

Install and Setup

npm install dynamodb-toolbox @aws-sdk/client-dynamodb @aws-sdk/lib-dynamodb
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import { DynamoDBDocumentClient } from '@aws-sdk/lib-dynamodb';
import { Table } from 'dynamodb-toolbox/table';
import { Entity } from 'dynamodb-toolbox/entity';
import { item, string, number, list, map } from 'dynamodb-toolbox/schema';

const client = new DynamoDBClient({ region: process.env.AWS_REGION ?? 'eu-west-1' });
const documentClient = DynamoDBDocumentClient.from(client);

export const AppTable = new Table({
  name: 'app-single-table',
  partitionKey: { name: 'PK', type: 'string' },
  sortKey: { name: 'SK', type: 'string' },
  indexes: {
    byType: { type: 'global', partitionKey: { name: 'GSI1PK', type: 'string' }, sortKey: { name: 'GSI1SK', type: 'string' } }
  },
  documentClient
});

Entity Schema with Modifiers and Complex Attributes

const now = () => new Date().toISOString();

export const UserEntity = new Entity({
  name: 'User',
  table: AppTable,
  schema: item({
    tenantId: string().required('always'),
    userId: string().required('always'),
    email: string().required('always').transform(input => input.toLowerCase()),
    role: string().enum('admin', 'member').default('member'),
    loginCount: number().default(0),
    tags: list(string()).default([]),
    profile: map({
      displayName: string().optional(),
      timezone: string().default('UTC')
    }).default({ timezone: 'UTC' })
  }),
  computeKey: ({ tenantId, userId }) => ({
    PK: `TENANT#${tenantId}`,
    SK: `USER#${userId}`,
    GSI1PK: `TENANT#${tenantId}#TYPE#USER`,
    GSI1SK: `EMAIL#${userId}`
  })
});

.build() CRUD Commands

import { PutItemCommand } from 'dynamodb-toolbox/entity/actions/put';
import { GetItemCommand } from 'dynamodb-toolbox/entity/actions/get';
import { UpdateItemCommand, $add } from 'dynamodb-toolbox/entity/actions/update';
import { DeleteItemCommand } from 'dynamodb-toolbox/entity/actions/delete';

await UserEntity.build(PutItemCommand)
  .item({ tenantId: 't1', userId: 'u1', email: 'A@Example.com' })
  .send();

const { Item } = await UserEntity.build(GetItemCommand)
  .key({ tenantId: 't1', userId: 'u1' })
  .send();

await UserEntity.build(UpdateItemCommand)
  .item({ tenantId: 't1', userId: 'u1', loginCount: $add(1) })
  .send();

await UserEntity.build(DeleteItemCommand)
  .key({ tenantId: 't1', userId: 'u1' })
  .send();

Query and Scan Patterns

import { QueryCommand } from 'dynamodb-toolbox/table/actions/query';
import { ScanCommand } from 'dynamodb-toolbox/table/actions/scan';

const byTenant = await AppTable.build(QueryCommand)
  .query({
    partition: `TENANT#t1`,
    range: { beginsWith: 'USER#' }
  })
  .send();

const byTypeIndex = await AppTable.build(QueryCommand)
  .query({
    index: 'byType',
    partition: 'TENANT#t1#TYPE#USER'
  })
  .options({ limit: 25 })
  .send();

const scanned = await AppTable.build(ScanCommand)
  .options({ limit: 100 })
  .send();

Batch and Transaction Workflows

import { BatchWriteCommand } from 'dynamodb-toolbox/table/actions/batchWrite';
import { TransactWriteCommand } from 'dynamodb-toolbox/table/actions/transactWrite';

await AppTable.build(BatchWriteCommand)
  .requests(
    UserEntity.build(PutItemCommand).item({ tenantId: 't1', userId: 'u2', email: 'u2@example.com' }),
    UserEntity.build(PutItemCommand).item({ tenantId: 't1', userId: 'u3', email: 'u3@example.com' })
  )
  .send();

await AppTable.build(TransactWriteCommand)
  .requests(
    UserEntity.build(PutItemCommand).item({ tenantId: 't1', userId: 'u4', email: 'u4@example.com' }),
    UserEntity.build(UpdateItemCommand).item({ tenantId: 't1', userId: 'u1', loginCount: $add(1) })
  )
  .send();

Single-Table Design Guidance

  • Model each business concept as an entity with strict schema.
  • Keep PK/SK predictable and composable (TENANT#, USER#, ORDER#).
  • Encode access paths into GSI keys, not in-memory filters.
  • Prefer append-only timelines for audit/history data.
  • Keep hot partitions under control with scoped partitions and sharding where needed.

Best Practices

  • Design keys from access patterns first, then derive entity attributes.
  • Keep one source of truth for key composition (computeKey) to avoid drift.
  • Use .options({ consistent: true }) only where strict read-after-write is required.
  • Prefer targeted queries over scans for runtime request paths.
  • Add conditional expressions for idempotency and optimistic concurrency control.
  • Validate batch/transaction size limits before execution to avoid partial failures.

Constraints and Warnings

  • DynamoDB-Toolbox v2 relies on AWS SDK v3 DocumentClient integration.
  • Avoid table scans in request paths unless explicitly bounded.
  • Use conditional writes for concurrency-sensitive updates.
  • Transactions are limited and slower than single-item writes; use only for true atomic requirements.
  • Validate key design against target throughput before implementation.

References

Primary references curated from Context7 are available in:

  • references/api-dynamodb-toolbox-v2.md

Related skills

Forks & variants (1)

Dynamodb Toolbox Patterns has 1 known copy in the catalog totaling 2 installs. They canonicalize to this original listing.

How it compares

Pick dynamodb-toolbox-patterns over generic DynamoDB skills when the codebase already uses DynamoDB-Toolbox v2 and agents need `.build()`-specific examples.

FAQ

What does dynamodb-toolbox-patterns do?

Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction operations, and single-table design with computed

When should I use dynamodb-toolbox-patterns?

Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction operations, and single-table design with computed

What are common prerequisites?

--- name: dynamodb-toolbox-patterns description: Provides TypeScript patterns for DynamoDB-Toolbox v2 including schema/table/entity modeling, .build() command workflow, query/scan access patterns, batch and transaction o

Is Dynamodb Toolbox Patterns safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.