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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
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.
댓글
- …
이 저장소의 다른 스킬
advisor
15k사용자가 켜 두면, 큰 결정 전이나 오류에 막혔을 때처럼 핵심 시점에 에이전트가 더 강력한 두 번째 모델에게 자문을 구하도록 합니다.
check-agent-compatibility
15kAI 코딩 에이전트가 저장소를 시작하고, 검증하고, 문서화할 수 있는지 전체 점검해, 하나의 호환성 점수와 주요 문제를 돌려줍니다.
cli-for-agents
15kAI 에이전트가 프롬프트 없이 실행할 수 있도록 명령줄 도구를 설계하거나 검토하며, 명확한 도움말과 예시를 담도록 에이전트를 가르칩니다.
continual-learning
15k과거 채팅을 검토하는 일을 전담 메모리 업데이터에게 맡겨서 AGENTS.md 메모를 최신 상태로 유지합니다.