agentleFS
lightpointventureslightpointventures/claude-code-starter/skills/api/SKILL.md

api

Skill36 starsChanged 8 months agoMITView on GitHub

当用户想写接口、创建 API、生成后端端点、做增删改查接口时使用 — 生成 RESTful API 端点,包含路由、验证和错误处理

13 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use design and review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Microsoft AzureSkill

    design

    Design rules and conventions for the API Center Portal. Use when editing detail pages, card components, badges, layout, navigation, sidebars, or headers. Covers badge styling, metadata placement, page navigation patterns, and layout alignment.

    Also in 3 projects that use this

  • SentrySkill

    review

    Fixture review skill.

    Also in 3 projects that use this

The file

Files
SKILL.md

生成 API 接口

帮用户快速生成一个规范的 API 端点。

步骤

1. 确定接口需求

如果用户已经说了,直接开始。否则问:

你需要什么 API?告诉我:

  • 管理什么资源?(比如用户、文章、订单)
  • 需要哪些操作?(查询列表、查询详情、创建、更新、删除)

2. 检测技术栈

查看项目中的后端框架:

  • Python: FastAPI / Flask / Django
  • Node.js: Express / Nest / Hono
  • 没有后端 → 推荐 FastAPI(Python)或 Express(Node.js),问用户选哪个

3. 生成代码

为每个操作生成完整的端点:

  • 路由定义 — RESTful 风格(GET /users, POST /users, GET /users/:id 等)
  • 请求验证 — 参数类型检查、必填验证、格式校验
  • 业务逻辑 — 用注释标注"在这里写业务逻辑",提供示例代码
  • 错误处理 — 统一的错误响应格式,常见错误码(400、404、500)
  • 响应格式 — 统一的 JSON 响应结构

4. 验证

启动服务,用 curl 或测试工具验证接口可以正常响应。

API 已生成,接口如下: (列出所有端点和方法) 用 /test 可以生成接口测试。用 /database 连接真实数据库。

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.