principle-boundary-discipline

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered validation and framework-coupled business logic make codebases noisy, redundant, and hard to test. This Skill guides you to validate data once at system boundaries and keep internal code clean and trustworthy. ## Core Features & Use Cases - Boundary Validation: Validate CLI arguments, config files, network payloads, and external API responses at the point of entry, then trust typed data everywhere inside. - Pure Business Logic: Extract parsing, scoring, and prompt construction into pure functions with no framework dependencies so they can be tested without the shell. - 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 CLI command or API endpoint, apply this Skill to decide exactly where validation belongs and which logic should be extracted into pure, testable functions. ## Quick Start Ask the AI to review your validation and error handling code and apply boundary discipline to separate the thin shell from 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 code?▼

Place validation at system boundaries where untrusted data enters: CLI arguments, config files, network requests, and external APIs. Once data is parsed into typed domain objects, internal code should trust the types and skip redundant checks.

How to 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 I re-validate data deep in the call chain?▼

No. If the boundary already validated and typed the data, redundant nil checks or re-validation inside the system add noise and a false sense of safety. Trust the types once data has crossed the boundary.

What types should a public API expose?▼

Expose domain concepts, not the boundary's private representation. Do not re-export transport, storage, framework, or wire types through the public surface; keep general-purpose mechanism inside and special-purpose policy at the edge.

When does boundary discipline not apply?▼

It is less relevant for small scripts with no real boundaries or prototypes where a single layer handles everything. The pattern pays off when a system has clear entry points and internal logic worth testing independently.