Scaffold

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

Scaffold is an AI agent skill from the GitHub repository schuettc/claude-code-plugins. Creates the CDK TypeScript infrastructure project alongside the existing app. Use when setting up infrastructure or the CDK project.

How to use this skill

Skill file

Scaffold — Set Up Infrastructure Project

You are creating the AWS CDK TypeScript project that defines the cloud infrastructure for the user's app.

Prerequisites

What To Do

Phase 0: Environment Check

Before creating the CDK project, verify the user's environment can support it. Catching these issues now saves confusing errors later.

  1. Check Node.js version — Run node --version. CDK and TypeScript compilation require Node.js 18+. If older:

"CDK needs Node.js 18 or newer to work properly. You're on [version]. I'd recommend upgrading first — you can use nvm (nvm install 20) or download from nodejs.org."

  1. Check AWS CLI is installed — Run aws --version. If not found:

"We'll need the AWS CLI to deploy later. You don't need it right now for scaffolding, but let's get it installed so you're ready. Here's how: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"

  1. Check AWS credentials — Run aws sts get-caller-identity. If it fails, don't block — just note it:

"AWS credentials aren't configured yet. That's fine for now — we can set those up before we deploy. Just keep in mind you'll need an AWS account and credentials before the deploy step."

If all checks pass (or the user acknowledges the warnings), proceed.

Phase 1: Plan

Show the proposed directory layout:

infrastructure/
├── bin/
│   └── app.ts              ← CDK app entry point
├── lib/
│   └── api-stack.ts        ← Lambda + API Gateway (next step)
├── lambda/
│   ├── handlers/           ← Lambda function code (next step)
│   └── shared/             ← Shared utilities
├── cdk.json
├── tsconfig.json
└── package.json

Ask the user:

  1. "What would you like to name your project?" — Explain that this becomes part of AWS resource names (e.g., 'my-app' becomes 'MyAppApiStack'). Suggest lowercase with hyphens. Keep it short — long names hit AWS character limits.
  2. "Which AWS region do you prefer?" — Help them choose:

Phase 2: Execute

  1. Create infrastructure/ directory
  2. Create infrastructure/package.json with:
  1. Create infrastructure/cdk.json with standard CDK config
  2. Create infrastructure/tsconfig.json with strict TypeScript config
  3. Create infrastructure/bin/app.ts — CDK app entry point
  1. Create infrastructure/lib/api-stack.ts — Empty stack skeleton (resources come in create-api)
  2. Create infrastructure/lambda/handlers/ and infrastructure/lambda/shared/ (empty, with .gitkeep)

After creating files:

Phase 3: Verify

  1. Run cd infrastructure && npx cdk synth to verify the project compiles
  2. If it fails, debug the issue with the user
  3. Update .migration/plan.md to mark scaffold as complete

Important Notes

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.