Fix Invalid JSON from AI
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
The PRD looks done — but Non-Goals is gone and Requirements jumped above Goals. Section presence and order, checked in one pass.
The most dangerous document violation is the missing section nobody notices: a PRD without Non-Goals reads fine and ships scope creep. This setup validates a PRD against its six-section structure and catches both the silently-missing Non-Goals and an order violation (Requirements appearing before Goals). Order matters in documents that get reviewed section by section — reviewers navigate by position, and a reordered document breaks their checklist.
Validate before the review meeting
A structural pass costs seconds; a review derailed by a missing section costs the meeting.
Treat order as part of the contract
Reviewers navigate by position — the order warning is about their checklist, not aesthetics.
Repair and re-validate
The repair prompt restores Non-Goals and the correct order; a second pass confirms PASS.
It fixes only the two listed structural problems — a missing "## Non-Goals" section and Requirements appearing before Goals — and leaves everything else alone. The OUTPUT RULES are explicit: "keep everything that was already correct unchanged" and "fix only the problems listed above — do not change anything else." It checks presence and order against the six-section structure, not requirement quality; judging substance stays the reviewer's job.
Because reviewers navigate structured documents by position. The PROBLEMS FOUND list flags "Sections out of order: 'Requirements' appears before 'Goals'" with the fix to "keep the sections in the defined order" (Problem, Goals, Non-Goals, Requirements, Risks, Timeline). This validation surfaces the flagged structural issue for you to confirm — it acts on the listed problems, not a guarantee it caught every possible ordering issue.
The JSON won't parse and you can't see why. Deterministic cause-sniffing — trailing commas, single quotes, unclosed brackets — and the repair prompt that fixes it.
Paste the response, get the verdict: real JSON parsing, missing-field detection, and a repair prompt for everything found.
Grade agent output the same way every time — a rubric scoring correctness, grounding, safety, tone, and completeness, with a pass threshold instead of a gut call.
Stop getting 'Sure, here is the JSON…' — the output-contract pattern that forces models to return only parseable JSON: schema, example, and a strict rule block.
Free text in, named fields out. The extraction prompt pattern that turns any unstructured text into consistent, parseable records.
Billing, Technical, Account, How-To, Feature Request — ticket triage with definitions that decide the borderline cases for the model.
Paste an AI's output and validate it against the expected format — with a repair prompt for every failure found.
The draft is 90% right and you ask AI to fix the one thing that's wrong — and it hands back a whole new version with the good parts rewritten worse. Here's how to ask for a targeted edit that fixes what's broken and leaves the rest exactly as it was.
AI hands you a polished email, landing page, or support reply that looks ready to send — and only after you send it do you find the claim you can't back or the audience you got wrong. Here's how to build a reusable QA checklist and review generated content against it first.