Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add vikasudasi/skill-vault --skill llm-json-outputgit clone --depth 1 https://github.com/vikasudasi/skill-vaultWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/vikasudasi/skill-vault/llm-json-output)<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/llm-json-output"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/llm-json-output/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/vikasudasi/skill-vault/llm-json-output"><img src="https://agentmods.dev/badge/skills/vikasudasi/skill-vault/llm-json-output.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00026 | $0.00383 |
| Opus 5 | $0.00013 | $0.00192 |
| Sonnet 5 | $0.00005 | $0.00077 |
| Haiku 4.5 | $0.00003 | $0.00038 |
Grade A, and why
llm-json-output scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Reliable Structured JSON from LLMs
Use when an LLM must return machine-parseable JSON — for tool results, configs, or data you validate downstream.
Prefer native structured output when available
Many providers offer a JSON schema / structured-output mode that constrains generation. If available, pass your Pydantic schema and skip manual prompt hacks.
Fallback: prompt with a schema
Return a JSON object with exactly these keys:
{"name": string, "port": int, "enabled": bool}
No other text, no markdown fences.
Add 1-2 examples of the exact shape you want.
Always validate + retry
Never trust the raw string. Parse, validate against your model, and on failure
re-prompt with the error (Invalid JSON: {e}. Please retry). Cap retries (2-3);
if still failing, fall back to a degraded default.
Strip markdown fences
Models often wrap JSON in ```json fences — strip them before json.loads.
Pitfalls
- JSON is order-sensitive to the model's tokens, not to you: keep the schema small.
- Booleans/numbers coerce surprisingly; validate types, not just that it parses.
- Don't paste secrets or huge schemas into the prompt — it costs tokens and dilutes output.
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 48 lines · 26 tokens per session scan A 690ed7e533a9
llm-json-output is a skill published in the GitHub repository vikasudasi/skill-vault (0 stars, last pushed 23d ago), licensed Apache-2.0. It adds 26 tokens to every session and 383 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
llm-integration
LLM integration patterns for function calling, streaming responses, local inference with Ollama, and fine-tuning customization. Use when implementing tool use, SSE streaming, local model deployment, LoRA/QLoRA fine-tuning, or multi-provider LLM APIs.
prompt-engineering
Use when one prompt must give the same right answer across reruns, models, and pasted-in hostile input: forcing a fixed schema, picking the few-shot set, ordering the prompt blocks, or the inline cases you run while tuning. NOT the agent loop, tools, or retrieval (that is building-agents), NOT a standing CI eval…
llm-engineering-expert
Build reliable applications on large language models: prompt design, structured output, evaluation, guardrails, and cost and latency control. Use when the user mentions LLMs, prompts, prompt engineering, few-shot examples, structured or JSON output, function calling, hallucination, model evaluation, token costs…
openai-patterns
Production OpenAI API patterns — model selection, prompt engineering, function calling, streaming, error handling, cost control, and structured outputs.
prompt_engineering
Expert guide on prompt engineering for 2024-2025 models (GPT-4o, Claude 3.5, o1, o3, Gemini 2.0). Covers reasoning models, delimiters, structured output, and context engineering.
prompt-engineering
Master advanced prompt engineering techniques to maximize LLM performance, reliability, and controllability in production. Use when optimizing prompts, improving LLM outputs, designing production prompt templates, or building AI-powered features.