Add api integration

From jujunjun110/product-starter · View interactive version

Add api integration is an AI agent skill from the GitHub repository jujunjun110/product-starter. 外部APIとの連携を追加する。Gateway interface + 本番実装 + Stub実装を生成する

How to use this skill

Skill file

外部API連携追加スキル

ユーザーが「〇〇APIと連携して」「〇〇サービスを使いたい」と指示したときに適用する。

生成するファイル(3ファイルセット)

  1. Gateway Interface (src/backend/domain/gateways/{name}.gateway.ts)
  1. 本番実装 (src/backend/infrastructure/adapters/{provider}-{name}.adapter.ts)
  1. Stub 実装 (src/backend/infrastructure/adapters/stub-{name}.adapter.ts)
  1. Composition の更新 (src/backend/presentation/composition/{name}.composition.ts)

```typescript

const apiKey = process.env.{SERVICE}_API_KEY;

const gateway = apiKey ? new RealGateway(apiKey) : new StubGateway();

```

ルール

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.