Agent skill

Typescript Cdk Testing

by macalbert in macalbert/envilder

AWS CDK testing patterns including snapshot tests, fine-grained assertions with Template.fromStack(), and normalization strategies.

MITAuto-check passedTesting & QA

Install Typescript Cdk Testing

skills CLI
$ npx skills add macalbert/envilder --skill typescript-cdk-testing -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install macalbert/envilder typescript-cdk-testing --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/macalbert/envilder.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/typescript-cdk-testing .claude/skills/typescript-cdk-testing && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
typescript-cdk-testing
GitHub stars
138
Token cost
~1.6k tokens
SKILL.md length
328 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

AWS CDK testing patterns including snapshot tests, fine-grained assertions with Template.fromStack(), and normalization strategies.

  • Reviewing CDK infrastructure tests
  • SKILL.md covers When to Use, Test Architecture, Snapshot Testing (Primary… and Fine-Grained Assertions…, plus 5 more sections
  • Calls pnpm
  • Tasks that involve Database schema design

What it does

Typescript Cdk Testing is an agent skill from macalbert/envilder. AWS CDK testing patterns including snapshot tests, fine-grained assertions with Template.fromStack(), and normalization strategies. Use when writing or reviewing CDK infrastructure tests.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Database schema design and Test strategy. It works with TypeScript and Amazon Web Services. The repository describes itself as: One secret mapping for local dev, CI/CD, and runtime. Envilder resolves cloud secrets from your own vaults without SaaS middlemen, duplicated config, or .env drift. The licence is MIT.

When your agent uses it

  • Reviewing CDK infrastructure tests
  • Tasks that involve Database schema design
  • Tasks that involve Test strategy

Example prompts

  • “/typescript-cdk-testing”

What it can do on your machine

Read from SKILL.md and the folder at commit b6a0327. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Typescript Cdk Testing loads about 1.6k tokens when it runs. Until then it costs about 53 tokens; SKILL.md has 328 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~53
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from macalbert/envilder at commit b6a0327, republished under its MIT licence (© macalbert). 328 words, ~1,638 tokens.

Download SKILL.mdSave it as .claude/skills/typescript-cdk-testing/SKILL.md (or your agent's skills folder).
name
typescript-cdk-testing
description
AWS CDK testing patterns including snapshot tests, fine-grained assertions with Template.fromStack(), and normalization strategies. Use when writing or reviewing CDK infrastructure tests.

CDK Testing Skill

Testing patterns for AWS CDK infrastructure in the Envilder project (src/iac/). Tests live in tests/iac/ and run with Vitest.

When to Use

  • Writing tests for new CDK stacks or constructs
  • Adding assertions for specific resource properties
  • Updating snapshots after intentional infrastructure changes
  • Reviewing CDK test coverage

Test Architecture

Test Organization

Tests mirror the source structure:

txt
tests/iac/
├── bin/
│   └── main.test.ts                  CDK app entry point test
├── lib/
│   ├── stacks/
│   │   ├── cloudfrontUrlRewrite.test.ts
│   │   ├── staticWebsiteStack.test.ts
│   │   └── __snapshots__/
│   └── utils/
│       └── cloudFormationUtils.test.ts
├── package.json
├── tsconfig.json
└── vitest.d.ts

Snapshot Testing (Primary Pattern)

~80% of CDK tests use snapshot testing to detect unintended infrastructure drift:

typescript
import { App } from "aws-cdk-lib";
import { Template } from "aws-cdk-lib/assertions";

describe("StaticWebsiteStack", () => {
    it("Should_MatchSnapshot_When_StackIsSynthesized", () => {
        // Arrange
        const app = new App();
        const stack = new StaticWebsiteStack(app, "TestStack", config);

        // Act
        const template = Template.fromStack(stack);

        // Assert
        expect(template).toMatchSnapshot("staticWebsiteStackTest");
    });
});
Snapshot Normalization

Remove non-deterministic values before snapshotting:

typescript
function normalizeTemplate(template: Template): object {
    const json = template.toJSON();
    for (const resource of Object.values(json.Resources ?? {})) {
        if (resource.Properties?.Code?.S3Key) {
            resource.Properties.Code.S3Key = "NORMALIZED";
        }
        if (resource.Properties?.SourceObjectKeys) {
            resource.Properties.SourceObjectKeys = ["NORMALIZED"];
        }
    }
    return json;
}

Normalize these properties:

  • S3Key: Lambda deployment artifact hash
  • SourceObjectKeys: Asset hashes
  • Any Fn::Join with account-specific values
Updating Snapshots

When infrastructure changes are intentional:

bash
pnpm test -- -u

Rules:

  • Review snapshot diffs carefully before approving
  • Never update snapshots to suppress failures: understand the change first
  • Commit updated snapshots alongside the code that caused the change

Fine-Grained Assertions (Secondary Pattern)

~20% of tests verify specific resource properties:

typescript
import { Template, Match } from "aws-cdk-lib/assertions";

describe("LambdaStack", () => {
    it("Should_HaveCorrectTimeout_When_ApiLambdaIsCreated", () => {
        // Arrange
        const app = new App();
        const stack = new LambdaStack(app, "TestStack", config);
        const template = Template.fromStack(stack);

        // Act & Assert
        template.hasResourceProperties("AWS::Lambda::Function", {
            Timeout: 30,
            MemorySize: 1024,
            Runtime: "provided.al2023",
        });
    });

    it("Should_HaveDeadLetterQueue_When_SqsIsCreated", () => {
        // Arrange
        const app = new App();
        const stack = new SqsStack(app, "TestStack", config);
        const template = Template.fromStack(stack);

        // Act & Assert
        template.hasResourceProperties("AWS::SQS::Queue", {
            RedrivePolicy: Match.objectLike({
                maxReceiveCount: 3,
            }),
        });
    });
});
Common Assertion Methods
MethodPurpose
template.hasResourceProperties(type, props)Resource exists with properties
template.hasResource(type, props)Resource exists with full config
template.resourceCountIs(type, count)Exact count of resource type
template.hasOutput(logicalId, props)Stack output exists
Match.objectLike({...})Partial match on nested objects
Match.arrayWith([...])Array contains expected elements
Match.stringLikeRegexp(pattern)String matches regex
Match.not(matcher)Negation of any matcher
Match.absent()Property should not exist

When to Use Which Pattern

ScenarioPattern
New stack or constructSnapshot: captures full baseline
Specific security property (e.g., encryption)Assertion: explicit check won't be missed
Resource count verificationAssertion: resourceCountIs
Cross-resource referencesAssertion: verify Ref/Fn::GetAtt
Infrastructure refactor (same output)Snapshot: confirms no drift
Config-driven resource creationSnapshot + assertion for critical properties

Test Naming

Follow the project Should_{Behavior}_When_{Condition} convention:

typescript
it("Should_MatchSnapshot_When_StackIsSynthesized", ...)
it("Should_HaveCorrectTimeout_When_ApiLambdaIsCreated", ...)
it("Should_CreateDeadLetterQueue_When_SqsHasMaxReceiveCount", ...)
it("Should_RestrictPublicAccess_When_S3BucketIsCreated", ...)

Test Data: Config Objects

Use realistic config objects that match the config-driven infrastructure pattern:

typescript
const testConfig: BackendStackConfig = {
    lambdas: [{ name: "TestLambda", timeoutSeconds: 30, memorySizeMbs: 1024 }],
    sqs: [{ name: "test-queue", maxReceiveCount: 3, deadLetter: true }],
    s3: [{ bucketNameSuffix: "test-bucket" }],
    fargates: [{ name: "TestService", cpu: 256, memoryLimitMiB: 512 }],
};

Commands

bash
# Run all CDK tests
cd tests/iac && pnpm test

# Update snapshots (after intentional changes only)
cd tests/iac && pnpm test -- -u

# Run specific test file
cd tests/iac && pnpm test -- lib/stacks/staticWebsiteStack.test.ts

# Filter by test name
cd tests/iac && pnpm test -- -t "Should_MatchSnapshot"

Anti-Patterns

Anti-PatternCorrect Approach
Snapshot without normalizationNormalize non-deterministic values (S3Key, hashes)
Testing CDK internals (construct tree)Test the synthesized CloudFormation template
Hardcoded account/region in testsUse test-specific App with mock env
Updating snapshots without reviewing diffAlways review what changed and why
Only snapshot tests for security-critical propsAdd explicit assertions for encryption, IAM, SG rules

© macalbert, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .github/skills/typescript-cdk-testing of macalbert/envilder.

Open the folder on GitHubat commit b6a0327

Compare with similar skills

Typescript Cdk Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Typescript Cdk Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Typescript Cdk Testing this skillmacalbert/envilder138—~1.6kAutomated safety check: PassMIT
Effect TStellahq/opensession392—~3.7kAutomated safety check: PassMIT
Data Strategyidavidov13/agentic-playwright223—~3.4kAutomated safety check: PassMIT
Javascript Testing Patternsdavila7/claude-code-templates32k12 repos~336Automated safety check: PassMIT
Mutation Testing Triagetrailofbits/skills7.4k—~3.2kAutomated safety check: PassCC-BY-SA-4.0
Testing Strategiesancoleman/ai-design-components526—~3.8kAutomated safety check: PassMIT

Similar skills

  • Effect TS

    tellahq/opensession

    Write idiomatic Effect v4 TypeScript verified against the pinned effect@4.0.0-rc.112 source.

    392 GitHub stars~3.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Data Strategy

    idavidov13/agentic-playwright

    Test data strategy for the Playwright scaffold — Faker + Zod factories for dynamic happy-path data, static TS files (.ts with as const exports — never .json) for domain-specific curated invalid…

    223 GitHub stars~3.4k tokensUpdated 6 days ago
    Testing & QAAuto-check passed
  • Javascript Testing Patterns

    davila7/claude-code-templates

    Comprehensive guide for implementing robust testing strategies in JavaScript/TypeScript applications using modern testing frameworks and best practices.

    32k GitHub starsUsed in 12 repos~336 tokens
    Testing & QAAuto-check passed
  • Mutation Testing Triage

    trailofbits/skills

    Official

    Triages survived mutants and unnecessary test statements using Trailmark call-graph data, sorting them into false positives, missing unit tests and fuzzing targets.

    7.4k GitHub stars~3.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing Strategies

    ancoleman/ai-design-components

    Strategic guidance for choosing and implementing testing approaches across the test pyramid.

    526 GitHub stars~3.8k tokensUpdated 10 mo ago
    Testing & QAAuto-check passed
  • Testing Patterns

    softspark/ai-toolkit

    Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

    179 GitHub stars~1.6k tokensUpdated yesterday
    Testing & QAAuto-check passed

More from macalbert/envilder

All 30 skills in this repo
  • Code Review Perspectives

    macalbert/envilder

    Five independent analysis perspectives for code review: correctness, architecture, security, conventions, and complexity.

    138 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Index of Architecture Decision Records (ADRs) for cross-cutting technical decisions.

    138 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Common Git

    macalbert/envilder

    Git commit messages, PR workflow, and branching strategy using Conventional Commits and Semantic Versioning.

    138 GitHub stars~991 tokensUpdated 2 days ago
    Auto-check passed
  • Common Testing Conventions

    macalbert/envilder

    Mandatory testing conventions including the narrow diagnostic exception for testing test-only code, AAA pattern, test naming, and assertions across all stacks (.NET, TypeScript, Python).

    138 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed
  • Doc Maintenance

    macalbert/envilder

    Workflow for maintaining changelogs, READMEs, and documentation files.

    138 GitHub stars~904 tokensUpdated 2 days ago
    Auto-check passed
  • Doc Sync

    macalbert/envilder

    Audit and synchronize documentation across website, READMEs, and docs/.

    138 GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed

Questions about Typescript Cdk Testing

What does Typescript Cdk Testing do?

AWS CDK testing patterns including snapshot tests, fine-grained assertions with Template.fromStack(), and normalization strategies. Typescript Cdk Testing is an agent skill from macalbert/envilder.fromStack(), and normalization strategies.

When should I use Typescript Cdk Testing?

Typescript Cdk Testing fits situations like: reviewing CDK infrastructure tests; tasks that involve Database schema design; tasks that involve Test strategy.

How do I install Typescript Cdk Testing in Claude Code?

Run `npx skills add macalbert/envilder --skill typescript-cdk-testing -a claude-code`. Or copy the skill folder (.github/skills/typescript-cdk-testing in macalbert/envilder) into .claude/skills/typescript-cdk-testing in your project. Claude Code loads it when a task matches its description.

How do I install Typescript Cdk Testing in Codex?

Run `npx skills add macalbert/envilder --skill typescript-cdk-testing -a codex`. Or copy the skill folder (.github/skills/typescript-cdk-testing in macalbert/envilder) into .agents/skills/typescript-cdk-testing in your project. Codex loads it when a task matches its description.

Can I use Typescript Cdk Testing in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add macalbert/envilder --skill typescript-cdk-testing -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-cdk-testing, .gemini/skills/typescript-cdk-testing, .github/skills/typescript-cdk-testing and .opencode/skills/typescript-cdk-testing in your project.

What does Typescript Cdk Testing need to run?

Going by SKILL.md and its folder, Typescript Cdk Testing needs the command-line tools its instructions call (pnpm).

Does Typescript Cdk Testing access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Typescript Cdk Testing safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Typescript Cdk Testing use?

Typescript Cdk Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Typescript Cdk Testing use?

About 1.6k tokens (SKILL.md is roughly 6.6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Typescript Cdk Testing?

Skills that share tags, products or a category with Typescript Cdk Testing: Effect TS (tellahq/opensession, 392 stars), Data Strategy (idavidov13/agentic-playwright, 223 stars), Javascript Testing Patterns (davila7/claude-code-templates, 32k stars) and Mutation Testing Triage (trailofbits/skills, 7.4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript Cdk Testing?

macalbert (a GitHub user) maintains it in macalbert/envilder, which has 138 GitHub stars. The repository holds 30 skills in this directory. The repository was last updated on October 5, 2026.

Source: macalbert/envilder on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.