AGENT SKILL

principle-boundary-discipline

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.

License 许可
MIT
所属仓库
ravnhq/ravn-core
最近更新
2026-11-13
Stars
★ 2
Forks
0

01 前言 Front Matter

name
principle-boundary-discipline
license
See LICENSE.txt
metadata
{ "proof": "subjective" }
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

02 资源文件 2

03 SKILL.md 正文

Boundary Discipline

Adapted from pstack principle-boundary-discipline, MIT License, Copyright (c) 2026 Lauren Tan. See LICENSE.txt.

Place validation, type narrowing, and error handling at system boundaries and trust internal code. Business logic lives in pure functions; the shell is thin and mechanical, so the logic runs without the framework.

  • At boundaries (CLI args, config files, external APIs, network protocols): validate at parse time, parse raw data into domain types, return errors, handle defensively.
  • Inside the system: typed data, error propagation, no re-validation, no redundant nil checks deep in call chains.
  • Across the boundary: expose domain concepts, not the boundary's private representation (transport, storage, framework, and wire types stay out of the public surface). Keep general-purpose mechanism inside and special-purpose policy at the edge.
  • Pure core: parse functions (raw bytes to typed state), prompt construction (state in, string out), scoring and assessment (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.

04 同仓库更多 Skills