Whenever I add, update, or delete an API in this collection, your job is to automatically sync API_DOC.md (or a specified markdown file) to reflect the latest state of all APIs.
Watch for any of these:
- New
.yml/.brufile added to any folder - Existing
.yml/.brufile modified (endpoint, method, request body, response changed) .yml/.brufile deleted- New group/folder created (= new API group)
When any of the above happens — re-read all collection files and regenerate the affected sections in the markdown doc.
Always write the final result to:
API_DOC.md
(Unless I tell you a different filename.)
Use this EXACT structure every time:
# [Project Name] — API Documentation
> 🌐 **Base URL:** `http://localhost:3000`
> 📅 **Last Updated:** [date]
---
### Table of Contents
- [Group Name](#group-name)
- [API 01: Action Name](#api-01-action-name)
- [API 02: Action Name](#api-02-action-name)
---
### Group Name
<a id="api-01-action-name"></a>
<details>
<summary style="padding: 8px; font-size: 16px; background-color: #f0f6ff; margin-bottom: 8px;">
API 01: Action Name
</summary>
#### Endpoint:
```text
METHOD http://localhost:3000/api/path
```
#### Request:
```json
{
"field": "value"
}
```
#### Response:
```json
{
"field": "value"
}
```
</details>
---- Number APIs sequentially across the entire document:
API 01,API 02,API 03, etc. - When a new API is added, assign the next available number
- When an API is deleted, do NOT renumber existing ones — keep gaps to avoid breaking links
- The number is part of the anchor ID (e.g.
api-01-action-name)
- Each
<details>block must be preceded by<a id="api-XX-action-name"></a> - TOC links must match these anchor IDs exactly (lowercase, hyphens only)
- Always regenerate the full TOC after any change
- Group endpoints under their collection file/folder name
- Always wrap each endpoint inside
<details>+<summary>HTML tags - Use this exact
<summary>style:style="padding: 8px; font-size: 16px; background-color: #f0f6ff; margin-bottom: 8px;" - Summary text shows only the API number and action name:
API 01: Action Name - Everything (endpoint, request, response) goes between
<details>and</details>
Every API response must follow this base structure — no exceptions:
{
"error": false,
"message": "...",
"data": {}
}error— alwaysfalsefor success responsesmessage— a short human-readable status string (e.g."Profile updated successfully")data— the actual response payload as an object/dict, ornullif there is no payload to return
- Endpoint: — always a
```textblock showingMETHOD full-url - Request: — a
```jsoncblock with inline//comments on every field. Formultipart/form-data, use```textand list the fields with inline comments. Omit this section entirely for GET requests with no body. - Response: — a
```jsonblock with the expected response body (no comments needed)
Every field in the Request block must have a trailing // comment in this format:
"field": "value" // required|optional | type | special notes (if any)
- required/optional —
requiredif the field must always be present,optionalif it can be omitted - type —
string,number,boolean,array,object,file - special notes — only add if there is a format rule, value constraint, or enum (e.g.
YYYY-MM-DD format,min 6 characters,"host" or "driver",image (PNG, JPG)) - Use
jsonc(JSON with Comments) as the code block language for all Request blocks
- Always use
---between each endpoint block - Always use
---after the TOC
- Use
###(h3) for group section headers — no emojis - Example:
### Auth,### Profile,### User Documents
- Always update the
📅 Last Updateddate at the top when the file is modified
meta {
name: Create User
type: http
}
post {
url: {{baseUrl}}/api/add
}
headers {
Content-Type: application/json
}
body:json {
{
"name": "Dedar",
"age": 25
}
}
info:
name: Create User
type: http
seq: 1
http:
method: POST
url: http://localhost:3000/api/add
headers:
- name: Authorization
value: Bearer <token>
body:
type: json
data: |
{
"name": "Dedar",
"age": 25
}Parsing rules:
info.name/meta.name→ endpoint action namehttp.method/get|post|put|deleteblock → HTTP methodhttp.url/ url field → full endpoint URLhttp.body.data/body:jsonblock → request body (parse as JSON)http.body.type: multipart-form→ use text block listing field names- File/folder name → API group name
I added a new API in the Profile group called Delete Profile. Update the docs.
I updated the request body of Update Profile. Sync the markdown.
I deleted the Get Profile endpoint. Remove it from the docs.
Regenerate the full API doc from scratch based on all collection files.
If running for the first time, say:
Read all .yml (or .bru) files in this project and generate the full API documentation in API_DOC.md