principle-boundary-discipline

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

1|Updated Aug 27, 2025
One-click install
npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill principle-boundary-discipline-igorganapolsky
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-boundary-discipline
Source: https://github.com/IgorGanapolsky/Random-Timer/tree/main/.cursor/skills/principle-boundary-discipline
Command: npx skills add https://github.com/IgorGanapolsky/Random-Timer --skill principle-boundary-discipline-igorganapolsky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered validation and redundant defensive checks make code noisy, hard to test, and give a false sense of safety. This Skill guides you to place validation, type narrowing, and error handling only at system boundaries (CLI, config, network, external APIs) so internal code can trust its types and business logic stays in pure, framework-free functions. ## Core Features & Use Cases - Boundary Validation: Validate config at parse time, parse raw data into domain types at the edge, and handle external API errors defensively. - Pure Business Logic: Keep parsing, prompt construction, scoring, and assessment as pure transforms with no framework dependencies, so they can be tested without the framework. - Clean Public Surface: Avoid re-exporting transport, storage, or wire types through the public API; expose domain concepts instead. - Use Case: When wiring a CLI tool or framework adapter, apply this Skill to decide where each validation check belongs and extract testable pure functions from the shell. ## Quick Start Ask the AI to review your validation and error handling placement using the boundary discipline principle, concentrating guards at the CLI, config, and network edges.

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 crosses the boundary as typed domain values, internal code should trust the types and skip redundant checks.

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

Keep business logic in pure functions with no framework dependencies: parse functions transform raw bytes to typed state, and scoring or assessment functions transform state to results. The framework shell then just calls these functions, so tests need no framework setup.

Should internal functions re-validate data already checked at the boundary?▼

No. If the boundary already validated and parsed the data into domain types, re-validation deep in call chains is redundant noise. Ask whether the data is crossing a system boundary right now; if not, the check can 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.

When is defensive error handling appropriate?▼

Defensive error handling is appropriate at boundaries where data enters from untrusted sources like config files, CLI input, or external APIs. Inside the system, prefer typed data and error propagation over defensive nil checks.