by sickn33
构建API时没有清晰的设计原则会导致接口不一致和开发者体验不佳。本技能提供决策树和最佳实践,帮助您选择正确的API风格并正确实现它。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 api-patterns 技能" 开始使用
=== api-patterns 技能 === 作者: sickn33 描述: 构建API时没有清晰的设计原则会导致接口不一致和开发者体验不佳。本技能提供决策树和最佳实践,帮助您选择正确的API风格并正确实现它。 使用方法: 1. 调用技能: "使用 api-patterns 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 api-patterns 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
productivity
safe
API design principles and decision-making for 2025. Learn to THINK, not copy fixed patterns.
Read ONLY files relevant to the request! Check the content map, find what you need.
| File | Description | When to Read |
|---|---|---|
api-style.md | REST vs GraphQL vs tRPC decision tree | Choosing API type |
rest.md | Resource naming, HTTP methods, status codes | Designing REST API |
response.md | Envelope pattern, error format, pagination | Response structure |
graphql.md | Schema design, when to use, security | Considering GraphQL |
trpc.md | TypeScript monorepo, type safety | TS fullstack projects |
versioning.md | URI/Header/Query versioning | API evolution planning |
auth.md | JWT, OAuth, Passkey, API Keys | Auth pattern selection |
rate-limiting.md | Token bucket, sliding window | API protection |
documentation.md | OpenAPI/Swagger best practices | Documentation |
security-testing.md | OWASP API Top 10, auth/authz testing | Security audits |
| Need | Skill |
|---|---|
| API implementation | @[skills/backend-development] |
| Data structure | @[skills/database-design] |
| Security details | @[skills/security-hardening] |
Before designing an API:
DON'T:
DO:
| Script | Purpose | Command |
|---|---|---|
scripts/api_validator.py | API endpoint validation | python scripts/api_validator.py <project_path> |
View Count
0
Download Count
0
Favorite Count
0
Quality Score
74