api-design

api-design is a skill for Claude Code from cass-2003/local-workflow-skill. It costs 46 tokens per session (2,769 once invoked), scanned A, original, MIT.

An API design guide for planning interfaces that software uses to exchange data, including REST, GraphQL, gRPC, and WebSocket APIs.

In plain words
What is it for?
Use it to analyze API requirements, design resources and schemas, write OpenAPI specifications or code, test interface behavior, and check API or GraphQL security.
Why use it?
It helps avoid inconsistent URLs, schemas, authentication, pagination, and other choices that make an API difficult or unsafe to use.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to analyze API requirements, design resources and schemas, write OpenAPI specifications or code, test interface behavior, and check API or GraphQL security.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/api-design
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.

Any agent
npx skills add cass-2003/local-workflow-skill --skill api-design
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/api-design/github.svg)](https://agentmods.dev/skills/cass-2003/local-workflow-skill/api-design)
Your own site
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/api-design"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/api-design/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-design

Your own site · 80×15
<a href="https://agentmods.dev/skills/cass-2003/local-workflow-skill/api-design"><img src="https://agentmods.dev/badge/skills/cass-2003/local-workflow-skill/api-design.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,769 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00046 $0.02769
Opus 5.5 $0.00018 $0.01108
Sonnet 5.5 $0.00009 $0.00554
Haiku 4.5 $0.00005 $0.00277

Measured 1mo ago against content hash ae1a1b205eb7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

api-design scanned grade A with 1 finding 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 1mo 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

| 测试 API | Bash (curl/httpie) / mcp__fetch__fetch | — |
skills/backend-api/codex/api-design/SKILL.md · 447 lines

How it starts

The opening of the file, as written. The whole thing — 447 lines — stays where its author put it; the contents beside it link to each section on GitHub.

API 设计

角色定义

你是 API 架构师,精通 RESTful/GraphQL/gRPC 设计。目标:设计一致、安全、易用的 API。

行为指令

  1. 需求分析: 确认 API 类型(REST/GraphQL/gRPC)、消费者、性能要求
  2. 设计: 资源建模 → URL/Schema 设计 → 认证方案
  3. 实现: 编写 OpenAPI spec 或代码
  4. 验证: 测试接口行为、安全检查

工具策略

任务 首选工具 备选
读取现有 API Read —
编写 Schema Edit / Write —
测试 API Bash (curl/httpie) / mcp__fetch__fetch —
API 安全扫描 mcp__redteam__full_api_scan —
GraphQL 扫描 mcp__redteam__graphql_scan —

决策树

API 类型?
├── RESTful (默认推荐)
│   ├── 资源 CRUD → 标准 HTTP 方法
│   ├── 文档 → OpenAPI 3.1
│   ├── 版本 → URL 前缀 /v1/ (简单) 或 Header (灵活)
│   └── 分页 → cursor-based (推荐) 或 offset
├── GraphQL
│   ├── 适用 → 多端消费、嵌套数据、灵活查询
│   ├── 注意 → N+1 (DataLoader)、深度限制、复杂度限制
│   └── 工具 → Apollo / Yoga
├── gRPC
│   ├── 适用 → 微服务内部、高性能、流式
│   ├── 定义 → .proto 文件
│   └── 注意 → 浏览器不直接支持(需 gRPC-Web)
└── WebSocket
    ├── 适用 → 实时推送、双向通信
    └── 协议 → WS/WSS

RESTful 设计规范

规则 示例
名词复数 GET /users (非 /getUsers)
嵌套资源 GET /users/123/orders
筛选排序 ?status=active&sort=-created_at
分页 ?cursor=abc&limit=20
字段选择 ?fields=id,name,email

HTTP 方法语义

方法 幂等 安全 用途 成功状态
GET 是 是 查询 200
POST 否 否 创建 201
PUT 是 否 全量更新 200
PATCH 否 否 部分更新 200
DELETE 是 否 删除 204

标准响应格式

{
  "data": { ... },
  "error": null,
  "meta": { "page": 1, "total": 100 }
}
{
  "data": null,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid email format",
    "details": [{"field": "email", "reason": "must be valid email"}]
  }
}

认证方案对比

方案 适用场景 复杂度
API Key 服务间调用 低
JWT (Bearer) 用户认证 中
OAuth 2.0 第三方授权 高
mTLS 微服务零信任 高

安全清单

  • HTTPS 强制
  • 认证 + 授权(RBAC/ABAC)
  • 输入校验 + 输出编码
  • 限流(per-user/per-IP)
  • CORS 白名单(非 *)
  • 敏感字段脱敏(日志/响应)
  • 请求大小限制

输出格式

## API 规范文档

### 概述
- **API 类型**: REST / GraphQL / gRPC
- **基础路径**: `https://api.example.com/v1`
- **认证方式**: Bearer JWT / API Key / OAuth 2.0

### 端点定义
| 方法 | 路径 | 描述 | 请求体 | 响应 |
|------|------|------|--------|------|

### 数据模型
```json
{
  "field": "type — 说明"
}

错误码

HTTP 状态 错误码 描述

安全要求

  1. [认证/授权/限流等]

变更记录

版本 变更 日期

Read the full file on GitHub · 447 lines

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. 1mo ago First seen · 447 lines · 46 tokens per session scan A ae1a1b205eb7

Subscribe to this mod's changes

api-design is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 3mo ago), licensed MIT. It adds 46 tokens to every session and 2,769 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan, then execute, a migration of a project from the mem0 open-source / self-hosted SDK (local Memory class) to the mem0 Platform / hosted SDK (MemoryClient). TRIGGER when: the developer wants to move, switch, or migrate mem0 off OSS/self-hosted to the hosted API, e.g. "migrate my mem0 setup to the platform", "switch…

mem0ai/mem0 · 217 tokens

agui-dotnet-protobuf

Use the protobuf wire transport (instead of the default Server-Sent Events) for an AG-UI connection with the AG-UI .NET SDK — a compact binary event stream negotiated via the Accept header. USE FOR: making an AGUIChatClient prefer protobuf by wiring an AGUIEventStreamHandler with ProtobufEventStreamFormatter (then…

ag-ui-protocol/ag-ui · 162 tokens

azure-mgmt-botservice-dotnet

Azure Resource Manager SDK for Bot Service in .NET. Management plane operations for creating and managing Azure Bot resources, channels (Teams, DirectLine, Slack), and connection settings. Triggers: "Bot Service", "BotResource", "Azure Bot", "DirectLine channel", "Teams channel", "bot management .NET", "create bot".

microsoft/skills · 78 tokens

fastapi-router-py

Create FastAPI routers with CRUD operations, authentication dependencies, and proper response models. Use when building REST API endpoints, creating new routes, implementing CRUD operations, or adding authenticated endpoints in FastAPI applications.

microsoft/skills · 46 tokens

dev-runtime

How the Node side of a dev stack runs without haven, and the backend host: pnpm dev (UI built once, backend reloading), pnpm dev:hmr (adds the Vite ui lane), tools/dev-runtime (api + worker in one Node process), backend reload on a file change, the debounce (quiet window + max wait), ports derived from PORT. Use when…

langwatch/langwatch · 172 tokens

migrate-segw-to-rap

Reverse-engineer a SEGW-built OData V2 service (MPC/DPC/MPCEXT/DPCEXT) into a modern RAP V4 service — tables, CDS views (interface + projection), behavior definitions, draft entities, service definition + binding. Use when asked to "migrate this SEGW service to RAP", "convert OData V2 to V4 RAP", "modernize this…

arc-mcp/arc-1 · 106 tokens