liberal-accept-strict-return

Community

Be liberal in input, strict in output.

Authorluyi985
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This pattern helps API designers and library authors balance flexibility with clarity by allowing broader input types while returning a fixed, precise output format. It applies Postel's Law to TypeScript and similar systems to improve usability without sacrificing downstream correctness.

Core Features & Use Cases

  • Accept multiple input formats or optional fields to make APIs easier to use.
  • Return a single, well-defined structure with concrete types to simplify consumption.
  • Use Case: Designing a function signature or API where callers may provide varied inputs but should receive a predictable result.

Quick Start

Broaden input types and constrain output to a single, precise format in your API design.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: liberal-accept-strict-return
Download link: https://github.com/luyi985/lyi-bash/archive/main.zip#liberal-accept-strict-return

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.