liberal-accept-strict-return
Installation
SKILL.md
Be Liberal in What You Accept and Strict in What You Produce
Overview
Accept broad input types, return narrow output types.
This is Postel's Law applied to TypeScript: functions should be flexible about what they accept but precise about what they return. This makes APIs easier to use and types more useful.
When to Use This Skill
- Designing function parameters and return types
- Creating reusable APIs or libraries
- Function returns feel too broad for callers to use
- Want to accept multiple input formats
- Struggling with optional fields that shouldn't be optional in output