One-click install
npx skills add https://github.com/carterwayneskhizeine/hermes-agent-windows-R --skill guidance-carterwayneskhizeine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guidance
Source: https://github.com/carterwayneskhizeine/hermes-agent-windows-R/tree/main/optional-skills/mlops/guidance
Command: npx skills add https://github.com/carterwayneskhizeine/hermes-agent-windows-R --skill guidance-carterwayneskhizeine

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires guidance, transformers, and includes references (resource) components.

What problem does it solve?

It helps developers control LLM output format so responses reliably become valid JSON, XML, or code instead of malformed, off-spec text.

Core Features & Use Cases

  • Regex and grammar-constrained generation: Force outputs to match patterns (regex) or structured rules (grammars) for fields like emails, IDs, dates, and nested objects.
  • Structured multi-step workflows: Build reusable, stateful or stateless generation functions to assemble complex workflows without brittle prompt engineering.
  • Token healing for clean syntax: Reduce spacing/token-boundary artifacts so generated text concatenates naturally into well-formed results.

Use Case: Extract user profiles from free-form text and emit guaranteed-valid JSON with constrained fields (e.g., email format regex, numeric ranges, and allowed categorical values) for downstream automation.

Quick Start

Use the guidance skill to generate a constrained JSON object where each field is validated by a regex or grammar.

Frequently Asked Questions about guidance

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I guarantee LLM outputs are valid JSON during generation?

Constrained LLM generation guarantees valid JSON by applying regex or context-free grammars during token-level production. This enforces structural syntax and field-level rules, preventing malformed outputs and eliminating the need for brittle prompt engineering.

What is token healing and how does it improve structured text generation?

Token healing reduces spacing and token-boundary artifacts during constrained generation. It ensures generated text concatenates naturally into well-formed results, producing clean syntax for structured outputs like JSON and XML.

How do I enforce regex constraints for specific fields in LLM extraction pipelines?

You can enforce regex constraints by applying grammar-based decoding to control token production for specific fields. This validates formats like emails, IDs, and dates during generation, ensuring extracted data matches required patterns.

Can I build multi-step agent workflows with constrained LLM generation?

Yes, you can build stateful or stateless multi-step agent workflows using constrained generation. This assembles complex pipelines with optional selection constraints for fixed categorical choices without relying on brittle prompt engineering.

Does constrained generation work with the transformers library?

Yes, constrained generation works with the transformers library. The implementation uses guidance alongside transformers to apply grammar-based decoding, regex constraints, and token healing to control LLM output formats.

What are the limitations of using grammar-based decoding for LLM outputs?

Grammar-based decoding limits generation flexibility, as strict regex or context-free grammar rules restrict open-ended text. It is best suited for structured formats like JSON, XML, and code rather than creative text generation.