重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
api-architect by erichowens/some_claude_skills
npx skills add https://github.com/erichowens/some_claude_skills --skill api-architect专注于 REST、GraphQL、gRPC 和 WebSocket 架构的 API 设计专家。
在以下情况激活: "API 设计"、"REST API"、"GraphQL 模式"、"gRPC 服务"、"OpenAPI"、"Swagger"、"API 版本控制"、"端点设计"、"速率限制"、"OAuth 流程"、"API 网关"
不适用于: 数据库模式 → data-pipeline-engineer | 前端消费 → web-design-expert | 部署 → devops-automator
| 领域 | 技术 |
|---|---|
| REST |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| OpenAPI 3.1, HATEOAS, 分页 |
| GraphQL | SDL, Relay, DataLoader, Federation |
| gRPC | Protocol Buffers, 流模式 |
| 安全 | OAuth 2.0, JWT, API 密钥, RBAC |
| 开发者体验 | Swagger UI, SDK 生成, 沙盒环境 |
Design Contract → Generate Stubs → Implement → Test Against Spec
success: { data: <resource>, meta: { page, total } }
error: { error: { code, message, details: [{ field, issue }] } }
/v1/users (最明确)Accept: application/vnd.api+json;version=1/users?version=1完整工作示例位于 ./references/:
| 文件 | 描述 | 行数 |
|---|---|---|
openapi-spec.yaml | 完整的 OpenAPI 3.1 规范 | 162 |
graphql-schema.graphql | 包含 Relay 连接的 GraphQL 模式 | 111 |
grpc-service.proto | Protocol Buffer,包含所有流模式 | 95 |
rate-limiting.yaml | 基于层级的速率限制配置 | 85 |
api-security.yaml | 认证、CORS、安全请求头 | 130 |
症状 : /getUsers, /createOrder, /deleteProduct
修复 : 使用名词 (/users, /orders),让 HTTP 方法表达动作
症状 : 有时返回 {data: [...]},有时返回原始数组
修复 : 始终使用一致的包装器结构
症状 : 移除字段、更改类型而不发出警告 修复 : 语义化版本控制、弃用请求头、日落期
症状 : 解析器为列表中的每个项目查询数据库
修复 : 使用 DataLoader 模式进行批处理,对大负载使用 @defer
症状 : /users 返回 50 个字段,而客户端只需要 3 个
修复 : 稀疏字段集 (?fields=id,name,email) 或使用 GraphQL
症状 : 列表端点返回所有记录
修复 : 默认限制、基于游标的分页、hasMore 指示器
症状 : 重复的 POST 请求创建重复的资源
修复 : 接受 Idempotency-Key 请求头,返回缓存的响应
症状 : 堆栈跟踪、SQL 错误暴露在 500 响应中 修复 : 生产环境使用通用错误消息,使用请求 ID 进行调试
症状 : 浏览器客户端因 CORS 错误被阻止 修复 : 明确配置允许的来源、方法和请求头
症状 : API 易受滥用攻击,没有使用可见性
修复 : 为每个层级实施限制,返回 X-RateLimit-* 请求头
运行 ./scripts/validate-api-spec.sh 以检查:
[ ] 所有端点使用名词,而非动词
[ ] 一致的响应包装器结构
[ ] 错误响应包含代码和可操作的提示信息
[ ] 所有列表端点都有分页
[ ] 认证/授权已记录
[ ] 速率限制请求头已定义
[ ] 版本控制策略已记录
[ ] 为已知来源配置了 CORS
[ ] 变更操作支持幂等性密钥
[ ] OpenAPI 规范验证无误
[ ] SDK 生成已测试
[ ] 所有请求/响应类型都有示例
Read, Write, Edit - 用于规范的文件操作Bash(npm:*, npx:*) - OpenAPI 代码检查、代码生成Bash(openapi-generator:*) - SDK 生成每周安装次数
56
代码仓库
GitHub 星标数
78
首次出现
Jan 23, 2026
安全审计
安装于
codex49
cursor49
opencode48
gemini-cli48
github-copilot45
cline40
Expert API designer specializing in REST, GraphQL, gRPC, and WebSocket architectures.
Activate on: "API design", "REST API", "GraphQL schema", "gRPC service", "OpenAPI", "Swagger", "API versioning", "endpoint design", "rate limiting", "OAuth flow", "API gateway"
NOT for: Database schema → data-pipeline-engineer | Frontend consumption → web-design-expert | Deployment → devops-automator
| Domain | Technologies |
|---|---|
| REST | OpenAPI 3.1, HATEOAS, Pagination |
| GraphQL | SDL, Relay, DataLoader, Federation |
| gRPC | Protocol Buffers, Streaming patterns |
| Security | OAuth 2.0, JWT, API Keys, RBAC |
| DX | Swagger UI, SDK generation, Sandboxes |
Design Contract → Generate Stubs → Implement → Test Against Spec
success: { data: <resource>, meta: { page, total } }
error: { error: { code, message, details: [{ field, issue }] } }
/v1/users (most explicit)Accept: application/vnd.api+json;version=1/users?version=1Full working examples in ./references/:
| File | Description | Lines |
|---|---|---|
openapi-spec.yaml | Complete OpenAPI 3.1 spec | 162 |
graphql-schema.graphql | GraphQL with Relay connections | 111 |
grpc-service.proto | Protocol Buffer, all streaming | 95 |
rate-limiting.yaml | Tier-based rate limit config | 85 |
api-security.yaml | Auth, CORS, security headers |
Symptom : /getUsers, /createOrder, /deleteProduct Fix : Use nouns (/users, /orders), let HTTP methods convey action
Symptom : {data: [...]} sometimes, raw arrays other times Fix : Always use consistent envelope structure
Symptom : Removing fields, changing types without warning Fix : Semantic versioning, deprecation headers, sunset periods
Symptom : Resolver queries database per item in list Fix : DataLoader pattern for batching, @defer for large payloads
Symptom : /users returns 50 fields when clients need 3 Fix : Sparse fieldsets (?fields=id,name,email) or GraphQL
Symptom : List endpoints return all records Fix : Default limits, cursor-based pagination, hasMore indicator
Symptom : Duplicate POST requests create duplicate resources Fix : Accept Idempotency-Key header, return cached response
Symptom : Stack traces, SQL errors exposed in 500 responses Fix : Generic error messages in production, request IDs for debugging
Symptom : Browser clients blocked with CORS errors Fix : Configure allowed origins, methods, headers explicitly
Symptom : API vulnerable to abuse, no usage visibility Fix : Implement limits per tier, return X-RateLimit-* headers
Run ./scripts/validate-api-spec.sh to check:
[ ] All endpoints use nouns, not verbs
[ ] Consistent response envelope structure
[ ] Error responses include codes and actionable messages
[ ] Pagination on all list endpoints
[ ] Authentication/authorization documented
[ ] Rate limit headers defined
[ ] Versioning strategy documented
[ ] CORS configured for known origins
[ ] Idempotency keys for mutating operations
[ ] OpenAPI spec validates without errors
[ ] SDK generation tested
[ ] Examples for all request/response types
Read, Write, Edit - File operations for specsBash(npm:*, npx:*) - OpenAPI linting, code generationBash(openapi-generator:*) - SDK generationWeekly Installs
56
Repository
GitHub Stars
78
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex49
cursor49
opencode48
gemini-cli48
github-copilot45
cline40
Lark Drive API 使用指南:飞书云文档、Wiki、表格 Token 处理与文件管理
48,300 周安装
多智能体结构化设计评审 - 智能体协作头脑风暴与设计验证流程
654 周安装
Gmail CLI 命令行工具:通过终端管理Gmail邮件、搜索和发送邮件
45 周安装
音频转录工具 - 自动将音频转换为Markdown文本,支持发言人识别和会议纪要生成
655 周安装
Azure Verified Modules (AVM) 认证要求详解:Terraform 模块开发规范与最佳实践
658 周安装
json-render生成式UI框架:AI驱动、多平台JSON渲染,安全构建动态界面
666 周安装
LinkedIn URL查找配方 - 集成GTM元技能,自动化处理社交网络数据
682 周安装
| 130 |