본문으로 건너뛰기
Skillpedia
일반 코딩15k · #10974

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가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-boundary-discipline/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

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.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬