Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when reviewing scripts, client components, bundles, or runtime behavior related to Parse JSON safely with error handling. Inspect both source code and the browser execution path so fixes target the real bottleneck or bug.
.claude/skills/thedaviddias-json-safety/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 24% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 51% | 0% |
| case-05 | ✓→✓ | = Same ✓ | -10% | 0% |
JSON.parse() on invalid input throws a SyntaxError that will crash your application if uncaught. API responses, localStorage values, and user-provided data can all be malformed. Safe parsing with validation catches these errors at the point of parsing, not deep in your application logic when a missing property causes an unexpected error.
Find all JSON.parse() calls in this file and check whether each one is wrapped in try/catch and whether the result is validated before use.
Add try/catch error handling to all JSON.parse() calls and add shape validation to protect against unexpected data structures.
Explain why JSON.parse can throw, what safe JSON parsing looks like, and when to use schema validation libraries.
Review scripts, client components, and browser execution paths related to Parse JSON safely with error handling. Flag exact imports, event handlers, runtime side effects, or blocking operations that violate the rule, and state how the change should be verified in the browser.
For full implementation details, code examples, and framework-specific guidance, see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/javascript/json-safety
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-05 | pass→pass | 18,947 | 17,232 | -9% | 1 | 1 | 0% | 3,035 | 2,732 | -10% | 0 | 0 | — |
case-01 | fail→pass | 12,381 | 14,688 | +19% | 1 | 1 | 0% | 2,161 | 3,359 | +55% | 0 | 0 | — |
case-02 | pass→pass | 15,340 | 6,809 | -56% | 1 | 1 | 0% | 2,279 | 1,642 | -28% | 0 | 0 | — |
case-03 | pass→pass | 17,163 | 17,957 | +5% | 1 | 1 | 0% | 1,962 | 1,391 | -29% | 0 | 0 | — |
case-04 | pass→pass | 19,902 | 16,729 | -16% | 1 | 1 | 0% | 3,032 | 3,153 | +4% | 0 | 0 | — |
case-06 | pass→pass | 11,846 | 6,033 | -49% | 1 | 1 | 0% | 1,845 | 1,300 | -30% | 0 | 0 | — |
case-07 | pass→pass | 11,300 | 8,205 | -27% | 1 | 1 | 0% | 2,095 | 1,815 | -13% | 0 | 0 | — |
case-08 | fail→pass | 9,526 | 9,000 | -6% | 1 | 1 | 0% | 1,617 | 2,013 | +24% | 0 | 0 | — |
case-09 | pass→pass | 13,884 | 10,882 | -22% | 1 | 1 | 0% | 2,239 | 2,243 | +0% | 0 | 0 | — |
case-10 | pass→pass | 14,751 | 10,494 | -29% | 1 | 1 | 0% | 2,440 | 1,982 | -19% | 0 | 0 | — |
case-11 | pass→pass | 12,923 | 8,565 | -34% | 1 | 1 | 0% | 2,160 | 1,646 | -24% | 0 | 0 | — |
case-12 | pass→pass | 10,788 | 9,228 | -14% | 1 | 1 | 0% | 1,683 | 1,899 | +13% | 0 | 0 | — |
case-13 | fail→pass | 15,298 | 9,022 | -41% | 1 | 1 | 0% | 2,219 | 1,705 | -23% | 0 | 0 | — |
case-14 | fail→pass | 7,144 | 8,648 | +21% | 1 | 1 | 0% | 1,161 | 1,749 | +51% | 0 | 0 | — |
case-15 | pass→pass | 13,732 | 9,666 | -30% | 1 | 1 | 0% | 2,022 | 1,723 | -15% | 0 | 0 | — |
case-16 | pass→pass | 16,287 | 10,474 | -36% | 1 | 1 | 0% | 2,461 | 1,900 | -23% | 0 | 0 | — |
case-17 | pass→pass | 9,723 | 9,450 | -3% | 1 | 1 | 0% | 1,482 | 1,726 | +16% | 0 | 0 | — |
case-18 | pass→pass | 9,845 | 10,275 | +4% | 1 | 1 | 0% | 1,490 | 1,883 | +26% | 0 | 0 | — |
case-19 | pass→pass | 11,412 | 7,636 | -33% | 1 | 1 | 0% | 2,020 | 1,710 | -15% | 0 | 0 | — |
case-20 | pass→pass | 13,997 | 15,957 | +14% | 1 | 1 | 0% | 2,453 | 3,220 | +31% | 0 | 0 | — |
case-21 | pass→pass | 15,562 | 17,394 | +12% | 1 | 1 | 0% | 2,820 | 3,384 | +20% | 0 | 0 | — |
case-22 | pass→pass | 15,489 | 14,704 | -5% | 1 | 1 | 0% | 2,488 | 2,731 | +10% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +18 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.