scott-ddd-refactor

Refactor codebases to enforce domain correctness with semantic types and explicit state transitions.

1|Updated Feb 17, 2026
One-click install
npx skills add https://github.com/lprior-repo/claude-skills --skill scott-ddd-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scott-ddd-refactor
Source: https://github.com/lprior-repo/claude-skills/tree/main/scott-ddd-refactor
Command: npx skills add https://github.com/lprior-repo/claude-skills --skill scott-ddd-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Strict Scott Wlaschin style refactoring for DDD and type-driven design. Use when transforming codebases to make illegal states unrepresentable, parse at boundaries, and model workflows as explicit type transitions.

Core Features & Use Cases

  • Enforce domain correctness by replacing primitive domain representations with semantic types and type-safe boundaries.
  • Model workflows as explicit state transitions and boundary parsing rules to keep core logic pure and deterministic.
  • Provide a practical migration blueprint with a phased refactor playbook and decision matrix for safe evolution.

Quick Start

Begin by auditing domain concepts, replace primitives with semantic types, and migrate workflows into explicit state transitions.

Frequently Asked Questions about scott-ddd-refactor

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

FAQPage Schema
How do I refactor code to make illegal states unrepresentable?

Model workflows as explicit state transitions by replacing primitives with semantic types and applying boundary parsing rules. This keeps core logic pure and deterministic by ensuring only valid typed transitions are allowed.

When do I need type-driven design for domain modeling?

You need type-driven design when transforming codebases that require explicit state modeling and boundary isolation. It is essential for projects where preventing illegal states and maintaining strict domain correctness are critical.

How do I parse at boundaries to keep core domain logic pure?

Parse at boundaries by isolating external data conversion rules at the system edges before data enters the core. This boundary parsing ensures internal domain logic remains pure, deterministic, and free of unvalidated primitive types.

What is the best way to migrate a codebase to domain-driven design safely?

The best way to migrate safely is using a phased refactor playbook with a decision matrix. This guides the evolution by auditing domain concepts first, then replacing primitives with semantic types, and finally migrating workflows into explicit state transitions.

How does a domain error taxonomy guide safe codebase evolution?

A domain error taxonomy guides safe evolution by categorizing domain-specific failures systematically. This structured error classification directs the refactoring process to ensure type-safe boundaries and explicit state transitions handle errors correctly.