skills/backend-api-documenter/SKILL.md
Automatically generate comprehensive backend API documentation in AGENTS.md format. Use when the user requests to: (1) Document backend API endpoints, (2) Update backend API specifications after code changes, (3) Create or refresh backend/AGENTS.md with complete API documentation including request/response schemas, business rules, and authentication details, (4) Generate API documentation from FastAPI route files
npx skillsauth add realroc/skills backend-api-documenterInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate comprehensive backend API documentation by reading FastAPI route files and schema definitions, then creating detailed specifications in backend/AGENTS.md.
Read all backend API route files to identify:
Key files to read:
backend/app/api/v1/*.py - All API route filesbackend/app/schemas/*.py - Request/response schema definitionsbackend/CLAUDE.md - Backend-specific specifications (if exists)Optional helper script:
python3 scripts/scan_api_routes.py ./backend
For each endpoint, extract:
Structure documentation following this hierarchy:
1. Module Overview
Base路径: /api/v1/module
1.1 Endpoint Name
- 接口 (Interface)
- 描述 (Description)
- 请求头 (Request Headers)
- 请求体 (Request Body) with field descriptions
- 响应体 (Response Body) with field descriptions
- 错误响应 (Error Responses)
- 权限要求 (Authorization)
- 业务规则 (Business Rules)
Always include these appendices at the end:
See doc_template.md for complete template structure.
Write the complete documentation to backend/AGENTS.md:
> **Inherits from**: [Root AGENTS.md](../AGENTS.md)For every field in request/response schemas, document:
field_name (string, int, float, bool, array, object)Example:
- `email` (string, optional): User email address, must be valid email format, max 255 characters
- `reward_amount` (float, required): Task reward amount, must be > 0, max 100000
- `status` (string, required): Task status, possible values: published/in_progress/completed/expired
- `location` (object, optional): GeoJSON Point format with coordinates [longitude, latitude]
**请求头**:
Authorization: Bearer {access_token}
或
X-API-Key: {api_key}
**权限要求**: 需要人类用户认证(JWT Token) 或 需要代理认证(API Key)
**错误响应**:
验证失败(400):
```json
{
"success": false,
"code": "INVALID_INPUT",
"message": "输入参数无效",
"data": null
}
未授权(401):
{
"success": false,
"code": "UNAUTHORIZED",
"message": "未授权",
"data": null
}
### Business Rules Documentation
```markdown
**业务规则**:
- 只有任务所有者可以更新
- 创建任务时会锁定相应金额
- 任务发布后立即可见
- 评分范围: 1.0-5.0
development
Screen MongoDB conversation collections for script-driven abuse (prompt-injection templates, curl/empty user agents, probe-word floods, sessionless calls, multi-account IPs). Produces a two-tier triage report (confirmed abuse / suspicious) plus a multi-account IP list and a ban candidate CSV. Use when asked to find script callers, prompt-injection attempts, abnormal high-frequency users, accounts bypassing the web UI, or "who is using my AI as a cron job".
development
Audit or rewrite a prompt into a six-section issue spec (Goal / Constraints / Non-goals / Verification / Architecture notes / Existing context) before any code gets generated. Use when the user pastes a vague request and asks for implementation, or explicitly says they want to frame an issue properly. Triggers on: prompt spec, audit this prompt, check my prompt, what's missing in this prompt, frame this issue, rewrite as a prompt spec, convert to issue spec, make this an issue, issue framing.
testing
GitHire's six-step AI-native engineering method: frame the issue, sandbox, AI execute, AI review, architect decision, ship. Use when planning or executing real work with AI agents — issue framing, prompt writing, PR review gating, architect handoff — or anytime humans-frame-AI-execute-architects-verify applies. Triggers on: use githire, githire methodology, issue-first onboarding, ai-native workflow, frame this issue, prompt spec, architect review, first PR for a candidate, hire through real PRs.
development
Geolocate a batch of IPv4 addresses and produce a Markdown distribution table — Chinese IPs broken down by province (incl. HK/MO/TW), foreign IPs by country, with counts and percentages. Optionally exports CSV. Uses the free ip-api.com batch endpoint (no key, no signup, HTTP only, 15 batches × 100 IPs per minute). Use when the user pastes a list of IPs and asks for "IP 分布", "IP 归属地分布", "省份分布", "where are these IPs from", "geolocate these IPs", or wants an IP-region breakdown table.