principle-boundary-discipline

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered validation and redundant nil checks create noisy code and a false sense of safety. This Skill guides you to validate data once at system boundaries (CLI args, config files, network, external APIs) and trust typed data inside the system, keeping business logic testable without framework dependencies. ## Core Features & Use Cases - Boundary Validation: Validate config at parse time and parse raw data into domain types at the edge, never deep in call chains. - Pure Business Logic: Keep logic in pure functions with no framework dependencies so it can be tested without the framework. - Clean Public Surfaces: Avoid re-exporting transport, storage, or wire types through your public API. - Use Case: When wiring a CLI tool that reads a config file and calls an external API, apply this Skill to validate inputs at the entry point, then pass typed domain objects through pure scoring and transformation functions. ## Quick Start Ask the AI to review your validation and error handling code and refactor it so all guards live at system boundaries with business logic extracted into pure functions.

Frequently Asked Questions about principle-boundary-discipline

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

FAQPage Schema
How do I structure validation in a CLI application?▼

Validate all inputs at the boundary where they enter the system, such as argument parsing and config file loading. Once data crosses the boundary as typed domain objects, internal code should trust the types and propagate errors without re-validation.

Where should error handling live in a layered architecture?▼

Error handling belongs at system boundaries like network calls, config parsing, and external API adapters. Inside the system, use typed error propagation rather than defensive checks, since the boundary already guaranteed valid data.

Should business logic depend on framework code?▼

No. Business logic should live in pure functions with no framework dependencies so it can be tested without the framework. The framework shell stays thin and mechanical, just calling pure transforms.

When is redundant validation actually harmful?▼

Redundant nil checks deep in call chains add noise and create a false sense of safety when the boundary already validated the data. If data is not crossing a system boundary, additional validation is redundant and should be removed.

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.