Skip to content
Skillpedia
General coding15k · #10974

principle-boundary-discipline

What it does

Gives the assistant a rule for where to put checks and error handling in code. It is for developers who want fewer redundant guards and code that is easier to test.

When to use it

  • ✓When you are wiring validation or error handling into a program.
  • ✓When the same checks are repeated across many internal functions.
  • ✓When you want business logic kept in pure functions that are easy to test.

Skill link

https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-boundary-discipline/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-boundary-discipline/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Where should I validate the config and API responses in this service so the rest of the code can stay simple?”

5 new skills a week. 1 minute to read.

How it works

The assistant places validation at the boundaries, such as command-line arguments, config files and external calls, then trusts typed internal data. It keeps business logic in pure functions that work without the framework.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.
FAQ

Why not validate everywhere?

Scattered checks are noisy, repeated and give a false sense of safety.

What belongs inside the system?

Typed data and error propagation, with no re-checking of values the boundary already validated.

Why keep logic out of the framework?

So it can be tested without starting the framework.

Details

Original description by the author

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.

repo: cursor/plugins

Popularity

GitHub stars
15k
Ranking position
#10974
License
—
Updated
10/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills