What problem does it solve? LLMs often produce malformed JSON, invalid formats, or off-spec text that breaks downstream parsing and requires retry loops. This Skill teaches how to use the Guidance library from Microsoft Research to enforce token-level constraints so model outputs always match required patterns. ## Core Features & Use Cases - Regex and Grammar Constraints: Force generation to match patterns like emails, dates, phone numbers, UUIDs, or full JSON schemas compiled from Pydantic models. - Selection and Token Healing: Restrict outputs to fixed option sets with select() and fix tokenization boundary artifacts automatically. - Reusable Workflows: Build stateful @guidance functions for classification, entity extraction, chain-of-thought reasoning, and ReAct agents with tool use. - Use Case: You need an LLM to return a user profile as parseable JSON with a valid email field. Use guidance.json() with a Pydantic schema on a local Transformers model to guarantee schema-conforming output on every call. ## Quick Start Use the guidance skill to generate a JSON user profile with name, age, and a regex-validated email field using a local Transformers model.