---
title: "Enable on-demand expertise with Agent Skills in Genkit Go"
description: "Agent Skills in Genkit Go address the prompt-context problem caused by loading every procedure, guide, and document into an agent’s persistent context. The tutorial defines skills as discoverable knowledge packs organized around a SKILL.md file, whose frontmatter is exposed first and whose instructions, references, assets, and scripts are loaded through progressive disclosure when needed. It integrates the Skills middleware with Genkit’s wrapper architecture, scans SkillPaths for metadata, matches descriptions, and invokes the use_skill tool before injecting the selected skill into active context; Go examples use ai.WithUse during Generate or GenerateText. Recipe and image-restoration examples show skills activating for matching requests, while the post notes that the restoration skill may require several attempts because model behavior is non-deterministic."
---

# Enable on-demand expertise with Agent Skills in Genkit Go

[Google](https://yomu.fyi/company/google) · Daniela Petruzalek · Jul 31, 2026

**Type:** Tutorial

## Summary

Agent Skills in Genkit Go address the prompt-context problem caused by loading every procedure, guide, and document into an agent’s persistent context. The tutorial defines skills as discoverable knowledge packs organized around a SKILL.md file, whose frontmatter is exposed first and whose instructions, references, assets, and scripts are loaded through progressive disclosure when needed. It integrates the Skills middleware with Genkit’s wrapper architecture, scans SkillPaths for metadata, matches descriptions, and invokes the use\_skill tool before injecting the selected skill into active context; Go examples use ai.WithUse during Generate or GenerateText. Recipe and image-restoration examples show skills activating for matching requests, while the post notes that the restoration skill may require several attempts because model behavior is non-deterministic.

## Context

Large language model agents may need substantial standard operating procedures, reference guides, and other documents, but loading all of that material into persistent prompt context consumes tokens, dilutes focus, and can increase incorrect responses.

## Approach / What changed

Use Genkit’s Skills middleware with configured SkillPaths. It discovers SKILL.md metadata, exposes descriptions to the agent, activates a matching skill through the use\_skill tool, and loads its full instructions and optional references, assets, or scripts only when required.

## Takeaways

- A skill uses a SKILL.md file with frontmatter for metadata and a body containing instructions; optional scripts, references, and assets can accompany it.
- Genkit’s Skills middleware is added with ai.WithUse and SkillPaths, and supports dynamic discovery, activation, and execution during Generate or GenerateText calls.
- The image-restoration example activated a painting skill, but the post notes that non-deterministic model behavior may require several attempts for a good result.

**Tags:** [AI Agents](https://yomu.fyi/topic/ai-agents), [Genkit](https://yomu.fyi/topic/genkit), [Go](https://yomu.fyi/topic/go)

- Source: [Google](https://developers.googleblog.com/enable-on-demand-expertise-with-agent-skills-in-genkit-go)
- Source URL: https://developers.googleblog.com/enable-on-demand-expertise-with-agent-skills-in-genkit-go
- Ingested by Yomu: 2026-09-09T14:28:09.486Z

[Read original post](https://developers.googleblog.com/enable-on-demand-expertise-with-agent-skills-in-genkit-go)
