360 Secure SkillHub
360 安全技能中心

principle-boundary-discipline

该 Skill 是一套编码与架构原则,建议在 CLI、配置、网络或外部 API 等系统边界集中做校验、类型收窄和错误处理,内部信任类型,业务逻辑放入纯函数,并保持框架适配层轻薄。

分类:开发
michael-denyer
热度 0.00
最近更新 2026-11-25 17:32:56

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add michael-denyer/pstack-claude/principle-boundary-discipline
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
principle-boundary-discipline
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.
user-invocable
false

Boundary Discipline

Validate, narrow types, and handle errors where data crosses a system boundary (CLI args, config files, external APIs, network). Inside, trust the types: no re-validation and no redundant nil checks. Parse raw data into domain types at the boundary, and keep transport and framework types out of the public surface. Business logic lives in pure functions with no framework dependencies. The shell that calls them is thin.

Two tests. Is this data crossing a boundary right now? If not, the validation is redundant. Can this be a pure function the shell just calls? If yes, extract it.