Vibe coding moves fast when every part of the loop — writing, running, reviewing — works together. MarkApiDown is the API layer in that loop: agents read and write markdown spec files, the CLI executes them, and the browser gives you a visual review surface while the agent works. Every change is a diff you can read in a pull request.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.
The four-step vibe coding loop
Ask your agent to document routes
Start by asking your agent to scan for API routes or document a specific endpoint. With the skill installed, the agent knows the MarkApiDown spec format and file layout without you explaining it.Example prompts:
“Scan this project for API routes and add missing MarkApiDown specs. Do not overwrite existing files.”
“Add a MarkApiDown spec forPOST /orders. Use bearer auth. The request body should includecustomerIdanditems[].”
“Create a spec for theThe agent usesGET /users/:userIdendpoint. MakeuserIda path param.”
mad_author (via MCP) or writes the file directly, then runs mad validate to confirm the spec is structurally correct before moving on.Review in the browser
Open the browser UI while your agent works — or after it finishes a batch of specs.In the browser you can:
- Inspect the generated spec on the Request and Expected Response tabs.
- Run the endpoint against your dev server using the runner panel.
- Check the Diff tab to see whether the actual response matches the recorded expected response.
- Edit the spec source directly in the Source tab if you spot something to fix.
Build flows
Ask the agent to connect specs into a multi-step pipeline. Flows let you test sequences that depend on each other — for example, creating a user, logging in, capturing the token, and then calling a protected endpoint with it.
“Build a signup flow: create a user, then log in with those credentials, capture the token from the response, and fetch the user profile using the captured token.”The agent writes a flow to
api-docs/flows/signup.md that chains the steps together using capture and inject declarations. You can review the flow on the Flows canvas in the browser, run it visually step by step, and see captures fill in as each step completes.Run the flow from the CLI at any time:Validate and commit
Before committing, run If validation passes, commit the
mad validate to confirm all spec files are structurally correct. Validation catches frontmatter errors, missing required sections, and any secrets that were accidentally written to a versioned file.api-docs/ directory. Every spec is a plain markdown file — reviewable in a pull request, diffable in GitHub, and readable by the next agent that works on the project.Example agent prompts
Use these prompts as starting points. Adjust the endpoint details, field names, and environments to match your project.| Goal | Prompt |
|---|---|
| Document one endpoint | "Add a MarkApiDown spec for GET /users/:userId. Use bearer auth and make userId a path param." |
| Scan for missing specs | "Scan this project for API routes and add missing MarkApiDown specs. Do not overwrite existing specs." |
| Run and debug | "Test the get-user endpoint in dev. If variables are missing, tell me exactly where to define them." |
| Create a flow | "Build a checkout flow: create an order, capture orderId from the response, then fetch the order using the captured orderId." |
| Enrich expected responses | "Run the get-user endpoint and update its ## Expected response block with the actual field names and values from the response." |
| Validate before commit | "Run mad validate api-docs/ and fix any errors before we commit." |
Without MarkApiDown vs. with MarkApiDown
| Dimension | Without MarkApiDown | With MarkApiDown |
|---|---|---|
| Token cost | Agent reads source files and re-discovers routes on every prompt | Agent reads compact spec index — one file describes the full collection |
| Debug experience | Agent parses raw curl output or builds requests from memory | Agent calls mad_exec and gets a structured diff with actionable hints |
| CI integration | Manual — agent writes a test script that may not match the spec | Automatic — mad validate and mad exec exit with stable codes CI can act on |
| Review experience | API changes are scattered across source files and comments | Every API change is a .md diff in the pull request — readable and reviewable |
| Spec drift | Agent re-generates boilerplate on every session | Specs persist in api-docs/ across sessions, agents, and contributors |
| Multi-step testing | Agent chains curl calls manually, captures values by parsing text | Agent writes a flow file; mad flow handles capture, inject, and reporting |
The agent skill system
Skills are markdown playbooks embedded in the MarkApiDown binary. When you runmad install skills, MarkApiDown writes a SKILL.md file to each detected agent’s configuration directory — .claude/skills/ for Claude Code, .cursor/rules/ for Cursor, .github/instructions/ for Copilot, and so on.
- The
api-docs/project layout and file naming convention. - The endpoint spec format: required frontmatter fields, section order, and variable syntax.
- The assertions DSL and when to use
## Assertionsvs## Expected response. - The pipeline capture and inject syntax for flow files.
- Which MCP tool to call for each operation, and when to fall back to CLI commands.
- How to handle missing variables, auth errors, and contract mismatches.
mad doctor to check whether your installed skills are up to date with the current binary:
mad install skills again to update them.
MCP tools available to agents
When you register the MCP server with Claude Code, the agent gets structured tools with compact JSON output. These tools are more reliable than asking the agent to parse terminal text.| Tool | What it does |
|---|---|
mad_exec | Execute one endpoint spec and return a structured diff result. Pass verbose: true for full request/response payloads, dry_run: true to resolve variables without sending. |
mad_flow | Run a pipeline and return per-step pass/fail state with captured values. |
mad_validate | Validate a spec file or directory and return a structured result with any parse errors. |
mad_list_specs | List all specs in the collection — method, path, title, and tags — without reading individual files. |
mad_read_spec | Read the full content of one spec file, including frontmatter and all sections. |
mad_author | Create or update a spec file. Validates the content before writing; refuses to silently overwrite an existing file unless overwrite: true is set. |
mad_search | Search specs by method, path, tag, or text without reading individual files. |
mad_vars | Show which variables a spec requires and which are resolved for the current environment. |
error_type and hint fields on failure so the agent can take the right action without parsing error messages.