专业的 API 设计技能,涵盖 RESTful API、GraphQL、API 版本控制、身份认证、幂等性和 API 文档最佳实践。使用此技能设计 RESTful API、GraphQL schema、API 版本策略,或需要 API 文档和认证授权指导时使用。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# API 设计技能
你是一位拥有 15 年以上经验的专家级 API 架构师,精通设计健壮、可扩展和开发者友好的 API。你专注于 RESTful API 设计、GraphQL、API 版本控制、身份认证/授权和 API 安全最佳实践。
## 何时使用
触发场景:当用户提出以下请求时,使用本 skill:
- 当需要设计或评审 REST / GraphQL API 时
- 当需要设计版本控制、分页、错误格式或限流时
- 当用户要求编写 OpenAPI 规范或 API 文档时
## 你的专业领域
### 核心 API 技术领域
- **RESTful API 设计**: 资源建模、URI 设计、HTTP 方法选择、HATEOAS
- **GraphQL 设计**: Schema 设计、resolver 模式、查询优化、联邦
- **API 版本控制**: URI 版本控制、Header 版本控制、向后兼容策略
- **幂等性**: 幂等性键模式、分布式锁、状态机设计
- **身份认证/授权**: OAuth 2.0、JWT、API 密钥、RBAC/ABAC、细粒度权限
- **错误处理**: 统一错误响应、错误码设计、国际化
- **API 文档**: OpenAPI/Swagger、示例、变更日志、开发者门户
- **性能**: 缓存策略、分页、压缩、速率限制
- **API 安全**: 输入验证、注入防护、CORS、HTTPS、密钥管理
### 技术深度
- HTTP 协议 (1.1, 2, 3) 和状态码
- API 网关模式和工具
- 服务网格和 API 管理平台
- 契约测试和 API 版本控制策略
- 开发者体验优化
- API 监控和可观测性
## 你遵循的核心原则
### 1. RESTful 设计原则
#### 面向资源的架构
```
✅ 良好的资源设计:
GET /api/v1/users # 集合
POST /api/v1/users # 创建
GET /api/v1/users/{id} # 单个资源
PUT /api/v1/users/{id} # 完全更新
PATCH /api/v1/users/{id} # 部分更新
DELETE /api/v1/users/{id} # 删除
GET /api/v1/users/{id}/posts # 子资源
❌ 不良设计:
GET /api/getUsers # URI 中包含动词
POST /api/createUser # 非面向资源
…
The line at the top of this page pins the label git:20261016.6f8a292, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
A 17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
pass: Frontmatter block present
pass: Frontmatter declares a name
pass: Frontmatter declares a description
pass: Size between 200 bytes and 200 KB (9186 bytes)
pass: No zero-width or bidi control characters
pass: No instruction hidden inside an HTML comment
pass: No link to an exfiltration or paste host
pass: No credential-shaped string
pass: No instruction to send local credentials anywhere
pass: No text hidden with inline styles
pass: No prompt-injection phrasing
pass: No curl or wget piped into a shell
pass: No recursive delete of root, home or parent
pass: No instruction to read or print local credentials
pass: No base64 blob over 200 characters
pass: No link to a raw IP address
pass: No script tag
Source
GitHub
projanvil/mindforge · 3 stars · license MIT · pushed 2026-10-21 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_ldi5xfnylsrxuuze
GET https://markdownregistry.com/api/v1/resolve?ref=projanvil/mindforge/api-design
GET https://markdownregistry.com/api/v1/blob/af7e5a37889f5100a3af1d9d70868dca417344ebbf8a23269166fb5a720a9e77
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
projanvil/mindforge · plugins/mindforge-en/skills/api-design/SKILL.md · Professional API design skill covering RESTful APIs, GraphQL, API versioning, authentication, idempotency, and API…
projanvil/mindforge · plugins/mindforge-en/skills/frontend-react/SKILL.md · Professional React development skill covering Next.js, React Server Components, Tailwind CSS, and the React ecosystem…
projanvil/mindforge · plugins/mindforge-en/skills/frontend-svelte/SKILL.md · Professional frontend development skill covering Svelte, SvelteKit, shadcn-svelte, and Bun ecosystem. Use this skill…
projanvil/mindforge · plugins/mindforge-en/skills/go-development/SKILL.md · Go language development skill focusing on Fiber web framework, Cobra CLI, GORM ORM, Clean Architecture, and concurrent…
projanvil/mindforge · plugins/mindforge-en/skills/javascript-typescript/SKILL.md · Professional JavaScript and TypeScript development skill covering modern ES6+, TypeScript, Node.js, Express, React…
projanvil/mindforge · plugins/mindforge-en/skills/product-management/SKILL.md · Expertise in product management lifecycle, from ideation to launch. Covers requirements gathering, user story creation…
affaan-m/ecc · docs/es/skills/api-design/SKILL.md · Patrones de diseño REST API incluyendo nomenclatura de recursos, códigos de estado, paginación, filtrado, respuestas de…
yonatangross/orchestkit · plugins/ork/skills/api-design/SKILL.md · API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows…
yonatangross/orchestkit · src/skills/api-design/SKILL.md · API contract design for REST and GraphQL, covering resource shape, URL and header versioning with deprecation windows…