mapper
Skill1 starsChanged 56 days agoApache-2.0View on GitHub
Scaffold a manual `object` mapper between a domain model and JPA entity. This project maps by hand, not MapStruct, because entities are immutable. Use when adding model-to-entity or entity-to-model conversion.
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 44
Keep mapping unidirectional and explicit: toModel and toEntity are separate functions.
- Distinctive: line 54
Run the project's Kotlin compile task via the detected build system (gradle/maven 등 빌드시스템 자동감지).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
mapper — manual object mapper
Generate a hand-written object mapper between a domain model and its entity. This project
maps by hand, not with MapStruct, because entities/models are immutable (val). This skill encodes
that decision so new mappers don't reintroduce MapStruct by accident.
Authority: project conventions (e.g.
AGENTS.md) are binding. Review withkotlin-spring-review.
Where it goes
- Domain module (
<domain-module>), packagecom.example.<domain>.mapper. Nopublickeyword. object <Name>Mapper— a stateless singleton, not a Spring bean (callers reference it statically).
Skeleton (see order/mapper/OrderMapper.kt, member/mapper/MemberMapper.kt)
object <Name>Mapper {
fun toModel(entity: <Name>Entity): <Name> =
<Name>(
id = entity.id,
status = entity.status,
// ...one line per field
)
fun toEntity(model: <Name>): <Name>Entity =
<Name>Entity(
id = model.id,
status = model.status,
// ...
)
fun toModels(entities: List<<Name>Entity>): List<<Name>> = entities.map(::toModel)
}Rules (MUST)
- Hand-written
object. Map via constructor (entities/models are immutableval, so MapStruct setter injection cannot work). Do not add@Mapper/org.mapstruct.*. - Convert enum↔String only where the stored representation differs from the model representation; preserve unknown-enum fallbacks (see
enum). - Nested values map with
entity.x?.let(::toX). KDoc in Korean noting why MapStruct is avoided (immutableval). - The mapper lives at the persistence boundary: services hold models, repositories hold entities, the mapper crosses between them.
- Keep mapping unidirectional and explicit:
toModelandtoEntityare separate functions; do not collapse them. - For single-parameter Kotlin lambdas, use
itwhen the lambda is not nested. Only name an inner parameter when nested scopes would otherwise make the value ambiguous; keep API-required parameters for multi-parameter lambdas.
Note (project convention)
This project deliberately chooses manual mappers: entities and models are immutable val, so
constructor-based mapping is the only safe option and MapStruct's setter/builder injection adds no value.
New mappers MUST be manual objects — do not wire componentModel. (MapStruct itself is a fine tool in
projects with mutable models; see the reference KB for a fair comparison.)
Verify
Run the project's Kotlin compile task via the detected build system (gradle/maven 등 빌드시스템 자동감지).
reference
Deeper rationale, trade-offs, and per-task rules: see reference/principles.md
and the knowledge base at reference/kb/INDEX.md. KB takes precedence on conflicts.
Related
[[entity]] · [[repository]] · [[enum]]
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- meganz/android★ 1.9ksame 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
- enumSkill
- 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
- 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.

