api-client

Enforce Client + Service boundaries for HTTP API integrations.

33|5|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/ocbunknown/fastapi-claude-template --skill api-client-ocbunknown
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-client
Source: https://github.com/ocbunknown/fastapi-claude-template/tree/main/.claude/skills/api-client
Command: npx skills add https://github.com/ocbunknown/fastapi-claude-template --skill api-client-ocbunknown

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

External HTTP API integrations often leak vendor-specific logic into domain code. This Skill enforces a clean Client + Service boundary so infrastructure vendors return raw DTOs while a dedicated application service maps them into stable application results.

Core Features & Use Cases

  • Client + Service split: Client lives in infrastructure and returns vendor-shaped responses; Service consumes the client and translates data into application results.
  • Layering guidance: Defines where to place ports, vendor enums, raw response DTOs, and how to wire DI so domain logic stays vendor-agnostic.
  • Use-case patterns: Use service-backed workflows, or opt for direct client port access for debugging or admin tasks, with guardrails to keep domain boundaries intact.
  • Vendor examples: Patterns apply to Stripe, GitHub, Twilio, and other HTTP providers.

Quick Start

Start by implementing a vendor-specific Client in infrastructure, a corresponding Service in application, and wire them through your DI container.

Frequently Asked Questions about api-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent vendor DTOs from leaking into domain logic when integrating external HTTP APIs?

To prevent vendor DTOs from leaking into domain logic, enforce a Client and Service boundary where infrastructure clients return raw vendor responses and application services map them into stable application results.

What is the best way to structure dependency injection for external API integrations?

Structure dependency injection for API integrations by having application services depend on a stable port interface rather than concrete vendor clients, keeping use cases vendor-agnostic and mapping data to persistence types or results.

Does this API integration pattern work with Stripe, GitHub, and Twilio integrations?

This API integration pattern works with Stripe, GitHub, Twilio, and other HTTP providers by applying a consistent Client and Service split to isolate vendor-specific logic from domain code.

When do I need a dedicated application service for an HTTP API integration?

You need a dedicated application service for an HTTP API integration when you must translate raw vendor responses into application results and keep domain logic separated from infrastructure concerns.

Can I access a vendor client directly for admin tasks without breaking the service boundary?

You can access a vendor client port directly for debugging or admin tasks, provided you follow guardrails to keep domain boundaries intact and avoid leaking vendor-specific logic into use cases.