developing-genkit-go
What it does
This skill helps developers build AI-powered features in Go using the Genkit SDK. It is for teams that run their backend in Go and want to add model calls or agents.
When to use it
- ✓When you want to build an AI feature, agent or flow in Go using Genkit.
- ✓When you need text generation, streaming or tool calling in a Go service.
- ✓When you want to set up Genkit plugins and HTTP handlers for a Go server.
Skill link
https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-go/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Build a Go server with a Genkit flow that tells a joke about any topic a user sends.”
5 new skills a week. 1 minute to read.
How it works
It writes Go code that uses Genkit's init, flow and generation functions, and it includes a sample server. It loads reference guides for each feature as needed.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Genkit Go
Genkit Go is an AI SDK for Go that provides generation, structured output, streaming, tool calling, prompts, and flows with a unified interface across model providers.
Hello World
package main
import (
"context"
"fmt"
"log"
"net/http"
"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/server"
)
func main() {
ctx := context.Background()
g := genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))
genkit.DefineFlow(g, "jokeFlow", func(ctx context.Context, topic string) (string, error) {
return genkit.GenerateText(ctx, g,
ai.WithModelName("googleai/gemini-flash-latest"),
ai.WithPrompt("Tell me a joke about %s", topic),
)
})
mux := http.NewServeMux()
for _, f := range genkit.ListFlows(g) {
mux.HandleFunc("POST /"+f.Name(), genkit.Handler(f))
}
log.Fatal(server.Start(ctx, "127.0.0.1:8080", mux))
}
Core Features
Load the appropriate reference based on what you need:
| Feature | Reference | When to load |
|---|---|---|
| Initialization | references/getting-started.md | Setting up genkit.Init, plugins, the *Genkit instance pattern |
| Generation | references/generation.md | Generate, GenerateText, GenerateData, streaming, output formats |
| Prompts | references/prompts.md | DefinePrompt, DefineDataPrompt, .prompt files, schemas |
| Tools | references/tools.md | DefineTool, DefineResumableTool interrupts (Interrupted claim, Restart/Respond, WithResume), ai/tool helpers (tool.Interrupt, tool.Fail, tool.AttachParts) |
| Middleware | references/middleware.md | ai.Middleware, ai.WithUse, Hooks (Generate/Model/Tool), built-ins (Retry, Fallback, ToolApproval, Filesystem, Skills, SoftToolErrors, ContextCompression, Budget) |
| Observability | references/observability.md | OpenTelemetry export (otelgenai), tracing.SetInstrumentation, aix.Observer, reflection API outside dev |
| Flows & HTTP | references/flows-and-http.md | DefineFlow, DefineStreamingFlow, genkit.Handler, HTTP serving |
| Model Providers | references/providers.md | Google AI, Vertex AI, Anthropic, OpenAI-compatible, Ollama setup |
Agents (Experimental)
Genkit Go has an experimental agent API for persistent, multi-turn
conversations (sessions, snapshots, interrupts, branching, background execution).
It is gated: initialize with genkit.Init(ctx, genkit.WithExperimental()) or the
constructors panic. Server constructors come from genkit/exp (aliased
genkitx); types and options from ai/exp (aliased aix); session stores from
ai/exp/localstore.
- Agent or flow? If the task is conversational, multi-turn, or described as "an agent", "assistant", or "chatbot", build it with
genkitx.DefineAgentrather than hand-rolling aGenerate+ tools loop in a flow. Reach for a plain flow only for single-shot, stateless generation.
For details see:
- Agents: defining/serving an agent, running turns, and client- vs server-managed state (start here).
- Sessions & persistence: session stores (
localstore.NewInMemorySessionStore/NewFileSessionStore, PostgreSQL), snapshots, and thesessionstoretestconformance suite. - Human-in-the-loop / interrupts: pausing for approval/input and resuming.
- Branching: forking a conversation from a snapshot.
- Background agents: detaching long-running turns and polling.
- Working with state: typed custom session state, streamed as JSON patches.
- Artifacts: producing and reading named deliverables.
- Multi-agent orchestration: delegating to sub-agents, background delegation,
continue_task, and remote agents (DefineRemoteAgent). - Advanced custom agents:
DefineCustomAgentfor full turn control. - Deploying agents: serving agents over HTTP with
genkit.Handler.
Generative UI (A2UI)
Genkit
FAQ
Which model providers does it support?
It uses one interface across model providers, with Google AI as one example plugin.
Does it include an example?
Yes. It includes a hello-world flow served over HTTP.
Does it cover structured output?
Yes. It covers structured output and prompts along with generation.
Details
Original description by the author
Develop AI-powered applications using Genkit in Go. Use when the user asks to build AI features, agents, flows, or tools in Go using Genkit, or when working with Genkit Go code involving generation, prompts, streaming, tool calling, or model providers.
repo: google/skills
Popularity
- GitHub stars
- 22k
- Ranking position
- #10256
- License
- Apache-2.0
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
finding-google-skills
22kHelps your agent find the right Google guides for a setup task, such as hosting, databases, storage, sign-in or AI model serving.
gcloud
22kHelps your agent write and check Google Cloud gcloud commands, looking up exact syntax before it runs anything so it does not guess flags.
google-cloud-recipe-auth
22kGuides your agent through Google Cloud identity and access, including how people and services sign in and which permissions they get.
google-cloud-recipe-onboarding
22kWalks a new developer through first steps on Google Cloud, including choosing a project, linking billing, and deploying a first resource.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.