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.mdCopy 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
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
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
Comments
- …
More skills from this repository
advisor
15kLets your agent consult a stronger second model at key checkpoints, such as before a big decision or when stuck on an error, if you turn it on.
check-agent-compatibility
15kRuns a full check of whether AI coding agents can start, verify and document a repository, and returns one compatibility score with the main issues.
cli-for-agents
15kTeaches your agent to design or review command-line tools so AI agents can run them without prompts, with clear help text and examples.
continual-learning
15kKeeps your AGENTS.md notes up to date by handing the work of reviewing past chats to a dedicated memory updater.
Similar skills
diffs
394kLets your agent produce a real, shareable diff of edits as a viewer link or image file, instead of a hand-written summary.
coding-agent
394kHelps your agent hand a larger coding job to Codex, Claude Code, or OpenCode as a background worker, then check on its progress.
gh-issues
394kHelps your agent find GitHub issues, pick the ones to work on, and open pull requests with fixes, including follow-up on review comments.