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 코딩 에이전트가 저장소를 시작하고, 검증하고, 문서화할 수 있는지 전체 점검해, 하나의 호환성 점수와 주요 문제를 돌려줍니다.
cli-for-agents
15kAI 에이전트가 프롬프트 없이 실행할 수 있도록 명령줄 도구를 설계하거나 검토하며, 명확한 도움말과 예시를 담도록 에이전트를 가르칩니다.
continual-learning
15k과거 채팅을 검토하는 일을 전담 메모리 업데이터에게 맡겨서 AGENTS.md 메모를 최신 상태로 유지합니다.