# Principle boundary discipline

> Principle boundary discipline is an open-source agent skill for developer tools. Guides the agent to validate and parse data only at system boundaries, keeping logic pure. It is available on Claude Code.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code
- **Website:** https://github.com/michael-denyer/pstack-claude/tree/main/plugins/pstack/skills/principle-boundary-discipline
- **Repository:** https://github.com/michael-denyer/pstack-claude
- **GitHub stars:** 5,057
- **License:** MIT
- **Skill name:** principle-boundary-discipline
- **Collection:** https://github.com/michael-denyer/pstack-claude
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

This skill sets out a design discipline for code that touches the outside world. Validation, type narrowing and error handling belong where data enters the system, such as CLI arguments, config files, network responses and external APIs. Once data is parsed into domain types, inner code can trust those types instead of re-checking them.

The skill gives the agent two checks to apply while wiring code. The first asks whether data is crossing a boundary at that point; if it is not, extra validation is redundant. The second asks whether a piece of logic can be a pure function with no framework dependencies that a thin shell calls; if so, it should be extracted.

It is a plain instruction file with no scripts or bundled tools. It applies to whatever languages and frameworks the project already uses.

## When your agent uses it

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

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-boundary-discipline)
- [License: MIT](https://github.com/michael-denyer/pstack-claude/tree/HEAD/plugins/pstack/skills/principle-boundary-discipline)

## Features

- **Boundary-only validation:** Guards and parsing are concentrated where external data enters, not repeated internally.
- **Domain type parsing:** Raw input is converted into domain types at the edge of the system.
- **Pure business logic:** Core rules are kept in functions free of framework or transport dependencies.
- **Thin shell design:** Calling code stays minimal and delegates decisions to the pure functions.
- **Adapter type isolation:** Transport and framework types are kept out of the public surface of modules.

## Good for

- Refactor a CLI tool so argument parsing happens in one place
- Add config file validation without repeating checks deeper in the code
- Wrap an external API client so responses are parsed into domain types
- Extract business rules from a web handler into testable pure functions

## Install

### Claude Code

This skill ships in the `pstack` plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

```sh
/plugin marketplace add michael-denyer/pstack-claude
/plugin install pstack@pstack-claude
```

Or copy only this skill to `~/.claude/skills/principle-boundary-discipline`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/principle-boundary-discipline &&
cp -R "$tmp/plugins/pstack/skills/principle-boundary-discipline" ~/.claude/skills/principle-boundary-discipline &&
rm -rf "$tmp"
```

For one project only, put the folder in `.claude/skills/principle-boundary-discipline` inside it instead.

### Codex

Copy the skill folder to `~/.agents/skills/principle-boundary-discipline` to use it in every repository:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/principle-boundary-discipline &&
cp -R "$tmp/plugins/pstack/skills/principle-boundary-discipline" ~/.agents/skills/principle-boundary-discipline &&
rm -rf "$tmp"
```

For one repository only, put the folder in `.agents/skills/principle-boundary-discipline` inside it instead.

### Cursor

Copy the skill folder to `~/.cursor/skills/principle-boundary-discipline` to use it in every project:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/principle-boundary-discipline &&
cp -R "$tmp/plugins/pstack/skills/principle-boundary-discipline" ~/.cursor/skills/principle-boundary-discipline &&
rm -rf "$tmp"
```

For one project only, put the folder in `.cursor/skills/principle-boundary-discipline` inside it instead.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/michael-denyer/pstack-claude.git --path plugins/pstack/skills/principle-boundary-discipline
```

Or copy the folder to `~/.gemini/skills/principle-boundary-discipline` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/principle-boundary-discipline`:

```sh
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/principle-boundary-discipline &&
cp -R "$tmp/plugins/pstack/skills/principle-boundary-discipline" ~/.copilot/skills/principle-boundary-discipline &&
rm -rf "$tmp"
```

For one project only, put the folder in `.github/skills/principle-boundary-discipline` inside it instead.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/michael-denyer/pstack-claude.git
```

Then copy `pstack-claude/plugins/pstack/skills/principle-boundary-discipline` into your agent's skills folder as `principle-boundary-discipline`. Agents that support SKILL.md read one folder per skill.

## FAQ

### When does Principle boundary discipline trigger?

It applies when the agent is wiring validation, error handling or framework adapters, according to its description.

### Does Principle boundary discipline need any scripts or tools?

No. It has no scripts and does not set any allowed tools; it is a SKILL.md instruction file with one supporting file.

### Does Principle boundary discipline change how the code is written?

It guides the agent to place validation at system boundaries and to keep business logic in pure functions that a thin shell calls.

### How do I install Principle boundary discipline in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/principle-boundary-discipline to use it in all your projects, or to .claude/skills/principle-boundary-discipline in one project. Or install the pstack plugin, which includes it: /plugin marketplace add michael-denyer/pstack-claude, then /plugin install pstack@pstack-claude.

### Does Principle boundary discipline run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

### Which AI agents can use Principle boundary discipline?

Claude Code. It reads skills in the SKILL.md format; the install steps on this page show where to put the folder.

### What are the best alternatives to Principle boundary discipline?

The closest alternatives to Principle boundary discipline are Principle type system discipline, Principle foundational thinking, Principle model the domain, Principle subtract before you add and Principle minimize reader load.

## Where this comes from

- Description: from the skill's own SKILL.md.

## Alternatives

- [Principle type system discipline](https://ai-powered.com/skills/principle-type-system-discipline): Principle type system discipline is an open-source agent skill for developer tools.
- [Principle foundational thinking](https://ai-powered.com/skills/principle-foundational-thinking): Principle foundational thinking is an open-source agent skill for developer tools.
- [Principle model the domain](https://ai-powered.com/skills/principle-model-the-domain): Principle model the domain is an open-source agent skill for developer tools.
- [Principle subtract before you add](https://ai-powered.com/skills/principle-subtract-before-you-add): Principle subtract before you add is an open-source agent skill for developer tools.
- [Principle minimize reader load](https://ai-powered.com/skills/principle-minimize-reader-load): Principle minimize reader load is an open-source agent skill for developer tools.
- [Domain modeling](https://ai-powered.com/skills/domain-modeling-xd4o): Domain modeling is an open-source agent skill for developer tools.
- [Principle test behavior not implementation](https://ai-powered.com/skills/principle-test-behavior-not-implementation): Principle test behavior not implementation is an open-source agent skill for developer tools.
- [Principle never block on the human](https://ai-powered.com/skills/principle-never-block-on-the-human): Principle never block on the human is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/principle-boundary-discipline
