principle-boundary-discipline
できること
このスキルは、コードのどこにチェックとエラー処理を置くべきかについての規則を、アシスタントに与えます。冗長なガードを減らし、テストしやすいコードにしたい開発者向けです。
使う場面
- ✓プログラムに入力の検証やエラー処理を組み込んでいるとき。
- ✓同じチェックが多くの内部関数で繰り返されているとき。
- ✓ビジネスロジックを、テストしやすい純粋な関数に保ちたいとき。
スキルのリンク
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-boundary-discipline/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このサービスの設定とAPIのレスポンスは、どこで検証すべきですか。残りのコードを単純に保つにはどうすればよいですか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
アシスタントは、検証を境界に置きます。例えばコマンドライン引数、設定ファイル、外部の呼び出しです。その後、型付きの内部データを信頼します。ビジネスロジックは、フレームワークなしで動く純粋な関数に保ちます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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.
よくある質問
なぜどこでも検証しないのですか?
散らばったチェックは雑然とし、繰り返しになり、安全だという誤った感覚を与えるからです。
システムの内側には何がありますか?
型付きのデータとエラーの伝播です。境界が既に検証した値を、もう一度チェックすることはありません。
なぜロジックをフレームワークの外に置くのですか?
フレームワークを起動しなくてもテストできるようにするためです。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 15k
- ランキング
- #10974
- ライセンス
- —
- 更新日
- 2026/10/31
コメント
- …
このリポジトリの他のスキル
advisor
15k重要な判断の前や、エラーで行き詰まったときなど、要所でより強力な第二のモデルに相談させます。機能をオンにしている場合のみ動きます。
check-agent-compatibility
15kAIコーディングエージェントがリポジトリを起動し、検証し、文書化できるかを包括的に確認し、主な問題とともに1つの互換性スコアを返します。
cli-for-agents
15kAIエージェントがプロンプトなしで実行でき、わかりやすいヘルプ文と例を備えるように、コマンドラインツールを設計または確認する方法をエージェントに教えます。
continual-learning
15k過去のチャットを確認する作業を専用のメモリ更新エージェントに任せることで、AGENTS.mdのメモを最新に保ちます。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。