Documents

API Documentation & Diagram Generator

Try it

API documentation generator and diagram creator. Turn OpenAPI specs, API endpoints, and code snippets into visual workflows, process diagrams, and step-by-st...

What it does

API documentation generator and diagram creator. Turn OpenAPI specs, API endpoints, and code snippets into visual workflows, process diagrams, and step-by-step guides. Export to Markdown, SVG, PNG, PDF, or JSON. Built on Workflow Weaver (weaver.vibingfun.com). Drive via CLI or 23 MCP tools. Use when asked to create API docs, generate diagrams, build process guides, or turn code into visual workflows.

The skill document

run-workflow-weaver

Agent skill for driving the workflow-weaver CLI and MCP server headlessly. Works from any agent runtime that can invoke subprocesses or connect to an MCP host.

Prerequisites

  • Node.js ≥ 20
  • Global install:
    npm install -g workflow-weaver @workflow-weaver/mcp
    

Authentication

Interactive (recommended for first-time setup):

workflow-weaver auth login --email you@example.com
# Password is prompted interactively — omit --password to avoid exposing it in shell history
***

**Non-interactive (agents / CI):**

Export the token after interactive login:

```bash
node -e "process.stdout.write(require(require('os').homedir()+'/.workflow-weaver/config.json').refreshToken)"

Then set it in the agent's environment:

export WORKFLOW_WEAVER_REFRESH_TOKEN=***

The CLI automatically reads WORKFLOW_WEAVER_REFRESH_TOKEN from the environment. No prefix mapping is needed.

Security

RuleDetail
No hardcoded credentialsNever embed tokens, passwords, or keys in scripts, logs, or skill files
Refresh token via env var onlyWORKFLOW_WEAVER_REFRESH_TOKEN — never interpolate into log lines or echo
Supabase credentials via env var onlyWORKFLOW_WEAVER_SUPABASE_URL and WORKFLOW_WEAVER_SUPABASE_KEY — never in scripts
Config file path~/.workflow-weaver/config.json (chmod 600) — document but never read directly in automation scripts; one-time setup extraction is acceptable
Stripe/billing URLsPresent to the user to open in a browser — never open programmatically
Smoke placeholderUse clearly-named placeholders like smoke-test-invalid-token, never real-looking values

Run (Agent Path)

CLI subprocess pattern

All commands support --json for machine-readable NDJSON output:

workflow-weaver  [args] --json

Exit codes

CodeMeaning
0Success
1Domain error (WorkflowWeaverError) — check stderr for JSON
2Unexpected error

Core 6-step sequence

# 1. Verify credentials
workflow-weaver auth status --json

# 2. Check quota before generating
workflow-weaver billing status --json

# 3. Create a project
PROJECT=$(workflow-weaver projects create \
  --title "Stripe Guide" \
  --use-case "Payment integration" \
  --json)
PROJECT_ID=$(echo "$PROJECT" | jq -r '.id')

# 4. Add a source
workflow-weaver sources add "$PROJECT_ID" \
  --type snippet \
  --content "GET /users" \
  --json

# 5. Generate (streams progress events as NDJSON, final line is the completed version)
GENERATE_OUTPUT=$(workflow-weaver generate "$PROJECT_ID" --json)
echo "$GENERATE_OUTPUT" | tail -1
VERSION_ID=$(echo "$GENERATE_OUTPUT" | tail -1 | jq -r '.versionId // .id')

# 6. Export
workflow-weaver export "$PROJECT_ID" "$VERSION_ID" --format md

Error handling for agents

On any WorkflowWeaverError (exit code 1), stderr contains JSON:

{ "error": "Project has no sources", "code": "PRECONDITION_FAILED", "statusCode": 400 }

Quota exhaustion / BYOK

When billing status --json returns canGenerate: false:

ResolutionAction
Subscribeworkflow-weaver billing subscribe → present Stripe URL to user
Buy creditsworkflow-weaver billing buy-credits → present Stripe URL to user
BYOKworkflow-weaver providers set-key — bypasses quota entirely

If byok_active: true, generation is unlimited regardless of plan or credits.

Token rotation gotcha

The refresh token in ~/.workflow-weaver/config.json may be rotated (invalidated and replaced) by the server. Never cache the token by reading the config file directly.

  • Always pass the token via WORKFLOW_WEAVER_REFRESH_TOKEN env var
  • If you must read from config, re-read before every operation — do not cache
  • The CLI handles token refresh internally; let it read from its config file
  • When using the env var, each CLI call may rotate the token server-side. The CLI writes the new token to ~/.workflow-weaver/config.json, but the env var still holds the old value. For long-running agent sessions, prefer letting the CLI read from its config file rather than setting the env var persistently

MCP Server Configuration

The MCP server requires three env vars: WORKFLOW_WEAVER_REFRESH_TOKEN, WORKFLOW_WEAVER_SUPABASE_URL, and WORKFLOW_WEAVER_SUPABASE_KEY.

Claude Desktop

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "workflow-weaver": {
      "command": "npx",
      "args": ["@workflow-weaver/mcp@latest"],
      "env": {
        "WORKFLOW_WEAVER_REFRESH_TOKEN": "***",
        "WORKFLOW_WEAVER_SUPABASE_URL": "***",
        "WORKFLOW_WEAVER_SUPABASE_KEY": "***"
      }
    }
  }
}

Cursor

Edit .cursor/mcp.json in your project root (or ~/.cursor/mcp.json globally):

{
  "mcpServers": {
    "workflow-weaver": {
      "command": "npx",
      "args": ["@workflow-weaver/mcp@latest"],
      "env": {
        "WORKFLOW_WEAVER_REFRESH_TOKEN": "***",
        "WORKFLOW_WEAVER_SUPABASE_URL": "***",
        "WORKFLOW_WEAVER_SUPABASE_KEY": "***"
      }
    }
  }
}

Kiro

Edit .kiro/settings/mcp.json in your workspace:

{
  "mcpServers": {
    "workflow-weaver": {
      "command": "npx",
      "args": ["@workflow-weaver/mcp@latest"],
      "env": {
        "WORKFLOW_WEAVER_REFRESH_TOKEN": "***",
        "WORKFLOW_WEAVER_SUPABASE_URL": "***",
        "WORKFLOW_WEAVER_SUPABASE_KEY": "***"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

Note: If you installed @workflow-weaver/mcp globally, you can also use the workflow-weaver-mcp binary directly instead of npx.

MCP Tools (23)

#ToolDescription
1get_auth_statusVerify the configured token
2list_projectsList all projects
3create_projectCreate a new project
4get_projectGet a project by ID
5delete_projectDelete a project
6add_sourceAdd an API doc source to a project
7list_sourcesList sources for a project
8remove_sourceRemove a source from a project
9list_providersList AI providers and key status
10set_provider_keyStore a BYOK provider key
11remove_provider_keyRemove a provider key
12generate_workflowGenerate a workflow from sources
13list_versionsList workflow versions
14get_versionGet a specific version
15patch_versionApply a JSON Patch (RFC 6902) to a version
16chat_editEdit a version via natural language
17export_versionExport a version (svg/png/pdf/md/json)
18create_share_linkCreate a public share link
19list_share_linksList share links
20revoke_share_linkRevoke a share link
21get_billing_statusCheck plan, usage, and quota
22get_checkout_urlGet a Stripe checkout URL
23get_portal_urlGet a Stripe customer portal URL

MCP error handling

All tool errors return isError: true with JSON in content[0].text:

{ "code": "INVALID_PARAMS", "message": "project_id is required" }
{ "code": "QUOTA_EXCEEDED", "message": "...", "resolution_paths": [...] }
{ "code": "AUTH_FAILED", "message": "Token is not authenticated" }

Smoke Test

Run offline checks (no token required):

bash .claude/skills/run-workflow-weaver/smoke.sh

Run with live credentials:

WORKFLOW_WEAVER_REFRESH_TOKEN=*** bash .claude/skills/run-workflow-weaver/smoke.sh

Global Flags

FlagDescription
--jsonOutput as newline-delimited JSON (NDJSON)
--quietSuppress all non-error output
--api-url Override the Supabase URL
--versionPrint CLI version

Environment Variables

VariableDescription
WORKFLOW_WEAVER_REFRESH_TOKENRefresh token (read by CLI and MCP automatically)
WORKFLOW_WEAVER_SUPABASE_URLSupabase project URL (required by MCP)
WORKFLOW_WEAVER_SUPABASE_KEYSupabase anon key (required by MCP)
WORKFLOW_WEAVER_CLIOverride CLI binary path (default: workflow-weaver)
WORKFLOW_WEAVER_MCPOverride MCP binary path (default: workflow-weaver-mcp)

Related skills

Write clear, developer-facing API documentation. Use when asked to document an API endpoint, write API reference docs, create a developer guide, or turn a ra...

Generates a Mermaid workflow diagram showing process steps, decisions, and state transitions

25 installs

Create JSON-driven single-page interactive HTML documentation for app workflows between packages, services, and components. Use when a user asks for clickabl...

12 installs

Generate beautiful draw.io diagrams with a mandatory visual QA loop. Covers flowcharts, ERD, architecture, sequence, and class diagrams. Use when user reques...

by Spotlight Revenue