Markdown validation

From y-miyazaki/terraform-aws-base · View interactive version

Markdown validation is an AI agent skill from the GitHub repository y-miyazaki/terraform-aws-base. Validate Markdown syntax, formatting, and links using markdownlint-cli2 and markdown-link-check. Use when committing docs changes, checking broken links, or validating Markdown in pull requests.

How to use this skill

Skill file

Input

Output Specification

Return structured Markdown in accordance with references/common-output-format.md. That file is the source of truth for the output contract.

Structured validation results from two tools: markdownlint-cli2 → markdown-link-check.

Execution Scope

USE FOR:

DO NOT USE FOR:

Reference Files Guide

Workflow

  1. From the repository root, run bash <skill-dir>/scripts/validate.sh [path] (omit path to scan the whole working directory).
  2. For each failed tool, get details per common-individual-commands.md: re-run markdownlint-cli2 <files> (the script hides its output), and re-run markdown-link-check on every target file (the script stops at the first broken file, so later files are unchecked). Map rule IDs and broken links to checklist ItemIDs and prefix each finding in ## Error Details with its ItemID, so the report names which checklist item failed.
  3. Report failed/skipped tools per references/common-output-format.md.

Error Handling

| Condition | Severity | Action |

| -------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------- |

| scripts/validate.sh missing | Fatal | Stop; report missing script |

| No .md files under target path | Info | Report both tools as ⊘ Skipped (no .md files) in ## Tool Results; Status ✅ PASS; stop |

| markdownlint-cli2 or link-check tool missing | Recoverable | Report that tool as skipped in ## Tool Results |

| External link timeout or transient network | Recoverable | Report the link-check failure; note in ## Error Details that it is network-only |

| Single tool fails, other succeeds | Recoverable | Report both tools in ## Tool Results; include the failed tool's output in ## Error Details |

| All tools fail | Fatal | Status: ❌ FAIL with per-tool output in ## Error Details |

| common-checklist.md unavailable | Fatal | Stop; report missing dependency |

| common-output-format.md unavailable | Recoverable | Note missing file; emit ## Summary, ## Tool Results, and ## Error Details only |

Examples

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.