Skip to content
Back to skills

Swagger Gen

ASecurity

Generate OpenAPI specs from Express routes. Use when documenting APIs.

  • 651 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 10, 2026
developmentbashnodeexpressgitapidocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 11 files and shows the line behind each finding

Scanned February 12, 2026

npx -y skills add sundial-org/awesome-openclaw-skills --skill swagger-gen --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Swagger Gen?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Swagger Gen
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sundial-org-swagger-gen/badge)](https://www.skillsdirectory.com/skills/sundial-org-swagger-gen)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: swagger-gen
description: Generate OpenAPI specs from Express routes. Use when documenting APIs.
---

# Swagger Generator

Your API has no documentation. This reads your Express routes and generates a complete OpenAPI 3.0 spec.

**One command. Zero config. Just works.**

## Quick Start

```bash
npx ai-swagger ./src/routes/
```

## What It Does

- Reads your Express route files
- Generates OpenAPI 3.0 specification
- Documents request/response shapes
- Ready for Swagger UI

## Usage Examples

```bash
# Generate from routes
npx ai-swagger ./src/routes/

# Single file
npx ai-swagger ./src/routes/users.ts -o docs/api.yaml
```

## Best Practices

- **Keep it updated** - regenerate when routes change
- **Add descriptions** - explain what endpoints do
- **Include examples** - show sample requests
- **Document errors** - not just happy paths

## When to Use This

- Creating API documentation
- Setting up Swagger UI
- Onboarding API consumers
- API-first design

## Part of the LXGIC Dev Toolkit

This is one of 110+ free developer tools built by LXGIC Studios. No paywalls, no sign-ups, no API keys on free tiers. Just tools that work.

**Find more:**
- GitHub: https://github.com/LXGIC-Studios
- Twitter: https://x.com/lxgicstudios
- Substack: https://lxgicstudios.substack.com
- Website: https://lxgic.dev

## Requirements

No install needed. Just run with npx. Node.js 18+ recommended. Needs OPENAI_API_KEY environment variable.

```bash
npx ai-swagger --help
```

## How It Works

Parses your Express route definitions to extract endpoints, methods, and handler code. Then generates OpenAPI spec with proper types and descriptions.

## License

MIT. Free forever. Use it however you want.

Files in this skill

  • README.md520 B
  • SKILL.md1.7 KB
  • dist/cli.d.ts31 B
  • dist/cli.js2.5 KB
  • dist/index.d.ts75 B
  • dist/index.js3.1 KB
  • package-lock.json30.2 KB
  • package.json658 B
  • src/cli.ts938 B
  • src/index.ts1.4 KB
  • tsconfig.json251 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…