A skill is a single markdown file that MarkApiDown installs into your AI agent’s config directory. When you open a file inDocumentation Index
Fetch the complete documentation index at: https://docs.markapidown.net/llms.txt
Use this file to discover all available pages before exploring further.
api-docs/ or ask your agent to document an endpoint, the agent reads that file first — learning the MarkApiDown spec format, project layout, variable syntax, assertion rules, and tool preferences before it writes a single line. The result is a correctly structured spec on the first attempt, without any manual prompting on your part.
What a skill is
Themad skill is sourced from skills/mad/SKILL.md inside the MarkApiDown installation. When you run mad install skills, the CLI reads that file, adapts the frontmatter to match the target agent’s format, and writes it to the agent’s config directory. The content teaches the agent everything it needs to work with MarkApiDown specs autonomously.
Skills are static files — they don’t run code or phone home. You can open, read, and commit the installed file like any other project file.
Where skills are installed
The installation path differs by agent. MarkApiDown writes the correct format automatically.| Agent | Installed file path | Format |
|---|---|---|
| Claude Code | .claude/skills/mad/SKILL.md | Standard SKILL.md with YAML frontmatter |
| Codex CLI | ~/.codex/skills/mad/SKILL.md | Standard SKILL.md with YAML frontmatter |
| Antigravity | .agents/skills/mad/SKILL.md | Standard SKILL.md with YAML frontmatter |
| OpenCode | .opencode/skills/mad/SKILL.md | Standard SKILL.md with YAML frontmatter |
| Cursor | .cursor/rules/mad.mdc | .mdc with globs: api-docs/**/*.md |
| GitHub Copilot | .github/instructions/mad.instructions.md | Markdown with applyTo frontmatter |
Cursor and GitHub Copilot use their own file formats. MarkApiDown adapts the skill content automatically — Cursor receives an
.mdc file scoped to api-docs/**/*.md, and Copilot receives an instructions file with an applyTo header. The skill content is identical; only the wrapper differs.What the mad skill covers
The skill is organized into sections that map to the parts of the MarkApiDown workflow an agent needs to know.Project layout
Project layout
The skill teaches the agent the canonical The agent knows to place new specs under
api-docs/ directory structure:apis/ and new pipelines under flows/, using the <method>-<slug>.md naming convention.Endpoint file format
Endpoint file format
The skill defines the required YAML frontmatter fields and the exact section order every endpoint spec must follow:Required frontmatter:
resource, protocol: http, method, path (:param for path params), version: 1.Section order: ## Request → ## Expected response → ## Error responses (optional, reference only) → ## Assertions (optional) → ## Tests (optional) → ## Notes (optional).The agent uses this to generate a complete, valid spec without guessing at structure.Variable syntax
Variable syntax
Variables in
## Request and ## Expected response http blocks use double-brace syntax: {{name}}. The skill explains the resolution chain:_shared/env.mdunder the matching[<env>]section.env.localin the project root (for secrets)MAD_*environment variables
{{authToken}} and expect the value to come from .env.local or the environment.Assertion operators
Assertion operators
The skill lists every assertion operator the agent can add to a
The agent uses these to add meaningful assertions rather than leaving the section empty.
## Assertions section:| Operator | Example |
|---|---|
| Exact status match | status: 200 |
| Field existence | body.id: exists |
| Enum membership | body.role: in [admin, user] |
| Substring match | headers.content-type: contains json |
| Regex match | body.slug: matches ^[a-z]+$ |
Pipeline capture patterns
Pipeline capture patterns
The skill shows the capture expression syntax used to pass values between steps in a pipeline:
response.body.id— scalar fieldresponse.body[0].id— first array elementresponse.body.data.token— nested fieldresponse.headers.Location— response header
flows/ pipelines that chain endpoint calls together.When to use MCP tools vs. shell commands
When to use MCP tools vs. shell commands
The skill includes a decision table so the agent picks the right tool for each task:
The agent never invokes
| Situation | Use |
|---|---|
| Execute a single endpoint spec | mad_exec MCP tool |
| Run a multi-step pipeline | mad_flow MCP tool |
| Create or update a spec file | mad_author MCP tool |
| Search specs by method, path, or tag | mad_search MCP tool |
| Show variable resolution for a spec | mad_vars MCP tool |
| Execute multiple specs in one call | mad_exec_batch MCP tool |
| Validate a spec or directory | mad validate shell command |
| Rebuild the index | mad index shell command |
| Debug a failing endpoint | /mad-debug slash command |
mad_exec to create files, and never writes spec files directly without going through mad_author.Rules the agent must follow
Rules the agent must follow
The skill ends with a short, firm rules section the agent treats as constraints:
- Use
mad_author, not direct file writes, for all spec creation and updates. - Run
mad indexafter writing or updating any spec. - Default to
--env=dev. Confirm explicitly before using--env=prod. - Never embed secrets in markdown — use
.env.localorMAD_*environment variables. - Use realistic field names and values in specs — never
"string"or1as placeholder content.
How agents use the skill in practice
When you ask your agent to document an endpoint — for example, “document POST /orders” — it follows a sequence driven by what it learned from the skill:Read the skill
The agent loads
.claude/skills/mad/SKILL.md (or the equivalent for your agent) and internalizes the spec format, project layout, and rules.Locate the handler
The agent searches the source code for the
POST /orders route handler and reads the request body type, response shape, and any authentication requirements.Author the spec
The agent calls
mad_author with a fully-formed spec: correct frontmatter, a realistic ## Request block with real field values, an ## Expected response block matching the handler’s return type, and ## Assertions covering at least the status code and one body field.