Data & Analysis

Markdown Table Repair: Fix the Table, Keep Every Cell

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.

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.

Tested 2026-10-08No code, no hidden instructionsv1.0.0 · 10.0 KB · perpetual license

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 with a strong and a weak model.

With and without the skill

Results with and without the skill, for Sonnet and Haiku
SonnetHaiku
withwithoutwithwithout
Tables repaired right (21 tables)21/2117/2120/2117/21

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.

SonnetStrong model, claude-sonnet-5-5
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.
HaikuWeak model, claude-haiku-5-5
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.

Full test summary

Example

Our own test text, before and after the skill ran. Excerpts only.

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. Tried in: English, Bulgarian, German, Spanish.

License

Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing. Holder: Georgi Kalchev, aiskills402.com. Full terms.

Versions

Current version 1.0.0, updated 2026-10-08. Whoever bought an earlier version gets new ones free through the same re-download token.

  1. v1.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.

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.

Share

Read this page as Markdown: /skills/markdown-table-repair.md.

  • CSV Repair: Fix the Form, Keep Every Cell

    Data & Analysis

    SKILL.md · v1.0.0 · 8.3 KB

    Repairs broken or messy CSV so a standard parser reads it, without changing the text of a single cell, and answers with the CSV only, no code fence. Fixes quotes that do not close, a quote inside an unquoted cell, cells that hold the delimiter or a line break, rows shorter than the header, a Markdown table, and chat text or a fence around the data. Numbers such as 1,250, 007 and 1.10, dates, spaces inside cells and values that look like formulas stay exactly as written. Semicolon and tab files keep their delimiter. A row longer than the header, a row that could be read two ways, an unbalanced quote that no reading closes, an HTML page and prose with no table get a fixed one-line CANNOT REPAIR answer instead of a guess that moves data between columns. Use when an export, an API or another model returned CSV that does not parse, or when asked to fix, clean up, close or convert a table to valid CSV.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026

  • JSON Repair: Fix It, Keep Every Value

    Data & Analysis

    SKILL.md · v1.0.1 · 6.9 KB

    Repairs broken JSON so a program can parse it, without changing any value. Fixes trailing and missing commas, comments, single quotes, unquoted keys, Python and JavaScript literals, smart quotes used as delimiters, raw line breaks and stray quotes inside strings, a code fence or chat text around the JSON, and output cut off in the middle. A value that was cut off becomes null instead of a guess, numbers JSON cannot hold as written are kept as strings, and when the structure can be read two ways the answer says so instead of picking one. Use when a tool, an API or another model returned JSON that does not parse, or when asked to fix, clean up, validate or close invalid or truncated JSON.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 7 Oct 2026

  • YAML Repair: Fix It, Keep Every Value

    Data & Analysis

    SKILL.md · v1.0.0 · 8.4 KB

    Repairs broken YAML and Markdown front matter so a program can parse it, without changing any value's text or type, and answers with the YAML only, no code fence. Fixes tabs used as indentation, indentation that fits no parent, a missing closing quote or bracket, values that need quotes (a colon inside, a leading star or at sign), and output cut off in the middle, where the cut value is kept as cut and never completed. Yes, no, on, off and NO stay strings, 1,250 stays a string, 1.10 and 01234 stay as written. Duplicate keys, input that is not YAML, and input with two readings get a fixed one-line answer instead of a guess. Use when a tool, an API or another model returned YAML or front matter that does not parse, or when asked to fix, clean up or close invalid or truncated YAML.

    $0.05once

    • x402
    • USDC
    • Base
    Get skill

    Tested with Sonnet and Haiku, 8 Oct 2026