guidance

Constrain LLM output generation with regex and grammars for structured formats.

Updated May 4, 2026
One-click install
npx skills add https://github.com/Supporter09/Face_Anti_Spoofing_Biometric --skill guidance-supporter09
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guidance
Source: https://github.com/Supporter09/Face_Anti_Spoofing_Biometric/tree/main/.claude/skills/guidance
Command: npx skills add https://github.com/Supporter09/Face_Anti_Spoofing_Biometric --skill guidance-supporter09

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Guidance removes the uncertainty from LLM output by letting you constrain what the model can say, so you can reliably produce valid structured results instead of fixing malformed responses after the fact.

Core Features & Use Cases

  • Constrained Generation: Enforce exact formats for JSON, XML, dates, emails, IDs, and other structured fields with regex and grammars.
  • Workflow Building: Compose multi-step prompts, decision branches, and reusable generation functions for agents, extraction, and classification pipelines.
  • Backend Flexibility: Work with API models or local models while keeping the same constraint-driven prompting approach.
  • Use Case: A developer can generate a valid API payload, classify a user message into a fixed label set, or extract entities from text without writing brittle retry logic.

Quick Start

Ask the skill to generate a constrained output for your model, such as a valid JSON object, a labeled classification result, or a multi-step guided workflow.

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 every time?

To ensure valid JSON output from an LLM, use constrained generation with regex constraints and grammars to enforce exact formats, preventing malformed responses without writing retry logic.

What is constrained generation for LLM workflows?

Constrained generation for LLM workflows is the process of controlling model output using grammars, selection controls, and token healing to guarantee valid structured results like JSON or XML.

Can I use constrained generation with local models and API models?

Yes, you can use constrained generation with both local models and API models, applying the same constraint-driven prompting approach across different backends to maintain output consistency.

How do I build multi-step LLM workflows with decision branches?

You can build multi-step LLM workflows with decision branches by composing prompts and defining reusable guidance functions to create agents, extraction, and classification pipelines.

What is token healing in structured output generation?

Token healing in structured output generation is a control mechanism that repairs boundary tokens to ensure the final text strictly adheres to the specified regex or grammar constraints.

How do I extract entities from text without writing retry logic?

You can extract entities from text without retry logic by applying constrained generation to enforce the exact output format, eliminating the need to fix malformed responses after generation.