Skip to content
add-service logo

Add Service

add-service

새 API 서비스를 생성합니다. service + hook + type 세트를 함께 생성합니다. 사용법: /add-service EntityName

SKILL.md

Full skill instructions

Add Service

새 API 도메인 추가 시 서비스, 훅, 타입을 한 번에 생성합니다.

Instructions

  1. 사용자로부터 엔티티 이름(PascalCase)을 받습니다
  2. 다음 3개 파일을 생성합니다:
    • src/​types/​{entityName}.ts
    • src/​services/​{entityName}Service.ts
    • src/​hooks/​use{EntityName}s.ts
  3. API_SPEC.md와 엔드포인트가 일치하는지 확인합니다

Type Template

// src/​types/​{entityName}.ts
export interface ${EntityName} {
  id: string;
  projectId: string;
  // TODO: Add entity-specific fields
  createdAt: string;
  updatedAt: string;
}

export interface Create${EntityName}Input {
  projectId: string;
}

export interface Update${EntityName}Input {
  // TODO: Add updatable fields
}

Service Template

// src/​services/​${entityName}Service.ts
import api from "@/​api/​client";
import type { ApiResponse } from "@/​types/​api";
import type { ${EntityName}, Create${EntityName}Input, Update${EntityName}Input } from "@/​types/​${entityName}";

const BASE_URL = "/​api";

export const ${entityName}Service = {
  getAll: async (projectId: string): Promise<ApiResponse<${EntityName}[]>> => {
    const response = await api.get(`${BASE_URL}/​projects/​${projectId}/​${entityName}s`);
    return response.data;
  },

  getById: async (id: string): Promise<ApiResponse<${EntityName}>> => {
    const response = await api.get(`${BASE_URL}/​${entityName}s/​${id}`);
    return response.data;
  },

  create: async (payload: Create${EntityName}Input): Promise<ApiResponse<${EntityName}>> => {
    const response = await api.post(
      `${BASE_URL}/​projects/​${payload.projectId}/​${entityName}s`,
      payload
    );
    return response.data;
  },

  update: async (id: string, payload: Update${EntityName}Input): Promise<ApiResponse<${EntityName}>> => {
    const response = await api.patch(`${BASE_URL}/​${entityName}s/​${id}`, payload);
    return response.data;
  },

  delete: async (id: string): Promise<ApiResponse<void>> => {
    const response = await api.delete(`${BASE_URL}/​${entityName}s/​${id}`);
    return response.data;
  },
};

Hook

add-hook Skill을 사용하여 훅을 생성합니다.

Checklist

  • 타입 파일에 필수 필드 정의
  • API_SPEC.md와 엔드포인트 일치 확인
  • barrel export 추가

Examples

/​add-service Bookmark

→ 3개 파일 생성:

  • src/​types/​bookmark.ts
  • src/​services/​bookmarkService.ts
  • src/​hooks/​useBookmarks.ts

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