# generate-swagger-docs

generate-swagger-docs scans a codebase for API endpoints and produces an OpenAPI file plus interactive HTML docs. Use it when a REST API needs generated documentation.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 260 installs · ★ 50 repo stars
- Author: qodex-ai
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/generate-swagger-docs/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/generate-swagger-docs

## What it does

This skill inspects a repository, identifies its web framework, and maps the API endpoints it finds. It writes an OpenAPI 3.0 document to `apimesh/swagger.json` and creates a standalone HTML page at `apimesh/apimesh-docs.html` for browsing the result.

A shell wrapper accepts the OpenAI key, prepares the `apimesh` directory, and runs the `apimesh` tool. Framework detection covers Django, Flask, FastAPI, Express, NestJS, Rails, and Go; a framework can also be supplied manually.

An OpenAI API key is required for the code analysis. The run stores settings in `apimesh/config.json`, so that file belongs in `.gitignore` because it can contain secrets. Documentation generation stops without the key.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill generate-swagger-docs -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/generate-swagger-docs/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/generate-swagger-docs/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill generate-swagger-docs -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/generate-swagger-docs/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill generate-swagger-docs -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/generate-swagger-docs/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install qodex-ai/ai-agent-skills skills/generate-swagger-docs
```

2. **Manually: put the files in place**
- File: `.github/skills/generate-swagger-docs/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill generate-swagger-docs -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/qodex-ai/ai-agent-skills --path skills/generate-swagger-docs
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/generate-swagger-docs/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill generate-swagger-docs -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/generate-swagger-docs/SKILL.md

## When to use it
- discover API endpoints across a repository
- produce an OpenAPI 3.0 specification
- build interactive HTML API docs
- identify the project’s web framework
- store run settings in `apimesh/config.json`

## Example prompts
- Scan this repository and document every API endpoint you find.
- Generate the OpenAPI file at `apimesh/swagger.json` and place the HTML docs beside it.
- Detect the API framework and run the generator through `generate-with-key.sh` using my OpenAI key.

## Similar
- [generate-api-documentation](https://affpapa.org/en/nevibecode/commands/generate-api-documentation.md) — command · 1849 installs
- [adding-api-docs](https://affpapa.org/en/nevibecode/skills/adding-api-docs.md) — skill · 455 installs
- [api-docs-generator](https://affpapa.org/en/nevibecode/skills/api-docs-generator.md) — skill · 411 installs
- [api-docs](https://affpapa.org/en/nevibecode/agents/api-docs.md) — subagent · ★ 850 repo stars
- [golang-swagger](https://affpapa.org/en/nevibecode/skills/golang-swagger.md) — skill · 39200 installs
- [swagger-doc-creator](https://affpapa.org/en/nevibecode/skills/swagger-doc-creator.md) — skill · 239 installs

From the same set: [qodex-ai/ai-agent-skills](https://affpapa.org/en/nevibecode/by/qodex-ai/ai-agent-skills.md) — 42 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
