enum
Skill1 starsChanged 56 days agoApache-2.0View on GitHub
Scaffold a protocol enum in the shared SSOT module with the unknown-value fallback convention. Use when adding a domain/protocol enum shared across modules.
Files
enum — protocol enum scaffold (shared SSOT module)
Generate a shared enum in the single source of truth, with the unknown-value handling that forward-compatible deserialization relies on.
Authority: 프로젝트 규약(AGENTS.md 등)이 바인딩. 원칙:
reference/principles.md, 지식:reference/kb/INDEX.md.
Where it goes
- 프로토콜 공유 모듈(
<protocol-module>, 공유 enum SSOT 모듈), 패키지com.example.protocol.enums.<domain>. public enum class—explicitApi = Enabled로 설정된 모듈은public이 필수다.
Skeleton
// 외부/불안정 소스에서 역직렬화 → UNKNOWN 폴백 + 표시 텍스트:
public enum class MemberType(public val text: String) {
@JsonEnumDefaultValue UNKNOWN("미상"),
INDIVIDUAL("개인"),
BUSINESS("기업"),
}
// 내부/닫힌 집합(예: @Enumerated(STRING)으로 영속화) → 단순:
public enum class OrderStatus { PENDING, PAID, SHIPPED, CANCELLED }Rules (MUST)
- 이 모듈이 프로토콜/도메인 enum의 SSOT. 다른 모듈은
typealias <Alias> = <Name>로 재사용 — 재정의 금지. - 외부/불안정 소스에서 역직렬화하는 enum은
@JsonEnumDefaultValue UNKNOWN(...)을 선언하고, 소비 측ObjectMapper/JsonMapper가EnumFeature.READ_UNKNOWN_ENUM_VALUES_USING_DEFAULT_VALUE를 활성화해야 한다 — 이건 **Jackson 3.x의EnumFeature**이지 구버전DeserializationFeature가 아니다. - 이름→값 변환은 제네릭 헬퍼(
enumFromNameOrDefault류)로 통일하고, per-enum companion은 피한다. - 표시 라벨이 필요하면
public val text: String생성자 파라미터로 매핑(코드와 표시 텍스트 분리). - 생성 코드에 단일 파라미터 람다가 있으면 중첩되지 않은 경우
it을 쓰고, 중첩 스코프를 구분해야 할 때만 내부 파라미터에 이름을 붙인다. 여러 파라미터가 필요한 API는 예외다.
Hard constraints (build/runtime fail otherwise)
public누락 시 explicitApi 모듈에서는 컴파일이 실패한다.typealias는 어노테이션을 옮기지 못하므로, aliased enum의 unknown 폴백을 복원하는 것은 매퍼의EnumFeature설정이다.- feature 위치 오류(Jackson-3
EnumFeature대신 구DeserializationFeature사용)는 폴백이 조용히 실패하고 미지원 값에서 예외를 던진다.
Verify
빌드시스템 자동감지(gradle/maven 등) 후 공유 모듈의 컴파일 태스크를 실행해 확인한다.
reference
원칙: reference/principles.md, 지식: reference/kb/INDEX.md.
Related
[[entity]] · [[mapper]]
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- gabriellst/codm★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository65 other files it gives its agents.
- agent-evalSkill
- architecture-review-workflowSkill
- backend-code-review-workflowSkill
- code-authoring-routerSkill
- code-diagram-extractSkill
- codex-agent-runtimeSkill
- design-pattern-applySkill
- diagram-stylerSkill
- document-designerSkill
- e2e-evidence-reportSkill
- e2e-report-rendererSkill
- e2e-runnerSkill
- e2e-scenario-authorSkill
- e2e-test-workflowSkill
- entitySkill
- explore-dead-codeSkill
- flywaySkill
- git-flowSkill
- harness-proposeSkill
- harness-refineSkill
- java-spring-review-workflowSkill
- knowledge-auditSkill
- korean-dev-writerSkill
- kotlin-code-authoringSkill
- kotlin-spring-reviewSkill
- kotlin-spring-review-workflowSkill
- learnSkill
- mapperSkill
- markdown-publisherSkill
- mermaid-diagramsSkill
- mssql-code-authoringSkill
- nl-sql-querySkill
- notion-domain-contextSkill
- oop-design-reviewSkill
- opensearch-code-authoringSkill
- opensearch-optimizationSkill
- opensearch-query-reviewSkill
- opensearch-review-workflowSkill
- opensearch-schema-reviewSkill
- pdf-qaSkill
- playwright-e2eSkill
- postgres-code-authoringSkill
- postgres-query-reviewSkill
- postgres-review-workflowSkill
- postgres-risk-checkSkill
- postgres-schema-designSkill
- product-requirementsSkill
- product-ui-designSkill
- refactoring-catalogSkill
- repositorySkill
- requestSkill
- responseSkill
- retroSkill
- schema-doc-extractSkill
- security-scan-workflowSkill
- serviceSkill
- skill-updaterSkill
- start-taskSkill
- test-authoringSkill
- test-quality-refactoring-workflowSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

