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

principle-model-the-domain

하는 일

도메인에 맞는 구조로 상태가 있는 로직을 모델링하는 규칙을 에이전트에 제공합니다. 플래그와 중첩 조건이 많은 코드를 다루는 엔지니어를 위한 스킬입니다.

사용하는 경우

  • ✓수명 주기나 단계가 있는 상태 기반 로직을 작성할 때.
  • ✓분기가 많거나 여러 파일에서 같은 형태의 가정이 반복되는 경우.
  • ✓잘못된 상태가 계속 시스템에 들어올 때.

스킬 링크

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

AI에게 요청하는 예시

“주문 흐름은 상태를 추적하는 여러 개의 불리언 값으로 엉켜 있습니다. 불가능한 상태가 생기지 않도록 제대로 모델링해 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 실제 상태와 규칙을 찾아낸 뒤, 상태 기계, 타입 모델, 조회 테이블 같은 알맞은 구조로 씁니다. 이렇게 하면 많은 분기가 사라지고 잘못된 상태를 만들기 어려워집니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Model the Domain

Encode the real domain in a data structure instead of scattering it across conditionals. A structure that matches the domain makes invalid states unrepresentable and deletes branches. Choosing it at write time is cheap. Recovering it later reads as a refactor and gets deferred.

Reach for:

  • A state machine instead of scattered booleans, phases, or lifecycle checks.
  • A typed model instead of loose parameters or repeated shape assumptions.
  • A map, registry, lookup table, or discriminated union instead of branching spread across files.
  • A reducer or command/event model instead of ad hoc state mutations.
  • A module organized around one body of domain knowledge instead of a sequence such as load, validate, transform, and save. Execution order is not ownership.
  • A small module boundary that gathers repeated behavior, ownership, or invariants.
  • A queue, cache, index, graph, tree, or normalized collection where the access pattern calls for it.
  • Any other structure that fits. When none fits, work out what the code must never allow and how the data gets read, then find the structure that encodes exactly that.

Do not force an abstraction. Prefer boring code if the current shape is already clear, local, and unlikely to grow. Be skeptical of an abstraction that adds indirection without removing branches, duplicated rules, invalid states, or lifecycle risk.

The sign that you skipped this is a new feature that grows an existing if/else chain by one more branch, or a second boolean that must stay in sync with the first. Temporal decomposition is another sign. Phase-named modules repeat the same domain rules across steps.

자주 묻는 질문

모든 문제에 새 구조가 필요한가요?

아닙니다. 현재 형태가 분명하고 커질 가능성이 낮다면, 이 스킬은 평범한 코드를 선호합니다.

흔한 예는 무엇인가요?

흩어진 불리언 값을, 허용된 전이만 가능한 상태 기계로 바꾸는 것입니다.

구조를 왜 일찍 고르나요?

작성할 때는 비용이 적지만, 나중에 올바른 구조를 되찾는 일은 자주 미뤄지고 비용도 더 많이 듭니다.

상세 정보

작성자의 원본 설명

Apply when writing stateful logic, or when code branches a lot or repeats a shape assumption across files.

repo: cursor/plugins

인기도

GitHub 스타
15k
순위
#10982
라이선스
—
업데이트
2026. 10. 31.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬