# TOML Repair: Fix It, Keep Every Value

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.

- Page: https://aiskills402.com/skills/toml-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/toml-repair

## Use it 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.

## Tested, honestly

Tested 2026-10-08.

- Strong model (claude-sonnet-5-5 (Claude Code alias "sonnet")): 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")): 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.

### With and without the skill

Tested 2026-10-08.

- Files repaired right (22 files): Sonnet 22/22 with, 17/22 without; Haiku 21/22 with, 14/22 without.

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.

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

## Example

### 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

## How to buy

Agent (HTTP):

1. GET https://api.aiskills402.com/v1/skills/toml-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: 9.5 KB (9706 bytes)
- SHA-256: ec4d917b29825ef795a18cef5852b13dfeb841fa98602442116e5c6e0e142932
- Updated: 2026-10-08
- New versions are free through your re-download token.

## Versions

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

## 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

### 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.

## Related skills

- [YAML Repair: Fix It, Keep Every Value](https://aiskills402.com/skills/yaml-repair.md): $0.05 once
- [JSON Repair: Fix It, Keep Every Value](https://aiskills402.com/skills/json-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.
