Communitygithub.com

curiositech/windags-skills

Generates OpenAPI 3.0/3.1 specs, TypeScript client types, and curl examples from existing route handler code. Supports Express, Next.js API routes, Fastify, and Hono. Produces complete documentation including auth requirements, rate limits, error codes, and request/response examples. Activate on: 'generate API docs', 'OpenAPI from code', 'document endpoints', 'API reference', 'swagger generation', 'endpoint documentation'. NOT for: API design from scratch (use api-architect), deployment (use devops-automator), testing (use test-automation-expert).

What is windags-skills?

windags-skills is a Cursor agent skill that generates OpenAPI 3.0/3.1 specs, TypeScript client types, and curl examples from existing route handler code. Supports Express, Next.js API routes, Fastify, and Hono. Produces complete documentation including auth requirements, rate limits, error codes, and request/response examples. Activate on: 'generate API docs', 'OpenAPI from code', 'document endpoints', 'API reference', 'swagger generation', 'endpoint documentation'. NOT for: API design from scratch (use api-architect), deployment (use devops-automator), testing (use test-automation-expert).

Works with~Claude Code~Codex CLI✓Cursor
npx skills add https://github.com/curiositech/windags-skills/tree/HEAD/skills/api-documentation-generator

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

API Documentation Generator

Extracts API documentation from existing route handler code. Reads your source, infers schemas, and produces OpenAPI specs, TypeScript types, and runnable curl examples -- not from design intent but from actual implementation.

Activation Triggers

Activate on: "generate API docs", "OpenAPI from code", "document endpoints", "API reference", "swagger generation", "endpoint documentation", "create API types", "curl examples for API"

NOT for: API design from scratch --> api-architect | OpenAPI authoring without source code --> openapi-spec-writer | API testing --> test-automation-expert

Core Capabilities

  • Extract route definitions from Express, Next.js App Router, Next.js Pages API routes, Fastify, and Hono handlers
  • Infer request/response schemas from TypeScript types, Zod schemas, or runtime validation
  • Generate OpenAPI 3.0/3.1 specifications with accurate path parameters, query strings, and request bodies
  • Produce TypeScript type definitions matching the actual API contract
  • Create curl examples for every endpoint with realistic sample data
  • Document authentication requirements by tracing middleware chains
  • Identify rate limiting configuration and document per-endpoint limits
  • Catalog error responses by analyzing throw/return patterns in handlers
  • Detect undocumented endpoints (routes that exist but have no JSDoc or schema)

Framework Detection

Before generating anything, identify the framework. The extraction strategy differs significantly.

Express / Express-like

Signals: app.get(), router.post(), express.Router()
Route source: app._router.stack or explicit router files
Middleware chain: app.use() order matters for auth detection

Look for route registration patterns:

  • router.get('/users/:id', authenticate, getUser) -- middleware before handler means auth required
  • app.use('/api/v1', rateLimiter({ max: 100 }), apiRouter) -- rate limiter applied to subtree

Next.js App Router

Signals: route.ts files exporting GET, POST, PUT, DELETE, PATCH
Route source: File-system convention in app/api/
Middleware chain: middleware.ts at directory boundaries

Path parameters come from folder names: app/api/users/[id]/route.ts --> /api/users/{id}

Next.js Pages API Routes

Signals: pages/api/**/*.ts with default export handler
Route source: File-system convention
Method routing: req.method switch inside handler

Fastify

Signals: fastify.get(), fastify.route(), schema property on route options
Route source: Plugin registration with fastify.register()
Schema: Fastify routes often have JSON Schema already -- extract and convert

Fastify is the easiest framework to document because routes frequently declare their own schemas. Prioritize extracting existing schema.body, schema.response, and schema.querystring before inferring.

Hono

Signals: app.get(), app.post(), Hono(), zValidator()
Route source: Method chaining on Hono instance
Validation: zod-based via zValidator middleware

Hono with zValidator gives you Zod schemas directly. Convert Zod --> JSON Schema --> OpenAPI schema.

Extraction Process

Step 1: Discover Routes

Scan the project for route registration. Do not rely on a single entry point -- frameworks often split routes across files.

# Express: find router files
grep -rl "express.Router\|app.get\|app.post\|router\." src/ --include="*.ts" --include="*.js"

# Next.js App Router: find route handlers
find src/app/api -name "route.ts" -o -name "route.js"

# Next.js Pages: find API routes
find src/pages/api -name "*.ts" -o -name "*.js"

# Fastify: find route registrations
grep -rl "fastify\.\(get\|post\|put\|delete\|route\)" src/ --include="*.ts"

# Hono: find route definitions
grep -rl "app\.\(get\|post\|put\|delete\|patch\)" src/ --include="*.ts"

Step 2: Extract Schemas

For each route, identify the request and response shapes.

Priority order for schema sources:

  1. Explicit Zod/Joi/Yup validation schemas (highest confidence)
  2. TypeScript type annotations on request/response
  3. JSON Schema declarations (Fastify)
  4. JSDoc @param / @returns annotations
  5. Runtime inference from response construction (lowest confidence -- flag as approximate)

When using runtime inference (option 5), always mark the schema with x-inferred: true in the OpenAPI output so consumers know it may be incomplete.

Step 3: Trace Authentication

Walk the middleware chain for each route to determine auth requirements:

  • No auth middleware: Mark as security: [] (public)
  • Bearer token middleware: Mark as security: [{ bearerAuth: [] }]
  • API key middleware: Mark as security: [{ apiKeyAuth: [] }]
  • Session/cookie auth: Mark as security: [{ cookieAuth: [] }]
  • Multiple auth options: List all as alternatives in the security array

Step 4: Catalog Errors

Read each handler and list every error response:

  • res.status(400).json(...) or throw new BadRequestError(...) --> 400 response schema
  • res.status(401) --> 401 (include if auth middleware present even without explicit throw)
  • res.status(404) --> 404
  • res.status(409) --> 409 (conflict, common in create operations)
  • res.status(422) --> 422 (validation failure)
  • res.status(429) --> 429 (rate limited, include if rate limiter middleware detected)
  • res.status(500) --> 500 (always include as possibility)

Step 5: Generate Outputs

Produce three artifacts:

  1. OpenAPI spec (YAML, not JSON -- more readable, easier to diff)
  2. TypeScript types (standalone .d.ts file with all request/response types)
  3. curl examples (one per endpoint, with headers and sample payloads)

Decision Points

When the codebase has NO validation schemas

If handlers accept raw req.body without Zod/Joi validation, you must infer types from usage. Look for:

  • Property access patterns: req.body.name, req.body.email --> { name: string, email: string }
  • Destructuring: const { name, email } = req.body --> same inference
  • Database insert calls: db.users.create({ name: body.name }) --> cross-reference DB schema if available

Flag the entire spec with a warning: x-schemas-inferred: true at the info level.

When routes use dynamic path segments

  • Express: :id --> OpenAPI {id}
  • Next.js: [id] --> OpenAPI {id}
  • Next.js catch-all: [...slug] --> OpenAPI {slug} with note about array behavior
  • Fastify: :id --> OpenAPI {id}
  • Hono: :id --> OpenAPI {id}

When response shape varies by status code

Document each status code with its own schema. Do not merge 200 and 201 into one schema if they differ. Common pattern:

responses:
  '200':
    description: User found
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/User'
  '404':
    description: User not found
    content:
      application/json:
        schema:
          $ref: '#/components/schemas/ErrorResponse'

When rate limits differ per endpoint

Document rate limits using OpenAPI extensions:

x-rate-limit:
  requests: 100
  window: 60s
  scope: per-api-key

If the rate limiter is global (applied once at the app level), document it at the top-level info section. If per-route, document on each operation.

TypeScript Type Generation

Generate types that match the OpenAPI spec exactly. Use branded types for IDs when the codebase uses them.

// Generated from OpenAPI spec -- do not edit manually

export interface CreateUserRequest {
  name: string;
  email: string;
  role?: 'admin' | 'member' | 'viewer';
}

export interface CreateUserResponse {
  id: string;
  name: string;
  email: string;
  role: 'admin' | 'member' | 'viewer';
  createdAt: string; // ISO 8601
}

export interface ErrorResponse {
  error: {
    code: string;
    message: string;
    details?: Array<{
      field: string;
      issue: string;
    }>;
  };
}

export interface PaginatedResponse<T> {
  data: T[];
  meta: {
    page: number;
    perPage: number;
    total: number;
    hasMore: boolean;
  };
}

Curl Example Generation

Generate one curl per endpoint. Use realistic but obviously fake data.

# GET /api/users/:id -- Fetch a single user
curl -X GET https://api.example.com/api/users/usr_abc123 \
  -H "Authorization: Bearer sk_test_..." \
  -H "Accept: application/json"

# POST /api/users -- Create a new user
curl -X POST https://api.example.com/api/users \
  -H "Authorization: Bearer sk_test_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ada Lovelace",
    "email": "[email protected]",
    "role": "member"
  }'

# GET /api/users -- List users with pagination
curl -X GET "https://api.example.com/api/users?page=1&perPage=20&role=admin" \
  -H "Authorization: Bearer sk_test_..." \
  -H "Accept: application/json"

Rules for curl examples:

  • Always include the full URL (use https://api.example.com as base)
  • Include all required headers
  • Use -d with formatted JSON for request bodies
  • Quote URLs that contain query parameters
  • Show the HTTP method explicitly even for GET
  • Use sk_test_... for auth tokens (obviously fake)
  • Use realistic field values, not "string" or "test"

Anti-Patterns

1. Documenting Aspirational APIs

Symptom: Spec describes endpoints that do not exist in code yet Fix: Only document what the code actually implements. If a planned endpoint is in comments or a spec file but not in handlers, exclude it.

2. Ignoring Middleware Side Effects

Symptom: Docs say endpoint is public when it actually requires auth through a parent middleware Fix: Trace the full middleware chain from app root to handler. A router.use(auth) above the route definition means all routes below require auth.

3. Assuming Request Body Shape

Symptom: Documenting req.body as any or object because there is no validation Fix: Infer from usage (property access, destructuring, database calls). Mark as x-inferred: true. Recommend adding Zod validation.

4. Flat Error Documentation

Symptom: Every endpoint lists the same generic "400 Bad Request" without details Fix: Read each handler's error paths. Document the specific error codes and messages returned. Different validation failures should show different example responses.

5. Stale Generated Docs

Symptom: Spec was generated once and never updated as code changed Fix: Generate into a well-known path (docs/openapi.yaml). Add a CI check that regenerates and diffs against committed spec. If they diverge, fail the build.

6. Missing Pagination Documentation

Symptom: List endpoints documented without query parameter schemas for pagination Fix: If the handler supports page, limit, cursor, offset, or similar parameters, document them with defaults and max values.

7. Undocumented File Uploads

Symptom: Multipart/form-data endpoints documented as JSON Fix: Detect multer, formidable, busboy, or framework-native file handling. Use multipart/form-data content type with proper binary schema.

Quality Checklist

[ ] Every route handler in the codebase has a corresponding OpenAPI operation
[ ] Path parameters match between code and spec (no :id vs {userId} mismatches)
[ ] Request body schemas cover all required and optional fields
[ ] Response schemas match actual JSON structure (verified by reading handler return)
[ ] Authentication requirements match middleware chain analysis
[ ] Rate limit information documented where rate limiting middleware exists
[ ] Error responses cataloged from actual throw/return statements in handlers
[ ] Curl examples execute successfully against a running instance
[ ] TypeScript types compile without errors
[ ] No x-inferred schemas left undocumented (each flagged one has a TODO for proper validation)
[ ] Pagination parameters documented with defaults and maximums
[ ] File upload endpoints use multipart/form-data content type
[ ] OpenAPI spec validates with spectral or swagger-cli lint
[ ] Generated spec committed to a known path for CI diffing

Output Artifacts

  1. docs/openapi.yaml -- Complete OpenAPI 3.0/3.1 specification
  2. docs/api-types.d.ts -- TypeScript type definitions for all request/response shapes
  3. docs/api-examples.sh -- Runnable curl examples for every endpoint
  4. docs/api-coverage.md -- Report listing documented vs undocumented routes

Validation

# Lint the generated OpenAPI spec
npx @stoplight/spectral-cli lint docs/openapi.yaml

# Validate spec structure
npx swagger-cli validate docs/openapi.yaml

# Generate TypeScript client to verify types compile
npx openapi-typescript docs/openapi.yaml -o /tmp/api-check.d.ts
tsc --noEmit /tmp/api-check.d.ts

# Diff against last committed spec (CI check)
diff <(cat docs/openapi.yaml) <(npx tsx scripts/generate-api-docs.ts --stdout) && echo "Spec is current" || echo "Spec is stale"

Covers: OpenAPI generation | TypeScript type extraction | Curl example creation | Auth documentation | Rate limit documentation | Error code cataloging

Use with: api-architect (design first, document after) | openapi-spec-writer (manual authoring) | test-automation-expert (contract testing against generated spec)

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

curiositech/windags-skills

Expert in 2000s-era music visualization (Milkdrop, AVS, Geiss) and modern WebGL implementations. Specializes in Butterchurn integration, Web Audio API AnalyserNode FFT data, GLSL shaders for audio-reactive visuals, and psychedelic generative art. Activate on "Milkdrop", "music visualization", "WebGL visualizer", "Butterchurn", "audio reactive", "FFT visualization", "spectrum analyzer". NOT for simple bar charts/waveforms (use basic canvas), video editing, or non-audio visuals.

curiositech/windags-skills

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape.

curiositech/windags-skills

Expert in 3D computer vision labeling tools, workflows, and AI-assisted annotation for LiDAR, point clouds, and sensor fusion. Covers SAM4D/Point-SAM, human-in-the-loop architectures, and vertical-specific training strategies. Activate on '3D labeling', 'point cloud annotation', 'LiDAR labeling', 'SAM 3D', 'SAM4D', 'sensor fusion annotation', '3D bounding box', 'semantic segmentation point cloud'. NOT for 2D image labeling (use clip-aware-embeddings), general ML training (use ml-engineer), video annotation without 3D (use computer-vision-pipeline), or VLM prompt engineering (use prompt-engineer).

curiositech/windags-skills

Implement WCAG 2.2 AA/AAA compliance with automated testing, keyboard navigation, screen reader support, and focus management. Activate on: accessibility audit, WCAG compliance, keyboard navigation, screen reader, aria attributes, axe-core, focus trap. NOT for: design-level accessibility review (use design-accessibility-auditor), color contrast only (use css-in-js-architect).

curiositech/windags-skills

Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that actually work for neurodivergent minds.

curiositech/windags-skills

Designs digital experiences for ADHD brains using neuroscience research and UX principles. Expert in reducing cognitive load, time blindness solutions, dopamine-driven engagement, and compassionate design patterns. Activate on 'ADHD design', 'cognitive load', 'accessibility', 'neurodivergent UX', 'time blindness', 'dopamine-driven', 'executive function'. NOT for general accessibility (WCAG only), neurotypical UX design, or simple UI styling without ADHD context.

curiositech/windags-skills

>- Apply crisis decision-making research to agent routing, uncertainty triage, and coordination failure analysis in time-pressured systems. Use when diagnosing handoff failures, analytical paralysis, or expert judgment under incomplete information. NOT for routine coding, simple CRUD design, or static single-agent tasks with complete information.

curiositech/windags-skills

Extend and modify the admin dashboard, developer portal, and operations console. Use when adding new admin tabs, metrics, monitoring features, or internal tools. Activates for dashboard development, analytics, user management, and internal tooling.

curiositech/windags-skills

Conversation patterns and interaction protocols for multi-agent systems. Covers request/response, pub/sub, blackboard, delegation chains, debate, critique, consensus, fan-out/fan-in, supervisor-worker, and peer negotiation. Deep analysis of AutoGen conversation patterns, CrewAI delegation, LangGraph state passing, and FIPA-ACL performatives. Teaches how to design what agents say to each other and in what order. Activate on: "agent conversation", "agent protocol", "multi-agent debate", "agent delegation", "supervisor worker pattern", "agent voting", "consensus protocol", "fan-out fan-in", "agent negotiation", "blackboard pattern", "agent dialogue", "conversation topology", "agent handoff". NOT for: wire format or serialization (use agent-interchange-formats), orchestration infrastructure (use agentic-infrastructure-2026), single agent behavior (use agentic-patterns).

curiositech/windags-skills

Meta-agent for creating new custom agents, skills, and MCP integrations. Expert in agent design, MCP development, skill architecture, and rapid prototyping. Activate on 'create agent', 'new skill', 'MCP server', 'custom tool', 'agent design'. NOT for using existing agents (invoke them directly), general coding (use language-specific skills), or infrastructure setup (use deployment-engineer).

curiositech/windags-skills

AI-powered calendar management and agent-based scheduling coordination. Covers calendar APIs (Google Calendar, CalDAV/iCal), AI scheduling assistants (Reclaim, Clockwise, Motion, Cal.com), building custom calendar agents with MCP, multi-calendar merging, timezone management, focus block protection, meeting fatigue detection, and agent-to-agent meeting negotiation protocols. Activate on: "calendar agent", "AI scheduling", "calendar coordination", "meeting scheduling", "calendar API", "focus time protection", "calendar optimization", "Google Calendar MCP", "Reclaim", "Clockwise", "Motion", "Cal.com", "smart scheduling", "calendar-aware agent", "timezone scheduling", "agent negotiation meetings". NOT for: manual calendar UI component design (use form-validation-architect), project management scheduling or Gantt charts (use project-management-guru-adhd), general time-tracking or pomodoro apps (use adhd-daily-planner for time-awareness), building the agent itself from scratch (use agent-creator).

curiositech/windags-skills

Build and adopt production AI agent infrastructure in 2026. Covers framework selection (LangGraph, CrewAI, AutoGen, MCP), orchestration patterns, evaluation, observability, memory systems, and tool use. Also covers the SOCIAL dimension: how to sell agent infrastructure internally, change management, measuring ROI, building trust in autonomous systems, and scaling adoption across teams. Activate on: "agent infrastructure", "agent framework comparison", "which agent framework", "sell AI tools internally", "agent adoption", "agent observability", "agent evaluation", "MCP architecture", "agentic mesh", "enterprise AI agents", "AI change management", "agent ROI". NOT for: building specific agents (use ai-engineer), designing agent behavior patterns (use agentic-patterns), prompt tuning (use prompt-engineer).

curiositech/windags-skills

Fundamental patterns for effective agentic behavior. Teaches decomposition, tool orchestration, error recovery, context management, quality self-assessment, and knowing when to stop. Model-agnostic principles that make any agent more effective regardless of domain. Activate on: "how should I structure this agent", "agentic workflow", "agent patterns", "multi-step task", "tool orchestration", "/agentic-patterns", "decompose this", "agent best practices", "chain of actions", "when should the agent stop", "agent loop design". NOT for: creating agent infrastructure (use agent-creator), building DAGs (use windags-architect), specific tool implementation.

curiositech/windags-skills

Automated discovery and matching of agent skills for dynamic task routing and capability assessment

curiositech/windags-skills

Cryptographic security for agentic systems — zero-trust agent networking, signed message envelopes (JWS/JWE), capability-based security (ocaps), Merkle tree audit trails, WASM sandboxing, and formal verification. Covers CLI dev tool security, mTLS between agents, permission boundaries (least privilege for AI agents), and supply chain security for skills/plugins. Activate on: "agent security", "zero trust agents", "secure agent communication", "capability-based security", "ocap", "signed messages between agents", "agent audit trail", "sandbox agent execution", "agent permissions", "mTLS agents", "cryptographic verification", "agent supply chain", "OWASP agentic", "prove agent did X", "tamper-proof agent logs". NOT for: application-level SAST scanning (use security-auditor), network firewall rules (use infrastructure), SOC2/HIPAA compliance (organizational), or prompt injection defense (use prompt-engineer).

curiositech/windags-skills

Data structures and serialization formats for agent-to-agent communication. Covers message envelopes, structured output schemas, capability declarations, task handoff payloads, error/retry signaling, and context windows as data structures. Deep comparison of A2A protocol, MCP, OpenAI function calling, and LangChain message types. Teaches when to use rigid schemas vs free-form with validation, typed vs untyped, streaming vs batch. Activate on: "agent message format", "agent communication schema", "agent-to-agent protocol", "A2A protocol", "MCP message format", "structured output for agents", "agent interop", "interchange format", "agent serialization", "task handoff format", "capability declaration". NOT for: what agents say to each other (use agent-conversation-protocols), orchestration topology (use multi-agent-coordination), building agent infrastructure (use agentic-infrastructure-2026).

curiositech/windags-skills

Logic-based agent programming language implementing BDI architecture for practical autonomous agent development

curiositech/windags-skills

>- Design AgentSpeak(L)-style BDI agents with context-guarded plans, selection functions, and intention stacks. Use for interruptible autonomy, agent policy, and multi-agent orchestration in dynamic environments. NOT for simple rule engines, static planners, or centralized workflows.

curiositech/windags-skills

Foundational concurrent computation model where actors communicate exclusively through asynchronous message passing

curiositech/windags-skills

license: Apache-2.0 NOT for unrelated tasks outside this domain.

Related Skills