principle-boundary-discipline

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

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Scattered validation and defensive checks deep inside call chains create noisy, redundant code and a false sense of safety. This Skill guides you to validate data once at system boundaries and keep internal business logic pure and testable without framework dependencies. ## Core Features & Use Cases - Boundary Validation: Enforces validation, type narrowing, and error handling at CLI args, config files, external APIs, and network protocols while trusting internal types. - Pure Business Logic: Keeps scoring, parsing, and prompt construction as pure functions with no framework dependencies, so they can be tested without the framework. - Android App/Data Layering (P2): Ensures app/UI modules consume domain models and interfaces without importing data-layer DTOs or entities. - Use Case: When wiring a new network endpoint, validate and parse the raw response into domain types at the API boundary, then pass typed data into pure functions instead of re-checking values throughout the call chain. ## Quick Start Apply the boundary discipline principle to review my validation and error handling code and move guards to the system boundaries.

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 and error handling in an application?▼

Validate data once at system boundaries such as CLI args, config parsing, and external APIs, then trust typed data internally. Return errors at the boundary and propagate them inside rather than adding redundant nil checks deep in call chains.

How to keep business logic testable without framework dependencies?▼

Place business logic in pure functions with no framework dependencies, and keep the outer shell thin and mechanical. Parse functions transform raw bytes to typed state, and scoring functions transform state to results, so all logic is testable in isolation.

Should Android app modules import data layer DTOs or entities?▼

No. App and UI modules should consume domain models and repository interfaces only. The data layer maps DTOs and entities to domain models and implements the repositories, so no new app-to-data model imports should be added.

When is defensive validation redundant in code?▼

Validation is redundant when the data is not crossing a system boundary at that point. If the boundary already parsed and validated the input into typed domain data, re-checking it inside the system adds noise without safety.

What types should cross a system boundary in a public API?▼

Expose domain concepts across the boundary, 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 policy at the edge.