Skip to content
extract-api-info logo

REST API 정보 추출

extract-api-info

Spring Boot 백엔드의 REST API 엔드포인트 정보를 추출합니다. API 명세, 엔드포인트 목록, API 문서, 프론트엔드 연동 정보가 필요할 때 사용하세요.

SKILL.md

Full skill instructions

REST API 정보 추출

이 Skill은 Spring Boot 백엔드 프로젝트에서 REST API 엔드포인트 정보를 자동으로 추출하여 프론트엔드 개발자에게 전달할 수 있는 형태로 정리합니다.

Instructions

다음 단계를 따라 API 정보를 추출하세요:

1. Controller 파일 찾기

  • src/​main/​kotlin/​com/​sight/​controllers/​http/ 디렉토리에서 모든 *Controller.kt 파일을 찾습니다
  • InternalApiController나 TestController 같은 내부용 API는 제외할 수 있습니다
  • 찾은 컨트롤러 파일 중 주어진 프롬프트와 관련된 컨트롤러만 추출합니다

2. 각 Controller 분석

각 Controller 파일에서 다음 정보를 추출합니다:

  • HTTP 메서드: @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping
  • 경로: 매핑 어노테이션의 값 (예: @GetMapping("/​users/​@me"))
  • 권한: @Auth 어노테이션의 UserRole 배열
  • 요청 DTO: @RequestBody, @ModelAttribute, @PathVariable, @RequestParam이 붙은 파라미터
  • 응답 DTO: 메서드의 반환 타입
  • 상태 코드: @ResponseStatus 어노테이션 또는 ResponseEntity 사용 여부

3. DTO 정보 수집

Request/​Response DTO가 있는 경우:

  • src/​main/​kotlin/​com/​sight/​controllers/​http/​dto/ 디렉토리에서 해당 DTO 파일을 찾습니다
  • DTO의 필드 이름과 타입을 추출합니다

4. 출력 형식

다음과 같은 형식으로 API 정보를 정리합니다:

# API 엔드포인트 목록

## [Controller 이름]

### [HTTP METHOD] [경로]
- **권한**: [필요한 권한 목록]
- **설명**: [엔드포인트 설명]
- **요청 파라미터**:
  - [파라미터명] ([타입]): [설명]
- **요청 본문** (있는 경우):
  ```typescript
  {
    필드명: 타입,
  }
  • 응답:
    {
      필드명: 타입,
    }
    
  • 상태 코드: [HTTP 상태 코드]
  • 파일 참조: [파일경로]:[라인번호]

### 5. TypeScript 타입 변환
Kotlin 타입을 TypeScript 타입으로 변환:
- `String` → `string`
- `Int`, `Long` → `number`
- `Boolean` → `boolean`
- `LocalDateTime`, `Instant` → `string` (ISO 8601 형식)
- `List<T>` → `T[]`
- `Map<K, V>` → `Record<K, V>`
- nullable 타입 (`T?`) → `T | null`

## Examples

### 예시 1: 단순 GET 엔드포인트
```kotlin
@Auth([UserRole.USER, UserRole.MANAGER])
@GetMapping("/​users/​@me")
fun getCurrentUser(requester: Requester): GetCurrentUserResponse

출력:

### GET /​users/​@me
- **권한**: USER, MANAGER
- **설명**: 현재 로그인한 사용자 정보 조회
- **응답**:
  ```typescript
  {
    id: string,
    name: string,
    manager: boolean,
    status: string,
    studentStatus: string,
    createdAt: string,
    updatedAt: string
  }
  • 파일 참조: src/​main/​kotlin/​com/​sight/​controllers/​http/​UserController.kt:28

### 예시 2: POST 엔드포인트 (Request Body 포함)
```kotlin
@Auth([UserRole.MANAGER])
@PostMapping("/​transactions")
@ResponseStatus(HttpStatus.CREATED)
fun createTransaction(
    @Valid @RequestBody request: CreateTransactionRequest,
    requester: Requester,
): CreateTransactionResponse

출력:

### POST /​transactions
- **권한**: MANAGER
- **설명**: 새 거래 내역 생성
- **요청 본문**:
  ```typescript
  {
    item: string,
    price: number,
    quantity: number,
    place: string | null,
    note: string | null,
    usedAt: string  // ISO 8601 datetime
  }
  • 응답:
    {
      id: string,
      author: string,
      item: string,
      price: number,
      quantity: number,
      total: number,
      cumulative: number,
      place: string | null,
      note: string | null,
      usedAt: string,
      createdAt: string
    }
    
  • 상태 코드: 201 Created
  • 파일 참조: src/​main/​kotlin/​com/​sight/​controllers/​http/​TransactionController.kt:72

### 예시 3: Query Parameters 포함
```kotlin
@Auth([UserRole.USER, UserRole.MANAGER])
@GetMapping("/​transactions")
fun getTransactions(
    @RequestParam year: Int,
    @RequestParam(defaultValue = "0") @Min(0) offset: Int,
    @RequestParam(defaultValue = "20") @Min(1) @Max(50) limit: Int,
): ListTransactionsResponse

출력:

### GET /​transactions
- **권한**: USER, MANAGER
- **설명**: 거래 내역 목록 조회
- **요청 파라미터**:
  - year (number): 조회할 연도 (필수)
  - offset (number): 페이지 오프셋 (기본값: 0)
  - limit (number): 페이지 크기 (기본값: 20)
- **응답**:
  ```typescript
  {
    count: number,
    transactions: Array<{
      id: string,
      author: string,
      item: string,
      price: number,
      quantity: number,
      total: number,
      cumulative: number,
      place: string | null,
      note: string | null,
      usedAt: string,
      createdAt: string,
      updatedAt: string
    }>
  }
  • 파일 참조: src/​main/​kotlin/​com/​sight/​controllers/​http/​TransactionController.kt:32

## Tips

1. **그룹화**: Controller별로 엔드포인트를 그룹화하여 가독성을 높입니다
2. **정렬**: 각 그룹 내에서 경로 알파벳 순으로 정렬합니다
3. **상세 수준**: 사용자가 "간단하게" 또는 "상세하게"를 요청하면 DTO 필드 포함 여부를 조정합니다
4. **필터링**: 특정 Controller나 경로 패턴만 추출하고 싶다면 사용자에게 확인합니다
5. **OpenAPI**: 가능하다면 OpenAPI/​Swagger 형식으로도 출력할 수 있습니다

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View