← Back to Skills Marketplace
yongjie666888

API Doc Writer

by yongjie666888 · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
1159
Downloads
0
Stars
4
Active Installs
2
Versions
Install in OpenClaw
/install api-doc-writer
Description
API接口文档助手。用于编写REST API文档、定义接口规范、生成接口说明。当需要编写API文档、接口规范时触发。
README (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过期机制
  • 接口调用频率限制
  • 参数校验过滤
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install api-doc-writer
  3. After installation, invoke the skill by name or use /api-doc-writer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
Continue publishing
v1.0.0
Initial release
Metadata
Slug api-doc-writer
Version 1.0.1
License MIT-0
All-time Installs 4
Active Installs 4
Total Versions 2
Frequently Asked Questions

What is API Doc Writer?

API接口文档助手。用于编写REST API文档、定义接口规范、生成接口说明。当需要编写API文档、接口规范时触发。 It is an AI Agent Skill for Claude Code / OpenClaw, with 1159 downloads so far.

How do I install API Doc Writer?

Run "/install api-doc-writer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is API Doc Writer free?

Yes, API Doc Writer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does API Doc Writer support?

API Doc Writer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created API Doc Writer?

It is built and maintained by yongjie666888 (@yongjie666888); the current version is v1.0.1.

💬 Comments