manage-fake

Generate and update Fake test doubles for TypeScript interfaces.

4|Updated Sep 24, 2025
One-click install
npx skills add https://github.com/talbenmoshe/zdr-tools --skill manage-fake
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: manage-fake
Source: https://github.com/talbenmoshe/zdr-tools/tree/main/.claude/skills/manage-fake
Command: npx skills add https://github.com/talbenmoshe/zdr-tools --skill manage-fake

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the creation and maintenance of Fake test doubles for TypeScript interfaces, reducing boilerplate and keeping tests aligned with the latest interface definitions.

Core Features & Use Cases

  • Generate Initializer, Fake class, and Builder for any interface, including those that extend IEntity.
  • Update existing Fake artifacts when interfaces change, adding or removing fields and methods as needed.
  • Standardized Pattern ensures initializer fields are mandatory, methods return values via a dedicated ReturnValue slot, and builders provide sensible defaults.

Quick Start

Provide the interface name to generate its Fake files: Initializer, Fake class, and Builder, placed under the fakes folder. If a Fake already exists, run updates to reflect changes in the interface. Use the builder to customize default values before instantiation.

Frequently Asked Questions about manage-fake

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate test fakes for TypeScript interfaces?

Test fakes for TypeScript interfaces are generated by providing the interface name, which auto-creates a Fake class, an Initializer, and a Builder under the fakes folder following existing project patterns. This includes support for interfaces extending IEntity and EventBrokers.

Can I update existing fake test doubles when my TypeScript interface changes?

Yes, existing fake test doubles can be updated when a TypeScript interface changes. The process adds or removes fields and methods as needed, ensuring the Fake class, Initializer, and Builder stay aligned with the latest interface definitions without requiring a full rewrite.

What is the best way to set up default mock values for TypeScript entity tests?

Using the generated Builder is the best way to set up default mock values for TypeScript entity tests. The Builder provides sensible defaults for initialization, allowing you to customize values before instantiation to streamline your testing setup.

Does the fake builder pattern support EventBrokers and related types in TypeScript?

Yes, the fake builder pattern supports EventBrokers and related types in TypeScript. The generation process targets interfaces and produces a cohesive Fake class, Initializer, and Builder that integrate with EventBrokers following the project's existing patterns.

Why does the generated initializer require mandatory fields for TypeScript fakes?

Generated initializers require mandatory fields for TypeScript fakes to enforce safe instantiation and ensure critical properties are explicitly provided. This standardized pattern uses getMockingFunction for method stubs and a dedicated ReturnValue slot for method returns.

Do I need a fakes index file to export TypeScript mock classes and builders?

A fakes/index.ts export file is needed to properly export TypeScript mock classes and builders. The skill automatically updates or creates this index file to maintain cohesive imports across your testing infrastructure when generating or updating fakes.