guidance

Generate structured JSON, XML, and code outputs using regex and grammars.

3|1|Updated May 19, 2026
One-click install
npx skills add https://github.com/Quill-Agent/Quill-Agent --skill guidance-quill-agent
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guidance
Source: https://github.com/Quill-Agent/Quill-Agent/tree/main/optional-skills/mlops/guidance
Command: npx skills add https://github.com/Quill-Agent/Quill-Agent --skill guidance-quill-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires guidance, transformers, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps ensure that LLM outputs are constrained and structured, reducing errors and improving data quality.

Core Features & Use Cases

  • Regex Constraints: Control LLM output syntax with regex for specific formats.
  • Grammar-Based Generation: Build complex structured outputs like JSON, XML, and code.
  • Token Healing: Prevent awkward spacing issues from tokenization.
  • Multi-Step Workflows: Build structured multi-step workflows with Pythonic control flow.
  • Use Case: For example, use this Skill to generate valid JSON data from free-form text, or to create structured documents from user input.

Quick Start

Use the guidance skill to generate a structured JSON object from a text description like "Person: John Doe, Age: 30, Email: [email protected]".

Frequently Asked Questions about guidance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I ensure valid JSON output from an LLM?

To ensure valid JSON output from an LLM, apply grammar-based generation and regex constraints to control the syntax. This guarantees structured data generation and prevents formatting errors during extraction.

How do I prevent awkward spacing issues caused by LLM tokenization?

Prevent awkward spacing issues caused by LLM tokenization by applying token healing techniques. This fixes tokenization artifacts to ensure clean, properly formatted structured outputs like JSON and XML.

Can I use regex constraints to control LLM output syntax for specific formats?

Yes, you can use regex constraints to control LLM output syntax for specific formats. This allows you to enforce strict formatting rules, ensuring the generated text matches required patterns for structured data tasks.

Do I need the Guidance library and Python to generate structured multi-step workflows?

Yes, you need the Guidance library and Python to generate structured multi-step workflows. These dependencies provide the Pythonic control flow and regex capabilities required for grammar-based generation and complex structured outputs.

What is the best way to extract structured data from free-form text inputs?

The best way to extract structured data from free-form text inputs is using grammar-based generation with token healing. This approach guarantees valid formats like JSON, XML, and tables by constraining the LLM output syntax.