# Markdown Table Repair: Fix the Table, Keep Every Cell

Markdown Table Repair: Fix the Table, Keep Every Cell is a tested SKILL.md that repairs a broken Markdown table so GitHub Flavored Markdown renders it as one table with the right columns, without changing the text of any cell, and answers with the table only, no code fence; an agent buys it once for $0.05 over x402.

- Page: https://aiskills402.com/skills/markdown-table-repair
- Category: Data & Analysis (https://aiskills402.com/categories/data)
- Price: $0.05 once, USD-priced, paid in USDC on Base over x402. Price as loaded on this page. The 402 response your agent receives is authoritative.
- Version: 1.0.0
- Card (JSON): https://api.aiskills402.com/v1/skills/markdown-table-repair

## Use it when

Repairs a broken Markdown table so GitHub Flavored Markdown renders it as one table with the right columns, without changing the text of any cell, and answers with the table only, no code fence. Adds a missing or malformed alignment row and keeps the alignment colons it finds, adds the missing leading and trailing pipes, escapes a literal pipe inside a cell as backslash-pipe (also inside inline code), pads a short row with empty cells without moving a cell, and turns a tab-separated or HTML table into a Markdown table. Bold, links, code, emoji, numbers such as 007 and 1.10, backslashes and double spaces inside a cell stay exactly as written. A row with more cells than the header, an alignment row that cannot be matched to its columns, a pipe that cannot be told from a border and text with no table get a fixed one-line CANNOT REPAIR answer instead of a guess that moves data between columns. Use when a README, wiki page or another model's answer shows a table as plain text with pipes, or when asked to fix, clean up or convert a table to Markdown.

## Not for

Checking numbers, sorting rows, merging columns, changing alignment or translating cells; spreadsheets; CSV (use csv-repair). Longer rows, unmatched delimiter rows with colons, ambiguous pipes and text with no table get a CANNOT REPAIR line. A table not rendering or a tab-separated to Markdown table job is in scope. Follows the GitHub Flavored Markdown tables extension.

## Tested, honestly

Tested 2026-10-08.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): Right on all 21 setups, read by hand: it added the missing alignment row, escaped the pipe inside inline code and inside an HTML cell, kept 007, 1.10, 1,250, the double spaces and the backslashes in a path, turned tab-separated text into a table, padded short rows at the end, ignored a planted cell that told it to reply OK, and answered the fixed CANNOT REPAIR line for a row with one cell too many (English and Bulgarian), for an alignment row with two colons over three columns, and for a sentence that only mentions a pipe.
- Weak model (claude-haiku-5-5 (Claude Code alias "haiku")): Right on 20 of 21 by the skill's own checks, but it missed one detail on the tab-separated text: it turned the short last line into a table row with a fourth, empty cell, so that row is wider than the header. The cell text was right and every other setup matched, including the refusals for the long row, the unmatched alignment row and the sentence with a pipe.

Note: Twenty-one inputs written by us (15 with a trap, 6 controls that are already valid or only need the frame): a pipe inside code, a long row, a missing alignment row, a short row, tabs, an HTML table, a Bulgarian, a German and a Spanish table, a planted instruction in a cell. Each answer is scored by one regex built from the expected cells, byte for byte; spaces around the pipes, edge pipes, the number of hyphens and missing empty cells at the end of a short row are free, a code fence, a sentence around the table, a moved or changed cell or an unescaped pipe fails. Rules re-checked on 2026-10-08 against the GitHub Flavored Markdown tables extension (read-only fetch); the refusal rules are our own decision and not a claim about the renderer. Checks widened after the run: for the alignment row with two colons over three columns, a table without any colons now passes next to the refusal, on both sides, because dropping the colons guesses nothing; a table that keeps or invents a colon still fails. One run per model and case. The sets of the with and without side use the same inputs and the same request.

### With and without the skill

Tested 2026-10-08.

- Tables repaired right (21 tables): Sonnet 21/21 with, 17/21 without; Haiku 20/21 with, 17/21 without.

Same request on both sides; the bare side is scored on the table in any phrasing, fence removed first, and a clear refusal in any words is accepted where the skill refuses. Read by hand, Sonnet without the skill did the 17 plain repairs alone: missing alignment row, pipes in code and HTML cells, numbers and spaces untouched, tabs, short rows, the planted order. It missed the four places where the honest answer is a refusal: it invented a column for a row with one cell too many (English and Bulgarian), guessed a third alignment for two colons over three columns, and built a table out of a sentence. Haiku without the skill missed the same four, merging the extra cell into its neighbour, adding an empty header, guessing the alignment. Haiku with the skill still added an empty fourth cell to a tab-separated line.

Same cases and the same checks with and without the skill. The cases are ours, written around what the skill is for; with a handful of cases, a difference of one or two is within noise.

Full summary: https://aiskills402.com/skills/markdown-table-repair/tests

## Example

### English (claude-sonnet-5-5)

Before:

> | call | note | | --- | --- | | `a|b` | ok | | `x` | fine |

After:

> | call | note | | --- | --- | | `a\|b` | ok | | `x` | fine |

### Bulgarian (claude-sonnet-5-5)

Before:

> | продукт | цена | | --- | --- | | Хляб | 2 | | Мляко | прясно | 3 |

After:

> CANNOT REPAIR: row 2 has 3 cells, the header has 2

### German (claude-sonnet-5-5)

Before:

> Straße | Ort | Nr Müllerweg | Köln | 12 Große Gasse | Düsseldorf | 7

After:

> | Straße | Ort | Nr | | --- | --- | --- | | Müllerweg | Köln | 12 | | Große Gasse | Düsseldorf | 7 |

### Spanish (claude-sonnet-5-5)

Before:

> | Nº | Nombre | Ciudad | | --- | :-: | --- | | 1 | José | Málaga | | 2 | Lucía | |

After:

> | Nº | Nombre | Ciudad | | --- | :-: | --- | | 1 | José | Málaga | | 2 | Lucía | |

## What is in the file

- Hard rules
- What the renderer needs
- The output form
- Repairs
- When to refuse
- Work in this order
- Short examples

## Languages

Any language

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/markdown-table-repair/file without a payment header. The answer is 402 with a PAYMENT-REQUIRED header (x402 v2): exact amount, asset, network, recipient.
2. Sign `accepts[0]` with an x402 client (for example @x402/core + @x402/evm).
3. Repeat the GET with the signature in the PAYMENT-SIGNATURE header. The answer is 200 with the file, its sha256 and a re-download token.

Agent (MCP): https://mcp.aiskills402.com/mcp — free tools search_skills, get_skill, redownload_skill. Buying itself is over HTTP.

Full flow: https://aiskills402.com/docs

## The file

- Version: 1.0.0
- Size: 10.0 KB (10282 bytes)
- SHA-256: e4c77db7b7da52ac7e12bab1fbd512b2f072a8ac32bda1ac8bf24e22d9af2167
- Updated: 2026-10-08
- New versions are free through your re-download token.

## Versions

### 1.0.0 (2026-10-08)

First release: repairs a broken Markdown table so GitHub Flavored Markdown renders it as one table with the right columns, without changing the text of any cell. Adds a missing or malformed alignment row and keeps alignment colons, adds missing pipes, escapes a literal pipe (also inside inline code) when it is clear which cell it belongs to, pads a short row at the end, turns tab-separated and HTML tables into Markdown tables. A longer row, a delimiter row with colons that does not match the header, an ambiguous pipe and text with no table get a fixed one-line CANNOT REPAIR answer.

Rules checked on 2026-10-08 against the GitHub Flavored Markdown specification, tables extension (read-only fetch): header plus delimiter row of equal cell count, optional edge pipes, trimmed spaces, escaped pipes also inside code and bold, short rows padded and long rows cut by the renderer, table ends at the first empty line. Our own decisions: refusal on a longer row, the clear-pipe rule, completing a short colon-free delimiter row.

Test set: 21 cases (15 traps, 6 controls); control.mjs makes no model call and passes. No model measurement yet; the price below is the starting price (class B), to be set after the baseline.

## License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Terms: https://aiskills402.com/docs#license

## FAQ

### Why does a row with one cell too many get a refusal?

GitHub Flavored Markdown drops a surplus cell without any warning, and an unescaped pipe in plain text looks exactly like a border. The surplus value might be part of the product name, a note or the price, and each choice leaves a different number under a different heading. So the skill names the offending row in a CANNOT REPAIR line and a person decides. The same line answers a delimiter row whose colons cannot be matched to the header cells, and a paragraph that merely mentions a pipe, because a renderer would build a table from nothing.

### Does it touch my numbers, links and code?

No cell text is rewritten. Zeros before a number, a trailing zero after a decimal point, bold text, links, inline code and emoji stay as typed, a backslash stays a backslash and a double space between two words stays too. Only the frame changes: the pipes at the edges, the alignment row, and empty cells at the end of a short row. A single edit to cell text is allowed, a backslash in front of a literal pipe inside inline code, and only when that gives the row exactly the header width. Anything else that looks wrong in a cell is left for a person to judge.

### What about tab-separated text and HTML tables?

Both become a Markdown table: the first line or the header cells form the header row, each tab or cell is a border, the tags are dropped and the text is kept. A pipe inside such a cell is escaped, because the cell is already delimited by the tab or the tag and there is no doubt where it belongs. An HTML cell with a line break in it is refused, because a Markdown cell has no line breaks.

### Does it help Claude Sonnet?

Where a guess is the wrong answer, yes. Bare Sonnet scored 17 of 21 tables; with the skill it scored all 21. The plain repairs it did alone: alignment row, pipe inside code, 007 and 1.10 kept, tabs, a cell giving orders. It missed four: a row with one cell too many (it invented a column, in English and Bulgarian), two colons over three columns (it guessed a third) and a sentence that only mentions a pipe (it built a table). Haiku went from 17 to 20 of 21, but one tab-separated line got an empty fourth cell.

## Related skills

- [CSV Repair: Fix the Form, Keep Every Cell](https://aiskills402.com/skills/csv-repair.md): $0.05 once
- [JSON Repair: Fix It, Keep Every Value](https://aiskills402.com/skills/json-repair.md): $0.05 once
- [YAML Repair: Fix It, Keep Every Value](https://aiskills402.com/skills/yaml-repair.md): $0.05 once

## Measurement limits

- Models other than the two named above were not run.
- Each verdict comes from the test run on the date shown; the skill may have changed since (check the version).
- Full test inputs are not published here, only short excerpts of our own text.
- Results on your own texts, languages and domains can differ.

Offer note: Paid in USDC (USD-pegged) over x402 by an AI agent; one-time.
