Skill / SKILL.md

Type Driven Design

rewrite-rs/skills

Make illegal states unrepresentable — enums instead of boolean and string flags, newtypes instead of bare primitives, parsed types instead of validated ones, typestate for protocol order. Use when a struct has fields that are only valid in some combinations, when validation is re-checked at many call sites, when boolean flags multiply, or when the user asks how to model a domain in Rust.
2 views 29 repository stars 0 commentsUpdated Nov 27, 2026
Overview

Make illegal states unrepresentable — enums instead of boolean and string flags, newtypes instead of bare primitives, parsed types instead of validated ones, typestate for protocol order. Use when a struct has fields that are only valid in some combinations, when validation is re-checked at many call sites, when boolean flags multiply, or when the user asks how to model a domain in Rust.

Installation & variants

Download the repository, including the skill’s supporting files.

git clone -- 'https://github.com/rewrite-rs/skills' skill-source

Use the complete skill-source/skills/rust/type-driven-design directory with your client’s skill installer.

  • skills/rust/type-driven-design

    main · SKILL.md

    Open installation source

    Source directory recorded from the imported repository path

Source directory skills/rust/type-driven-design

Source instructions
Read source instructions

Open to load source instructions

Original SKILL.md

Open to load the original file

Source & validation
Source status
Awaiting source check
Format validation
Format valid
Checked at
Pending source check
Content SHA-256
07b99d5d73d94c15111e6c4303cc3d01355a74de7a40450ab3d343b2b24b9f67
Discussion
Comments Be the First to Comment

Please log in to comment

    No comments yet

Related skills