{"slug":"toml-repair","name":"TOML Repair: Fix It, Keep Every Value","version":"1.0.0","updated_at":"2026-10-08T16:27:12.724Z","use_when":"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.","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.","languages":["any"],"tags":["toml","toml-repair","config-files","pyproject","cargo","no-guessing"],"category":"data","category_url":"https://aiskills402.com/categories/data","keywords":["broken TOML","invalid TOML","TOML parse error"],"faq":[{"q":"Is 1.10 kept as 1.10, and 007 as 007?","a":"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."},{"q":"What happens when the file defines the same table twice?","a":"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."},{"q":"Does it keep my comments and the order of keys?","a":"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."},{"q":"Does it help Claude Sonnet?","a":"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."}],"examples":[{"lang":"en","model":"claude-sonnet-5-5","input_excerpt":"[package]\nname = \"tidy\"\nversion = \"0.4.0\"\nlicense = MIT\n\n[dependencies]\nserde = \"1.0\"\ntokio = \"1.35\"\nregex = 1.10","output_excerpt":"[package]\nname = \"tidy\"\nversion = \"0.4.0\"\nlicense = 'MIT'\n\n[dependencies]\nserde = \"1.0\"\ntokio = \"1.35\"\nregex = \"1.10\""},{"lang":"bg","model":"claude-sonnet-5-5","input_excerpt":"[client]\nброй опити = 3\ntimeout = 30","output_excerpt":"[client]\n\"брой опити\" = 3\ntimeout = 30"}],"page_url":"https://aiskills402.com/skills/toml-repair","markdown_url":"https://aiskills402.com/skills/toml-repair.md","image_url":"https://cdn.aiskills402.com/og/skills/toml-repair/d5efbec0.png","related_url":"https://api.aiskills402.com/v1/skills/toml-repair/related","purchases_count":null,"tested":{"date":"2026-10-08","strong":{"model":"claude-sonnet-5-5 (Claude Code alias \"sonnet\")","verdict":"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."},"weak":{"model":"claude-haiku-5-5 (Claude Code alias \"haiku\")","verdict":"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."},"note":"Twenty-two broken or valid TOML files written by us (15 with a planted trap, 7 controls): a version among string versions, a table defined twice, 007, an inline table with a trailing comma, a Windows path, a dotted key into a header table, a slash date, a missing equals sign, a key with spaces, an order inside a comment, decimal commas, a multi-line inline table, INI, a duplicate key, a bare date. Each answer is scored by code with a TOML 1.0 parser: the whole document and the type of the risky values must match, no fence, comments kept, and a single CANNOT REPAIR line for the refusals. The two traps about a trailing comma and a multi-line inline table carry another break, because the parser is lenient with them. Facts re-checked against the TOML 1.0.0 specification on 2026-10-08. After the run two checks were widened on both sides: for the dotted key into a header table and for INI, a refusal or an exact repair with every value kept (valid TOML 1.0, same data) is accepted, since a model can do that without changing any value. Scored with the fence removed from bare answers. One run per model and case.","baseline":{"date":"2026-10-08","rows":[{"label":"Files repaired right (22 files)","better":"higher","strong":{"with":{"n":22,"of":22},"without":{"n":17,"of":22}},"weak":{"with":{"n":21,"of":22},"without":{"n":14,"of":22}}}],"note":"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."},"report_url":null},"price_usd":"0.05","price_micro":50000,"size_bytes":9706,"sha256":"ec4d917b29825ef795a18cef5852b13dfeb841fa98602442116e5c6e0e142932","outline":["Hard rules","Repairs","Refusals","Work in this order","Short examples"],"license":{"summary":"Perpetual, non-exclusive; use and modify for yourself incl. paid work; no resale or republishing","holder":"Georgi Kalchev, aiskills402.com","url":"https://aiskills402.com/docs#license"},"buy_url":"https://api.aiskills402.com/v1/skills/toml-repair/file","redownload_url_template":"https://api.aiskills402.com/v1/purchases/{token}","mcp_tool":null,"payment":{"protocol":"x402","scheme":"exact","asset":"USDC","selling":true,"network":"base","network_caip2":"eip155:8453","pay_to":"0x8e37022edcf0f21cf3c9f93fee9d4d32519f36f4","facilitator":"cdp"},"seo_title":"TOML Repair Skill That Keeps Every Value","seo_description":"Fixes TOML that fails to parse, keeping every value and type: 1.10 and 007 stay text. Answers with the TOML alone. Pay $0.05 once, in USDC.","versions":[{"version":"1.0.0","date":"2026-10-08","changelog":"# Changelog\n\n## 1.0.0 — 2026-10-08\n\nFirst 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.\n\nRules 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.\n\nPrice: starting $0.05, to be set after the baseline run.\n\n## Test 2026-10-08 (Sonnet and Haiku, with and without the skill, 22 cases, one run each)\n- Measured: Sonnet 22/22 with, 17/22 without (gain 5); Haiku 21/22 with, 14/22 without (gain 7).\n- Check widened (both sides): dotted-key-meets-table now accepts a refusal OR an exact repair (valid TOML 1.0, same data, no key added or dropped, no `pool.` left); the bare model had produced such a repair. The \"wrong\" example for it is now a repair that drops timeout.\n- Check widened (both sides): ini-is-not-toml now accepts a refusal OR an INI-to-TOML repair with host quoted and port 8080 (number or string), nothing added.\n- control.mjs extended with okRepair cases; make-cases.mjs builds the alternatives with one lookahead regex.\n- No case needs a re-run; no input changed.\n- Price: $0.05 (Sonnet gain 5).\n"}]}