Slash commands are markdown files that Claude Code and Codex CLI load as reusable agent workflows. MarkApiDown ships two:Documentation Index
Fetch the complete documentation index at: https://docs.markapidown.net/llms.txt
Use this file to discover all available pages before exploring further.
/mad for creating and enriching specs, and /mad-debug for diagnosing failures. You type the command in the agent chat, optionally pass an argument, and the agent follows a structured decision tree to completion — no manual prompting required.
Install slash commands
Run the following command from your project root to install both/mad and /mad-debug:
| Agent | Install path |
|---|---|
| Claude Code | .claude/commands/mad.md and .claude/commands/mad-debug.md |
| Codex CLI | ~/.codex/commands/mad.md and ~/.codex/commands/mad-debug.md |
/mad — scan, enrich, and build flows
The/mad command routes to one of three modes depending on the argument you pass. You can invoke it by name, pass a target path, or describe a flow in plain language.
- Scan mode
- Enrich mode
- Flow mode
Trigger: Example conversation:
/mad, /mad scan, or /mad <directory>Scan mode imports or creates missing endpoint specs for your project. The agent runs mad import project first — if it finds an OpenAPI spec, it converts that. Otherwise, it reads your source routes directly and authors specs using mad_author.What the agent does:Auto-import
Runs
mad import project <directory>. If MarkApiDown finds an OpenAPI spec, it converts it and skips to validation. If it generates stubs from a CLI export command (FastAPI, Spring Boot, etc.), it runs that first.Read source routes
For any routes not covered by the import, the agent searches your source code for route definitions using patterns like
@GetMapping, @app.get, router.get, and r.GET — adapting to your framework automatically.Author specs
For each discovered route, the agent reads the handler and its type definitions, then calls
mad_author with a complete spec: realistic request body, real field names, an expected response that matches the handler’s return type, and assertions covering the happy path and at least one error case./mad-debug — diagnose failing specs
The/mad-debug command diagnoses a failing endpoint or pipeline. Pass it a spec file path, a pipeline file path, or a description of the endpoint that’s failing. The agent follows a structured diagnostic workflow and tells you exactly what to fix.
- Single endpoint
- Pipeline
Trigger: Example conversation:
/mad-debug <spec file> or /mad-debug <method> <path>The agent works through a fixed sequence of checks before drawing any conclusions.Locate the spec
Searches for the spec file using
mad_search (via MCP) or rg on the api-docs/apis/ directory. If no spec exists for the failing endpoint, it tells you to run /mad first.Validate
Runs
mad validate <file>. If validation fails, the error output identifies the exact field or section to fix.Dry run
Runs
mad exec <file> --env=dev --dry-run and checks the resolved request: correct baseUrl, auth header present, path params substituted, body shape correct.Execute
Calls
mad_exec via MCP with the spec and any required variables. Captures the full response.Interpret
Applies the following decision table to the result and tells you what to do:
| Exit / result | Fix |
|---|---|
| Exit 2 — invalid spec | Fix frontmatter field or ## Request http block |
| Exit 4 — network error | Check baseUrl in _shared/env.md, confirm server is running |
| Exit 5 — secret detected | Move the value to .env.local or a MAD_* environment variable |
| Response mismatch | Update ## Expected response if the API changed; otherwise fix the API |
| 401 / 403 | Check authToken in env, verify auth: frontmatter matches the header |
| Unresolved variable | Check _shared/env.md for baseUrl, check .env.local for tokens |