Agent skill

Typescript Testing

by macalbert in macalbert/envilder

Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK).

MITAuto-check passedTesting & QA

Install Typescript Testing

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

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

GitHub CLI
$ gh skill install macalbert/envilder typescript-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-testing .claude/skills/typescript-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-testing
GitHub stars
138
Token cost
~2.2k tokens
SKILL.md length
550 words
Files
1
Skills in repo
30
Repo updated
First seen
Licence
MIT

At a glance

Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK).

  • Works in 2 steps: AAA Pattern (Arrange – Act – Assert) → Test Naming Convention
  • E2E tests with Vitest
  • SKILL.md covers Documentation Rules, Stacks Overview, Core Principles and Variable Naming (MANDATORY), plus 7 more sections
  • Calls pnpm

What it does

Typescript Testing is an agent skill from macalbert/envilder. Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK). Use for unit, integration, or E2E tests with Vitest or Playwright.

Its SKILL.md is about 2.2k 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 Unit testing and End-to-end testing. It works with TypeScript, Vitest, Playwright and Node.js. 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

  • E2E tests with Vitest
  • Tasks that involve Unit testing
  • Tasks that involve End-to-end testing

Example prompts

  • “/typescript-testing”

Requirements

  • Node.js

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. AAA Pattern (Arrange – Act – Assert)
  2. Test Naming Convention

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 Testing loads about 2.2k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 550 words of instructions outside code blocks.

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

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). 550 words, ~2,188 tokens.

Download SKILL.mdSave it as .claude/skills/typescript-testing/SKILL.md (or your agent's skills folder).
name
typescript-testing
description
Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK). Use for unit, integration, or E2E tests with Vitest or Playwright.

Testing Conventions (TypeScript)

This skill defines the MANDATORY testing conventions for TypeScript projects. These are rules, not guidelines.


Documentation Rules

NO Comments Except AAA Markers
  • Do NOT write explanatory comments: code must be self-explanatory
  • Only // Arrange, // Act, // Assert comments are allowed in tests
  • The test name Should_X_When_Y already documents the intent

Exception: SDK public API: Code under src/sdks/*/ consumed by external developers (facade classes, public entry points) SHOULD have JSDoc with usage examples. This exception does not apply to tests or internal helpers.


Stacks Overview

StackTest RunnerLocation
CLI / CoreVitesttests/envilder/
Node.js SDKVitesttests/sdks/nodejs/
WebsiteVitesttests/website/
CDK (IaC)Vitesttests/iac/
E2EVitest + TestContainerse2e/

Core Principles

1. AAA Pattern (Arrange – Act – Assert)

ALL tests MUST follow the AAA pattern, separated by inline comments.

Rules
  • Each phase MUST be separated with comments
  • Never mix phases
  • Each comment (// Arrange, // Act, // Assert) appears AT MOST ONCE per test: if you need two actions or two asserts, write two tests
  • Act = one single invocation on the SUT. Multiple statements in Act only if they are genuinely part of the same logical action (rare and exceptional). Two independent operations = two tests.
  • All assertions belong in Assert only. No expect() in Arrange or Act. If you feel tempted to assert in Arrange (precondition check), extract it to a separate test or use a guard clause that throws: not an assertion.
  • AAA markers are mandatory in ALL tests: including structural guards, static completeness checks, and data validation tests. No exceptions.
  • No if, switch, or conditional logic inside Arrange, Act, or Assert
  • No try/catch/finally inside tests: use beforeEach/afterEach for teardown
  • No // Act & Assert combined blocks: Act and Assert are ALWAYS separate
  • For exceptions: expect(() => action()).toThrow() or await expect(asyncAction()).rejects.toThrow()
  • Omit comment if section is empty
  • If a test needs branching, split it into separate tests (one per scenario)
Vitest Example
typescript
it('Should_GenerateEnvFile_When_ValidParametersProvided', async () => {
  // Arrange
  mockStore.getMapping.mockResolvedValue({ KEY: '/ssm/path' });
  mockProvider.getSecret.mockResolvedValue('value');

  // Act
  await sut.handle(command);

  // Assert
  expect(mockStore.saveEnvironment).toHaveBeenCalled();
});

2. Test Naming Convention

Test names MUST follow exactly:

text
Should_{ExpectedBehavior}_When_{Condition}
Rules
  • PascalCase for both parts
  • NO natural language sentences in it() descriptions
  • NO vague names (Should_Work, TestHandler)
  • NO missing When clause
Show full SKILL.md (215 more words)Show less
Good Examples
Test NameScenario
Should_ThrowError_When_SSMParameterIsNotFoundError path
Should_ReturnMaskedValue_When_SecretIsLoadedSuccess path
Should_ReturnEmptyMap_When_NoMappingsExistEdge case

Variable Naming (MANDATORY)

PurposeName
Subject under testsut
Expected valueexpected
Actual resultactual

No creativity allowed here.


Mocking (Vitest)

Port Test Doubles
typescript
const mockProvider: ISecretProvider = {
  getSecret: vi.fn(),
};

const mockStore: IVariableStore = {
  getMapping: vi.fn(),
  saveEnvironment: vi.fn(),
};

const mockLogger: ILogger = {
  info: vi.fn(),
  warn: vi.fn(),
  error: vi.fn(),
};
Controlling Behavior
typescript
vi.mocked(mockProvider.getSecret).mockResolvedValue('secret-value');
vi.mocked(mockProvider.getSecret).mockRejectedValue(new Error('not found'));
vi.mocked(mockStore.getMapping).mockResolvedValue({ KEY: '/path' });
Verifying Interactions
typescript
expect(mockProvider.getSecret).toHaveBeenCalledWith('/ssm/path');
expect(mockProvider.getSecret).toHaveBeenCalledTimes(1);
expect(mockLogger.info).toHaveBeenCalledWith(expect.stringContaining('success'));

Exception Testing

Act and Assert MUST be separate. Wrap the action in Act, assert in Assert.

✅ CORRECT: separate Act and Assert
typescript
it('Should_ThrowInvalidArgument_When_ProviderIsUnsupported', () => {
  // Arrange
  const config = { provider: 'unsupported' };

  // Act
  const act = () => createProvider(config);

  // Assert
  expect(act).toThrow(InvalidArgumentError);
});
✅ CORRECT: async exceptions
typescript
it('Should_ThrowParameterNotFound_When_SSMKeyIsMissing', async () => {
  // Arrange
  mockProvider.getSecret.mockRejectedValue(new ParameterNotFoundError('/missing'));

  // Act
  const act = sut.handle(command);

  // Assert
  await expect(act).rejects.toThrow(ParameterNotFoundError);
});
❌ FORBIDDEN: combined Act & Assert
typescript
it('Should_ThrowError_When_Invalid', () => {
  // Act & Assert   ← NEVER DO THIS
  expect(() => sut.handle(bad)).toThrow();
});

Test Class Structure

CLI / Core (Vitest + InversifyJS handlers)
typescript
describe('PullSecretsToEnvCommandHandler', () => {
  let sut: PullSecretsToEnvCommandHandler;
  let mockStore: { getMapping: Mock; saveEnvironment: Mock };
  let mockProvider: { getSecret: Mock };
  let mockLogger: { info: Mock; warn: Mock; error: Mock };

  beforeEach(() => {
    mockStore = { getMapping: vi.fn(), saveEnvironment: vi.fn() };
    mockProvider = { getSecret: vi.fn() };
    mockLogger = { info: vi.fn(), warn: vi.fn(), error: vi.fn() };
    sut = new PullSecretsToEnvCommandHandler(
      mockProvider,
      mockStore,
      mockLogger,
    );
  });

  it('Should_GenerateEnvFile_When_ValidParametersProvided', async () => {
    // Arrange
    mockStore.getMapping.mockResolvedValue({ KEY: '/ssm/path' });
    mockProvider.getSecret.mockResolvedValue('value');

    // Act
    await sut.handle(command);

    // Assert
    expect(mockStore.saveEnvironment).toHaveBeenCalled();
  });
});
Node.js SDK (Vitest, no DI)
typescript
describe('EnvilderClient', () => {
  it('Should_ResolveSecrets_When_ProviderReturnsValues', async () => {
    // Arrange
    const mockProvider: ISecretProvider = {
      getSecrets: vi.fn().mockResolvedValue(new Map([['KEY', 'value']])),
    };
    const sut = new EnvilderClient(mockProvider);

    // Act
    const actual = await sut.resolveSecrets(parsedMapFile);

    // Assert
    expect(actual.get('KEY')).toBe('value');
  });
});
CDK / IaC (Vitest)
typescript
describe('AppStack', () => {
  it('Should_CreateLambda_When_StackSynthesized', () => {
    // Arrange
    const app = new cdk.App();
    const stack = new AppStack(app, 'TestStack');

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

    // Assert
    actual.hasResourceProperties('AWS::Lambda::Function', {
      Runtime: 'nodejs22.x',
      Handler: 'index.handler',
    });
  });
});

Structural Guards

Tests that validate static data (i18n completeness, schema conformance, version consistency) still MUST use AAA markers. Arrange can be omitted if data is set up at the describe level:

typescript
it('Should_HaveNoMissingKeys_When_CatalanComparedToEnglish', () => {
  // Act
  const actual = enKeys.filter((k) => !caKeys.includes(k));

  // Assert
  expect(actual, 'Keys missing in ca.ts').toEqual([]);
});

Verification Commands

ContextCommand
CLI / Core / Websitepnpm test
Node.js SDKcd tests/sdks/nodejs && pnpm vitest run --reporter=verbose
CDKcd tests/iac && pnpm test
CI paritypnpm test:ci
Lintpnpm lint
Formatpnpm format

Decision Points

  • Pure domain logic → unit test at domain layer
  • Handler orchestrating ports → mock ports with vi.fn()
  • AWS integration semantics → E2E with LocalStack/TestContainers
  • Static data consistency → structural guard
  • CDK infrastructure → snapshot + fine-grained assertions

Completion Criteria

  • Test names follow Should_<Expected>_When_<Condition>
  • AAA markers present, each at most once
  • sut, actual, expected used consistently
  • Positive and negative paths covered
  • Tests run green: pnpm test
  • No lint regressions: pnpm lint

© 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-testing of macalbert/envilder.

Open the folder on GitHubat commit b6a0327

Compare with similar skills

Typescript 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 Testing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Typescript Testing this skillmacalbert/envilder138—~2.2kAutomated safety check: PassMIT
Svelte Testingspences10/sveltest113—~579Automated safety check: PassMIT
Ha Frontend Testinghome-assistant/frontend5.7k—~1.7kAutomated safety check: PassApache-2.0
Frontend Typescript Testingshinpr/ai-coding-project-boilerplate232—~1.5kAutomated safety check: PassMIT
Test CommanderEliasOulkadi/shokunin114—~3kAutomated safety check: NotesMIT
Testing Patternssoftspark/ai-toolkit179—~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Svelte Testing

    spences10/sveltest

    Fix and create Svelte 5 tests with vitest-browser-svelte and Playwright.

    113 GitHub stars~579 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Ha Frontend Testing

    home-assistant/frontend

    Home Assistant frontend testing and validation workflow. An agent skill from home-assistant/frontend.

    5.7k GitHub stars~1.7k tokensUpdated today
    Testing & QAAuto-check passed
  • Frontend Typescript Testing

    shinpr/ai-coding-project-boilerplate

    Designs frontend tests using the repository's configured React test and browser harnesses, including RTL, MSW, Vitest, and Playwright when present.

    232 GitHub stars~1.5k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Test Commander

    EliasOulkadi/shokunin

    Generate unit, integration, E2E, and visual regression tests following the Testing Trophy methodology (80% integration).

    114 GitHub stars~3k tokensUpdated 2 days ago
    Testing & QAAuto-check: notes
  • Testing Patterns

    softspark/ai-toolkit

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

    179 GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Frontend Typescript Testing

    shinpr/ai-coding-project-boilerplate

    リポジトリで設定済みのReactテスト・ブラウザハーネスを使用してフロントエンドテストを設計。RTL、MSW、Vitest、Playwrightが存在する場合に適用。コンポーネント、loading/error state、統合、フロントエンドE2Eテストの追加・レビュー時に使用。

    232 GitHub stars~843 tokensUpdated 3 days ago
    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

Categories

Questions about Typescript Testing

What does Typescript Testing do?

Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK). Typescript Testing is an agent skill from macalbert/envilder. Mandatory testing conventions for TypeScript stacks (Vitest for CLI/SDK/Website/CDK).

When should I use Typescript Testing?

Typescript Testing fits situations like: E2E tests with Vitest; tasks that involve Unit testing; tasks that involve End-to-end testing.

How do I install Typescript Testing in Claude Code?

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

How do I install Typescript Testing in Codex?

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

Can I use Typescript 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-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-testing, .gemini/skills/typescript-testing, .github/skills/typescript-testing and .opencode/skills/typescript-testing in your project.

What does Typescript Testing need to run?

Going by SKILL.md and its folder, Typescript Testing needs the command-line tools its instructions call (pnpm). Our summary lists: Node.js.

Does Typescript 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 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 Testing use?

Typescript 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 Testing use?

About 2.2k tokens (SKILL.md is roughly 8.8k 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 Testing?

Skills that share tags, products or a category with Typescript Testing: Svelte Testing (spences10/sveltest, 113 stars), Ha Frontend Testing (home-assistant/frontend, 5.7k stars), Frontend Typescript Testing (shinpr/ai-coding-project-boilerplate, 232 stars) and Test Commander (EliasOulkadi/shokunin, 114 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Typescript 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.