From prompt-engineering
Make an LLM return reliably machine-parseable output — choose the enforcement mechanism (native JSON/schema mode, tool/function calling, constrained grammar, or prose+parser), define the schema, and build the parse/validate/repair path. Reach for this when output format drifts, when downstream code parses model output, or when 'return JSON' in prose keeps failing. Pairs with prompt-pattern-selection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/prompt-engineering:structured-output-designThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Turn "please return JSON" (a wish) into an enforced contract. The mechanism
Turn "please return JSON" (a wish) into an enforced contract. The mechanism matters more than the wording.
Prefer mechanism over pleading. Reach for the strongest enforcement the model supports before adding words that ask nicely. Prose instructions are the last resort, not the first.
Write the target schema (JSON Schema or a tool parameter schema). Then define the non-happy paths: the refusal shape, the "I don't know" shape, and what an error looks like. Downstream code needs a contract for failure too, not just success.
Trace ../../knowledge/prompt-decision-trees.md §2:
Never trust the raw output, even from native modes:
If user text, tool output, or retrieved docs go into the prompt, fence and label them as data (see the injection best-practice) — structured output does not by itself stop injection.
prompt-reliability-engineer.ai-coding-model-guidance / claude-api.backend-engineering.A structured-output implementation: the schema, the chosen enforcement mechanism (with the tree path), the parse/validate/repair path, the fail-closed behavior, and the fencing of any untrusted slots.
npx claudepluginhub mcorbett51090/ravenclaude --plugin prompt-engineeringGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.