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

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

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

Use this skill to help me: https://github.com/cursor/plugins/blob/main/harness/pstack/claude-code/skills/principle-type-system-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에게 요청하는 예시

“사용자 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. UserId and OrderId are 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.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬