principle-boundary-discipline

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

Updated Sep 18, 2026
One-click install
npx skills add https://github.com/fern-works/greenline --skill principle-boundary-discipline-fern-works
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: principle-boundary-discipline
Source: https://github.com/fern-works/greenline/tree/main/corpus/upstream/pstack/f5bdd6826fd0a0d9cbc4347134c3a74a200b9d9d/principle-boundary-discipline
Command: npx skills add https://github.com/fern-works/greenline --skill principle-boundary-discipline-fern-works

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 provides a discipline for deciding where validation, error handling, and type narrowing belong so internal code stays clean and testable. ## Core Features & Use Cases - Boundary Validation Rules: Validate CLI arguments, config files, network input, and external API responses at the edge, then trust typed data inside the system. - Pure Business Logic: Keep scoring, parsing, and prompt construction as pure functions with no framework dependencies so they can be tested without the framework. - Decision Tests: Apply two simple checks—"Is this data crossing a system boundary?" and "Can this be a pure function?"—to guide refactoring. - Use Case: When wiring a new REST endpoint or CLI command, use this Skill to place all input validation in the adapter layer and implement the actual logic as pure transforms over typed domain state. ## Quick Start Ask the agent to apply boundary discipline while wiring validation and error handling for a new CLI command or API adapter.

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 input validation in my application?▼

Place validation at system boundaries where data enters: CLI arguments, config files, network protocols, and external APIs. Once data crosses the boundary as typed domain values, internal code should trust the types and skip re-validation.

How to keep business logic testable without a framework?▼

Implement 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, keeping the shell thin and mechanical.

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

No. Redundant nil checks and repeated validation deep in call chains add noise and a false sense of safety. If the boundary already parsed raw data into domain types, internal code should propagate errors and trust the types.

What types should a public API expose across a system boundary?▼

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 boundary discipline not the right approach?▼

It fits systems with clear edges like CLIs, services, and adapters. It adds little value in small scripts with no real boundary, or where a framework already enforces validation contracts that cannot be separated from the wiring.