API Documentation Generator — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited API Documentation Generator (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill reads REST API route handlers (Express, FastAPI, Go net/http, Rails, Django, or any framework) and generates complete OpenAPI 3.0 YAML documentation. It extracts paths, HTTP methods, path/query/body parameters, response shapes, and error codes, then writes properly structured YAML with example request and response bodies. The output can be loaded directly into Swagger UI, Redoc, or any OpenAPI-compatible tool.
Use this when you have undocumented API code and need to produce accurate, usable API documentation quickly.
Copy this file to .agents/skills/api-docs-generator/SKILL.md in your project root.
Then point the agent at your routes file and ask:
The agent will read the route files and any referenced handler functions to extract parameter and response shapes.
Add the "Prompt / Instructions" section to your .cursorrules file. Open your routes file in the editor and ask Cursor to generate the OpenAPI YAML.
Paste your route definitions and handler code into the chat along with the instructions below. Include type definitions or schema files if they exist — they help Codex produce accurate request/response schemas.
When asked to generate API documentation, follow these steps:
/users/:id → /users/{id})security entries)req.params.id)req.query.page, req.query.limit)req.body fields are usedres.json() / return response shapes — enumerate every response including error paths200, 201, 400, 401, 404, 500, etc.)required if they are destructured without a default or checked for presencenullable: true on fields that may be nullopenapi: "3.0.3"info: title, version, descriptionservers: include a localhost dev server at minimumpaths: one entry per routecomponents/schemas: reusable schema objects referenced with $refcomponents/securitySchemes: if auth middleware is detected (Bearer, API key, cookie)summary: one sentence describing what the endpoint doesdescription: optional longer explanationparameters: path, query, and header params with name, in, required, schema, descriptionrequestBody: with content/application/json/schema and a fully-formed exampleresponses: at minimum the success response and common error responses (400, 401, 404, 500)description and a content/application/json/schema"string" or 0 — use realistic data (e.g., "[email protected]", 42, "2026-03-15T12:00:00Z").Input to Agent:
"Use the API Documentation Generator skill on this Express route:
>
```ts router.post('/users', async (req, res) => { const { name, email, role } = req.body; if (!name || !email) return res.status(400).json({ error: 'name and email are required' }); const user = await db.users.create({ name, email, role: role ?? 'viewer' }); res.status(201).json({ id: user.id, name: user.name, email: user.email, role: user.role }); });
>
router.get('/users/:id', requireAuth, async (req, res) => { const user = await db.users.findById(req.params.id); if (!user) return res.status(404).json({ error: 'User not found' }); res.json({ id: user.id, name: user.name, email: user.email, role: user.role }); }); ```"
Output from Agent:
``yaml openapi: "3.0.3" info: title: Users API version: "1.0.0" description: Endpoints for managing users. servers: - url: http://localhost:3000 description: Local development components: securitySchemes: bearerAuth: type: http scheme: bearer schemas: User: type: object properties: id: type: string example: "usr_a1b2c3" name: type: string example: "Jane Smith" email: type: string format: email example: "[email protected]" role: type: string enum: [viewer, admin] example: "viewer" Error: type: object properties: error: type: string paths: /users: post: summary: Create a new user requestBody: required: true content: application/json: schema: type: object required: [name, email] properties: name: type: string example: "Jane Smith" email: type: string format: email example: "[email protected]" role: type: string enum: [viewer, admin] default: viewer responses: "201": description: User created successfully. content: application/json: schema: $ref: '#/components/schemas/User' "400": description: Missing required fields. content: application/json: schema: $ref: '#/components/schemas/Error' /users/{id}: get: summary: Get a user by ID security: - bearerAuth: [] parameters: - name: id in: path required: true schema: type: string example: "usr_a1b2c3" responses: "200": description: User found. content: application/json: schema: $ref: '#/components/schemas/User' "401": description: Not authenticated. "404": description: User not found. content: application/json: schema: $ref: '#/components/schemas/Error' ``~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.