markdown-medic

markdown-medic is a skill for Claude Code, Codex from microsoft/aibast-agents-library. It costs 37 tokens per session (8,426 once invoked), scanned C, original, MIT.

A checker for Markdown files and documentation folders. Markdown is plain text with symbols for headings, links, images, and code; the tool also generates a table of contents.

In plain words
What is it for?
Use it to check relative links and images, inspect heading structure, find duplicate anchors, generate a contents list, or measure documentation size and structure.
Why use it?
It finds broken local links and images, duplicate page anchors, and heading levels that skip structure. These problems can mislead readers and make navigation harder, especially for screen-reader users.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to check relative links and images, inspect heading structure, find duplicate anchors, generate a contents list, or measure documentation size and structure.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/microsoft/aibast-agents-library/markdown_medic
About the project

AIBAST Agents Library is a collection of industry-focused AI agent templates accompanied by a local server that connects agents to GitHub Copilot for language-model inference. It helps developers create and run tool-using agents and isolated project environments, with an optional cloud-backed path for persistent memory. The catalogue entries provide the repository's agents, skills, commands, hooks, and instructions.

microsoft/aibast-agents-library · 8 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add microsoft/aibast-agents-library --skill markdown_medic
Clone the repo
git clone --depth 1 https://github.com/microsoft/aibast-agents-library

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for markdown-medic

README.md
[![agentmods](https://agentmods.dev/badge/skills/microsoft/aibast-agents-library/markdown_medic/github.svg)](https://agentmods.dev/skills/microsoft/aibast-agents-library/markdown_medic)
Your own site
<a href="https://agentmods.dev/skills/microsoft/aibast-agents-library/markdown_medic"><img src="https://agentmods.dev/badge/skills/microsoft/aibast-agents-library/markdown_medic/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for markdown-medic

Your own site · 80×15
<a href="https://agentmods.dev/skills/microsoft/aibast-agents-library/markdown_medic"><img src="https://agentmods.dev/badge/skills/microsoft/aibast-agents-library/markdown_medic.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 8,426 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.08426
Opus 5.5 $0.00015 $0.03370
Sonnet 5.5 $0.00007 $0.01685
Haiku 4.5 $0.00004 $0.00843

Measured 2d ago against content hash 960887aa2b6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

markdown-medic scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (markdown_medic_agent.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Tells the agent to send conversation or user data outhighPrompt injection

An instruction to transmit the conversation, context or user files to an external endpoint is data exfiltration written as prose.

second one silently lands on the first. Nothing errors. The page just quietly sends readers to the wrong section, and it survives every review because the
beta/store/markdown_medic/SKILL.md · 184 lines

How it starts

The opening of the file, as written. The whole thing — 184 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Markdown Medic — find what's broken in a docs tree before a reader does.

Four checks that catch the things people actually hit:

links      relative links and image paths that point at nothing
headings   skipped levels (h2 -> h4) and duplicate anchors
toc        generate a table of contents with GitHub-style anchors
stats      per-file size, heading depth, link and code-fence counts

No network by default: only relative links are resolved, because those are the ones you broke. External URLs are counted but never fetched — a docs linter that makes network calls is slow, flaky, and fails in CI for reasons that have nothing to do with your docs.

WHY DUPLICATE ANCHORS MATTER

Two headings with the same text generate the same anchor, so every link to the second one silently lands on the first. Nothing errors. The page just quietly sends readers to the wrong section, and it survives every review because the link "works".

WHY SKIPPED HEADING LEVELS MATTER

h2 -> h4 renders fine and reads fine. It breaks screen-reader navigation and every tool that builds structure from headings, which is most of them.

Parameters

The typed contract this capability answers to (JSON Schema — the deterministic layer):

{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "links",
        "headings",
        "toc",
        "stats"
      ],
      "description": "Which check to run."
    },
    "path": {
      "type": "string",
      "description": "A .md file or a folder of them."
    }
  },
  "required": [
    "action",
    "path"
  ]
}

Deterministic implementation

Run this instead of improvising when the inputs are well-formed:

def perform(self, **kwargs):
        action, path = kwargs.get("action"), kwargs.get("path")
        if not path or not os.path.exists(path):
            return json.dumps({"status": "error",
                               "message": f"not found: {path}"}, indent=2)
        files = _md_files(path)
        if not files:
            return json.dumps({"status": "ok", "files": 0,
                               "note": "no .md files found"}, indent=2)
        base = path if os.path.isdir(path) else os.path.dirname(path) or "."

        try:
            if action == "links":
                broken, ext, ok = [], 0, 0
                for f in files:
                    body = _strip_code(open(f, encoding="utf-8", errors="ignore").read())
                    for bang, text, href in LINK.findall(body):
                        if href.startswith(("http://", "https://", "mailto:", "#")):
                            ext += 1
                            continue
                        target = os.path.normpath(
                            os.path.join(os.path.dirname(f), href.split("#")[0]))
                        if href.split("#")[0] and not os.path.exists(target):
                            broken.append({"file": os.path.relpath(f, base),
                                           "kind": "image" if bang else "link",
                                           "text": text[:40], "href": href})
                        else:
                            ok += 1
                return json.dumps({
                    "status": "ok", "files": len(files), "broken": len(broken),
                    "relative_ok": ok, "external_not_checked": ext,
                    "findings": broken[:100],
                    "note": "External URLs are counted, never fetched — a linter "
                            "that makes network calls fails in CI for reasons "
                            "unrelated to your docs.",
                }, indent=2)

            if action == "headings":
                issues = []
                for f in files:
                    body = _strip_code(open(f, encoding="utf-8", errors="ignore").read())
                    hs = HEADING.findall(body)
                    seen, prev = {}, 0
                    for hashes, text in hs:
                        lvl = len(hashes)
                        if prev and lvl > prev + 1:
                            issues.append({"file": os.path.relpath(f, base),
                                           "kind": "skipped-level",
                                           "detail": f"h{prev} -> h{lvl}",
                                           "heading": text[:50]})
                        a = _anchor(text)
                        if a in seen:
                            issues.append({"file": os.path.relpath(f, base),
                                           "kind": "duplicate-anchor",
                                           "detail": f"#{a}", "heading": text[:50]})
                        seen[a] = True
                        prev = lvl
                return json.dumps({
                    "status": "ok", "files": len(files), "issues": len(issues),
                    "findings": issues[:100],
                    "note": "Duplicate anchors silently send every link to the "
                            "second heading to the first one instead.",
                }, indent=2)

            if action == "toc":
                out = []
                for f in files:
                    body = _strip_code(open(f, encoding="utf-8", errors="ignore").read())
                    lines = []
                    for hashes, text in HEADING.findall(body):
                        lvl = len(hashes)
                        if lvl == 1:
                            continue
                        clean = re.sub(r"`([^`]*)`", r"\1", text)
                        lines.append("  " * (lvl - 2) + f"- [{clean}](#{_anchor(text)})")
                    if lines:
                        out.append({"file": os.path.relpath(f, base),
                                    "toc": "\n".join(lines)})
                return json.dumps({"status": "ok", "files": len(out),
                                   "tables_of_contents": out[:20]}, indent=2)

            if action == "stats":
                rows = []
                for f in files:
                    raw = open(f, encoding="utf-8", errors="ignore").read()
                    body = _strip_code(raw)
                    hs = HEADING.findall(body)
                    rows.append({
                        "file": os.path.relpath(f, base),
                        "bytes": len(raw.encode()), "lines": raw.count("\n") + 1,
                        "headings": len(hs),
                        "max_depth": max([len(h) for h, _ in hs], default=0),
                        "links": len(LINK.findall(body)),
                        "code_fences": len(FENCE.findall(raw)) // 2,
                    })
                rows.sort(key=lambda r: -r["bytes"])
                return json.dumps({"status": "ok", "files": len(rows),
                                   "total_bytes": sum(r["bytes"] for r in rows),
                                   "documents": rows[:60]}, indent=2)

            return json.dumps({"status": "error",
                               "message": f"unknown action {action!r}",
                               "valid": ["links", "headings", "toc", "stats"]}, indent=2)
        except Exception as e:
            return json.dumps({"status": "error",
                               "message": f"{type(e).__name__}: {e}"}, indent=2)

Read the full file on GitHub · 184 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 184 lines · 37 tokens per session scan C 960887aa2b6f

Subscribe to this mod's changes

markdown-medic is a skill published in the GitHub repository microsoft/aibast-agents-library (8 stars, last pushed yesterday), licensed MIT. It adds 37 tokens to every session and 8,426 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (tells the agent to send conversation or user data out). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-06.

Related

markdown-medic compared with skills from other repositories

markdown-medic next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
markdown-medicmicrosoft/aibast-agents-librarySkill8yesterdayMITC37Claude Code, Codex
imagegenopenai/codexSkill134ktodayApache-2.0A113Codex
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill79kyesterdayMITA200Claude Code, Codex
playwright-climicrosoft/playwrightSkill100kyesterdayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill394ktodayMITA36Claude Code
systematic-debuggingobra/superpowersSkill314k5d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill143ktodayMITA95Claude Code