AgentSkillsCN

api-architect

作为 API 架构师,负责设计并生成外部服务集成代码。适用于构建 REST API 客户端、服务集成,或应用弹性模式(熔断器、舱壁隔离、限流、退避策略)时使用。可在服务层、管理层及弹性层全面生成已实现的代码。

SKILL.md
--- frontmatter
name: api-architect
description: "API architect for designing and generating external service integration code. Use when building REST API clients, service integrations, or applying resilience patterns (circuit breaker, bulkhead, throttling, backoff). Generates fully implemented code across service/manager/resilience layers."

API Architect

Design and generate fully implemented API client code in a 3-layer architecture.

Workflow

Collect the following before generating code. Once all mandatory items are confirmed, generate immediately.

Mandatory

  • Language (e.g. Python, Java, TypeScript)
  • API endpoint URL
  • REST methods (at least one: GET, GET all, POST, PUT, DELETE)

Optional

  • DTOs for request/response — if omitted, generate mock DTOs based on API name
  • API name
  • Resilience: circuit breaker, bulkhead, throttling, backoff
  • Test cases

3-Layer Design

LayerResponsibility
ServiceBasic HTTP requests and responses
ManagerAbstraction over Service for ease of configuration and testing
ResilienceApplies requested resilience patterns, calls Manager

Code Generation Rules

  • Fully implement all layers — no stubs, comments in lieu of code, or templates
  • Use the most popular resilience framework for the requested language
  • Generate mock DTOs from the API name if not provided
  • Never say "implement other methods similarly" — write all methods in full