tdd-typescript
БесплатноБез исполняемых скриптовНе проверенTypeScript/JavaScript Test-Driven Development with Vitest, strict red-green-refactor methodology, domain-first modeling (DDD) via branded types, principled…
Об этом скилле
TDD TypeScript Skill
TypeScript/JavaScript TDD using strict red-green-refactor with Vitest — sharpened by DDD at Red (model the domain with branded types) and DRY at Refactor (deduplicate same-concept repetition only).
Description
Implement features by writing failing tests first, minimal code to pass, then refactoring. Types are the first test; branded types extend that to catch domain errors the compiler wouldn't otherwise see.
Discipline Layering
- Before Red — Model the Domain: Name the entity, value object, or aggregate in the business's language. Use branded types for primitives that carry rules (
type EmailAddress = string & { readonly __brand: 'EmailAddress' }). Preferreadonlyclasses or frozen records for multi-field value objects. Zod/Valibot schemas inferred into branded types give runtime + compile-time safety. - Red: Write a failing test. Name it in domain terms (
it('rejects refund when amount exceeds daily limit')) — not mechanical (it('returns false')). - Green: Minimal code to pass.
- Refactor — DRY with discipline: Deduplicate only when the same domain concept appears ≥3 times with the same meaning. Distinguish true DRY from accidental similarity (same shape, different meaning). Promote recurring primitives to branded types. Keep domain logic out of components, routes, and stores.
What's Included
- Examples: TDD cycles, React component TDD, branded-type value objects, utility function TDD
- Reference: Red-green-refactor patterns, Vitest best practices, branded-type idioms
- Templates: Test templates, implementation workflows
Use When
- Implementing TypeScript features with TDD
- Modeling domain concepts (entities, value objects, aggregates) with branded types
- React component development (keeping domain logic out of components)
- Refactoring duplication after a green test
- Ensuring high test coverage
Related Agents
tdd-typescript-implementer
Skill Version: 1.1
Установить tdd-typescript в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteMultiEditBashGrepGlobTodoWriteВложенные файлы
FAQ
Что делает скилл tdd-typescript?
TypeScript/JavaScript Test-Driven Development with Vitest, strict red-green-refactor methodology, domain-first modeling (DDD) via branded types, principled DRY discipline, React component testing, and comprehensive coverage patterns. Use when implementing TypeScript features with TDD, writing Vitest tests, testing React components, developing with test-first approach, modeling domain concepts, refactoring duplication, or when user mentions 'TypeScript TDD', 'Vitest', 'React testing', 'JavaScript TDD', 'red-green-refactor', 'TypeScript unit tests', 'branded types', 'value object', 'ubiquitous language', 'DRY', or 'test-driven TypeScript'.
Как установить скилл tdd-typescript?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл tdd-typescript запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic