Agent skill · AI & Agents

guidance

Control LLM output with regex and grammars, guarantee valid JSON/XML/code generation, enforce structured formats, and build multi-step workflows with Guidance - Microsoft Research's constrained generation framework

Orchestra-Researchgithub.com/Orchestra-ResearchGitHub ↗
claude-codecodexMIT
Install
npx skills add Orchestra-Research/AI-Research-SKILLs --skill guidance --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 4
SKILL.md size: 14 KB
Bundled scripts: none
Version: 1.0.0
Declared author: Orchestra Research
Requires: [guidance, transformers]
Path: 16-prompt-engineering/guidance/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 11,391
Language: TeX
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Guidance: Constrained LLM Generation ## When to Use This Skill Use Guidance when you need to: - **Control LLM output syntax** with regex or grammars - **Guarantee valid JSON/XML/code** generation - **Reduce latency** vs traditional prompting approaches - **Enforce structured formats** (dates, emails, IDs, etc.) - **Build multi-step workflows** with Pythonic control flow - **Prevent invalid outputs** through grammatical constraints **GitHub Stars**: 18,000+ | **From**: Microsoft Research ## Installation ```bash # Base installation pip install guidance # With specific backends pip install guidance[transformers] # Hugging Face models pip install guidance[llama_cpp] # llama.cpp models ``` ## Quick Start ### Basic Example: Structured Generation ```python from guidance import models, gen # Load model (supports OpenAI, Transformers, llama.cpp) lm = models.OpenAI("gpt-4") # Generate with constraints result = lm + "The capital of France is " + gen("capital", max_tokens=5) print(result["capital"]) # "Paris" ``` ### With Anthropic Claude ```python from guidance import models, gen, system, user, assistant # Configure Claude lm = models.Anthropic("claude-sonnet-4-5-20250929") # Use context ma

What's inside
Steps it walks through
  1. When to Use This Skill
  2. Installation
  3. Quick Start
  4. Basic Example: Structured Generation
  5. With Anthropic Claude
  6. Core Concepts
  7. 1. Context Managers
  8. 2. Constrained Generation
  9. 3. Token Healing
  10. 4. Grammar-Based Generation
  11. 5. Guidance Functions
  12. Backend Configuration
  13. Anthropic Claude
  14. OpenAI
Ships with 3 files
  • references/backends.md
  • references/constraints.md
  • references/examples.md
Commands it runs
Base installation
pip install guidance
With specific backends
pip install guidance[transformers]  # Hugging Face models
pip install guidance[llama_cpp]     # llama.cpp models
More from AI-Research-SKILLs
All skills →
About this skill
What does the guidance skill do?

Control LLM output with regex and grammars, guarantee valid JSON/XML/code generation, enforce structured formats, and build multi-step workflows with Guidance - Microsoft Research's constrained generation framework

How do I install it?

Run `npx skills add Orchestra-Research/AI-Research-SKILLs --skill guidance --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From Orchestra-Research/AI-Research-SKILLs, a repository with 11,391 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going