principle-boundary-discipline

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

Updated Jul 29, 2026
One-click install
npx skills add https://github.com/mmdmcy/fluttAIrbar --skill principle-boundary-discipline-mmdmcy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-boundary-discipline
Source: https://github.com/mmdmcy/fluttAIrbar/tree/main/plugins/pstack/skills/principle-boundary-discipline
Command: npx skills add https://github.com/mmdmcy/fluttAIrbar --skill principle-boundary-discipline-mmdmcy

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 exactly where data enters the system and keep everything inside clean and pure. ## Core Features & Use Cases - Boundary Validation: Validate CLI arguments, config files, network payloads, and external API responses once at the entry point, then trust internal types. - Pure Business Logic: Keep parsing, scoring, and prompt construction as pure functions with no framework dependencies so they can be tested in isolation. - Clean Public Surfaces: Avoid re-exporting transport, storage, or wire types through your public API; expose domain concepts instead. - Use Case: When wiring a new HTTP endpoint or CLI command, apply this Skill to decide where validation belongs and which logic should be extracted into pure functions. ## Quick Start Ask the AI to review your validation and error handling using the principle-boundary-discipline workflow to move guards to system boundaries and extract pure business logic.

Frequently Asked Questions about principle-boundary-discipline

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

FAQPage Schema
How do I decide where to put validation in my application?▼

Place validation at system boundaries where external data enters: CLI arguments, config files, network requests, and external API responses. Once data crosses the boundary as typed domain objects, trust it and avoid re-validating deeper in the call chain.

How to keep business logic testable without a framework?▼

Write business logic as 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, making them testable in isolation.

Should I re-validate data inside internal functions?▼

No. If the boundary already validated and parsed the data into typed domain objects, redundant nil checks and re-validation inside the system add noise and a false sense of safety. Trust the types after the boundary.

When should I not apply boundary discipline?▼

Avoid it when data genuinely crosses a trust boundary mid-flow, such as calling an external service from deep inside the system. In those cases the call site becomes a new boundary and deserves its own defensive validation and error handling.

Why should public APIs not expose transport or wire types?▼

Exposing transport, storage, or framework types couples consumers to the boundary's private representation. Expose domain concepts instead, keeping general-purpose mechanism inside and special-purpose policy at the edge.