Skip to content
Back to skills

Response

ASecurity

Scaffold a REST response DTO in the API module with a `from(model)` companion factory; paginated lists use the shared cursor page envelope. Use when adding a response body for an API endpoint.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 19, 2026
ai-agentsgokotlinspringapi

Works with

  • cursor
  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned November 19, 2026

npx -y skills add ch4570/vulpora --skill response --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Response?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Response
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ch4570-response/badge)](https://www.skillsdirectory.com/skills/ch4570-response)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: response
description: Scaffold a REST response DTO in the API module with a `from(model)` companion factory; paginated lists use the shared cursor page envelope. Use when adding a response body for an API endpoint.
---

# response — REST response DTO scaffold (API module)

Generate a response body that maps from a domain model via a `from(...)` factory, keeping mapping out of
the controller.

> **Authority**: [`AGENTS.md`](../../../AGENTS.md) is binding. Review with `kotlin-spring-review`.

> **Reference loading (progressive disclosure):**
> Read [principles](reference/principles.md) first, then use the [KB index](reference/kb/INDEX.md).
> Load only topic files matching the current task; MUST NOT recursively load the entire KB.

## Where it goes
- API module, package `com.example.api.<domain>` — co-located with the controller. No `public` keyword.
- Class name `<Entity>Response`.

## Skeleton (see `order/OrderResponse.kt`)
```kotlin
data class <Entity>Response(
    val id: String,
    val <field>: <Type>,
) {
    companion object {
        fun from(model: <Model>): <Entity>Response =
            <Entity>Response(
                id = model.id,
                <field> = model.<field>,
            )
    }
}
```

## Rules (MUST)
- `data class` with `val` properties + a `companion object { fun from(model): <Entity>Response }` factory — the response, not the controller, owns model→DTO mapping.
- **Paginated lists** wrap in the shared cursor page envelope (공유 커서 페이지 엔벨로프 / 공통 프로토콜 모듈; `@JsonProperty("_pagination")` meta + `nextCursor`); do not invent a per-endpoint page wrapper.
- KDoc per field, in Korean.
- 생성 코드에 단일 파라미터 람다가 있으면 중첩되지 않은 경우 `it`을 쓰고, 중첩 스코프를 구분해야 할 때만 내부 파라미터에 이름을 붙인다. 여러 파라미터가 필요한 API는 예외다.

## Verify
빌드시스템 자동감지 (gradle/maven/npm/pnpm/yarn) 후 해당 빌드로 컴파일 확인.

## Related
[[request]] · [[service]]

Files in this skill

  • SKILL.md2 KB
  • reference/kb/INDEX.md3 KB
  • reference/kb/content-negotiation-serialization.md3.2 KB
  • reference/kb/error-response-design.md3.1 KB
  • reference/kb/http-status-codes.md3.9 KB
  • reference/kb/pagination-metadata.md3.5 KB
  • reference/kb/problem-detail-rfc9457.md3.9 KB
  • reference/kb/response-dto-mapping.md3.8 KB
  • reference/kb/response-envelope-design.md3.1 KB
  • reference/principles.md4.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.