creating-adts

Scaffold Algebraic Data Types with member files, unions, and barrel exports.

1|Updated Oct 21, 2016
One-click install
npx skills add https://github.com/jasonkuhrt/dotfiles --skill creating-adts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: creating-adts
Source: https://github.com/jasonkuhrt/dotfiles/tree/main/claude/todo/library-adt/skills/creating-adts
Command: npx skills add https://github.com/jasonkuhrt/dotfiles --skill creating-adts

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Scaffolds Algebraic Data Types (ADTs) with a consistent, repeatable multi-file layout to enable clean, scalable type systems and safer code organization.

Core Features & Use Cases

  • Creates ADT unions with discriminated member types that follow the library conventions
  • Generates the standard file structure: src/lib/<adt-name>/, __.ts, _.ts, and member files
  • Produces a barrel export file for consumers and straightforward imports

Quick Start

Use this skill to scaffold a new ADT named according to the conventions, creating the member files, union, and barrel exports.

Frequently Asked Questions about creating-adts

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

FAQPage Schema
How do I scaffold algebraic data types with a multi-file structure in TypeScript?

To scaffold algebraic data types in TypeScript, you generate a multi-file layout including member types, unions, and barrel exports. This enforces consistent naming rules and file structure for clean, scalable type organization.

What is the standard file structure for discriminated unions in a TypeScript library?

The standard file structure for discriminated unions uses a directory containing member files, a union file, and a barrel export file. This layout enforces naming rules to ensure correct imports and scalable type systems.

How do barrel exports work with algebraic data types?

Barrel exports work with algebraic data types by aggregating member types and unions into a single import source. This produces straightforward imports for consumers and enforces correct file structure conventions.

When do I need a multi-file layout for TypeScript ADTs?

You need a multi-file layout for TypeScript ADTs when building clean, scalable type systems. This structure separates member types, unions, and barrel exports to enable safer code organization and consistent imports.

Can I generate member files and union types automatically for TypeScript discriminated unions?

Yes, you can generate member files and union types automatically for TypeScript discriminated unions. Scaffolding tools enforce the naming and structure rules required for member, union, and barrel files to ensure correct imports.