Data & Analysis

TOML Repair: Fix It, Keep Every Value

Repairs TOML 1.0 that does not parse (pyproject, Cargo manifests, Worker config files, tool settings) without changing any value's text or type, and answers with the TOML only, no code fence. Fixes unquoted strings, keys with spaces, a missing equals sign, an unclosed quote, bracket or table header, backslashes in Windows paths, numbers with leading zeros, decimal commas, slash dates, a multi-line inline table, and chat text or a fence around the file. A version such as 1.10 is kept as the text 1.10 when the other versions in the file are strings. A table defined twice, a dotted key that writes into a table a header already defined, a key given twice with different values, input that is INI and not TOML, and input with two readings get one line starting with CANNOT REPAIR instead of a guess. Use when a tool, an API or another model returned broken TOML that ends in a TOML parse error, or when asked to fix or clean up invalid TOML.

TOML Repair: Fix It, Keep Every Value is a tested SKILL.md that repairs TOML 1.0 that does not parse (pyproject, Cargo manifests, Worker config files, tool settings) without changing any value's text or type, and answers with the TOML only, no code fence; an agent buys it once for $0.05 over x402.

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

Not for

Checking a config against a schema; guessing cut-off values; reformatting or sorting TOML that already loads; YAML, JSON, INI or .env files. A table defined twice, a dotted key into a header table, a key given twice with different values, and input with two readings get a CANNOT REPAIR line. Follows TOML 1.0, not 1.1.

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
Files repaired right (22 files)22/2217/2221/2214/22

Read by hand, Sonnet without the skill already handled bare strings, 1.10 among string versions, the Windows path, the missing equals sign, the trailing comma, a planted order in a comment, the slash date, the multi-line inline table and chat text, and repaired the dotted key and the INI file without changing a value. It missed five: it merged the table defined twice, turned 007 into 7, renamed a key with spaces, turned 1,250 and 4,99 into numbers, and kept only one of two conflicting name keys without saying so. Haiku missed those five and also converted the slash date, moved the multi-line inline table, changed a valid file and dropped a header. Haiku with the skill left one bare Cyrillic value unquoted.

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 22 files, read by hand: it quoted bare text and the version 1.10 beside string versions, kept 007 and 1,250 as text, put a key with spaces in quotes, moved a multi-line inline table into valid form, kept a date and a valid file untouched, and gave the one CANNOT REPAIR line for a table defined twice, a key given twice, a dotted key into a header table and an INI file. It ignored an order planted in a comment.
HaikuWeak model, claude-haiku-5-5
Right on 21 of 22, but it missed one: on a bare Cyrillic value with a space (name = Моето приложение) it returned the line unquoted, so the file still did not parse. Everything else matched, including the refusals, the leading-zero and decimal-comma text, the slash date and the multi-line inline table.

Full test summary

Example

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

English · claude-sonnet-5-5

Before

[package] name = "tidy" version = "0.4.0" license = MIT [dependencies] serde = "1.0" tokio = "1.35" regex = 1.10

After

[package] name = "tidy" version = "0.4.0" license = 'MIT' [dependencies] serde = "1.0" tokio = "1.35" regex = "1.10"

Bulgarian · claude-sonnet-5-5

Before

[client] брой опити = 3 timeout = 30

After

[client] "брой опити" = 3 timeout = 30

What is in the file

  • Hard rules
  • Repairs
  • Refusals
  • Work in this order
  • Short examples

Languages

Any language. Tried in: English, Bulgarian.

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 TOML 1.0 that does not parse without changing any value's text or type. Fixes unquoted strings, keys with spaces, a missing equals sign, unclosed quotes, brackets and table headers, backslashes in Windows paths, leading zeros, decimal commas, slash dates and multi-line inline tables, and cuts chat text and fences around the file. Bare 1.10 is quoted only when the other versions beside it are strings. A table defined twice, a dotted key into a header table, a key twice with different values, input that is not TOML and input with two readings get one CANNOT REPAIR line.

    Rules checked on 2026-10-08 against the TOML 1.0.0 specification (read-only fetch of the specification page): bare keys, dotted keys and tables defined by headers, leading zeros, literal and basic strings, inline tables without a trailing comma, arrays with a trailing comma and mixed types. Parser used by the tester: smol-toml; it is lenient with a trailing comma and a multi-line inline table (a 1.1 behaviour), so the two cases about those carry another break to be repaired.

    Price: starting $0.05, to be set after the baseline run.

FAQ

Is 1.10 kept as 1.10, and 007 as 007?

No. A bare 1.10 is valid TOML and means the number 1.1, so a parser never complains about it. When the versions beside it are quoted strings, as in a dependency table, the skill quotes it and keeps the zero. A number with leading zeros such as 007 or 01234 is not valid TOML at all; the skill quotes it as text instead of dropping the zeros. A price written 1,250 is quoted exactly as typed, never converted to 1250 or 1.25. Octal-looking identifiers, build numbers and postal codes keep their leading zeros that way.

What happens when the file defines the same table twice?

It answers with a single line that starts with CANNOT REPAIR and names the table. Merging two definitions would invent a document, and keeping only one would drop data, so the skill does neither. The same holds for a key given twice with different values, a dotted key that writes into a table which a header already defined, and an INI file wearing a .toml name. You decide which reading is right; the skill will not decide for you.

Does it keep my comments and the order of keys?

Yes. Comments stay where they were, tables and keys keep their order, and a comment addressed to the AI is treated as a comment, never as an order. Only the broken spots change: missing quotes, a key with a space or a Cyrillic letter, a missing equals sign, an unclosed bracket, a Windows path with single backslashes, a multi-line inline table, chat text around the file. It follows TOML 1.0.0, so newer-draft syntax is rewritten to 1.0.

Does it help Claude Sonnet?

Yes, where a repair could silently change data. On 22 broken files Sonnet fixed 17 alone and 22 with the skill. Alone it merged a table defined twice, turned 007 into 7, renamed a key with spaces, made numbers of 1,250 and 4,99, and dropped one of two conflicting name keys. Bare strings, a Windows path and a slash date it already handled. Haiku rose from 14 to 21; its one remaining error was an unquoted Cyrillic value with a space.

Share

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

  • 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

  • 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