[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69922RWSRWBZN9BQA59AJVP":3,"skill-same:01M69922RWSRWBZN9BQA59AJVP":153},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":44,"linkOnly":45,"markdownContent":46,"markdownBody":47,"frontMatter":48,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":58,"ownerDescription":59,"updatedAt":60,"install":61,"resources":74},"01M69922RWSRWBZN9BQA59AJVP","developing-genkit-go",null,"Provides guidance on developing 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. Don't use for Genkit in JavaScript\u002FTypeScript, Python, or Dart.","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",23830,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43],"go","genkit","developing genkit go","javascript","dart","python","for","when","user","Providers","Tools","prompts","build","generation","develop","with","streaming","code","use","calling","flows","applications","tool","model","tool calling","2026-11-10 10:12:30",false,"---\nname: developing-genkit-go\ndescription: >-\n  Provides guidance on developing AI-powered applications using Genkit in Go.\n  Use when the user asks to build AI features, agents, flows, or tools in Go\n  using Genkit, or when working with Genkit Go code involving generation,\n  prompts, streaming, tool calling, or model providers. Don't use for Genkit in\n  JavaScript\u002FTypeScript, Python, or Dart.\nmetadata:\n  version: \"1.0.0\"\n  category: AiAndMachineLearning\n---\n\n# Genkit Go\n\nGenkit Go is an AI SDK for Go that provides generation, structured output,\nstreaming, tool calling, prompts, and flows with a unified interface across\nmodel providers.\n\n## Hello World\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\u002Fhttp\"\n\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fai\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fgenkit\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fgooglegenai\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fserver\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tg := genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))\n\n\tgenkit.DefineFlow(g, \"jokeFlow\", func(ctx context.Context, topic string) (string, error) {\n\t\treturn genkit.GenerateText(ctx, g,\n\t\t\tai.WithModelName(\"googleai\u002Fgemini-flash-latest\"),\n\t\t\tai.WithPrompt(\"Tell me a joke about %s\", topic),\n\t\t)\n\t})\n\n\tmux := http.NewServeMux()\n\tfor _, f := range genkit.ListFlows(g) {\n\t\tmux.HandleFunc(\"POST \u002F\"+f.Name(), genkit.Handler(f))\n\t}\n\tlog.Fatal(server.Start(ctx, \"127.0.0.1:8080\", mux))\n}\n```\n\n## Core Features\n\nLoad the appropriate reference based on what you need:\n\n| Feature | Reference | When to load |\n| --- | --- | --- |\n| Initialization | [references\u002Fgetting-started.md](references\u002Fgetting-started.md) | Setting up `genkit.Init`, plugins, the `*Genkit` instance pattern |\n| Generation | [references\u002Fgeneration.md](references\u002Fgeneration.md) | `Generate`, `GenerateText`, `GenerateData`, streaming, output formats, `Embed` |\n| Prompts | [references\u002Fprompts.md](references\u002Fprompts.md) | `DefinePrompt`, `DefineDataPrompt`, `.prompt` files, schemas |\n| Tools | [references\u002Ftools.md](references\u002Ftools.md) | `DefineTool`, `DefineResumableTool` interrupts (`Interrupted` claim, `Restart`\u002F`Respond`, `WithResume`), `ai\u002Ftool` helpers (`tool.Interrupt`, `tool.Fail`, `tool.AttachParts`) |\n| Middleware | [references\u002Fmiddleware.md](references\u002Fmiddleware.md) | `ai.Middleware`, `ai.WithUse`, `Hooks` (Generate\u002FModel\u002FTool), built-ins (`Retry`, `Fallback`, `ToolApproval`, `Filesystem`, `Skills`, `SoftToolErrors`, `ContextCompression`, `Budget`) |\n| Observability | [references\u002Fobservability.md](references\u002Fobservability.md) | OpenTelemetry export (`otelgenai`), `tracing.SetInstrumentation`, `aix.Observer`, reflection API outside dev |\n| Flows & HTTP | [references\u002Fflows-and-http.md](references\u002Fflows-and-http.md) | `DefineFlow`, `DefineStreamingFlow`, `genkit.Handler`, HTTP serving |\n| Model Providers | [references\u002Fproviders.md](references\u002Fproviders.md) | Google AI, Vertex AI, Anthropic, OpenAI-compatible, Ollama setup |\n\n## Agents (Experimental)\n\nGenkit Go has an **experimental** agent API for persistent, multi-turn\nconversations (sessions, snapshots, interrupts, branching, background\nexecution).\nIt is gated: initialize with `genkit.Init(ctx, genkit.WithExperimental())` or\nthe\nconstructors panic. Server constructors come from `genkit\u002Fexp` (aliased\n`genkitx`); types and options from `ai\u002Fexp` (aliased `aix`); session stores from\n`ai\u002Fexp\u002Flocalstore`.\n\n- **Agent or flow?** If the task is conversational, multi-turn, or described as\n  \"an agent\", \"assistant\", or \"chatbot\", build it with `genkitx.DefineAgent`\n  rather than hand-rolling a `Generate` + tools loop in a flow. Reach for a\n  plain flow only for single-shot, stateless generation.\n\nFor details see:\n\n-   [Agents](references\u002Fagents.md): defining\u002Fserving an agent, running turns,\n    and client- vs server-managed state (start here).\n-   [Sessions & persistence](references\u002Fagents-sessions.md): session stores\n    (`localstore.NewInMemorySessionStore`\u002F`NewFileSessionStore`, PostgreSQL),\n    snapshots, and the `sessionstoretest` conformance suite.\n-   [Human-in-the-loop \u002F interrupts](references\u002Fagents-human-in-the-loop.md):\n    pausing for approval\u002Finput and resuming.\n-   [Branching](references\u002Fagents-branching.md): forking a conversation from a\n    snapshot.\n-   [Background agents](references\u002Fagents-background.md): detaching long-running\n    turns and polling.\n-   [Working with state](references\u002Fagents-state.md): typed custom session\n    state, streamed as JSON patches.\n-   [Artifacts](references\u002Fagents-artifacts.md): producing and reading named\n    deliverables.\n-   [Multi-agent orchestration](references\u002Fagents-multi-agent.md): delegating to\n    sub-agents, background delegation, `continue_task`, and remote agents\n    (`DefineRemoteAgent`).\n-   [Advanced custom agents](references\u002Fagents-custom.md): `DefineCustomAgent`\n    for full turn control.\n-   [Deploying agents](references\u002Fagents-deployment.md): serving agents over\n    HTTP with `genkit.Handler`.\n\n## Generative UI (A2UI)\n\nGenkit Go has an **A2UI** (Agent-to-UI) plugin\n(`github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fa2ui\u002Fexp`, imported as `a2uix`) that\nlets an agent stream interactive UI **surfaces** (cards, lists, forms, buttons),\nnot just prose. The whole integration is the `&a2uix.Surfaces{}` model\nmiddleware added via `ai.WithUse`\non a generate call or agent inline prompt. **Go is server-only: it has no A2UI\nclient\u002Frenderer.** Render surfaces with a JS or Dart\u002FFlutter client that talks\nto\nyour Go agent over HTTP (the server and clients are wire-compatible).\n\n-   [A2UI](references\u002Fa2ui.md): server middleware, options, custom catalogs, and\n    security. For the client (rendering surfaces), refer to the A2UI reference\n    in the Genkit JS or Dart skill.\n\n## Genkit CLI (recommended)\n\n`genkit start` unintrusively wraps any Go program that uses the Genkit library,\nrunning it unchanged while capturing traces from every Genkit action so you can\nprove tools were actually called and inspect model I\u002FO from the terminal, even\nfor headless checks. It forwards stdio, so interactive CLI tools that rely on\nstdin\u002Fstdout work without issues. Running the app directly (`go run .`) skips\ntrace capture, so you're debugging blind. Check install with `genkit --version`.\n\n**Installation:**\n```bash\ncurl -sL cli.genkit.dev | bash\n```\n\n**Primary pattern (default):** prefix `genkit start --` to your normal run\ncommand. This collects telemetry from any Genkit code your program runs, whether\ntriggered from the dev UI, your own web server\u002Fweb UI, or a plain script. Starts\nthe Developer UI (usually http:\u002F\u002Flocalhost:4000) for running flows, model and\nagent playground, and browsing traces:\n```bash\ngenkit start -- go run .\ngenkit start --noui -- go run .   # same, without the Dev UI (still a persistent server)\ngenkit start -o -- go run .       # also opens the browser\n```\n`genkit start` runs until you stop it with Ctrl+C. That is expected and correct\nfor the common cases: a server your web\u002Fmobile app calls, or an interactive CLI\nyou exit yourself. `--noui` only drops the Dev UI; it is **not** a one-shot\ncommand and will not exit on its own. Do **not** use `genkit start` as a\nblocking step in automated\u002Fnon-interactive contexts; use `flow:run` (below) for\nthat.\n\n**Non-interactive use (agents\u002FCI):** add the global `--non-interactive` flag\nbefore `--` so the CLI uses defaults and never blocks on a prompt (e.g. the\nfirst-run analytics notice): `genkit start --non-interactive -- go run .` (works\nwith `flow:run` too).\n\n**Run a flow (`flow:run`):** invoke a specific flow by name from the CLI. Append\nyour run command after `--` to spin up the runtime just for this run (the\ncommand runs as-is to register your flows):\n```bash\ngenkit flow:run myFlow '{\"data\": \"input\"}' -- go run .\ngenkit flow:run myFlow '{\"data\": \"input\"}' --stream -- go run .   # with streaming\ngenkit flow:run myFlow '{\"data\": \"input\"}' --wait -- go run .     # wait for completion\n```\nThis is **self-terminating**: it runs the flow once, prints a `Trace ID`, then\nexits, so it's the right choice for a quick, non-interactive check (unlike\n`genkit start`). Traces for this run can be inspected using the trace commands\nbelow.\n\n**Debugging with traces:** the fastest way to see prompts, model inputs\u002Foutputs,\ntool calls, latencies, and errors. Inspect from the terminal after any run under\n`genkit start`:\n```bash\ngenkit trace:list                        # find recent trace IDs\ngenkit trace:get \u003CtraceId>               # full trace details (inputs, outputs, tool calls, errors)\ngenkit trace:get \u003CtraceId> --format json # machine-readable JSON, safe to pipe into jq or other parsers\n```\n\nFor machine-readable output, pass `--format json` to get clean JSON you can pipe\ninto `jq` or other parsers. The **default** output is human-oriented (banner\u002Flog\nlines, possible truncation on large traces), so don't pipe that form directly;\nuse `--format json`, grep, or the Dev UI trace viewer.\n\n**Documentation:**\n```bash\ngenkit docs:search \"streaming\" go\ngenkit docs:list go\ngenkit docs:read go\u002Fflows.md\n```\n\nSee [references\u002Fgetting-started.md](references\u002Fgetting-started.md) for full CLI\nand Developer UI details.\n\n## Key Guidance\n\n- **Pass `g` explicitly.** The `*Genkit` instance returned by `genkit.Init` is\n  the central registry. Pass it to all Genkit functions rather than storing it\n  as a global. This is a core pattern throughout the SDK.\n- **Wrap AI logic in flows.** Flows give you tracing, observability, HTTP\n  deployment via `genkit.Handler`, and the ability to test from the Developer UI\n  and CLI. Any generation call worth keeping should live in a flow.\n- **Verify with traces, not a blind run.** Running the app directly (`go run .`)\n  does not capture dev traces. See the [Genkit CLI](#genkit-cli-recommended)\n  section for how to run your app and capture traces.\n- **Use `jsonschema:\"description=...\"` struct tags on output types.** The model\n  uses these descriptions to understand what each field should contain. Without\n  them, structured output quality drops significantly.\n- **Write good tool descriptions.** The model decides which tools to call based\n  on their description string. Vague descriptions lead to missed or incorrect\n  tool calls.\n- **Use `.prompt` files for complex prompts.** They separate prompt content from\n  Go code, support Handlebars templating, and can be iterated on without\n  recompilation. Code-defined prompts are better for simple, single-line cases.\n- **Use `DefineResumableTool` for interrupts.** Claim paused calls with the\n  tool's `Interrupted` method and resume with `ai.WithResume`.\n  `ai.InterruptWith`, `RestartWith`\u002F`RespondWith`, and `WithToolRestarts` are\n  deprecated; `genkitx.DefineInterruptibleTool` and `ai\u002Fexp\u002Ftool` were removed\n  in v1.14.0. See [references\u002Ftools.md](references\u002Ftools.md).\n- **Reach for built-in middleware before writing one.** `Retry`, `Fallback`,\n  `ToolApproval`, `Filesystem`, `Skills`, and `SoftToolErrors` cover the common\n  cross-cutting needs and compose with each other via `ai.WithUse`. See\n  [references\u002Fmiddleware.md](references\u002Fmiddleware.md). When you do write custom\n  middleware, allocate per-call state in closures captured by `New`, and guard\n  anything that `WrapTool` mutates because tools may run concurrently.\n- **Look up the latest model IDs.** Model names change frequently. Check\n  provider documentation for current model IDs rather than relying on hardcoded\n  names. See [references\u002Fproviders.md](references\u002Fproviders.md).\n","# Genkit Go\n\nGenkit Go is an AI SDK for Go that provides generation, structured output,\nstreaming, tool calling, prompts, and flows with a unified interface across\nmodel providers.\n\n## Hello World\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"net\u002Fhttp\"\n\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fai\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fgenkit\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fgooglegenai\"\n\t\"github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fserver\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\tg := genkit.Init(ctx, genkit.WithPlugins(&googlegenai.GoogleAI{}))\n\n\tgenkit.DefineFlow(g, \"jokeFlow\", func(ctx context.Context, topic string) (string, error) {\n\t\treturn genkit.GenerateText(ctx, g,\n\t\t\tai.WithModelName(\"googleai\u002Fgemini-flash-latest\"),\n\t\t\tai.WithPrompt(\"Tell me a joke about %s\", topic),\n\t\t)\n\t})\n\n\tmux := http.NewServeMux()\n\tfor _, f := range genkit.ListFlows(g) {\n\t\tmux.HandleFunc(\"POST \u002F\"+f.Name(), genkit.Handler(f))\n\t}\n\tlog.Fatal(server.Start(ctx, \"127.0.0.1:8080\", mux))\n}\n```\n\n## Core Features\n\nLoad the appropriate reference based on what you need:\n\n| Feature | Reference | When to load |\n| --- | --- | --- |\n| Initialization | [references\u002Fgetting-started.md](references\u002Fgetting-started.md) | Setting up `genkit.Init`, plugins, the `*Genkit` instance pattern |\n| Generation | [references\u002Fgeneration.md](references\u002Fgeneration.md) | `Generate`, `GenerateText`, `GenerateData`, streaming, output formats, `Embed` |\n| Prompts | [references\u002Fprompts.md](references\u002Fprompts.md) | `DefinePrompt`, `DefineDataPrompt`, `.prompt` files, schemas |\n| Tools | [references\u002Ftools.md](references\u002Ftools.md) | `DefineTool`, `DefineResumableTool` interrupts (`Interrupted` claim, `Restart`\u002F`Respond`, `WithResume`), `ai\u002Ftool` helpers (`tool.Interrupt`, `tool.Fail`, `tool.AttachParts`) |\n| Middleware | [references\u002Fmiddleware.md](references\u002Fmiddleware.md) | `ai.Middleware`, `ai.WithUse`, `Hooks` (Generate\u002FModel\u002FTool), built-ins (`Retry`, `Fallback`, `ToolApproval`, `Filesystem`, `Skills`, `SoftToolErrors`, `ContextCompression`, `Budget`) |\n| Observability | [references\u002Fobservability.md](references\u002Fobservability.md) | OpenTelemetry export (`otelgenai`), `tracing.SetInstrumentation`, `aix.Observer`, reflection API outside dev |\n| Flows & HTTP | [references\u002Fflows-and-http.md](references\u002Fflows-and-http.md) | `DefineFlow`, `DefineStreamingFlow`, `genkit.Handler`, HTTP serving |\n| Model Providers | [references\u002Fproviders.md](references\u002Fproviders.md) | Google AI, Vertex AI, Anthropic, OpenAI-compatible, Ollama setup |\n\n## Agents (Experimental)\n\nGenkit Go has an **experimental** agent API for persistent, multi-turn\nconversations (sessions, snapshots, interrupts, branching, background\nexecution).\nIt is gated: initialize with `genkit.Init(ctx, genkit.WithExperimental())` or\nthe\nconstructors panic. Server constructors come from `genkit\u002Fexp` (aliased\n`genkitx`); types and options from `ai\u002Fexp` (aliased `aix`); session stores from\n`ai\u002Fexp\u002Flocalstore`.\n\n- **Agent or flow?** If the task is conversational, multi-turn, or described as\n  \"an agent\", \"assistant\", or \"chatbot\", build it with `genkitx.DefineAgent`\n  rather than hand-rolling a `Generate` + tools loop in a flow. Reach for a\n  plain flow only for single-shot, stateless generation.\n\nFor details see:\n\n-   [Agents](references\u002Fagents.md): defining\u002Fserving an agent, running turns,\n    and client- vs server-managed state (start here).\n-   [Sessions & persistence](references\u002Fagents-sessions.md): session stores\n    (`localstore.NewInMemorySessionStore`\u002F`NewFileSessionStore`, PostgreSQL),\n    snapshots, and the `sessionstoretest` conformance suite.\n-   [Human-in-the-loop \u002F interrupts](references\u002Fagents-human-in-the-loop.md):\n    pausing for approval\u002Finput and resuming.\n-   [Branching](references\u002Fagents-branching.md): forking a conversation from a\n    snapshot.\n-   [Background agents](references\u002Fagents-background.md): detaching long-running\n    turns and polling.\n-   [Working with state](references\u002Fagents-state.md): typed custom session\n    state, streamed as JSON patches.\n-   [Artifacts](references\u002Fagents-artifacts.md): producing and reading named\n    deliverables.\n-   [Multi-agent orchestration](references\u002Fagents-multi-agent.md): delegating to\n    sub-agents, background delegation, `continue_task`, and remote agents\n    (`DefineRemoteAgent`).\n-   [Advanced custom agents](references\u002Fagents-custom.md): `DefineCustomAgent`\n    for full turn control.\n-   [Deploying agents](references\u002Fagents-deployment.md): serving agents over\n    HTTP with `genkit.Handler`.\n\n## Generative UI (A2UI)\n\nGenkit Go has an **A2UI** (Agent-to-UI) plugin\n(`github.com\u002Ffirebase\u002Fgenkit\u002Fgo\u002Fplugins\u002Fa2ui\u002Fexp`, imported as `a2uix`) that\nlets an agent stream interactive UI **surfaces** (cards, lists, forms, buttons),\nnot just prose. The whole integration is the `&a2uix.Surfaces{}` model\nmiddleware added via `ai.WithUse`\non a generate call or agent inline prompt. **Go is server-only: it has no A2UI\nclient\u002Frenderer.** Render surfaces with a JS or Dart\u002FFlutter client that talks\nto\nyour Go agent over HTTP (the server and clients are wire-compatible).\n\n-   [A2UI](references\u002Fa2ui.md): server middleware, options, custom catalogs, and\n    security. For the client (rendering surfaces), refer to the A2UI reference\n    in the Genkit JS or Dart skill.\n\n## Genkit CLI (recommended)\n\n`genkit start` unintrusively wraps any Go program that uses the Genkit library,\nrunning it unchanged while capturing traces from every Genkit action so you can\nprove tools were actually called and inspect model I\u002FO from the terminal, even\nfor headless checks. It forwards stdio, so interactive CLI tools that rely on\nstdin\u002Fstdout work without issues. Running the app directly (`go run .`) skips\ntrace capture, so you're debugging blind. Check install with `genkit --version`.\n\n**Installation:**\n```bash\ncurl -sL cli.genkit.dev | bash\n```\n\n**Primary pattern (default):** prefix `genkit start --` to your normal run\ncommand. This collects telemetry from any Genkit code your program runs, whether\ntriggered from the dev UI, your own web server\u002Fweb UI, or a plain script. Starts\nthe Developer UI (usually http:\u002F\u002Flocalhost:4000) for running flows, model and\nagent playground, and browsing traces:\n```bash\ngenkit start -- go run .\ngenkit start --noui -- go run .   # same, without the Dev UI (still a persistent server)\ngenkit start -o -- go run .       # also opens the browser\n```\n`genkit start` runs until you stop it with Ctrl+C. That is expected and correct\nfor the common cases: a server your web\u002Fmobile app calls, or an interactive CLI\nyou exit yourself. `--noui` only drops the Dev UI; it is **not** a one-shot\ncommand and will not exit on its own. Do **not** use `genkit start` as a\nblocking step in automated\u002Fnon-interactive contexts; use `flow:run` (below) for\nthat.\n\n**Non-interactive use (agents\u002FCI):** add the global `--non-interactive` flag\nbefore `--` so the CLI uses defaults and never blocks on a prompt (e.g. the\nfirst-run analytics notice): `genkit start --non-interactive -- go run .` (works\nwith `flow:run` too).\n\n**Run a flow (`flow:run`):** invoke a specific flow by name from the CLI. Append\nyour run command after `--` to spin up the runtime just for this run (the\ncommand runs as-is to register your flows):\n```bash\ngenkit flow:run myFlow '{\"data\": \"input\"}' -- go run .\ngenkit flow:run myFlow '{\"data\": \"input\"}' --stream -- go run .   # with streaming\ngenkit flow:run myFlow '{\"data\": \"input\"}' --wait -- go run .     # wait for completion\n```\nThis is **self-terminating**: it runs the flow once, prints a `Trace ID`, then\nexits, so it's the right choice for a quick, non-interactive check (unlike\n`genkit start`). Traces for this run can be inspected using the trace commands\nbelow.\n\n**Debugging with traces:** the fastest way to see prompts, model inputs\u002Foutputs,\ntool calls, latencies, and errors. Inspect from the terminal after any run under\n`genkit start`:\n```bash\ngenkit trace:list                        # find recent trace IDs\ngenkit trace:get \u003CtraceId>               # full trace details (inputs, outputs, tool calls, errors)\ngenkit trace:get \u003CtraceId> --format json # machine-readable JSON, safe to pipe into jq or other parsers\n```\n\nFor machine-readable output, pass `--format json` to get clean JSON you can pipe\ninto `jq` or other parsers. The **default** output is human-oriented (banner\u002Flog\nlines, possible truncation on large traces), so don't pipe that form directly;\nuse `--format json`, grep, or the Dev UI trace viewer.\n\n**Documentation:**\n```bash\ngenkit docs:search \"streaming\" go\ngenkit docs:list go\ngenkit docs:read go\u002Fflows.md\n```\n\nSee [references\u002Fgetting-started.md](references\u002Fgetting-started.md) for full CLI\nand Developer UI details.\n\n## Key Guidance\n\n- **Pass `g` explicitly.** The `*Genkit` instance returned by `genkit.Init` is\n  the central registry. Pass it to all Genkit functions rather than storing it\n  as a global. This is a core pattern throughout the SDK.\n- **Wrap AI logic in flows.** Flows give you tracing, observability, HTTP\n  deployment via `genkit.Handler`, and the ability to test from the Developer UI\n  and CLI. Any generation call worth keeping should live in a flow.\n- **Verify with traces, not a blind run.** Running the app directly (`go run .`)\n  does not capture dev traces. See the [Genkit CLI](#genkit-cli-recommended)\n  section for how to run your app and capture traces.\n- **Use `jsonschema:\"description=...\"` struct tags on output types.** The model\n  uses these descriptions to understand what each field should contain. Without\n  them, structured output quality drops significantly.\n- **Write good tool descriptions.** The model decides which tools to call based\n  on their description string. Vague descriptions lead to missed or incorrect\n  tool calls.\n- **Use `.prompt` files for complex prompts.** They separate prompt content from\n  Go code, support Handlebars templating, and can be iterated on without\n  recompilation. Code-defined prompts are better for simple, single-line cases.\n- **Use `DefineResumableTool` for interrupts.** Claim paused calls with the\n  tool's `Interrupted` method and resume with `ai.WithResume`.\n  `ai.InterruptWith`, `RestartWith`\u002F`RespondWith`, and `WithToolRestarts` are\n  deprecated; `genkitx.DefineInterruptibleTool` and `ai\u002Fexp\u002Ftool` were removed\n  in v1.14.0. See [references\u002Ftools.md](references\u002Ftools.md).\n- **Reach for built-in middleware before writing one.** `Retry`, `Fallback`,\n  `ToolApproval`, `Filesystem`, `Skills`, and `SoftToolErrors` cover the common\n  cross-cutting needs and compose with each other via `ai.WithUse`. See\n  [references\u002Fmiddleware.md](references\u002Fmiddleware.md). When you do write custom\n  middleware, allocate per-call state in closures captured by `New`, and guard\n  anything that `WrapTool` mutates because tools may run concurrently.\n- **Look up the latest model IDs.** Model names change frequently. Check\n  provider documentation for current model IDs rather than relying on hardcoded\n  names. See [references\u002Fproviders.md](references\u002Fproviders.md).\n",{"name":5,"metadata":49,"description":7},{"version":50,"category":51},"1.0.0","AiAndMachineLearning","main","64d010629e61e4a7d59fc21e042362f370b5888b","skills\u002Fcloud\u002Fdeveloping-genkit-go",1991,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-11 03:08:50",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add google\u002Fskills --skill developing-genkit-go",{"tool":67,"command":68},"bunx","bunx skills add google\u002Fskills --skill developing-genkit-go",{"tool":70,"command":71},"pnpm","pnpm dlx skills add google\u002Fskills --skill developing-genkit-go","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002FSKILL.md",true,[75,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Fa2ui.md","REFERENCE","参考文档",12601,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fa2ui.md",{"path":82,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":83,"sourceHtmlUrl":84},"references\u002Fagents-artifacts.md",4315,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-artifacts.md",{"path":86,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":87,"sourceHtmlUrl":88},"references\u002Fagents-background.md",5867,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-background.md",{"path":90,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":91,"sourceHtmlUrl":92},"references\u002Fagents-branching.md",3979,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-branching.md",{"path":94,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":95,"sourceHtmlUrl":96},"references\u002Fagents-custom.md",7301,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-custom.md",{"path":98,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":99,"sourceHtmlUrl":100},"references\u002Fagents-deployment.md",7252,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-deployment.md",{"path":102,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":103,"sourceHtmlUrl":104},"references\u002Fagents-human-in-the-loop.md",7839,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-human-in-the-loop.md",{"path":106,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":107,"sourceHtmlUrl":108},"references\u002Fagents-multi-agent.md",10147,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-multi-agent.md",{"path":110,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":111,"sourceHtmlUrl":112},"references\u002Fagents-sessions.md",9066,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-sessions.md",{"path":114,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":115,"sourceHtmlUrl":116},"references\u002Fagents-state.md",5186,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents-state.md",{"path":118,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":119,"sourceHtmlUrl":120},"references\u002Fagents.md",14042,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fagents.md",{"path":122,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":123,"sourceHtmlUrl":124},"references\u002Fflows-and-http.md",4687,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fflows-and-http.md",{"path":126,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":127,"sourceHtmlUrl":128},"references\u002Fgeneration.md",5754,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fgeneration.md",{"path":130,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":131,"sourceHtmlUrl":132},"references\u002Fgetting-started.md",3654,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fgetting-started.md",{"path":134,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":135,"sourceHtmlUrl":136},"references\u002Fmiddleware.md",21103,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fmiddleware.md",{"path":138,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":139,"sourceHtmlUrl":140},"references\u002Fobservability.md",4795,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fobservability.md",{"path":142,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":143,"sourceHtmlUrl":144},"references\u002Fprompts.md",7431,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fprompts.md",{"path":146,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":147,"sourceHtmlUrl":148},"references\u002Fproviders.md",4082,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Fproviders.md",{"path":150,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":151,"sourceHtmlUrl":152},"references\u002Ftools.md",8757,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-go\u002Freferences\u002Ftools.md",[154,189,218,247,274,297],{"skillNo":155,"name":156,"nameZh":6,"description":157,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":158,"categories":159,"keywords":168,"publishedAt":44},"01M6998S2EZKD3GEJ7F943RZTE","sign-in-with-google-web","Implement, configure, and secure Sign In With Google (SiwG) using Google Identity Services (GIS \u002F `https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fclient`) across web architectures. Use when creating Google sign-in buttons, implementing Google One Tap with FedCM, integrating GIS in React\u002FNext.js\u002FAngular\u002FHTML, verifying ID tokens on backend runtimes (Python\u002FNode.js\u002FGo\u002FJava), enforcing Google Workspace domain restrictions (`hd`), securing client-side ID tokens via WebCrypto nonces or encrypted IndexedDB, embedding in cross-origin iframes via the Intermediate Iframe API (`https:\u002F\u002Faccounts.google.com\u002Fgsi\u002Fintermediate`), configuring Content Security Policy (CSP), COOP, and Permissions Policy (`identity-credentials-get`) headers, or handling sign-out and revocation. Don't use for legacy Google Sign-In (`gapi.auth2`), Google Cloud IAM service accounts, or Android\u002FiOS native Credential Manager.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fsign-in-with-google-web\u002FSKILL.md",[160,165],{"categoryNo":161,"categoryName":162,"taxonomyType":163,"taxonomyTypeDesc":164},"01JBSEEDCAT000000000000009","前端开发","SCENARIO","使用场景",{"categoryNo":166,"categoryName":167,"taxonomyType":163,"taxonomyTypeDesc":164},"01JBSEEDCAT000000000000010","后端与接口",[9,169,170,34,171,172,19,173,174,175,176,177,24,178,179,180,181,182,183,184,185,186,187,188],"sign in with google web","sign","web","android","security","google workspace","google cloud","implement","policy","implementing","react","iam","permissions","buttons","secure","manager","identity","architectures","domain","runtimes",{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":204,"publishedAt":44},"01M6998PHPDCAD684VW5WRG83D","dpop-adoption","Implement and debug OAuth 2.0 DPoP (RFC 9449) refresh token sender-constraining for WebCrypto, Node.js ES6, and browser runtimes integrating with Google's OAuth platform. Use when configuring non-extractable asymmetric key pairs (P-256), generating DPoP Proof JWTs for authorization code exchange and token refresh, or handling 400 use_dpop_nonce challenge retry loops at oauth2.googleapis.com\u002Ftoken. Don't use for unconstrained OAuth 2.0 flows (where refresh tokens are not bound to a client key pair), or for Google Cloud IAM \u002F service account authentication.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fidentity\u002Fdpop-adoption\u002FSKILL.md",[195,196,199],{"categoryNo":166,"categoryName":167,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":197,"categoryName":198,"taxonomyType":163,"taxonomyTypeDesc":164},"01JBSEEDCAT000000000000023","Skill与智能体开发",{"categoryNo":200,"categoryName":201,"taxonomyType":202,"taxonomyTypeDesc":203},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",[205,206,9,175,207,208,209,39,210,36,180,211,212,213,214,215,216,185,188,217,26],"dpop adoption","adoption","es6","retry","authentication","challenge","browser","loops","at","node","token","pair","platform",{"skillNo":219,"name":220,"nameZh":6,"description":221,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":222,"categories":223,"keywords":230,"publishedAt":44},"01M6998M72TC73EEAQH4XC7EXW","retrieving-developer-knowledge","Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI\u002FGemini, Android, Chrome, Web, Flutter, Go, Firebase, and other Google developer platforms. Integrates with the Developer Knowledge MCP server (search_documents, get_documents, answer_query) or the Developer Knowledge REST API fallback. Use when searching for gcloud CLI commands, API syntax, IAM permissions, official documentation, architectural comparisons, or product choice overviews. Don't use for local filesystem lookups or non-Google documentation.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fretrieving-developer-knowledge\u002FSKILL.md",[224,225,228,229],{"categoryNo":166,"categoryName":167,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":226,"categoryName":227,"taxonomyType":163,"taxonomyTypeDesc":164},"01JBSEEDCAT000000000000021","资料检索与研究",{"categoryNo":197,"categoryName":198,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":200,"categoryName":201,"taxonomyType":202,"taxonomyTypeDesc":203},[231,232,233,234,175,235,236,237,238,239,240,241,242,26,243,244,245,180,246,181],"retrieving developer knowledge","knowledge","developer","MCP","mcp server","official","developer documentation","get","search","local","choice","documents","query","api","across","documentation",{"skillNo":248,"name":249,"nameZh":6,"description":250,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":251,"categories":252,"keywords":253,"publishedAt":44},"01M6998J2CZEXS9BES9S3WWFKC","migrate-to-rust","Clones, analyzes, plans, and migrates legacy codebases (C++, Fortran, Java, Python, C, Shell) from a GitHub URL or local directory to a modern, high-performance, deterministic, 100% Safe Rust architecture, tracking live telemetry across every task bucket, test failure\u002Ffix cycle, and Profile-Guided Optimization (PGO) stage, and producing a first-person AI storytelling report and interactive HTML infographic. Use when migrating a GitHub repository or local codebase to Rust, porting legacy C++, Fortran, Python, or Java workloads to memory-safe Rust, designing Struct-of-Arrays (SoA) or SIMD Rust architectures, or optimizing Rust ports with LLVM PGO. Don't use for unrelated non-Rust refactoring or single-line syntax questions.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Fmigrate-to-rust\u002FSKILL.md",[],[254,255,256,257,258,259,260,261,24,262,263,264,265,266,267,240,268,269,270,26,271,272,245,273],"migrate to rust","rust","migrate","github","memory","performance","directory","safe","ports","llvm","soa","cycle","porting","fix","arrays","infographic","high-performance","URL","architecture","unrelated",{"skillNo":275,"name":276,"nameZh":6,"description":277,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":278,"categories":279,"keywords":283,"publishedAt":44},"01M6998GCC3K29WZ82KXMB9E02","finding-google-skills","Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or setting up part of their stack, such as where to run a service, a database, storage, messaging, authentication, analytics, ads, or AI model serving, and a Google product is a reasonable candidate - whether or not a vendor is named - or when a request names a Google product or API. Brings in the matching Google skill so the answer can weigh Google options, their trade-offs, and when they are not the right fit. Skip when the stack is already settled on another provider and no Google product is named, or the task involves no platform choice.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fdevelopers\u002Ffinding-google-skills\u002FSKILL.md",[280,281,282],{"categoryNo":166,"categoryName":167,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":197,"categoryName":198,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":200,"categoryName":201,"taxonomyType":202,"taxonomyTypeDesc":203},[9,284,285,286,287,217,42,288,289,290,291,209,292,293,294,241,37,295,26,296,244],"finding google skills","storage","as","messaging","trade-offs","provider","answer","fit","catalog","up","decision","database","candidate",{"skillNo":298,"name":299,"nameZh":6,"description":300,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":301,"categories":302,"keywords":305,"publishedAt":44},"01M6998DWNHTH0BS6W1CY8ZXMP","workload-manager-basics","Use this skill to manage Google Cloud Workload Manager evaluations, rules, scanned resources, and validation results by using public client libraries and the REST API. Use when you need to inspect workload best-practice rules, create and run evaluations for Google Cloud general best practices, SAP, SQL Server, or custom organizational rules, review violations, export results to BigQuery, or automate Workload Manager through client libraries because no service-specific public CLI or MCP server is available. Don't use for general Google Compute Engine instance management, VPC configuration, or standard IAM auditing.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fworkload-manager-basics\u002FSKILL.md",[303,304],{"categoryNo":166,"categoryName":167,"taxonomyType":163,"taxonomyTypeDesc":164},{"categoryNo":197,"categoryName":198,"taxonomyType":163,"taxonomyTypeDesc":164},[306,307,184,308,9,234,309,175,235,310,311,312,313,26,314,244,180,315,316,317,318],"workload manager basics","workload","basics","cli","review","vpc","resources","inspect","you","create","libraries","server","run"]