/prd-api-templates
`/prd` Phase 3에서 선택한 API 유형의 상세 템플릿. REST / GraphQL / gRPC / WebSocket / OpenAPI 템플릿과 로그인 API 예시를 담고 있다. 필요한 유형 섹션만 참고하여 PRD §5.1 API Specification을 작성한다.
$ npx -y skills add wigtn/wigtn-plugins --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/prd-api-templates
Context preview
What this command does when you run it.
`/prd` Phase 3에서 선택한 API 유형의 상세 템플릿. REST / GraphQL / gRPC / WebSocket / OpenAPI 템플릿과 로그인 API 예시를 담고 있다. 필요한 유형 섹션만 참고하여 PRD §5.1 API Specification을 작성한다.
Command definition
prd-api-templates.mdPRD API Specification Templates
`/prd` Phase 3에서 선택한 API 유형의 상세 템플릿. REST / GraphQL / gRPC / WebSocket / OpenAPI 템플릿과 로그인 API 예시를 담고 있다. 필요한 유형 섹션만 참고하여 PRD §5.1 API Specification을 작성한다.
---
3.1 REST API 명세 템플릿
### API: [Endpoint Name]
#### `[METHOD] /api/v1/[resource]`
**Description**: [엔드포인트 설명]
**Authentication**: Required / Optional / None
**Headers**:
| Header | Required | Description |
|--------|----------|-------------|
| Authorization | Yes | Bearer {accessToken} |
| Content-Type | Yes | application/json |
**Request Body**:
```json
{
"field1": "string (required) - 필드 설명",
"field2": "number (optional) - 필드 설명",
"field3": {
"nested": "string (required) - 중첩 필드 설명"
}
}**Request Example**:
{
"email": "user@example.com",
"password": "securePassword123",
"rememberMe": true
}**Response 200 OK**:
{
"success": true,
"data": {
"id": "string - 리소스 ID",
"createdAt": "string (ISO 8601) - 생성 시간"
},
"meta": {
"timestamp": "string (ISO 8601)"
}
}**Response Example**:
{
"success": true,
"data": {
"id": "usr_123456",
"email": "user@example.com",
"createdAt": "2024-01-15T09:30:00Z"
},
"meta": {
"timestamp": "2024-01-15T09:30:00Z"
}
}**Error Responses**: | Status | Code | Message | Description | |--------|------|---------|-------------| | 400 | INVALID_INPUT | Invalid request body | 요청 본문 유효성 검사 실패 | | 401 | UNAUTHORIZED | Authentication required | 인증 토큰 누락 또는 만료 | | 403 | FORBIDDEN | Access denied | 권한 없음 | | 404 | NOT_FOUND | Resource not found | 리소스 없음 | | 409 | CONFLICT | Resource already exists | 중복 리소스 | | 422 | VALIDATION_ERROR | Validation failed | 비즈니스 규칙 위반 | | 500 | INTERNAL_ERROR | Internal server error | 서버 오류 |
**Error Response Format**:
{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request body",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
},
"meta": {
"timestamp": "2024-01-15T09:30:00Z"
}
}**Rate Limiting**:
- Limit: 100 requests per minute
- Headers: X-RateLimit-Limit, X-RateLimit-Remaining
---
#### 3.2 GraphQL Schema 템플릿
```graphql
# Schema Definition
type Query {
"""사용자 정보 조회"""
user(id: ID!): User
"""사용자 목록 조회 (페이지네이션)"""
users(
first: Int = 20
after: String
filter: UserFilter
): UserConnection!
}
type Mutation {
"""회원가입"""
signUp(input: SignUpInput!): AuthPayload!
"""로그인"""
signIn(input: SignInInput!): AuthPayload!
"""로그아웃"""
signOut: Boolean!
}
type Subscription {
"""실시간 알림 구독"""
onNotification(userId: ID!): Notification!
}
# Types
type User {
id: ID!
email: String!
name: String!
createdAt: DateTime!
updatedAt: DateTime!
}
type AuthPayload {
accessToken: String!
refreshToken: String!
user: User!
}
# Inputs
input SignUpInput {
email: String!
password: String!
name: String!
}
input SignInInput {
email: String!
password: String!
rememberMe: Boolean = false
}
# Pagination (Relay Cursor Connection)
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type UserEdge {
cursor: String!
node: User!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
# Error Handling
type UserError {
field: String
message: String!
code: ErrorCode!
}
enum ErrorCode {
INVALID_INPUT
UNAUTHORIZED
NOT_FOUND
CONFLICT
RATE_LIMITED
}---
3.3 gRPC Proto 정의 템플릿
syntax = "proto3";
package auth.v1;
option go_package = "github.com/example/auth/v1;authv1";
// AuthService 정의
service AuthService {
// 회원가입
rpc SignUp(SignUpRequest) returns (SignUpResponse);
// 로그인
rpc SignIn(SignInRequest) returns (SignInResponse);
// 토큰 갱신
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
// 사용자 정보 스트리밍 (서버 스트리밍)
rpc WatchUser(WatchUserRequest) returns (stream UserEvent);
}
// Request/Response Messages
message SignUpRequest {
string email = 1;
string password = 2;
string name = 3;
}
message SignUpResponse {
User user = 1;
AuthTokens tokens = 2;
}
message SignInRequest {
string email = 1;
string password = 2;
bool remember_me = 3;
}
message SignInResponse {
User user = 1;
AuthTokens tokens = 2;
}
message RefreshTokenRequest {
string refresh_token = 1;
}
message RefreshTokenResponse {
AuthTokens tokens = 1;
}
message WatchUserRequest {
string user_id = 1;
}
message UserEvent {
EventType type = 1;
User user = 2;
google.protobuf.Timestamp timestamp = 3;
enum EventType {
EVENT_TYPE_UNSPECIFIED = 0;
EVENT_TYPE_UPDATED = 1;
EVENT_TYPE_DELETED = 2;
}
}
// Common Types
message User {
string id = 1;
string email = 2;
string name = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}
message AuthTokens {
string access_token = 1;
string refresh_token = 2;
int64 expires_in = 3; // seconds
}
// Error Details (Google API Error Model)
import "google/rpc/status.proto";
import "google/rpc/error_details.proto";
// 에러 코드: google.rpc.Code 사용
// INVALID_ARGUMENT (3), UNAUTHENTICATED (16),
// NOT_FOUND (5), ALREADY_EXISTS (6),
// RESOURCE_EXHAUSTED (8) for rate limiting---
3.4 WebSocket 이벤트 스펙 템플릿
### WebSocket: [Namespace/Feature]
**Endpoint**: `wss://api.example.com/ws/v1/[namespace]`
**Connection Flow**:
Client Server | | |--- WS Upgrade Request --------->| |<-- 101 Switching Protocols -----| | | |--- auth:connect (token) ------->| |<-- auth:connected (session) ----| | | |<-- event:notification ----------| |--- event:ack (eventId) -------->| | | |--- ping ----------------------->| |<-- pong -------------------
Read more
PRD API Specification Templates
`/prd` Phase 3에서 선택한 API 유형의 상세 템플릿. REST / GraphQL / gRPC / WebSocket / OpenAPI 템플릿과 로그인 API 예시를 담고 있다. 필요한 유형 섹션만 참고하여 PRD §5.1 API Specification을 작성한다.
---
3.1 REST API 명세 템플릿
### API: [Endpoint Name]
#### `[METHOD] /api/v1/[resource]`
**Description**: [엔드포인트 설명]
**Authentication**: Required / Optional / None
**Headers**:
| Header | Required | Description |
|--------|----------|-------------|
| Authorization | Yes | Bearer {accessToken} |
| Content-Type | Yes | application/json |
**Request Body**:
```json
{
"field1": "string (required) - 필드 설명",
"field2": "number (optional) - 필드 설명",
"field3": {
"nested": "string (required) - 중첩 필드 설명"
}
}**Request Example**:
{
"email": "user@example.com",
"password": "securePassword123",
"rememberMe": true
}**Response 200 OK**:
{
"success": true,
"data": {
"id": "string - 리소스 ID",
"createdAt": "string (ISO 8601) - 생성 시간"
},
"meta": {
"timestamp": "string (ISO 8601)"
}
}**Response Example**:
{
"success": true,
"data": {
"id": "usr_123456",
"email": "user@example.com",
"createdAt": "2024-01-15T09:30:00Z"
},
"meta": {
"timestamp": "2024-01-15T09:30:00Z"
}
}**Error Responses**: | Status | Code | Message | Description | |--------|------|---------|-------------| | 400 | INVALID_INPUT | Invalid request body | 요청 본문 유효성 검사 실패 | | 401 | UNAUTHORIZED | Authentication required | 인증 토큰 누락 또는 만료 | | 403 | FORBIDDEN | Access denied | 권한 없음 | | 404 | NOT_FOUND | Resource not found | 리소스 없음 | | 409 | CONFLICT | Resource already exists | 중복 리소스 | | 422 | VALIDATION_ERROR | Validation failed | 비즈니스 규칙 위반 | | 500 | INTERNAL_ERROR | Internal server error | 서버 오류 |
**Error Response Format**:
{
"success": false,
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request body",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
},
"meta": {
"timestamp": "2024-01-15T09:30:00Z"
}
}**Rate Limiting**:
- Limit: 100 requests per minute
- Headers: X-RateLimit-Limit, X-RateLimit-Remaining
---
#### 3.2 GraphQL Schema 템플릿
```graphql
# Schema Definition
type Query {
"""사용자 정보 조회"""
user(id: ID!): User
"""사용자 목록 조회 (페이지네이션)"""
users(
first: Int = 20
after: String
filter: UserFilter
): UserConnection!
}
type Mutation {
"""회원가입"""
signUp(input: SignUpInput!): AuthPayload!
"""로그인"""
signIn(input: SignInInput!): AuthPayload!
"""로그아웃"""
signOut: Boolean!
}
type Subscription {
"""실시간 알림 구독"""
onNotification(userId: ID!): Notification!
}
# Types
type User {
id: ID!
email: String!
name: String!
createdAt: DateTime!
updatedAt: DateTime!
}
type AuthPayload {
accessToken: String!
refreshToken: String!
user: User!
}
# Inputs
input SignUpInput {
email: String!
password: String!
name: String!
}
input SignInInput {
email: String!
password: String!
rememberMe: Boolean = false
}
# Pagination (Relay Cursor Connection)
type UserConnection {
edges: [UserEdge!]!
pageInfo: PageInfo!
totalCount: Int!
}
type UserEdge {
cursor: String!
node: User!
}
type PageInfo {
hasNextPage: Boolean!
hasPreviousPage: Boolean!
startCursor: String
endCursor: String
}
# Error Handling
type UserError {
field: String
message: String!
code: ErrorCode!
}
enum ErrorCode {
INVALID_INPUT
UNAUTHORIZED
NOT_FOUND
CONFLICT
RATE_LIMITED
}---
3.3 gRPC Proto 정의 템플릿
syntax = "proto3";
package auth.v1;
option go_package = "github.com/example/auth/v1;authv1";
// AuthService 정의
service AuthService {
// 회원가입
rpc SignUp(SignUpRequest) returns (SignUpResponse);
// 로그인
rpc SignIn(SignInRequest) returns (SignInResponse);
// 토큰 갱신
rpc RefreshToken(RefreshTokenRequest) returns (RefreshTokenResponse);
// 사용자 정보 스트리밍 (서버 스트리밍)
rpc WatchUser(WatchUserRequest) returns (stream UserEvent);
}
// Request/Response Messages
message SignUpRequest {
string email = 1;
string password = 2;
string name = 3;
}
message SignUpResponse {
User user = 1;
AuthTokens tokens = 2;
}
message SignInRequest {
string email = 1;
string password = 2;
bool remember_me = 3;
}
message SignInResponse {
User user = 1;
AuthTokens tokens = 2;
}
message RefreshTokenRequest {
string refresh_token = 1;
}
message RefreshTokenResponse {
AuthTokens tokens = 1;
}
message WatchUserRequest {
string user_id = 1;
}
message UserEvent {
EventType type = 1;
User user = 2;
google.protobuf.Timestamp timestamp = 3;
enum EventType {
EVENT_TYPE_UNSPECIFIED = 0;
EVENT_TYPE_UPDATED = 1;
EVENT_TYPE_DELETED = 2;
}
}
// Common Types
message User {
string id = 1;
string email = 2;
string name = 3;
google.protobuf.Timestamp created_at = 4;
google.protobuf.Timestamp updated_at = 5;
}
message AuthTokens {
string access_token = 1;
string refresh_token = 2;
int64 expires_in = 3; // seconds
}
// Error Details (Google API Error Model)
import "google/rpc/status.proto";
import "google/rpc/error_details.proto";
// 에러 코드: google.rpc.Code 사용
// INVALID_ARGUMENT (3), UNAUTHENTICATED (16),
// NOT_FOUND (5), ALREADY_EXISTS (6),
// RESOURCE_EXHAUSTED (8) for rate limiting---
3.4 WebSocket 이벤트 스펙 템플릿
### WebSocket: [Namespace/Feature] **Endpoint**: `wss://api.example.com/ws/v1/[namespace]` **Connection Flow**:
Client Server | | |--- WS Upgrade Request --------->| |<-- 101 Switching Protocols -----| | | |--- auth:connect (token) ------->| |<-- auth:connected (session) ----| | | |<-- event:notification ----------| |--- event:ack (eventId) -------->| | | |--- ping ----------------------->| |<-- pong -------------------
One plugin. 11 agents. From idea to a verified commit.
Repo: wigtn/wigtn-plugins
Other commands on wigtn-plugins.
- /auto-commit
Analyze changes, run quality gate, and auto-commit with PR-based workflow. Trigger on "/auto-commit", "git 푸시", "git push", "자동 커밋", "커밋해줘", "변경사항 커밋", "PR 올려줘", "PR 만들어줘", or when user asks to commit their work after completing a task.
Open command - /implement
Implement features based on PRD specifications. Trigger keywords: - Commands: "/implement", "구현해줘", "만들어줘", "바로 구현" - Natural language (바이브 코더 친화): - "코드 작성해줘", "개발해줘", "빌드해줘" - "이제 만들어", "시작해줘", "진행해줘" - "코딩해줘", "개발 시작", "구현 시작" - "바로 만들어줘", "빨리 만들어줘" - "작업해줘", "개발 진행해줘" Best
Open command - /prd
Generate structured PRD documents from vague feature requests. Trigger keywords: - Commands: "/prd", "PRD 작성해줘", "기능 정의서", "요구사항 문서" - Natural language (바이브 코더 친화): - "~하는거 만들고 싶어", "~하는 기능 필요해" - "~할 수 있게 해줘", "~하는 앱 만들어줘" - "~하는 서비스 기획해줘", "이런 거 가능해?" - "아이디어가 있는데", "기능 추가하고
Open command - /review-pr
GitHub PR을 터미널에서 리뷰합니다. PR diff를 분석하고, 코드 리뷰 점수를 매기고, 리뷰 코멘트를 남깁니다. Trigger on "/review-pr", "PR 리뷰해줘", "리뷰해줘", "PR 봐줘", "코드 리뷰", "review this PR".
Open command - /screen-spec
Generate screen specifications (IA / User Flow / Screen Spec / Wireframe / Dev Handoff) from an existing PRD. Trigger keywords: - Commands: "/screen-spec", "화면정의서 만들어줘", "화면 명세 만들어줘", "와이어프레임 만들어줘" - Natural language (바이브 코더 친화): - "화면 어떻게 생겼는지 보여줘", "UI 정의해줘" - "와이어프레임 그려줘",
Open command

