principle-boundary-discipline

Concentrate validation and error handling at system boundaries while keeping business logic pure.

2|Updated Jun 27, 2026
One-click install
npx skills add https://github.com/imjasonh/playground --skill principle-boundary-discipline-imjasonh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-boundary-discipline
Source: https://github.com/imjasonh/playground/tree/main/.cursor/skills/principle-boundary-discipline
Command: npx skills add https://github.com/imjasonh/playground --skill principle-boundary-discipline-imjasonh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered validation and framework-coupled business logic make code noisy, redundant, and hard to test. This Skill guides you to place guards only where data crosses system boundaries, so internal code stays clean and testable without the framework. ## Core Features & Use Cases - Boundary Validation Guidance: Validate CLI args, config files, network input, and external API responses at the edge, then trust typed data internally. - Pure Function Extraction: Keep parsing, prompt construction, and scoring as pure transforms with no framework dependencies. - API Surface Discipline: Avoid re-exporting transport, storage, or wire types through the public surface. - Use Case: When wiring a new HTTP handler or CLI command, apply this Skill to decide exactly where validation belongs and which logic should be extracted into pure, framework-free functions. ## Quick Start Apply the boundary discipline principle to review where validation and error handling should live in my new CLI and API adapter code.

Frequently Asked Questions about principle-boundary-discipline

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

FAQPage Schema
Where should input validation go in an application?▼

Input validation belongs at system boundaries: CLI argument parsing, config file loading, network handlers, and external API clients. Once data is parsed into domain types at the boundary, internal code should trust those types without re-validating.

How do I make business logic testable without a framework?▼

Extract business logic into pure functions with no framework dependencies, such as parse functions transforming raw bytes to typed state or scoring functions mapping state to results. The framework shell then just calls these functions, so tests need no framework setup.

Should internal functions re-check for nil or invalid data?▼

No. If the boundary already validated the data, redundant nil checks deep in call chains add noise and a false sense of safety. Trust the types once data has crossed into the system.

When should I not re-export framework or wire types?▼

Do not re-export transport, storage, framework, or wire types through your public API surface. Expose domain concepts instead, keeping general-purpose mechanism inside and special-purpose policy at the edge.

How do I decide if validation is redundant?▼

Ask whether the data is crossing a system boundary right now. If not, validation is redundant. Also ask whether the logic can be a pure function the shell just calls; if yes, extract it from the framework wiring.