# Principle Boundary Discipline

Apply validation, type narrowing, and error handling only at system boundaries such as CLI args, config files, and external APIs. Keep internal logic pure and free from framework dependencies.

**Canonical URL:** https://skillshunter.net/skills/discovered-97e8f0ac6ed1ff95d0f9b7cccaea7fbf4f493728f6831c34

**JSON URL:** https://skillshunter.net/api/public/v1/skills/discovered-97e8f0ac6ed1ff95d0f9b7cccaea7fbf4f493728f6831c34

**Markdown URL:** https://skillshunter.net/skills/discovered-97e8f0ac6ed1ff95d0f9b7cccaea7fbf4f493728f6831c34.md

**Instructions download URL:** https://skillshunter.net/skills/discovered-97e8f0ac6ed1ff95d0f9b7cccaea7fbf4f493728f6831c34/download

**Category:** Software & Development

**Source URL:** https://github.com/jueyi6/empstack/blob/74181e31d2f00313f8683ba157966efcabbe109e/skills/principle-boundary-discipline/SKILL.md

**Source commit:** 74181e31d2f00313f8683ba157966efcabbe109e

**Listing approved at:** 2026-12-02

**Created at:** 2026-11-30T08:56:01.000000Z

**Updated at:** 2026-12-02T09:15:14.000000Z

## Catalog information

The following descriptions are catalog information. Listing approval does not mean the skill has been tested or is safe for every environment.

### Editor's note

Ensure that validation occurs only at system boundaries and that internal logic remains free of framework dependencies. Prepare by identifying where data crosses system boundaries and extract pure functions for the shell to call.

### When to use it

- Validating CLI arguments before passing them to internal logic
- Parsing external API responses into domain-specific types
- Handling errors in config file parsing without involving business logic
- Ensuring internal functions are pure and framework-agnostic

## Skill instructions

---
name: principle-boundary-discipline
description: When wiring validation or error handling, guard only at system boundaries.
disable-model-invocation: true
---

# Boundary Discipline

Validate, narrow types, and handle errors where data crosses a system boundary (CLI args, config files, external APIs, network). Inside, trust the types: no re-validation and no redundant nil checks. Parse raw data into domain types at the boundary, and keep transport and framework types out of the public API. Business logic lives in pure functions with no framework dependencies. The shell that calls them is thin.

Two tests. Is this data crossing a boundary right now? If not, the validation is redundant. Can this be a pure function the shell just calls? If yes, extract it.

