AGENT SKILL

api-design

Design REST APIs following best practices - use when building endpoints

License 许可
MIT
所属仓库
11vated/Nexus
最近更新
2026-06-19
Stars
★ 0
Forks
0

01 前言 Front Matter

name
api-design
model
qwen2.5-coder:14b
tools
Read, Write
description
Design REST APIs following best practices - use when building endpoints

03 SKILL.md 正文

API Design Skill

REST Principles

  • Nouns for resources: /users, /orders
  • HTTP verbs: GET, POST, PUT, DELETE
  • Return proper status codes

Status Codes

  • 200 OK
  • 201 Created
  • 400 Bad Request
  • 401 Unauthorized
  • 404 Not Found
  • 500 Server Error

Example: Flask

@app.route('/api/users', methods=['GET'])
def get_users():
    return jsonify(users)

@app.route('/api/users', methods=['POST'])
def create_user():
    user = request.json
    return jsonify(user), 201

04 同仓库更多 Skills