Sponsor Suno AI Music arrow_forward
Slash Command

Generate Api Docs by jeremylongshore

Generate comprehensive OpenAPI/Swagger documentation from existing APIs

Type
Slash Command
GitHub stars
2.8k
License
MIT
Repo last updated
Sep 27, 2026

What Generate Api Docs by jeremylongshore is

Generate Api Docs by jeremylongshore is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”

A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.

Generate Api Docs gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.

How to install Generate Api Docs by jeremylongshore

Claude Code

  1. Download generate-api-docs.md from the repository.
  2. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. Run it from any task with / and the skill name.

New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.

Inside the source file

An excerpt from plugins/api-development/api-documentation-generator/commands/generate-api-docs.md, shared under the repository's MIT license. Read the full file on GitHub.

Automatically generate comprehensive OpenAPI 3.0 specifications with interactive documentation, automated testing, and multi-language client SDKs from your existing API codebase or by analyzing live endpoints.

When to Use This Command

Use /generate-api-docs when you need to:

  • Document existing APIs without manual specification writing
  • Generate interactive API documentation for developers
  • Create Postman/Insomnia collections from your API
  • Enable "try it out" functionality for API endpoints
  • Generate client SDKs in multiple languages
  • Maintain API documentation synchronized with code
  • Create API reference documentation for external consumers
  • Validate API contracts and schemas
  • Enable API mocking for frontend development

DON'T use this when:

  • Your API is still in early design phase (use /api-contract-generator instead)
  • You only need internal code comments (use JSDoc/docstrings)
  • Building GraphQL APIs (use /build-graphql-server with introspection)
  • APIs have no stable contract (too early in development)

Design Decisions

This command implements OpenAPI 3.0.3 specification as the primary approach because:

  • Industry standard adopted by major organizations
  • Extensive tooling ecosystem (Swagger UI, Redoc, SDKs)
  • Supports complex schemas including oneOf, allOf, discriminators
  • Native support for webhooks and callbacks
  • JSON Schema validation built-in
  • Multiple security schemes support

Alternative considered: API Blueprint

  • Markdown-based format
  • Simpler for human writing
  • Less tooling support
  • Recommended for documentation-first design

Alternative considered: RAML

  • YAML-based with reusable components
  • Good for large enterprise APIs
  • Smaller ecosystem
  • Recommended when modularity is critical

Alternative considered: AsyncAPI

  • Specialized for event-driven APIs
  • WebSocket and message queue support
  • Use alongside OpenAPI for complete coverage

Prerequisites

Before running this command:

  1. Functioning API with consistent patterns
  2. Request/response examples available
  3. Authentication mechanism implemented
  4. Error response format standardized
  5. API versioning strategy defined

Implementation Process

Step 1: API Analysis and Discovery

Scan codebase and running API to discover all endpoints, methods, and data structures.

Step 2: Schema Extraction

Extract request/response schemas from code annotations, TypeScript types, or runtime analysis.

Step 3: OpenAPI Generation

Generate complete OpenAPI 3.0 specification with all paths, schemas, and security definitions.

Step 4: Documentation Enhancement

Add descriptions, examples, and grouping tags for better organization and understanding.

Step 5: Interactive Documentation Setup

Deploy Swagger UI and Redoc for interactive API exploration and testing.

Output Format

The command generates:

  • openapi.yaml - Main OpenAPI 3.0 specification
  • openapi.json - JSON format for tooling
  • docs/ - Static HTML documentation
  • index.html - Swagger UI interface
  • redoc.html - Redoc documentation
  • collections/ - External tool formats
  • postman_collection.json - Postman import
  • insomnia_workspace.json - Insomnia import
  • bruno_collection.bru - Bruno collection
  • examples/ - Request/response examples
  • schemas/ - Extracted JSON schemas
  • README.md - Getting started guide

Code Examples

Example 1: Express.js API with Automatic Documentation Generation

// api-documentation-generator.js
const swaggerJsdoc = require('swagger-jsdoc');
const swaggerUi = require('swagger-ui-express');
const { z } = require('zod');
const zodToJsonSchema = require('zod-to-json-schema');
const express = require('express');
const fs = require('fs').promises;
const path = require('path');
const yaml = require('js-yaml');

class APIDocumentationGenerator {
  constructor(app, config = {}) {
    this.app = app;
    this.config = {
      title: config.title || 'API Documentation',
      version: config.version || '1.0.0',
      description: config.description || 'API Documentation',
      servers: config.servers || [{ url: 'http://localhost:3000' }],
…

Example 2: Python FastAPI with Automatic OpenAPI Enhancement

# api_doc_enhancer.py
from fastapi import FastAPI, APIRouter, Depends, HTTPException
from fastapi.openapi.utils import get_openapi
from fastapi.openapi.docs import get_swagger_ui_html, get_redoc_html
from pydantic import BaseModel, Field
from typing import List, Optional, Dict, Any
import json
import yaml
from pathlib import Path
import httpx
from datetime import datetime

class OpenAPIEnhancer:
    """Enhance FastAPI's auto-generated OpenAPI with additional features"""

    def __init__(self, app: FastAPI):
        self.app = app
        self.examples = {}
…

Before you install

  • Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
  • Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
  • Try it in a test project or a copy of your files before pointing it at real work.
  • Pin the version you tested, and review changes before updating.
  • Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.

FAQ

What is Generate Api Docs by jeremylongshore?

Generate Api Docs by jeremylongshore is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Generate comprehensive OpenAPI/Swagger documentation from existing APIs

How do I install Generate Api Docs by jeremylongshore in Claude Code?

Download generate-api-docs.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.

Can I use Generate Api Docs by jeremylongshore in Claude Cowork?

Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.

Is Generate Api Docs by jeremylongshore safe to install?

It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.

Similar resources

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.