360 Secure SkillHub
360 安全技能中心

principle-boundary-discipline

该 Skill 是一份编码原则说明,强调仅在 CLI、配置、网络和外部 API 等系统边界进行校验、类型收窄与错误处理,内部代码信任类型,业务逻辑保持为无框架依赖的纯函数,调用外壳保持轻量。除原则文本外,未提供代码示例、工具、脚本或测试流程。

分类:开发
cursor
热度 52.86
最近更新 2026-11-17 11:40:32

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add cursor/plugins/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.
disable-model-invocation
true

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.