Loading...
Loading...
Apply AWS Prescriptive Guidance for TypeScript CDK development. Triggers when creating, modifying, or reviewing AWS CDK stacks, L2 constructs, multi-environment configurations, cdk-nag security scanning, unit testing, or dependency version management. Use for any task involving CDK code in bin/, lib/, config/, or test/.
npx skill4agent add dga-devops/ai-skill-cloud coding-cdk-tsproject-root/
├── bin/
│ └── app.ts # Entry point: load config → instantiate stacks
├── config/ # DATA LAYER — pure TypeScript data, no AWS constructs
│ ├── types.ts # All configuration interfaces
│ ├── environments.ts # Environment registry: Record<string, EnvironmentConfig>
│ ├── shared/ # Constants shared across all environments
│ └── [env]/ # One folder per environment (sandbox, dev, uat, prod…)
│ ├── index.ts # Merges per-resource configs into EnvironmentConfig
│ ├── env.ts # IntraEnvConfig (envName, prefix, account, region, tags)
│ ├── vpc.ts # VPC settings
│ ├── alb.ts # ALB settings
│ └── … # One file per resource type
├── lib/ # LOGIC LAYER — reusable stacks & constructs
│ ├── common/ # (optional) Shared aspects, extended L2 constructs
│ ├── network-stack.ts # One file per stack — flat layout
│ └── database-stack.ts
├── test/ # QUALITY LAYER — fine-grained assertion tests
│ ├── network-stack.test.ts # One test file per stack
│ └── config.test.ts # Config validation tests
├── .gitignore
├── .eslintrc.json
├── .prettierrc
├── jest.config.js
├── tsconfig.json
└── package.jsonreferences/structure.mdconfig/references/structure.mdreferences/constructs.mdconfig/[env]/enabledbin/app.tsIntraEnvConfigreferences/config-pattern.mdcdk-nagAwsSolutionsChecksuatpreprodprodreferences/security.mdTemplate.fromStack()references/testing.mdreferences/versions.mdreferences/versions.mdreferences/versions.mdnpm run clean.js.d.tsCfnOutputFn.importValuedesigns/<app-name>/design.mdreferences/design-handoff.mdprojects/<app-name>/config/lib/bin/anyconfig/types.tsconfig.[resource].enabledbin/app.tslib/config/[env]/vpc.tsalb.tsaurora.tsreferences/versions.mdconfig/[env]/${projectName}-${envName}-<resource>-<purpose>myproject-dev-ecs-clustermyproject-dev-sqs-order-queue${projectName}-${envName}-s3-<purpose>-${account}myproject-dev-s3-assets-123456789012<purpose>IntraEnvConfiglib/pre-prodfrontendfereferences/naming-limits.mdcdk bootstrap aws://<account>/<region>cdk deploy[!TIP] Need more details? Read:
— Project layout, layer responsibilities, config patternsreferences/structure.md — Construct hierarchy, L2-First rule, escape hatches, custom resourcesreferences/constructs.md — TypeScript best practices, naming conventions, interfaces, utility typesreferences/config-pattern.md — TDD approach, fine-grained assertions, unit test templatesreferences/testing.md — cdk-nag, Checkov, documentation with TypeDoc, versioning & releasereferences/security.md — Pinned dependency versions, standardized configs, upgrade/downgrade proceduresreferences/versions.md — Design doc handoff patterns: multi-service, existing VPC/ALB, CloudFront, DNS, SG, IAM, WAFreferences/design-handoff.md
designs/<app-name>/design.md| Design Doc Section | CDK Output |
|---|---|
| App Identity | |
| Services table | |
| Environment Matrix | per-env folders with correct enabled flags |
| Existing Infrastructure | |
| CloudFront Behaviors | |
| SG Rules | auto-generated in stack code from services |
| IAM Roles | |
| DNS/Domains | |
| CDK Config Values | copy directly into config files |
projects/<app-name>/enablednpm run buildnpm test