Agent Skills: Sync OpenAPI Skill

|

UncategorizedID: semicolon-devteam/semo/sync-openapi

Install this agent skill to your local

pnpm dlx add-skill https://github.com/semicolon-devteam/semo/tree/HEAD/semo-system/semo-skills/sync-openapi

Skill Files

Browse the full folder contents for sync-openapi.

Download Skill

Loading file tree…

semo-system/semo-skills/sync-openapi/SKILL.md

Skill Metadata

Name
sync-openapi
Description
|

πŸ”” μ‹œμŠ€ν…œ λ©”μ‹œμ§€: 이 Skill이 호좜되면 [SEMO] Skill: sync-openapi 호좜 - {API 경둜} μ‹œμŠ€ν…œ λ©”μ‹œμ§€λ₯Ό 첫 쀄에 좜λ ₯ν•˜μ„Έμš”.

Sync OpenAPI Skill

core-interface OpenAPI μŠ€νŽ™μ„ 기반으둜 API κ΅¬ν˜„ κ°€μ΄λ“œ

Background

core-interface (OpenAPI 3.1 Spec)
        ↓ (Single Source of Truth)
   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
   ↓         ↓
core-backend   cm-template
(Spring Boot)  (Next.js)

When to Use

  • API Controller κ΅¬ν˜„ μ „
  • Request/Response DTO μž‘μ„± μ‹œ
  • API 응닡 ν˜•μ‹ 확인 μ‹œ
  • v0.4.x CODE 단계

Quick Start

# OpenAPI μŠ€νŽ™ 전체 쑰회
gh api repos/semicolon-devteam/core-interface/contents/openapi-spec.json \
  --jq '.content' | base64 -d

# νŠΉμ • Path 쑰회 (jq ν•„μš”)
gh api repos/semicolon-devteam/core-interface/contents/openapi-spec.json \
  --jq '.content' | base64 -d | jq '.paths["/api/v1/posts"]'

DTO Naming Convention

| OpenAPI Operation | Request DTO | Response DTO | |-------------------|-------------|--------------| | createPost | CreatePostRequest | CreatePostResponse | | getPost | - | GetPostResponse | | updatePost | UpdatePostRequest | UpdatePostResponse | | deletePost | - | - | | listPosts | - | PagedPostsResponse |

ApiResponse Pattern

sealed class ApiResponse<T> {
    data class Success<T>(
        val success: Boolean = true,
        val data: T,
        val message: String? = null,
        val timestamp: Instant = Instant.now()
    )

    data class PagedSuccess<T>(
        val success: Boolean = true,
        val data: List<T>,
        val pagination: Pagination,
        val message: String? = null,
        val timestamp: Instant = Instant.now()
    )

    data class Error(
        val success: Boolean = false,
        val message: String,
        val errorCode: String? = null,
        val fieldErrors: Map<String, String>? = null,
        val timestamp: Instant = Instant.now()
    )
}

Output Format

[SEMO] Skill: sync-openapi 호좜 - {endpoint}

## API Spec: POST /api/v1/posts

### Request
```json
{
  "title": "string",
  "content": "string"
}

Response (201)

{
  "success": true,
  "data": {
    "id": "uuid",
    "title": "string",
    "content": "string",
    "createdAt": "datetime"
  }
}

DTO Suggestion

data class CreatePostRequest(
    val title: String,
    val content: String
)

data class CreatePostResponse(
    val id: UUID,
    val title: String,
    val content: String,
    val createdAt: Instant
)

## Critical Rules

1. **Always check spec first**: κ΅¬ν˜„ μ „ core-interface 확인 ν•„μˆ˜
2. **Follow DTO naming**: Operation ID prefix κ·œμΉ™ μ€€μˆ˜
3. **Polymorphic responses**: discriminator νŒ¨ν„΄ μ‚¬μš©
4. **Error responses**: ν‘œμ€€ ErrorResponse ν˜•μ‹

## Related Skills

- `implement` - v0.4.x CODE λ‹¨κ³„μ—μ„œ μ‚¬μš©
- `scaffold-domain` - Controller 생성 μ‹œ μ°Έμ‘°

## Related Resources

- **Swagger UI**: https://core-interface-ashen.vercel.app/
- **Repository**: https://github.com/semicolon-devteam/core-interface

## References

- [DTO Patterns](references/dto-patterns.md)
- [Polymorphic Types](references/polymorphic-types.md)