一键导入
new-api
Implement a new API endpoint end-to-end — Repository → Service interface → Service impl → Controller, following Flooding project conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Implement a new API endpoint end-to-end — Repository → Service interface → Service impl → Controller, following Flooding project conventions.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Creates a new git branch following the project's branch naming convention. Use this skill whenever the user wants to start new work, create a branch, switch to a new branch.
Generate PR title and body from commits since the base branch, then create the PR on GitHub following the project PR template exactly.
Check PR review comments, reflect valid feedback into code, commit, push, then reply to each comment with the resolving commit hash.
Create Git commits following Flooding project conventions. Splits changes into logical units with correct type prefix and Korean description.
Run a structured checklist over changed files — Kotlin style, JPA/transaction correctness, naming conventions, test coverage, and security basics. Produces a ✓/⚠/✗ report.
Run KtLint formatting on all Kotlin source files via Gradle. Use when .kt files need formatting or after bulk edits.
基于 SOC 职业分类
| name | new-api |
| description | Implement a new API endpoint end-to-end — Repository → Service interface → Service impl → Controller, following Flooding project conventions. |
domain/{domain}/
├── entity/ # (already exists)
├── repository/ # Step 1
├── presentation/
│ ├── controller/ # Step 4
│ └── data/
│ ├── request/ # Step 2
│ └── response/ # Step 2
├── service/ # Step 3a
└── service/impl/ # Step 3b
// src/main/kotlin/.../domain/{domain}/repository/{Domain}Repository.kt
package team.incube.flooding.domain.{domain}.repository
import org.springframework.data.jpa.repository.JpaRepository
import team.incube.flooding.domain.{domain}.entity.{Domain}JpaEntity
interface {Domain}Repository : JpaRepository<{Domain}JpaEntity, Long> {
// Add derived query methods as needed
fun findByXxxAndYyy(xxx: Long, yyy: Boolean): {Domain}JpaEntity?
fun findAllByXxxOrderByField(xxx: Long): List<{Domain}JpaEntity>
fun existsByXxxAndYyy(xxx: Long, yyy: Long): Boolean
}
Request:
// presentation/data/request/{Verb}{Domain}Request.kt
data class Create{Domain}Request(
val field1: String,
val field2: String?,
)
Response:
// presentation/data/response/{Verb}{Domain}Response.kt
data class Get{Domain}Response(
val id: Long,
val field1: String,
)
// service/{Verb}{Domain}Service.kt
package team.incube.flooding.domain.{domain}.service
interface {Verb}{Domain}Service {
fun execute(/* params */): {Verb}{Domain}Response
}
// service/impl/{Verb}{Domain}ServiceImpl.kt
@Service
class {Verb}{Domain}ServiceImpl(
private val repository: {Domain}Repository,
) : {Verb}{Domain}Service {
@Transactional
override fun execute(/* params */): {Verb}{Domain}Response {
val entity = repository.findById(id).orElseThrow {
ExpectedException("설명", HttpStatus.NOT_FOUND)
}
// business logic
return {Verb}{Domain}Response(...)
}
}
// presentation/controller/{Domain}Controller.kt
@Tag(name = "{도메인명}", description = "{도메인} 관련 API")
@RestController
@RequestMapping("/{domain}s")
class {Domain}Controller(
private val createService: Create{Domain}Service,
private val getService: Get{Domain}Service,
) {
@Operation(summary = "...", description = "...")
@ApiResponse(responseCode = "201", description = "생성 성공")
@PostMapping
fun create{Domain}(
@Valid @RequestBody request: Create{Domain}Request,
): ResponseEntity<CommonApiResponse<Create{Domain}Response>> =
ResponseEntity.status(HttpStatus.CREATED)
.body(CommonApiResponse.success(createService.execute(request)))
@Operation(summary = "...", description = "...")
@ApiResponse(responseCode = "200", description = "조회 성공")
@GetMapping("/{id}")
fun get{Domain}(
@PathVariable id: Long,
): ResponseEntity<CommonApiResponse<Get{Domain}Response>> =
ResponseEntity.ok(CommonApiResponse.success(getService.execute(id)))
}
@Transactional created@RequestBody parameter named requestExpectedException used for errors (no subclasses)