principle-type-system-discipline
하는 일
실수를 일찍 잡아내는 타입을 설계하는 규칙을 에이전트에 제공합니다. 정적 타입 언어로 작업하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓타입을 설계하거나 함수 시그니처를 검토할 때.
- ✓같은 타입이지만 의미가 다른 값이 두 개 이상 있을 때.
- ✓프로그램 바깥의 데이터가 코드에 들어올 때.
스킬 링크
https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-type-system-discipline/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“사용자 ID와 주문 ID가 모두 일반 문자열이라 자꾸 뒤섞입니다. 컴파일러가 이를 막도록 타입을 강화해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 의미가 다른 값마다 고유한 타입을 주고, 외부 데이터는 경계에서 타입이 있는 모델로 파싱합니다. 처리되지 않은 변형은 빌드를 실패하게 하고, 손으로 쓴 복사본 대신 권위 있는 스키마에서 타입을 만듭니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Type System Discipline
Make the compiler reject impossible states, mismatched primitives, and unhandled variants. Prefer defining errors and special cases out of existence over proliferating handlers. For TypeScript syntax, see the typescript-best-practices skill.
- Brand semantic primitives.
UserIdandOrderIdare strings underneath but should not be interchangeable. Give each its own type, such as a branded intersection in TypeScript or a newtype elsewhere. Validate once at creation, trust the type downstream. If two arguments share a primitive type but mean different things, brand them. - External data is untyped until parsed. RPC payloads, JSON, IPC messages, CLI args, config files, environment variables, database rows. Have a parse function at every boundary that turns unstructured input into the typed model. The boundary-discipline principle skill says where to put validation.
- Derive types from authoritative schemas. When a protocol buffer, OpenAPI spec, GraphQL schema, database migration, design-token file, or another file owns a shape, derive from it instead of hand-rolling a parallel type. See the encode-lessons-in-structure principle skill.
자주 묻는 질문
브랜디드 타입이란 무엇인가요?
밑바탕은 문자열이지만 다른 ID와 섞일 수 없는 타입이라서, 컴파일러가 실수를 잡아냅니다.
파싱은 어디에서 하나요?
네트워크 페이로드, 설정 파일, 명령줄 인자, 데이터베이스 행처럼 모든 경계에서 합니다.
왜 스키마에서 타입을 만드나요?
프로토콜 파일이나 마이그레이션이 가진 형태를 손으로 복제하면 어긋나기 쉬우므로, 그렇게 하지 않기 위해서입니다.
상세 정보
작성자의 원본 설명
Apply when designing types, reviewing a function signature, or writing code in any statically-typed language. Make illegal states unrepresentable, brand semantic primitives, parse external data at boundaries, exhaust variants, derive from authoritative schemas.
repo: cursor/plugins
인기도
- GitHub 스타
- 15k
- 순위
- #10991
- 라이선스
- —
- 업데이트
- 2026. 10. 31.
댓글
- …
이 저장소의 다른 스킬
advisor
15k사용자가 켜 두면, 큰 결정 전이나 오류에 막혔을 때처럼 핵심 시점에 에이전트가 더 강력한 두 번째 모델에게 자문을 구하도록 합니다.
check-agent-compatibility
15kAI 코딩 에이전트가 저장소를 시작하고, 검증하고, 문서화할 수 있는지 전체 점검해, 하나의 호환성 점수와 주요 문제를 돌려줍니다.
cli-for-agents
15kAI 에이전트가 프롬프트 없이 실행할 수 있도록 명령줄 도구를 설계하거나 검토하며, 명확한 도움말과 예시를 담도록 에이전트를 가르칩니다.
continual-learning
15k과거 채팅을 검토하는 일을 전담 메모리 업데이터에게 맡겨서 AGENTS.md 메모를 최신 상태로 유지합니다.