← 返回 Skills 市场
yongjie666888

API Doc Writer

作者 yongjie666888 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ 安全检测通过
1159
总下载
0
收藏
4
当前安装
2
版本数
在 OpenClaw 中安装
/install api-doc-writer
功能描述
API接口文档助手。用于编写REST API文档、定义接口规范、生成接口说明。当需要编写API文档、接口规范时触发。
使用说明 (SKILL.md)

API接口文档助手

API文档模板

# API接口文档

版本:V1.0
更新日期:YYYY-MM-DD
维护人:XXX

---

## 接口概览

| 模块 | 接口数 | 负责人 |
|------|--------|--------|
| 用户模块 | 5 | @xxx |
| 订单模块 | 8 | @xxx |
| 支付模块 | 4 | @xxx |

---

## 通用说明

### 认证方式

Authorization: Bearer \x3Ctoken>


### 请求格式

Content-Type: application/json


### 响应格式
```json
{
  "code": 0,
  "message": "success",
  "data": {}
}

状态码

状态码 说明
0 成功
1001 参数错误
2001 未授权
3001 资源不存在
5001 服务器错误

接口详情

1. 用户接口

1.1 获取用户信息

接口地址

GET /api/v1/users/{id}

请求参数

参数名 类型 位置 必填 说明
id long path 用户ID

请求示例

GET /api/v1/users/123

响应示例

{
  "code": 0,
  "message": "success",
  "data": {
    "id": 123,
    "name": "张三",
    "email": "[email protected]",
    "phone": "13800138000",
    "created_at": "2024-01-01 10:00:00"
  }
}

错误示例

{
  "code": 3001,
  "message": "用户不存在",
  "data": null
}

1.2 创建用户

接口地址

POST /api/v1/users

请求参数

参数名 类型 必填 说明
name string 用户名
email string 邮箱
phone string 手机号
password string 密码

请求示例

{
  "name": "张三",
  "email": "[email protected]",
  "phone": "13800138000",
  "password": "123456"
}

响应示例

{
  "code": 0,
  "message": "success",
  "data": {
    "id": 123,
    "name": "张三"
  }
}

2. 订单接口

2.1 订单列表

接口地址

GET /api/v1/orders

请求参数

参数名 类型 位置 必填 说明
page int query 页码,默认1
page_size int query 每页数量,默认20
status string query 订单状态

请求示例

GET /api/v1/orders?page=1&page_size=10&status=paid

响应示例

{
  "code": 0,
  "message": "success",
  "data": {
    "total": 100,
    "page": 1,
    "page_size": 10,
    "list": [
      {
        "id": "ORD202401010001",
        "user_id": 123,
        "amount": 100.00,
        "status": "paid",
        "created_at": "2024-01-01 10:00:00"
      }
    ]
  }
}

接口变更记录

版本 日期 变更内容 变更人
V1.0 YYYY-MM-DD 初始版本 @xxx
V1.1 YYYY-MM-DD 新增xxx接口 @xxx

## 接口设计原则

### RESTful规范
| 方法 | 用途 | 示例 |
|------|------|------|
| GET | 查询 | GET /users |
| POST | 创建 | POST /users |
| PUT | 完整更新 | PUT /users/1 |
| PATCH | 部分更新 | PATCH /users/1 |
| DELETE | 删除 | DELETE /users/1 |

### URL命名规范
```markdown
- 使用名词复数:/users
- 使用小写:/user-info
- 使用连字符分隔:/order-details
- 避免动词:不用 /getUser

状态码规范

类别 状态码 说明
1xx 信息 接收的请求正在处理
2xx 成功 请求正常处理完毕
3xx 重定向 需要附加操作完成请求
4xx 客户端错误 请求有语法错误
5xx 服务器错误 服务器处理出错

安全建议

  • 敏感信息加密传输
  • 身份验证Token过期机制
  • 接口调用频率限制
  • 参数校验过滤
安全使用建议
This skill appears to be a harmless documentation/template helper and is internally consistent. Before installing, consider: (1) the source is unknown—prefer skills from trusted authors or with a homepage; (2) never paste real secrets or production tokens into sample requests/examples; (3) review generated docs for organization-specific policies (auth, error codes, naming conventions); (4) if the skill later asks for environment variables or to run code, re-evaluate permissions. Overall, it's low-risk as provided.
功能分析
Type: OpenClaw Skill Name: api-doc-writer Version: 1.0.1 The skill bundle is a documentation assistant for writing REST API specifications. It contains only Markdown templates and design guidelines in SKILL.md, with no executable code, network requests, or instructions that could lead to data exfiltration or unauthorized system access.
能力评估
Purpose & Capability
Name and description (API doc writer) align with the SKILL.md content: templates, examples, and guidelines for REST API documentation. No unrelated capabilities or external services are requested.
Instruction Scope
SKILL.md contains only templates, examples, and design guidance for API docs. It does not instruct the agent to run commands, read files, access environment variables, or contact external endpoints.
Install Mechanism
No install spec or code files are present. Being instruction-only means nothing is written to disk or installed; this is the lowest-risk install model.
Credentials
The skill declares no required environment variables, credentials, or config paths. There is no disproportionate or unexplained secret access requested.
Persistence & Privilege
always:false and default invocation settings. The skill does not request persistent/system-level privileges or modifications to other skills or configs.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install api-doc-writer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /api-doc-writer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
Continue publishing
v1.0.0
Initial release
元数据
Slug api-doc-writer
版本 1.0.1
许可证 MIT-0
累计安装 4
当前安装数 4
历史版本数 2
常见问题

API Doc Writer 是什么?

API接口文档助手。用于编写REST API文档、定义接口规范、生成接口说明。当需要编写API文档、接口规范时触发。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1159 次。

如何安装 API Doc Writer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install api-doc-writer」即可一键安装,无需额外配置。

API Doc Writer 是免费的吗?

是的,API Doc Writer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

API Doc Writer 支持哪些平台?

API Doc Writer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 API Doc Writer?

由 yongjie666888(@yongjie666888)开发并维护,当前版本 v1.0.1。

💬 留言讨论