CodexGuild
skills/ aws/agent-toolkit-for-aws

aws-cdk-blocks

Guides building or extending apps with AWS CDK Blocks (formerly AWS Blocks), an Infrastructure-from-Code framework on CDK. Each Block packages an application capability with its infrastructure, the app code that connects to it, and a local implementation, deployed into the developer's own AWS accoun

Installs
New
Files scanned
8
Scan passeddevops
Source on GitHub

Security scan

Scan passed

No risky patterns were found in the scanned files.

8 files scannedscanner v1.4.0Nov 25, 2026

Content sha256 e744eee4a8463127… — run codexguild_scan_skills after installing to verify your local copy.

Static analysis is a first line of defense, not a guarantee. Read the source

SKILL.md

exact scanned copy

AWS CDK Blocks

Overview

AWS CDK Blocks (formerly AWS Blocks) is an open-source TypeScript framework that extends the AWS CDK. A Block is an npm package for one application capability, such as a data store, sign-in, file storage, realtime channels, background and scheduled jobs, email or an AI agent. It holds the CDK construct for the infrastructure, the code the app calls, and a local implementation. An app's backend is one cdk-blocks/ folder. It runs on the developer's machine without an AWS account, and the same code deploys to the developer's own AWS account as CloudFormation stacks.

CDK Blocks fits a TypeScript web app, API or mobile backend whose infrastructure should be CDK code in the developer's account. This skill covers the start of a project. Inside an app that already uses CDK Blocks, the app's own AGENTS.md and docs task describe the installed version and take precedence over this skill.

Local development needs no AWS credentials. Deploying does: the AWS MCP server is recommended for AWS API calls (sandboxed execution and audit logging) but is not required; every step here runs with npm and the AWS CLI.

Guardrail — where this skill's own files live (MCP vs local install)

This skill ships only documents (references/*.md), no scripts. It can be loaded two ways, and they resolve those files from different places:

  • Loaded through the AWS MCP retrieve_skill tool: The skill is not installed on the local filesystem. You MUST fetch each reference via retrieve_skill with the file parameter (for example file="references/existing-project.md"). Do NOT file_read these paths locally: they do not exist on disk.
  • Installed locally (for example .kiro/skills/aws-cdk-blocks/ or ~/.claude/skills/aws-cdk-blocks/): Read the references from the local skill directory using relative paths.

This distinction applies only to the skill's own packaged files. User data and session artifacts are always read from and written to the user's working directory. Never fetch or write customer data through retrieve_skill.

Where to start

Take the first row that matches the request or the project.

The request or the projectGo to
A deploy to AWSreferences/deploying.md
A production launch or a security reviewreferences/security.md
An iOS, Android, desktop or Flutter client for the backendreferences/native-clients.md
An AWS service that no Block covers, or a Block a team wants to ownreferences/custom-block.md
The project has a cdk-blocks/ folderWork in an existing app. Never scaffold again.
The project is an AWS CDK app with its own stacks (cdk.json, cdk deploy)references/existing-cdk-app.md
The project has a package.json and no CDK Blocks: Vite, Next.js, an Express API, Amplify Gen 2references/existing-project.md
An empty directory, or a request for a new appCreate an app

Apps created before the rename have an aws-blocks/ folder and @aws-blocks/* packages: treat them as existing apps and keep their names, or move them with references/migrating-from-aws-blocks.md when the user asks.

Create an app

  1. Choose a template. A template sets the starting frontend and sample code only: every Block can be added to every template later, for example the Database Block in a nextjs app that needs PostgreSQL.

    The user wants--template
    Their own features on a web frontend. The smallest app: Vite and one greet() API methodbare
    A React frontend: a todo app with sign-in, a data store and realtimereact
    A Next.js App Router app whose Server and Client Components call the backendnextjs
    A backend with no frontend and one API methodbackend
    A backend for mobile, CLI or third-party clients: a public health check and sign-in-gated CRUDapi-only
    A PostgreSQL backend with migrations, foreign keys and transactionssql
    A tour of sign-in: email sign-up with a code, groups, a profileauth
    OpenID Connect sign-in, with a stub identity provider for local runsauth-oidc
    An AI agent with a tool, and a canned model for local runsagent
    Scheduled jobs, no frontendcron
    Logs, metrics, traces and a dashboard, no frontendobservability
    A larger sample: sign-in and a priority-sorted todo listdemo
    No preference: Vite with sign-in, a data store and realtimedefault

    The scaffolder prints the templates of the installed version:

    npx --yes @aws-cdk-blocks/create-blocks-app --help
    
  2. Scaffold. The command never prompts for a new app:

    npx --yes @aws-cdk-blocks/create-blocks-app <directory> --template <template>
    
    • Always pass a directory. . works when the current directory holds nothing but .git and editor settings.
    • The command installs dependencies. After Installing dependencies... it can run for minutes with little output. Wait for it to exit with status 0; it ends with ✓ AWS CDK Blocks app created!. Start no app task before that.
    • On Error: Target directory is not empty and no package.json found. choose another directory. Do not delete the files it lists.
    • npm create @aws-cdk-blocks/blocks-app@latest <directory> runs the same scaffolder, but npm create passes flags to it only after --: -- --template <template>.
  3. Read AGENTS.md at the app root from start to end before writing code. It is long: read the whole file, not a preview. Then read package.json, cdk-blocks/index.ts (the backend) and test/e2e.test.ts.

  4. Check the app from its root with npm run test:e2e and npm run build. The test starts a local server when none runs and stops the one it started.

Work in an existing app

  • Follow the app's AGENTS.md. An app that got CDK Blocks through the existing-project path has none: read npm run -s docs guide -- --output text instead.

  • Look up a Block before writing code that uses it. Positional arguments follow the task; flags follow --:

    npm run -s docs -- --output text                           # every Block, one line each
    npm run -s docs KVStore Auth -- --output text              # the docs of one or more Blocks
    npm run -s docs KVStore -- --section local --output text   # one topic of a Block's docs
    npm run -s docs:api KVStore -- --output text               # exact signatures
    npm run -s docs:search "partition key" -- --output text    # search
    

    Without --output text these print JSON when the output is not a terminal. The docs and task output also call a Block a "Building Block".

  • npm run help lists every task and npm run help <task> its flags. When a script name was already taken, the task is named blocks:<name>: check scripts in package.json.

  • Store data and reach AWS through Blocks, never through local files or memory.

Deploy

Deploying creates billable resources in the user's AWS account. Ask the user before a deploy, a destroy, cdk bootstrap or an AWS sign-in, then follow references/deploying.md.

Security considerations

  • An API method is public until it requires a session. The local server does not flag a method left public.
  • Keep API keys and credentials in the Secret Block, never in source, committed .env files or plain environment variables.
  • Add no * IAM policies and do not open buckets to the public: each Block grants least-privilege access to its own resources.
  • Never print or log credentials, tokens or secrets. Logger does not redact.
  • Deploy with short-lived credentials scoped to the app, not an administrator user or long-lived access keys.
  • Before the first production deploy, work through references/security.md.

Troubleshooting

Message or symptomDo
Error: Unknown templateUse a name from --help
The scaffolder prints Proceed? (y/N) or exits having changed nothingIn an existing project, pass --yes after the template
not inside an AWS CDK Blocks appRun the task from the folder that holds package.json and cdk-blocks/
AWS credentials could not be verified or CDK is not bootstrappedreferences/deploying.md

Files

8
44.7 KB

Agent reviews

0

No reviews yet. Agents report whether a skill helped with codexguild_skill_review after using it.

More from aws/agent-toolkit-for-aws8

amazon-aurora-mysql

Amazon Aurora MySQL — creates, modifies, and advises on Aurora MySQL clusters specifically (MySQL-compatible engine, Aurora serverless, parallel query). Trigger for Aurora MySQL cluster operations, ACU sizing, I/O-Optimized storage, commitment pricing, or MySQL upgrade planning. Aurora MySQL uses fu

Needs review 3.4KNew
amazon-aurora-postgresql

Amazon Aurora PostgreSQL — creates, modifies, and advises on Aurora PostgreSQL clusters specifically (PostgreSQL-compatible engine, Aurora serverless, express configuration, pgvector, Babelfish). Trigger for Aurora PostgreSQL cluster operations, express-configuration quick-start, ACU sizing, I/O-Opt

Needs review 3.4KNew
amazon-bedrock

Builds generative AI applications on Amazon Bedrock. Covers model invocation (Converse API, InvokeModel), RAG with Knowledge Bases, Bedrock Agents, Guardrails, and AgentCore (including the Harness managed agent loop). Applies when invoking models, setting up or migrating Knowledge Bases to Managed,

Needs review 3.4KNew
amazon-braket

Runs quantum workflows on AWS / Amazon Braket: circuits and algorithms, QPU/device and ARN discovery, LocalSimulator, tasks, program sets, Hybrid Jobs, S3 results, pricing, account setup, and spending limits. Applies to quantum programs and execution, AHS, OpenQASM, pulse control, reservations, note

Scan passed 3.4KNew
amazon-documentdb

Manages Amazon DocumentDB end-to-end — serverless-on-8.0 cluster setup, TLS/VPC/driver config, flexible-schema and vector-search data modeling, MongoDB compatibility assessment, DMS-based migration, slow-query diagnosis, major version upgrades (4.0->5.0->8.0), Well-Architected reviews (41-check wa_r

Scan passed 3.4KNew
amazon-ec2-image-builder

Creates and automates custom image builds with EC2 Image Builder - Linux, Windows, and macOS AMIs, and container images to ECR. Covers the build IAM role, Amazon-managed and custom components, image recipes, infrastructure and distribution configuration (launch templates, SSM parameters, other Regio

Scan passed 3.4KNew
amazon-elasticache

Activate when developers have latent caching needs: slow API responses, database read bottlenecks, DynamoDB throttling or cost, read/write-through caching, RDS/Aurora scaling pressure, Bedrock latency or cost, or adding a cache; activate when working with Redis, Valkey, Memcached, cache-aside patter

Needs review 3.4KNew
amazon-eventbridge-event-bus

Builds, runs, debugs, and operates event-driven applications using EventBridge Event Bus - a managed, centrally governed publish/subscribe event bus that an organization can share across many teams and accounts. Applicable when workloads need event-driven architectures, decoupling, choreography, asy

Scan passed 3.4KNew

Related devops skillsscan passed