Command Palette

Search for a command to run...

Назад к скиллам
скилл № 84738

backend-api-development

Comprehensive backend API development skill for building robust, scalable APIs. Use when creating new endpoints, services, or backend functionality. Keywords…

БесплатноБез исполняемых скриптов
VoDaiLoczот VoDaiLocz★ 28 звёзд на GitHub

Установить backend-api-development в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

🔧 Backend API Development Skill

Philosophy: APIs are contracts. Build them right the first time.

When to Use

Use this skill when:

  • Creating a new API endpoint
  • Building a new service/module
  • Refactoring existing API code
  • Adding new functionality to backend
  • Need to follow RESTful/GraphQL best practices

Do NOT use this skill when:

  • Just fixing a small bug (use debugging skill)
  • Only modifying frontend (use frontend skill)
  • Database-only changes (use database skill)

Prerequisites

Before starting:

  • Requirements are clear (what the API should do)
  • Understand the existing architecture
  • Know the target stack (NestJS, Express, FastAPI, etc.)
  • Database schema exists (or will be created)

Process

Phase 1: DESIGN 📐

Goal: Design the API before writing code.

Steps:

  1. Define the Resource

    resource:
      name: User
      description: Represents a platform user
      domain: authentication
    
  2. Design Endpoints (REST)

    endpoints:
      - method: GET
        path: /users
        description: List all users
        query_params: [page, limit, search]
        response: User[]
      
      - method: GET
        path: /users/:id
        description: Get single user
        response: User
      
      - method: POST
        path: /users
        description: Create new user
        body: CreateUserDto
        response: User
      
      - method: PUT
        path: /users/:id
        description: Update user
        body: UpdateUserDto
        response: User
      
      - method: DELETE
        path: /users/:id
        description: Delete user
        response: void
    
  3. Define DTOs (Data Transfer Objects)

    // CreateUserDto
    interface CreateUserDto {
      email: string;      // required, email format
      password: string;   // required, min 8 chars
      name: string;       // required, min 2 chars
      role?: UserRole;    // optional, default: 'user'
    }
    
    // UpdateUserDto
    type UpdateUserDto = Partial<CreateUserDto>;
    
    // UserResponseDto
    interface UserResponseDto {
      id: string;
      email: string;
      name: string;
      role: UserRole;
      createdAt: DateTime;
      updatedAt: DateTime;
      // Note: password NOT included
    }
    
  4. Plan Error Responses

    errors:
      - code: 400
        when: Invalid input
        response: { message, errors: [{field, message}] }
      
      - code: 401
        when: Not authenticated
        response: { message: "Unauthorized" }
      
      - code: 403
        when: Not authorized
        response: { message: "Forbidden" }
      
      - code: 404
        when: Resource not found
        response: { message: "User not found" }
      
      - code: 409
        when: Conflict (e.g., email exists)
        response: { message: "Email already registered" }
    

Output: Complete API design document.


Phase 2: STRUCTURE 🏗️

Goal: Set up the file structure.

NestJS Structure:

src/
└── users/
    ├── users.module.ts       # Module definition
    ├── users.controller.ts   # HTTP layer
    ├── users.service.ts      # Business logic
    ├── users.repository.ts   # Data access (optional)
    ├── dto/
    │   ├── create-user.dto.ts
    │   ├── update-user.dto.ts
    │   └── user-response.dto.ts
    ├── entities/
    │   └── user.entity.ts
    ├── guards/
    │   └── user-owner.guard.ts
    └── users.controller.spec.ts

FastAPI Structure:

app/
└── users/
    ├── __init__.py
    ├── router.py          # Routes
    ├── service.py         # Business logic
    ├── repository.py      # Data access
    ├── schemas.py         # Pydantic models
    ├── models.py          # SQLAlchemy models
    └── dependencies.py    # Dependency injection

Phase 3: IMPLEMENTATION 💻

Goal: Implement the API layer by layer.

Order of Implementation:

  1. Entity/Model First

    // user.entity.ts
    @Entity('users')
    export class User {
      @PrimaryGeneratedColumn('uuid')
      id: string;
      
      @Column({ unique: true })
      @IsEmail()
      email: string;
      
      @Column()
      @Exclude() // Never expose password
      password: string;
      
      @Column()
      name: string;
      
      @Column({ default: 'user' })
      role: UserRole;
      
      @CreateDateColumn()
      createdAt: Date;
      
      @UpdateDateColumn()
      updatedAt: Date;
    }
    
  2. DTOs with Validation

    // create-user.dto.ts
    export class CreateUserDto {
      @IsEmail()
      @Transform(({ value }) => value.toLowerCase().trim())
      email: string;
      
      @IsString()
      @MinLength(8)
      @Matches(/^(?=.*[A-Za-z])(?=.*\d)/, {
        message: 'Password must contain letters and numbers'
      })
      password: string;
      
      @IsString()
      @MinLength(2)
      @MaxLength(50)
      name: string;
      
      @IsOptional()
      @IsEnum(UserRole)
      role?: UserRole;
    }
    
  3. **Service L

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл backend-api-development?

Comprehensive backend API development skill for building robust, scalable APIs. Use when creating new endpoints, services, or backend functionality. Keywords: API, backend, endpoint, service, REST, GraphQL, server, controller, route

Как установить скилл backend-api-development?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл backend-api-development запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить backend-api-development с