PA

parse-dont-validate

Promotes type-safe parsing over validation to enforce data invariants at the type level.

Install

mkdir -p .claude/skills/parse-dont-validate && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16359" && unzip -o skill.zip -d .claude/skills/parse-dont-validate && rm skill.zip

Installs to .claude/skills/parse-dont-validate

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

「Parse, don't validate」原則に基づくコードレビューと設計支援。validateパターン(チェックして結果を捨てる) をparseパターン(チェック結果を型で保持)に変換し、型システムで不変式を強制する設計を促進する。 コードレビュー、新規実装、リファクタリング時にvalidation関数の改善が必要な場合に使用。 対象言語: Rust, Haskell, TypeScript, Scala, Java, Go, Python。 トリガー:「バリデーションを改善して」「型で保証したい」「shotgun parsingを直して」 「不正な状態を型で防ぎたい」「Maybeを減らしたい」といった型安全性関連リクエストで起動。
323 charsno explicit “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Convert validation patterns to parsing patterns
  • Promote designs that enforce invariants with type systems
  • Improve validation functions during code review
  • Refactor existing implementations to use parsing
  • Detect anti-patterns like `validate*()` returning `()`
  • Transform lists into non-empty arrays or maps

How it works

The skill transforms validation functions that discard information into parsing functions that retain information within a type, ensuring type safety.

Inputs & outputs

You give it
A list of strings or pairs
You get back
A type-checked value like `NonEmptyArray` or `Map`

When to use parse-dont-validate

  • Replacing validation checks with types
  • Preventing shotgun parsing
  • Improving type safety in APIs

About parse-dont-validate

Identifies runtime validation anti-patterns and converts them into parsing functions that return type-checked values, preventing invalid states.

>-

When not to use it

  • When the cost of refactoring for a single `error "impossible"` is too high
  • When compatibility with existing APIs is required
  • In performance-critical hot paths

Limitations

  • Not suitable for single `error "impossible"` cases due to high modification cost
  • Not recommended when existing API compatibility is a concern
  • Avoid in performance-critical hot paths

How it compares

This approach uses the type system to guarantee invariants, unlike manual validation which requires re-checking and does not provide type guarantees.

Compared to similar skills

parse-dont-validate side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
parse-dont-validate (this skill)05moNo flagsIntermediate
deepwiki-rs259moReviewIntermediate
tldr-code17moReviewAdvanced
harness-boundary03moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry