Google wires Agent Skills into its Genkit framework for on-demand skill packs

Anthropic's open skills standard is now wired into all four of Google's language versions. Two runnable Go examples walk you through it, and hooking it in takes one line of code.
By Google Developers Blog08-04 · 8 min read⚑ Tutorial / how-to
🎧 Listen to the podcast0:00 / --:--
0:00 / --:--
Tool Tutorial · Xiaohu's Take
One-Minute Read
  • AI agent manuals keep piling up, and cramming them all into context burns tokens and distracts the model. Google wired Agent Skills into its own framework, Genkit: the manuals stay on disk, and the right one loads only when needed.
  • The skills standard started with Anthropic, and Google hooked it into all four language versions. Enabling it takes one line of code.
  • Google's official test image is the original painting of "Monkey Jesus" (disfigured in 2012). The model correctly identifies it as an oil painting and summons the matching restoration skill.
⚑ Source material comes from a Google Developers Blog tutorial on their own framework, Genkit. The example outputs shown are as displayed in the original article; this site has not independently re-run them.
The Problem

Stuffing the manual into the AI's head is a losing game

The Google Developers Blog just published a refreshingly practical tutorial: Genkit, their open-source AI application framework, now officially supports Agent Skills — the "AI skill pack" format started by Anthropic and now open as an industry standard. The short version: you used to have to shove every operating manual into the prompt, but now the manuals stay on disk and only the one you need gets loaded. The tutorial includes two directly runnable Go examples: a recipe bot, and an AI art restorer that picks its own restoration approach.

4 Languages
TypeScript / Go / Dart / Python all supported
3 Stages
Progressive disclosure: Discover → Activate → Execute
1-Line Hookup
ai.WithUse(...) is all it takes

Every agent builder knows this problem: the more tasks your agent takes on, the more manuals you have to hand it—operating procedures, reference guides, assorted docs. Keep all of it resident in the context window and three problems hit at once: tokens burn fast (every request re-reads the whole pile), attention dilutes (the few lines that matter get buried in hundreds of pages), and the odds of a wrong answer actually climb. It's like making an employee memorize the entire corporate rulebook every morning when they'll only need one page all day.

Before: crammed into context Operating rules Reference guide Brand book Review checklist Data dictionary More docs... (still coming) Every request carries the whole pile After: on-demand loading Skill card Room for the actual task Disk Skill bodies live here Summoned in
The same stack of manuals, two placements: always in context vs. card resident, body on disk (this site's diagram)

Agent Skills is the answer: package expertise into individual skills that sit in the background until the moment they're needed. If you've used Skills in Claude Code, this will feel familiar—same format, and Anthropic has opened it up as a standard (agentskills.io). Genkit now plugs into that same spec. We've previously broken down Anthropic's official take on using Skills to build a validation loop:

Related on this site
Anthropic shows you how to turn manual code review into a skill that reviews and fixes itself
That piece gives you the full breakdown of how Skills work in practice inside Claude Code. Today's piece is about the same format running inside Google's framework.
The Format

A skill is just a folder

So what does an "on-demand" skill actually look like? Surprisingly simple: a skill is a folder containing exactly one required file, SKILL.md. That file has two parts. At the top is the frontmatter — a small block of metadata wrapped in --- that says what the skill is called and when to reach for it. Below that is the body: the actual operating instructions. The folder can also hold three types of optional resources: scripts/ (executable code), references/ (documentation), and assets/ (templates or other resources).

Standard skill folder structure (set up your directory like this)
skill-name/
├── SKILL.md          # Required: metadata + instructions
├── scripts/          # Optional: executable code
├── references/       # Optional: documentation
├── assets/           # Optional: templates, resources
└── ...               # Any additional files or directories
The only required file is SKILL.md. Scripts, reference docs, and template assets are all optional extras you can bring along.
A skill = one folder skill-name/ ├─ SKILL.md ├─ scripts/ ├─ references/ └─ assets/ ★ Required Executable scripts Reference docs Template assets SKILL.md anatomy frontmatter · business card name: what it's called description: when to use me body · instructions The full how-to for getting the job done Can point to references/ and scripts/ Only the card — this small slice — stays in the system prompt
SKILL.md anatomy: the card is light, the body is heavy. The light part stays; the heavy part is loaded on demand (this site's diagram)

Because a skill is just Markdown plus regular files, you can distribute it with Git like any code—no extra server to stand up. For the frontmatter, Google's docs include an official template. The key is the description field: that's your trigger.

Example frontmatter (description is the trigger)
---
name: adr-template
description: Activate this skill when proposing significant architectural changes, documenting codebase refactorings, or resolving design/technical debates. Use this skill to author and maintain Architecture Decision Records (ADRs) to preserve engineering context.
license: Apache-2.0
metadata:
  author: example-org
  version: "1.0"
---
In plain English: when proposing significant architectural changes, documenting a refactor, or settling a design/technical debate, activate this skill. Use it to write and maintain Architecture Decision Records (ADRs) to capture engineering context. The more specific your description, the better the model knows when to call it.
The Mechanism

Progressive disclosure: the catalog stays resident, the body is summoned by name

With the folder ready, how does the model know when to use it? Through a mechanism called progressive disclosure, in three steps:

  1. Discovery: at startup, the framework scans the skills directory and injects just the name and description of each skill into the system prompt — the model only sees the table of contents;
  2. Activation: when a task matches a skill's description, the framework invokes the use_skill tool, pulling the full SKILL.md body into the context;
  3. Execution: the model follows the instructions, reading references or running bundled scripts as needed.
① Discover cheese-bread · card paintings · card adr-template · card Only name + description At startup: the TOC stays resident ② Activate SKILL.md Full body use_skill pulls it in Only when a match happens ③ Execute references/ read on demand scripts/ run on demand Follow the procedure Disclosure loop complete Context usage Cards (resident) Body (on activation) Refs/scripts (on demand)
The three stages of progressive disclosure: context usage only ticks up when a skill is actually summoned (this site's diagram)

That's how the token bill gets trimmed: the only thing living permanently in the context window is a few dozen characters per skill—the card. Hundreds of pages of fine print stay on disk, and only the one that gets called loads into memory. This design buys you three things:

Three core advantages
Radically fewer tokens: a skill you're not using costs a sliver of metadata. The full body loads only when actually needed.
Light and easy to maintain: plain Markdown files, versioned right alongside your business code. No complex external database or knowledge-base architecture required.
A toolbox built in: a skill pack can carry code scripts, so the AI can call deterministic tools when it hits a specific task.
Progressive disclosure flow diagram
The original article's progressive disclosure diagram: token spend gets deferred until the moment it's actually needed. Image from the Google Developers Blog (generated by Gemini 3.1 Flash Image)
The Code

One line to hook in, powered by middleware

Now that you understand the mechanism, how much code does it actually take? One line. Add an ai.WithUse argument to your genkit.Generate call, point it at the skills folder, and you're done:

The one line that enables skills in Genkit Go (added to your genkit.Generate call)
resp, err := genkit.Generate(ctx, g,
    ai.WithPrompt("How do I run tests in this repo?"),
    ai.WithUse(&middleware.Skills{SkillPaths: []string{"./skills"}}),
)
SkillPaths points at the directory holding your skill folders; the framework scans it for SKILL.md files by itself.

Behind that one line is Genkit's middleware system—a layer that sits between your code and the model. Every request passes through it, and at that point the middleware can add stuff, reroute things, or keep a ledger. Think of it like a package-sorting station. There are three types of hooks, each intercepting a different stage: WrapGenerate intercepts the per-turn conversation loop, handling jobs like system-prompt injection that need to see the full conversation. WrapModel intercepts each model API call, handling retries, fallbacks, and caching. WrapTool intercepts each tool execution. The Skills middleware sits on these hooks and does exactly three things: scan the directory for SKILL.md files → inject the cards into the system prompt → activate when a request matches a description.

Skills middleware Injects skill cards, activates use_skill on match WrapGenerate · intercepts each turn of the conversation loop System prompt injection, message accumulation WrapModel · intercepts each model call Retries / fallbacks / caching WrapTool · intercepts each tool execution Parallel tools each get intercepted One request, and every stage gets intercepted
Genkit's three middleware hook types each catch one stage; the Skills middleware rides on them to inject cards and activate skills (this site's diagram)
Example 1

Example 1: Say "cheese," summon the cheese bread skill

Let's start with the smallest possible example. The first one in the tutorial is a command-line recipe tool: you give it an ingredient, it gives you a recipe. The skills folder holds two skills, banana-bread and cheese-bread. Run go run main.go cheese, the model matches the description on cheese-bread, activates the skill, and prints out a full recipe for Brazilian cheese bread (Pão de Queijo) straight from the skill's instructions:

$ go run main.go cheese · Terminal output (excerpt)
+-------------------------------------------------+
|         TRADITIONAL BRAZILIAN CHEESE BREAD      |
|                 (Pao de Queijo)                 |
+-------------------------------------------------+
INGREDIENTS
* Tapioca Flour (Sour Starch) .. 2 cups (240g)
* Grated Parmesan/Queijo ...... 1.5 cups (150g)
  ……
PRO TIP: You can freeze the unbaked dough balls
on a tray, then store them in a bag.
Tapioca flour base, 150g of Parmesan — naturally gluten-free. The tip says the dough balls freeze well and can go straight into the oven for 25 minutes. The tutorial's author is Brazilian, and says the recipe looks right to her instincts, but "use at your own risk."

This example demonstrates the most basic loop: a user sentence matches a skill's description, the card gets swapped for the body, and the model follows the recipe.

Example 2

Example 2: An AI art restorer that picks its own skill by looking at the image

The minimal example only shows matching. The second one is closer to a production scenario: a multimodal AI art restorer. You feed it a photo of a damaged artwork, and the model first decides whether it's a drawing, a painting, or a photograph, then activates the matching restoration skill — drawings, paintings, and photography each have their own restoration protocol. Finally, Gemini 3.1 Flash Image (a.k.a. Nano Banana 2) generates the restored image. The skill-selection step needs zero branch logic in code. The model just looks at the image and decides.

The paintings skill's SKILL.md reads like the professional restorer's rulebook: absolute fidelity (strictly no adding elements that aren't in the original), anti-modernization (keeping brushstrokes, not smoothing out texture), respect for craquelure (the crack network is part of the artwork's history, don't fill it in). Then a three-step process: varnish correction → grime reduction → inpainting. The file itself is a model example of "turning a professional protocol into a skill":

skills/paintings/SKILL.md in full (a template for writing expert protocols as skills)
---
name: paintings
description: Restoration protocol for fine art paintings.
---

# Painting restoration

Perform direct, minimal-intervention restoration of fine art
paintings. Prioritize historical integrity, original pigment
depth, and surface textures over cosmetic modernization. Do not
include any elements, nor introduce any techniques not present
in the original piece.

### 1. Core conservation mandates
* **Absolute Fidelity:** Strictly forbidden to add new subjects,
  figures, scenery, details, or narrative elements under any
  circumstances.
* **Anti-Modernization:** Retain original brushstroke
  characteristics. Do not flatten support textures.
* **Patina & Craquelure:** Respect the natural crack network
  (craquelure) as part of the artwork's history. Do not fill or
  erase cracks unless they pose an active risk of paint loss.

### 2. Step-by-step restoration process
1. **Varnish Correction:** Gently balance aged, yellowed natural
   varnishes to recover original pigment chromaticity without
   forcing modern, high-contrast saturation.
2. **Soot & Grime Reduction:** Isolate and lift surface grime
   while protecting delicate, thin underlying glaze layers.
3. **Inpaint Major Loss:** Where paint layers are missing, use
   references from the surviving elements to bridge the gap.
   Replicate the original brush direction, speed, height,
   transparency, and light source.
In plain English: minimal-intervention restoration, historical integrity before "making it look nice." Three iron rules: absolute fidelity (never add elements under any circumstances), anti-modernization (keep the brushstrokes and the ground texture), respect the patina and craquelure (don't fill cracks unless they risk paint loss). Three steps: varnish correction (de-yellow without forcing saturation), grime reduction (protect the thin glaze), and inpainting (match brush direction, thickness, and light source from what survives).

The test image is an old friend: Elías García Martínez's Ecce Homo. In 2012, an amateur restorer turned the church fresco into "Monkey Jesus," and the internet went wild. The tutorial feeds the model the pre-incident original, and the model correctly identifies it as a classical religious oil painting, activates the paintings skill, and outputs a restoration plan: first remove the yellowed varnish and grime to recover the deep reds and flesh tones, then reduce distracting cracks while keeping the purple robe's mottled texture, and finally give the background scroll a deliberately aged parchment feel.

Ecce Homo before restoration
Before: the original Ecce Homo (public domain, via Wikimedia Commons)
Ecce Homo restored by Gemini
After: restored by Gemini 3.1 Flash Image following the paintings skill protocol

The restoration skill is still an early attempt: LLMs have randomness built in, so the same image may need several runs to get a good result, and the protocol itself would need a professional restorer to fine-tune. The full code for both examples is open-sourced in the GoogleCloudPlatform devrel-demos repository — links at the end of this article.

Practice

Four tips for writing your own skills

Before you write your own skills, run through the four pieces of advice the tutorial closes with:

✅ Pre-flight checklist for writing skills
One-line hookup, skill folder structure, a frontmatter template, and a complete professional restoration protocol in SKILL.md — four ready-to-copy pieces live in the article above.
Source
Enable on-demand expertise with Agent Skills in Genkit GoDaniela Petruzalek · Google Developers Blog·Original link·2026-07-31
About this site
The progressive disclosure diagram and the before/after Ecce Homo images come from the original article; the other four figures are this site's own diagrams. The claim that Agent Skills was started by Anthropic and opened as a standard comes from agentskills.io's own site copy. The example outputs shown are as displayed in the original article; this site has not independently re-run them.
↑ End of article
✓ This article is free to read in full

Members can copy or download the full Markdown, and let their AI subscribe and ask.

Read the original ↗
📮 New explainers, straight to your inbox

Found this useful? Leave your email — every new explainer, the moment it's out. Unsubscribe anytime.