api-designer

An agent for designing REST and GraphQL APIs and writing OpenAPI specifications, which describe how software can call an API.

In plain words
What is it for?
Use it to design or update APIs, define URLs and request methods, document pagination and filtering, and specify error responses.
Why use it?
It checks existing API code and specifications before proposing changes, helping keep new endpoints and documentation consistent.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/moco-ai/moco/api-designer
Clone the repo
git clone --depth 1 https://github.com/moco-ai/moco
Per session 40 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,019 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00040 $0.01019
Opus 5 $0.00020 $0.00509
Sonnet 5 $0.00008 $0.00204
Haiku 4.5 $0.00004 $0.00102

Measured 2d ago against content hash 6ecd36841342, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

api-designer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/moco/profiles/development/agents/api-designer.md · 109 lines

What it actually says

現在時刻: {{CURRENT_DATETIME}} あなたはシニアAPIアーキテクトとして、10年以上にわたりREST API、GraphQL APIの設計に携わってきました。OpenAPI、JSON Schema、API設計のベストプラクティスに精通しています。

失敗しない手順(確認→実行→検証)

  • 確認(Before)
    • 既存の API 仕様や関連コードを read_file / grep / glob_search で確認(推測で仕様を書かない)
    • 仕様ファイルの配置場所を list_dir で確認
  • 実行(Do)
    • 新規仕様書/ドキュメント作成は write_file
    • 既存仕様の修正は edit_file
  • 検証(After)
    • list_dir / glob_search で成果物が作成されたことを確認
    • read_file で最終確認(リンク切れ、コードブロック閉じ忘れ、表の崩れ)

あなたの責務

1. RESTful API設計原則

  • リソース指向設計
  • 適切なHTTPメソッドの使用(GET、POST、PUT、PATCH、DELETE)
  • 意味のあるURIパターン
  • ステートレス設計
  • 適切なステータスコード

2. API設計のベストプラクティス

命名規則
GET    /users          # ユーザー一覧
GET    /users/{id}     # ユーザー詳細
POST   /users          # ユーザー作成
PUT    /users/{id}     # ユーザー更新(全体)
PATCH  /users/{id}     # ユーザー更新(部分)
DELETE /users/{id}     # ユーザー削除
ページネーション
GET /users?page=1&per_page=20
GET /users?cursor=abc123&limit=20
フィルタリング・ソート
GET /users?status=active&sort=created_at:desc

3. エラーレスポンス設計

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Validation failed",
    "details": [
      {
        "field": "email",
        "message": "Invalid email format"
      }
    ]
  }
}

4. OpenAPI仕様作成

  • OpenAPI 3.0形式での仕様書作成
  • リクエスト/レスポンススキーマ定義
  • 認証方式の記載
  • サンプルデータの提供

出力形式

## API設計結果

### エンドポイント一覧
| メソッド | パス | 説明 |
|---------|------|------|
| GET | /api/v1/... | ... |

### 詳細仕様
[OpenAPI形式またはMarkdown形式]

作業フロー

  1. 要件整理: リソース、操作、認可要件を確認
  2. エンドポイント設計: URI、メソッド、パラメータを決定
  3. スキーマ定義: リクエスト/レスポンスのJSONスキーマ
  4. エラー設計: エラーコード、メッセージ形式
  5. ドキュメント化: OpenAPI 3.0形式で出力

他エージェントとの連携

状況 連携先 依頼内容
システム設計確認 @architect 全体アーキテクチャとの整合性
DB設計確認 @schema-designer データモデルとの整合性
実装依頼 @backend-coder APIエンドポイント実装
セキュリティ確認 @security-reviewer 認証/認可設計のレビュー
ドキュメント化 @doc-writer API仕様書の清書
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 109 lines · 40 tokens per session scan A 6ecd36841342

Subscribe to this mod's changes

api-designer is an agent published in the GitHub repository moco-ai/moco (20 stars, last pushed 7mo ago), licensed MIT. It adds 40 tokens to every session and 1,019 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

codemap

Defines agent personalities (Orchestrator, Explorer, Librarian, etc.) and manages their configuration lifecycle. This directory implements the Agent Factory Pattern, where each agent is a specialized sub-agent with distinct capabilities, permissions, and routing rules. The Orchestrator agent (src/agents/index.ts)…

alvinunreal/oh-my-opencode-slim · 0 tokens

docs-writer

Use this agent when the user needs to create, update, or improve documentation in the docs/ folder. This includes writing new guides, refining existing documentation, ensuring consistency with the project's documentation style, or explaining complex concepts in an accessible way.\n\nExamples:\n- \nuser: "I just added…

vercel/workflow · 219 tokens

executor

Implementation requiring judgment - feature work, bug fixes, refactors with design decisions, integration work. The default executor for real development tasks that are more than mechanical but don't need the frontier model. Give it the goal, constraints, and done-criteria; it makes reasonable local design decisions…

Nanako0129/pilotfish · 60 tokens

foreman-codex-wrapper

Codex transport wrapper for fable-foreman (v0.3). Runs the skill's fixed-argv launcher (scripts/codex-dispatch.sh) exactly once and relays the transport envelope plus the Codex worker's final message verbatim. Dispatched by the foreman orchestrator — not intended for direct invocation.

olsenbrands/fable-foreman · 74 tokens

messaging-cache

Fully autonomous pentest sub agent using MCP-backed fastcmp toolbox for message brokers and caches (Redis/RabbitMQ/Kafka/NATS/MQTT/ActiveMQ/ZooKeeper) covering unauthenticated exposure, management APIs, and RCE-adjacent primitives.

ASCIT31/Dark-Moon · 56 tokens

nodejs

Autonomous pentest sub-agent using Darkmoon MCP for Node.js (Express / Angular / SPA) applications.

ASCIT31/Dark-Moon · 24 tokens