convention-postels-law

Normalize heterogeneous input types into canonical structured outputs.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/sunLeee/optimization --skill convention-postels-law
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convention-postels-law
Source: https://github.com/sunLeee/optimization/tree/main/.claude/skills/reference/philosophy/laws/postels
Command: npx skills add https://github.com/sunLeee/optimization --skill convention-postels-law

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Postel's Law helps software cope with imperfect inputs by being liberal in what it accepts while enforcing strict, well-defined outputs.

Core Features & Use Cases

  • Liberal input handling: accepts multiple types (int, string, float) and normalizes to canonical forms.
  • Strict, predictable outputs: always returns structured data matching a defined schema.
  • Use cases: API design, data parsing, and integration tasks where inputs arrive with varying contracts.

Quick Start

Feed the system with mixed input types (123, 123, 123.0) and observe how inputs are normalized and outputs remain consistent.

Frequently Asked Questions about convention-postels-law

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

FAQPage Schema
How does Postel's Law help with robust API design and data parsing?

Postel's Law improves API design by enforcing liberal input acceptance for heterogeneous data formats while normalizing them into canonical forms for strict, predictable outputs. This ensures robust input handling without breaking downstream components.

How do I normalize mixed input types like integers and strings for downstream processing?

You normalize mixed input types by applying liberal input handling to accept diverse formats such as int, string, or float, then converting them into a canonical form. This data normalization ensures deterministic, strictly shaped outputs for downstream components.

Can I use this for system integration tasks with heterogeneous data contracts?

Yes, this approach is specifically designed for system integration tasks where inputs arrive from heterogeneous contracts. It applies defensive programming to accept diverse data formats and outputs strictly structured data matching a defined schema.

What is the best way to enforce strict output schemas while accepting variable inputs?

The best way to enforce strict output schemas is to decouple input handling from output generation. Accept variable inputs liberally, apply canonical normalization, and then generate deterministic, strictly shaped outputs that match your defined downstream schema.

When should I not use liberal input acceptance for data normalization?

You should avoid liberal input acceptance when your downstream components require raw, unaltered data or when input variability cannot be safely normalized without losing critical context, as this method enforces canonical forms and strict outputs.