AI Agent - Aug 3, 2026

Genkit Agent Skills Go Setup Guide

Quick answer

In Genkit Go, install the current SDK, register the middleware plugin, and attach a middleware.Skills instance to the generation call. Point SkillPaths at one or more directories whose direct child folders contain a SKILL.md file.

resp, err := genkit.Generate(ctx, g,
    ai.WithPrompt("How do I run tests in this repo?"),
    ai.WithUse(&middleware.Skills{
        SkillPaths: []string{"./skills"},
    }),
)

Google’s July 31, 2026 announcement uses this same pattern. At the August 3 source check, the latest Go module returned by the Go proxy was github.com/firebase/genkit/go v1.11.0. Treat that as a dated observation, not a hard-coded requirement: select a reviewed version and commit the resulting module files.

Start with the Genkit Agent Skills product guide if you first need the progressive-disclosure architecture and decision boundary.

Install and initialize

Install or update the Go SDK in the target module:

go get github.com/firebase/genkit/go

The current Google example initializes the Google GenAI and middleware plugins together:

import (
    "github.com/firebase/genkit/go/ai"
    "github.com/firebase/genkit/go/genkit"
    "github.com/firebase/genkit/go/plugins/googlegenai"
    "github.com/firebase/genkit/go/plugins/middleware"
)

g := genkit.Init(ctx, genkit.WithPlugins(
    &googlegenai.GoogleAI{},
    &middleware.Middleware{},
))

Configure the model provider credential through the deployment’s secret mechanism. Do not store an API key inside SKILL.md, the skills directory, source control, or a generated prompt.

Create a focused skill

The Skills middleware scans each configured path for direct subdirectories containing SKILL.md:

skills/
└── release-check/
    ├── SKILL.md
    ├── references/
    └── scripts/

A minimal skill is:

---
name: release-check
description: Use when preparing a Go service release or verifying its release evidence.
---

# Release check

1. Read the repository release policy.
2. Run the approved tests.
3. Report failures without bypassing them.
4. Require a human decision before deployment.

The folder name is the runtime lookup key. In the current implementation, the middleware uses the frontmatter description for discovery and the complete file for activation. Write the description as a precise trigger, keep one skill focused on one workflow, and move large supporting material into clearly named references.

How discovery and activation work

For each Generate call, the middleware:

  1. scans the configured skill directories;
  2. injects the available directory names and descriptions into a marked system-prompt section;
  3. registers a use_skill tool;
  4. returns the selected SKILL.md text when the model calls that tool.

The implementation skips missing paths and folders without a readable SKILL.md. An empty library therefore may not fail loudly. Add a startup or test assertion that the expected skill names are present rather than assuming a typo will surface at runtime.

The middleware reads SKILL.md; it does not automatically execute files in scripts/ or open arbitrary references. If the application needs file or command tools, add them separately with a narrow root, read-only default, validation, logging, and approval for consequential actions.

Test the activation boundary

Use a small table of expected and unexpected triggers:

TestExpected evidence
Direct release requestrelease-check is discovered and use_skill loads it once
Unrelated writing requestThe release skill remains inactive
Similar but excluded taskThe agent explains the mismatch or chooses a more relevant skill
Missing skill directoryThe test fails before deployment instead of silently weakening behavior
Malicious content in a referenceThe agent does not gain unapproved tools or ignore higher-priority policy

Inspect the Genkit trace for the injected skill inventory, use_skill call, returned instructions, model output, and any downstream tool calls. Test repeated turns as well as a single prompt so activation is not duplicated or lost.

Production controls

Agent Skills improve how procedural context is packaged; they do not prove task correctness. Version the skill alongside its tests, require review for instruction changes, and record which version produced an action. Keep external content out of trusted instructions unless it is validated.

Separate these permissions:

  • reading the skill inventory;
  • loading the selected SKILL.md;
  • reading a referenced file;
  • executing a bundled script;
  • calling an external service;
  • changing production state.

For other languages, use the TypeScript, Python, and Dart support guide. Their method names and package maturity differ from Go even though the folder format and progressive-disclosure sequence are shared.

Frequently asked questions

How do I add Agent Skills to a Genkit Go generation?

Install the current Genkit Go SDK, initialize the middleware plugin, and pass &middleware.Skills{SkillPaths: []string{”./skills”}} through ai.WithUse on the Generate or GenerateText call. Each direct child directory must contain a SKILL.md file.

What does the Genkit Go Skills middleware load into context?

It scans configured directories once per Generate call, places each skill directory name and description in the system prompt, and exposes a use_skill tool that returns the selected SKILL.md file. Full instructions load only after activation.

Does Genkit Go automatically run scripts bundled in an Agent Skill?

No. The Skills middleware loads SKILL.md text; it does not by itself execute bundled scripts or grant arbitrary file access. Add separately scoped tools only when the workflow needs them, and require approval for sensitive actions.

Official sources

Source check: August 3, 2026. Verify the latest module, middleware API, model plugin, Agent Skills specification, and deployment permissions before production use.