Skip to main content
skill CX Codex

principle-boundary-discipline — Claude Code skill: what it does

A rule-set skill for coding agents: validation and error handling stay at system boundaries, while the inside trusts its types and plain functions.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add backnotprop/pstack --skill principle-boundary-discipline -a claude-code
Open on GitHub

What principle-boundary-discipline does

The skill carries a single rule. Validation, type narrowing and error handling belong at the edges: CLI args, config files, network, external APIs. Inside the system, code trusts its types and skips checks that already ran at the door. Business logic moves into pure functions, and the shell around the framework stays thin.

What you install is one SKILL.md. It lists the applications and gives two test questions. Is this data crossing a boundary right now? If not, the validation is redundant. Can this become a pure function the shell just calls? It also names the usual leaks: re-exporting transport or wire types through the public surface, nil checks buried deep in a call chain, config validated after startup instead of at parse time.

disable-model-invocation: true sits in the frontmatter, so the agent will not load the skill on its own. You call it while wiring a validator or a framework adapter. On a codebase where checks are scattered through handlers, expect the advice to push a refactor rather than a small patch.

What it helps with

  • collect config checks into one parse step
  • pull business logic out of framework handlers
  • drop repeated nil checks from deep call chains
  • keep transport and wire types off the public surface
  • decide where a guard earns its place and where types are enough

Example prompts for the agent

  • Apply principle-boundary-discipline: find where validation in src/config.ts drifted into business logic.
  • Use principle-boundary-discipline to move the API response parsing into a pure function.
  • Check this new adapter against principle-boundary-discipline: what is the boundary here and what is a redundant inner check?

How to install principle-boundary-discipline

1Skills CLI (Vercel)

npx skills add backnotprop/pstack --skill principle-boundary-discipline -a claude-code

2Manually: put the files in place

~/.claude/skills/principle-boundary-discipline/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/principle-boundary-discipline/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about principle-boundary-discipline

How do I install principle-boundary-discipline in Claude Code?

Run npx skills add backnotprop/pstack --skill principle-boundary-discipline -a claude-code. The file lands at ~/.claude/skills/principle-boundary-discipline/SKILL.md.

What does principle-boundary-discipline do?

It gives the agent one rule: validation, type narrowing and error handling live at system boundaries, and inner code trusts its types. Business logic goes into pure functions that can be tested without the framework.

Which platforms support this skill?

Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. Copilot uses a different command: gh skill install backnotprop/pstack principle-boundary-discipline.

Source text

SKILL.md · MIT
---
name: principle-boundary-discipline
description: "Apply when wiring validation, error handling, or framework adapters. Concentrate guards at system boundaries (CLI, config, network, external APIs); trust internal types and keep business logic in pure functions."
disable-model-invocation: true
---

# Boundary Discipline

Place validation, type narrowing, and error handling at system boundaries. Trust internal code unconditionally. Business logic lives in pure functions. The shell is thin and mechanical.

**Why:** Scattered validation is noisy, redundant, and gives a false sense of safety. Keep logic out of framework wiring so it can be tested without the framework.

**The pattern:**
- **At boundaries** (CLI args, config files, external APIs, network protocols): validate, return errors, handle defensively.
- **Inside the system:** typed data, error propagation, no re-validation. Trust the types.
- **Across the boundary.** Expose domain concepts, not the boundary's private representation. Keep general-purpose mechanism inside and special-purpose policy at the edge.

**Applications:**

Validation and error handling:
- Validate config at parse time (the boundary), not inside business logic
- Parse raw data into domain types at the boundary
- Do not re-export transport, storage, framework, or wire types through the public surface
- No redundant nil checks deep in call chains if the boundary already validated

Code organization:
- Business logic in pure functions with no framework dependencies
- Parse functions: pure transforms from raw bytes to typed state
- Prompt construction: structured state in, string out
- Scoring and assessment: pure transforms from state to results

**The tests:**
- "Is this data crossing a system boundary right now?" If not, validation is redundant.
- "Can this be a pure function that the shell just calls?" If yes, extract it.

© backnotprop · MIT · backnotprop/pstack

Similar skills

Everything for Code review and refactoring →

From the same set44

reflect Mines the current session transcript using three review subagents and turns discovered lessons into concrete skill edits. CX Codex +1 5,300installs recall Rebuilds a short brief from your chat transcripts, the live repo state and the shared record: where things stand and what to do next. CX Codex +1 5,000installs automate-me Turns your daily coding habits into a personal -mode skill by mining recent workspace transcripts and running structured questionnaires. CX Codex +1 5,100installs principle-outcome-oriented-execution A rule for planned rewrites and migrations: the agent converges on the target architecture instead of propping up intermediate states with compatibility code. CX Codex +1 5,100installs principle-sequence-verifiable-units Guides coding agents to break multi-step sweeps and migrations into verifiable units. Keeps each step verified before proceeding to the next. CX Codex +1 5,100installs principle-test-behavior-not-implementation A rule for tests you write or keep: assert what callers can observe. Turns tests that break on every refactor into ones that catch real bugs. CX Codex +1 5,200installs principle-minimize-reader-load A skill that spots unnecessary layers of abstraction and hidden state slowing down code comprehension. Use it when reviewing complex code where the logic is hard to trace. CX Codex +1 5,200installs principle-migrate-callers-then-delete-legacy-apis Instructs the assistant to migrate internal callers and delete legacy APIs in a single wave, skipping temporary compatibility layers. CX Codex +1 5,200installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor