What problem does it solve? LLMs frequently produce malformed JSON, invalid emails, or off-format outputs that break downstream parsing and require retry loops. This Skill uses Microsoft Research's Guidance framework to enforce regex and grammar constraints at the token level, so generated outputs always match the required structure. ## Core Features & Use Cases - Regex and Grammar Constraints: Force outputs to match patterns like emails, dates, phone numbers, UUIDs, or full JSON/XML grammars during generation. - Token Healing: Automatically fixes tokenization boundary issues so concatenated prompts and generations produce natural text without spacing artifacts. - Multi-Step Workflows and Agents: Build ReAct agents, chain-of-thought pipelines, and reusable @guidance functions with Pythonic control flow across Anthropic, OpenAI, Transformers, and llama.cpp backends. - Use Case: You need an extraction pipeline that pulls name, date, and email fields from unstructured text into guaranteed-valid JSON. Define regex constraints per field, run the generation once, and parse the result without validation retries. ## Quick Start Ask the AI to write a Guidance script that generates a JSON object with name, age, and email fields using regex constraints with the Anthropic backend.