From doc-tools
Detects and fixes Markdown (GFM) table rendering issues: unescaped pipes, column-count mismatches, indented code-block tables, and misplaced alignment colons. Use when tables render as raw text or cleaning LLM-generated docs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/doc-tools:markdown-table-validatorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Scan Markdown files for the structural problems that silently demote a GFM table
Scan Markdown files for the structural problems that silently demote a GFM table
to a plain paragraph on GitHub / VS Code preview, and optionally auto-escape the
single most common cause (an unescaped | inside a cell).
Self-Evolving Skill: This skill improves through use. If the detector misses a real broken-table case, the
--fixheuristic guesses wrong, or a path/flag has drifted — fix this file (and the detector SSoT) immediately, don't defer. Only update for real, reproducible issues.
GFM ignores whitespace between pipes, so alignment is never the cause. What
breaks rendering is structure — overwhelmingly an unescaped | inside a
cell. GFM's table tokenizer treats a | as a column delimiter even inside a
`code span`, so a regex/code cell like `a | b | c` inflates that
row's cell count and the whole table collapses. The fix — escaping it as \| —
changes meaning, so no formatter does it for you (Prettier actively corrupts
such tables: prettier#10164 / #11410). This skill detects it and can apply the
escape under review.
SCAN=${CLAUDE_PLUGIN_ROOT}/skills/markdown-table-validator/scripts/scan_markdown_tables.ts
# Report problems in one file (exit 1 if any render-breaking error)
bun "$SCAN" path/to/FILE.md
# Audit a whole tree
bun "$SCAN" "docs/**/*.md" "plugins/**/*.md"
# Opt-in auto-fix: escape over-count pipes, then re-align with prettier
bun "$SCAN" --fix path/to/FILE.md
prettier --write path/to/FILE.md
| Code | Severity | Meaning |
|---|---|---|
column-overflow | error | A row has more cells than the header → unescaped | in a cell. |
header-mismatch | error | Header and separator row have different column counts → won't render. |
indented-table | error | Table indented ≥4 spaces → parsed as a code block. |
alignment-colon-in-row | error | An alignment token like :--: sits in a data row (misplaced separator). |
short-row | info | Row has too few cells; GFM pads and markdownlint --fix repairs. |
missing-blank-line | info | No blank line before/after the table; the formatter auto-fixes. |
Fenced code blocks ( ```) are skipped, so example broken tables shown
inside docs don't trip the scan.
Compiler-style path:line: severity: message [code]. Exit 0 when no error
remains (info nits never fail the run), 1 otherwise — usable as a gate.
--fix heuristic (always review the diff)For a row with more cells than the header, the genuine columns are assumed to be
the first N; every pipe beyond column N is treated as literal content and
escaped as \|. This exactly fixes the common case (regex/code in the last
cell) but can guess wrong when a pipe was a genuinely missing delimiter — so
review the diff, then run prettier --write to re-align.
This skill is the manual, repo-wide counterpart to the per-edit
itp-hooks PostToolUse guard (posttooluse-markdown-table-guard.ts), which
reminds Claude to fix the same errors the moment a .md file is written. Use
the skill to clean existing docs in bulk; the hook prevents new
breakage. Both share the same detection algorithm (SSoT:
plugins/itp-hooks/hooks/lib/markdown-table-detector.ts).
Suppress the per-edit hook on a file by adding a comment containing MD-TABLE-OK.
After this skill completes, reflect before closing the task:
markdown-table-detector.ts) and its mirror here.Do NOT defer. The next invocation inherits whatever you leave behind.
npx claudepluginhub terrylica/cc-skills --plugin doc-toolsGuides creation and formatting of Markdown tables with syntax, alignment, pipe escaping, inline markdown, multi-line workarounds, empty cells, and wide table strategies.
Applies markdown linting rules and best practices for consistent formatting in .md and .mdc files, covering blank lines, bullet style, code fences, table alignment, headers, lists, and links.
Use this skill immediately when the user needs to: set up markdownlint-cli2 and pre-commit hooks in a repository, fix or batch-repair markdownlint errors like MD013/MD040/MD060, configure .markdownlint.json rules, remove horizontal rules from markdown files while preserving YAML frontmatter, or run markdown format checking in a monorepo. Trigger on: markdownlint 报错, 设置 markdown lint, 格式化 markdown, 检查 md 格式, 设置 pre-commit, markdownlint error, MD013/MD040/MD060 violations. Do NOT use for general article proofreading, writing new markdown content, or YAML/JSON linting.