guidance
Microsoft's structured generation library for constrained LLM outputs using Handlebars-style templates
Skill by UltronCore
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ultroncore-guidance
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: ml
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/guidance
What's inside
- Skill name
guidance- Description
- Microsoft's structured generation library for constrained LLM outputs using Handlebars-style templates
- License
- MIT
- Instructions
- 191 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Guidance — Structured LLM Generation (Microsoft)
## Overview
Guidance (by Microsoft) is a Python library for constrained LLM generation that interleaves generation with control flow. Unlike prompt engineering, Guidance programs interleave text generation with Python logic, enabling token-level constraints (regex, grammars, selects), JSON schema enforcement, and stateful multi-turn generation. Works with local models (llama.cpp, transformers) and cloud APIs (OpenAI, Anthropic).
GitHub: https://github.com/guidance-ai/guidance (19k+ stars)
## When to Use
- Enforcing strict output formats (JSON, XML, code) at the token level
- Building structured extraction pipelines without post-processing
- Constrained decoding for classification, slot-filling, or form completion
- Multi-turn agentic loops with guaranteed schema conformance
- When regex or grammar constraints on generation are needed
## Installation
```bash
pip install guidance
# For local llama.cpp support
pip install guidance[llamacpp]
# For transformers support
pip install guidance[transformers]
```
## Key Patterns / Usage
### Basic Template Generation
```python
import guidance
from guidance import models, gen
# Use OpenAI
lm = models.OpenAI("gpt-4o-mini")
# Or local llama.cpp
# lm = models.LlamaCpp("path/to/model.gguf")
# Simple generation
lm += "The capital of France is " + gen("capital", stop=".")
print(lm["capital"]) # → "Paris"
```
### Select (Classification)
```python
from guidance import select
lm = models.OpenAI("gpt-4o-mini")
lm += f"""Classify the sentiment of this review:
Review: "The product was amazing and exceeded expectations!"
Sentiment: """ + select(["positive", "negative", "neutral"], name="sentiment")
print(lm["sentiment"]) # → "positive" (guaranteed)
```
### JSON Schema Enforcement
```python
from guidance import json as guidance_json
from pydantic import BaseModel
from typing import List
class Person(BaseModel):
name: str
age: int
hobbies: List[str]
lm = models.OpenAI("gpt-4o-mini")
lm += "Extract person info: John is 30 and loves hiking and cooking.\n"
lm += guidance_json(name="person", schema=Person)
import json
person = json.loads(lm["person"])
print(person) # {"name": "John", "age": 30, "hobbies": ["hiking", "cooking"]}
```
### Regex Constraints
```python
from guidance import regex
lm = models.OpenAI("gpt-4o-mini")
# Extract phone number in exact format
lm += "Customer phone: " + regex(r"\(\d{3}\) \d{3}-\d{4}", name="phone")
print(lm["phone"]) # → "(555) 123-4567"
# Extract date
lm += "\nDate of birth: " + regex(r"\d{4}-\d{2}-\d{2}", name="dob")
```
### Multi-Step Conditional Generation
```python
from guidance import system, user, assistant, gen, select
@guidance
def analyze_code(lm, code):
lm += system("You are a code reviewer.")
lm += user(f"Review this code:\n```python\n{code}\n```")
lm += assistant(
"Severity: " + select(["low", "medium", "high", "critical"], name="severity") + "\n"
"Issues found: " + gen("issues", max_tokens=200) + "\n"
"Suggested fix: " + gen("fix", max_tokens=300)
)
return lm
lm = models.OpenAI("gpt-4o-mini")
result = analyze_code(lm, "x = input(); eval(x)")
print(result["severity"]) # → "critical"
print(result["issues"])
```
### Grammar-Constrained Generation
```python
from guidance import grammar
# Define a simple grammar for arithmetic expressionsFrom UltronCore/claude-skill-vault, MIT.
More from UltronCore/claude-skill-vault
- 0.494score
ai-agent-memory
UltronCore
Design and implement memory systems for AI agents — short-term working context, episodic memory in vector stores, entity extraction into knowledge graphs…
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
embeddings-expert
UltronCore
Text embeddings for semantic search, clustering, RAG retrieval, and similarity.
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
ai-cost-optimizer
UltronCore
LLM cost reduction: prompt caching, model routing, token optimization, and batching.
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
claude-tool-use
UltronCore
Advanced Claude tool/function calling patterns: tool definitions, parallel tool use, tool result chaining, and agentic loops.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
autogen
UltronCore
Microsoft's multi-agent conversation framework for building collaborative AI workflows
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
haystack
UltronCore
Production-ready LLM pipeline framework with component-based architecture for RAG and QA
SkillCFreshness: C★ 1Claude Code +9 - 0.485score
diffusion-models
UltronCore
Build and deploy diffusion model pipelines for image generation, inpainting, and fine-tuning using Hugging Face Diffusers.
SkillCFreshness: C★ 1Claude Code +9 - 0.485score
embedding-pipeline
UltronCore
Build production embedding pipelines for semantic search, RAG, and recommendation systems.
SkillCFreshness: C★ 1Claude Code +9 - 0.484score
computer-vision
UltronCore
Computer vision tasks: image classification, object detection, OCR, and manga/comic image processing.
SkillCFreshness: C★ 1Claude Code +9 - 0.483score
skill-name
UltronCore
One-line description of what this skill does and when to use it.
SkillCFreshness: C★ 1Claude Code +9 - 0.264score
ab-testing-statistics-ai-ml-stub
UltronCore
No description from the publisher yet.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 24, 2026 (5 months ago)
- Last release
- May 24, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/UltronCore/claude-skill-vault
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from UltronCore
- 0.494score
ai-agent-memory
UltronCore
Design and implement memory systems for AI agents — short-term working context, episodic memory in vector stores, entity extraction into knowledge graphs…
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
embeddings-expert
UltronCore
Text embeddings for semantic search, clustering, RAG retrieval, and similarity.
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
ai-cost-optimizer
UltronCore
LLM cost reduction: prompt caching, model routing, token optimization, and batching.
SkillCFreshness: C★ 1Claude Code +9 - 0.493score
claude-tool-use
UltronCore
Advanced Claude tool/function calling patterns: tool definitions, parallel tool use, tool result chaining, and agentic loops.
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
autogen
UltronCore
Microsoft's multi-agent conversation framework for building collaborative AI workflows
SkillCFreshness: C★ 1Claude Code +9 - 0.491score
haystack
UltronCore
Production-ready LLM pipeline framework with component-based architecture for RAG and QA
SkillCFreshness: C★ 1Claude Code +9
Cite this page
guidance skill. Agent Mart. https://agentmart.dev/skills/ultroncore-guidance (last updated 2026-10-24)