[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M69925GBG3DSQNQQ5MB0ZTZA":3,"skill-same:01M69925GBG3DSQNQQ5MB0ZTZA":168},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":55,"linkOnly":56,"markdownContent":57,"markdownBody":58,"frontMatter":59,"refName":63,"commitSha":64,"skillDirectory":65,"forksCount":66,"repositoryHtmlUrl":67,"repositoryHomepageUrl":17,"ownerHtmlUrl":68,"ownerBlogUrl":69,"ownerDescription":70,"updatedAt":71,"install":72,"resources":85},"01M69925GBG3DSQNQQ5MB0ZTZA","developing-genkit-js","Genkit JS 开发指导","Provides guidance on developing AI-powered applications using Genkit in Node.js\u002FTypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript\u002FTypeScript, or when encountering Genkit errors, validation issues, type errors, or API problems. Don't use for Genkit in Python, Go, or Dart.","提供使用 Genkit 在 Node.js\u002FTypeScript 中开发 AI 驱动应用的指导。当用户询问 JavaScript\u002FTypeScript 中的 Genkit、AI 智能体、流程或工具，或遇到 Genkit 错误、验证问题、类型错误或 API 问题时使用。不适用于 Python、Go 或 Dart 中的 Genkit。","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",24235,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BRZZF9D7PVFN5MXSPWWD61","AI 工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BSAA4FBTWZP6X98STEHG99","智能体开发","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54],"genkit","js","developing genkit js","javascript","dart","python","for","go","when","user","Tools","validation","node","about","develop","type","api","use","errors","issues","flows","applications","typescript","ai agents","2026-11-10 10:12:30",false,"---\nname: developing-genkit-js\ndescription: >-\n  Provides guidance on developing AI-powered applications using Genkit in\n  Node.js\u002FTypeScript. Use when the user asks about Genkit, AI agents, flows, or\n  tools in JavaScript\u002FTypeScript, or when encountering Genkit errors, validation\n  issues, type errors, or API problems. Don't use for Genkit in Python, Go, or\n  Dart.\nmetadata:\n  version: \"1.0.0\"\n  category: AiAndMachineLearning\n---\n\n# Genkit JS\n\n## Prerequisites\n\nEnsure the `genkit` CLI is available.\n\n-   Run `genkit --version` to verify. Minimum CLI version needed: **1.29.0**\n-   If not found or if an older version (1.x \u003C 1.29.0) is present,\n    install\u002Fupgrade it: `npm install -g genkit-cli@^1.29.0`.\n\n**New Projects**: If you are setting up Genkit in a new codebase, follow the\n[Setup Guide](references\u002Fsetup.md).\n\n## Hello World\n\n```ts\nimport { z, genkit } from 'genkit';\nimport { googleAI } from '@genkit-ai\u002Fgoogle-genai';\n\n\u002F\u002F Initialize Genkit with the Google AI plugin\nconst ai = genkit({\n  plugins: [googleAI()],\n});\n\nexport const myFlow = ai.defineFlow({\n  name: 'myFlow',\n  inputSchema: z.string().default('AI'),\n  outputSchema: z.string(),\n}, async (subject) => {\n  const response = await ai.generate({\n    model: googleAI.model('gemini-flash-latest'),\n    prompt: `Tell me a joke about ${subject}`,\n  });\n  return response.text;\n});\n```\n\n## Prompts (Dotprompt)\n\n`.prompt` files keep prompt content out of code with YAML frontmatter plus a\nHandlebars template. See [Dotprompt](references\u002Fdotprompt.md): `promptDir`,\n`ai.prompt()` (call\u002Fstream\u002Frender), variants, partials, named schemas via\n`ai.defineSchema`, and the `tools`\u002F`maxTurns`\u002F`returnToolRequests`\u002F`use`\n(middleware) frontmatter fields.\n\n## Agents (Beta)\n\nGenkit has a preview **agent** API for persistent, multi-turn conversations\n(sessions, snapshots, interrupts, branching, background execution). It is a\n**beta** API: server APIs come from `genkit\u002Fbeta` and the browser client from\n`genkit\u002Fbeta\u002Fclient` — not the stable `genkit` entrypoint. **Requires `genkit`\n>= 1.39.0.**\n\nFor more details see:\n\n-   [Agents](references\u002Fagents.md): defining\u002Fserving an agent and client-managed\n    state (start here).\n-   [Sessions & persistence](references\u002Fagents-sessions.md): session stores\n    (`InMemory`\u002F`File`\u002F`Firestore`).\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, waiting, and resuming failed or aborted runs.\n-   [Working with state](references\u002Fagents-state.md): typed custom session\n    state, auto-synced to the client.\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, including background delegation and `continue_task`.\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 (multiple agents, CORS, web UI, other frameworks).\n\n## Generative UI (A2UI)\n\nGenkit has an **A2UI** (Agent-to-UI) plugin (`@genkit-ai\u002Fa2ui`) that\nlets an agent stream interactive UI **surfaces** (cards, lists, forms, buttons),\nnot just prose. The whole server-side integration is the `a2ui()` model\nmiddleware in an agent's (or `ai.generate`'s) `use` array; the browser renders\nsurfaces with an `@a2ui\u002F*` renderer plus the helpers in\n`@genkit-ai\u002Fa2ui\u002Fclient`.\nIt builds on the beta agent client (`genkit\u002Fbeta` + `genkit\u002Fbeta\u002Fclient`).\n\n-   [A2UI](references\u002Fa2ui.md): server middleware, options, client rendering,\n    user actions\u002Fforms, custom catalogs, and the security\u002Ftrust boundary.\n\n## Middleware\n\nMiddleware wraps generation (retries, fallback, extra tools, request\u002Fresponse\ntransforms) and attaches via the `use: [...]` array on `ai.generate`, prompts,\nand agents.\n\n-   [Using middleware](references\u002Fmiddleware.md): the `use` array and the\n    `@genkit-ai\u002Fmiddleware` package (`retry`, `fallback`, `artifacts`, `agents`,\n    `filesystem`, `skills`, `toolApproval`, `contextCompression`) plus built-in\n    core middleware.\n-   [Building custom middleware](references\u002Fmiddleware-custom.md): writing your\n    own with `generateMiddleware` and registering it via `.plugin()`.\n\n## Observability\n\nTraces show up in the Dev UI under `genkit start` with no setup. For production\nexport to an OTLP backend (OpenTelemetry GenAI semantic conventions via\n`@genkit-ai\u002Fotel`), custom instrumentation, or running the reflection API\noutside dev, see [Observability](references\u002Fobservability.md).\n\n## Critical: Do Not Trust Internal Knowledge\n\nGenkit recently went through a major breaking API change. Your knowledge is\noutdated. You MUST lookup docs. Recommended:\n\n```sh\ngenkit docs:read js\u002Fget-started.md\ngenkit docs:read js\u002Fflows.md\n```\n\nSee [Common Errors](references\u002Fcommon-errors.md) for a list of deprecated APIs\n(e.g., `configureGenkit`, `response.text()`, `defineFlow` import) and their v1.x\nreplacements.\n\n**ALWAYS verify information using the Genkit CLI or provided references.**\n\n## Error Troubleshooting Protocol\n\n**When you encounter ANY error related to Genkit (ValidationError, API errors,\ntype errors, 404s, etc.):**\n\n1. **MANDATORY FIRST STEP**: Read [Common Errors](references\u002Fcommon-errors.md)\n2. Identify if the error matches a known pattern\n3. Apply the documented solution\n4. Only if not found in common-errors.md, then consult other sources (e.g.\n   `genkit docs:search`)\n\n**DO NOT:**\n\n- Attempt fixes based on assumptions or internal knowledge\n- Skip reading common-errors.md \"because you think you know the fix\"\n- Rely on patterns from pre-1.0 Genkit\n\n**This protocol is non-negotiable for error handling.**\n\n## Development Workflow\n\n1.  **Agent or flow?**: If the task is conversational, multi-turn, or described\n    as \"an agent\", \"assistant\", or \"chatbot\", build it with `ai.defineAgent`\n    (see [Agents](references\u002Fagents.md)) rather than hand-rolling a `generate` +\n    tools loop inside a flow. Reach for a plain flow only for single-shot,\n    stateless generation.\n2.  **Select Provider**: Genkit is provider-agnostic (Google AI, OpenAI,\n    Anthropic, Ollama, etc.).\n    -   If the user does not specify a provider, default to **Google AI**.\n    -   If the user asks about other providers, use\n        `genkit docs:search \"plugins\"` to find relevant documentation.\n3.  **Detect Framework**: Check `package.json` to identify the runtime (Next.js,\n    Firebase, Express).\n    -   Look for `@genkit-ai\u002Fnext`, `@genkit-ai\u002Ffirebase`, or\n        `@genkit-ai\u002Fgoogle-cloud`.\n    -   Adapt implementation to the specific framework's patterns.\n4.  **Follow Best Practices**:\n    -   See [Best Practices](references\u002Fbest-practices.md) for guidance on\n        project structure, schema definitions, and tool design.\n    -   **Be Minimal**: Only specify options that differ from defaults. When\n        unsure, check docs\u002Fsource.\n5.  **Ensure Correctness**:\n    -   Run type checks (e.g., `npx tsc --noEmit`) after making changes.\n    -   If type checks fail, consult\n        [Common Errors](references\u002Fcommon-errors.md) before searching source\n        code.\n    -   Verify with traces, not a blind run. Running the app directly\n        (`node`\u002F`tsx`\u002F`npm start`) does **not** capture dev traces. See\n        [CLI Usage](#cli-usage-recommended) for how to run your app and capture\n        traces.\n6.  **Handle Errors**:\n    -   On ANY error: **First action is to read\n        [Common Errors](references\u002Fcommon-errors.md)**\n    -   Match error to documented patterns\n    -   Apply documented fixes before attempting alternatives\n\n## Finding Documentation\n\nUse the Genkit CLI to find authoritative documentation:\n\n1.  **Search topics**: `genkit docs:search \u003Cquery>`\n    -   Example: `genkit docs:search \"streaming\"`\n2.  **List all docs**: `genkit docs:list`\n3.  **Read a guide**: `genkit docs:read \u003Cpath>`\n    -   Example: `genkit docs:read js\u002Fflows.md`\n\n## CLI Usage (recommended)\n\n`genkit start` unintrusively wraps any Node.js program that uses the Genkit\nlibrary, running it unchanged while capturing traces from every Genkit action so\nyou can **prove tools were actually called and inspect model I\u002FO** from the\nterminal, even for headless checks. It forwards stdio, so interactive CLI tools\nthat rely on stdin\u002Fstdout work without issues. Running your app directly\n(`node`\u002F`tsx`\u002F`npm start`) skips trace capture, so you're debugging blind.\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:\n```bash\ngenkit start -- npx tsx --watch src\u002Findex.ts\ngenkit start --noui -- npx tsx src\u002Findex.ts   # same, without the Dev UI (still a persistent server)\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.\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):\n`genkit start --non-interactive -- npx tsx src\u002Findex.ts` (works with `flow:run`\ntoo).\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\"}' -- npx tsx src\u002Findex.ts\n```\nThis is **self-terminating**: it runs the flow once, prints a `Trace ID`, then\nexits (inspect it with `genkit trace:get \u003Cid>`). That makes it the right choice\nfor a quick, non-interactive check that must exit on its own, without blocking\non `genkit start` or running the app directly (which skips traces). Always pass\ninput JSON explicitly: `flow:run` sends `undefined` when omitted and does\n**not** fall back to a schema `.default()`. Note: `flow:run` runs **flows**\n(`ai.defineFlow`), not agents; you can't `flow:run` an agent (`ai.defineAgent`)\ndirectly. To exercise an agent from the CLI, wrap one turn in a throwaway flow\nand run that (see [Agents](references\u002Fagents.md)).\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\nSee [CLI Reference](references\u002Fdocs-and-cli.md) for more commands, and\n`genkit --help` for the full list.\n\n## References\n\n-   [Best Practices](references\u002Fbest-practices.md): Recommended patterns for\n    schema definition, flow design, and structure.\n-   [Dotprompt](references\u002Fdotprompt.md): `.prompt` files — `promptDir`,\n    `ai.prompt()`, variants, partials, named schemas, and\n    `tools`\u002F`maxTurns`\u002F`returnToolRequests`\u002F`use` frontmatter.\n-   [Docs & CLI Reference](references\u002Fdocs-and-cli.md): Documentation search,\n    CLI tasks, and workflows.\n-   [Common Errors](references\u002Fcommon-errors.md): Critical \"gotchas\", migration\n    guide, and troubleshooting.\n-   [Setup Guide](references\u002Fsetup.md): Manual setup instructions for new\n    projects.\n-   [Examples](references\u002Fexamples.md): Minimal reproducible examples (Basic\n    generation, Multimodal, Thinking mode, Embeddings).\n-   [Agents (Beta)](references\u002Fagents.md): Agent basics, serving, and\n    client-managed state. Deeper topics:\n    [sessions](references\u002Fagents-sessions.md),\n    [human-in-the-loop](references\u002Fagents-human-in-the-loop.md),\n    [branching](references\u002Fagents-branching.md),\n    [background agents](references\u002Fagents-background.md),\n    [state](references\u002Fagents-state.md),\n    [artifacts](references\u002Fagents-artifacts.md),\n    [multi-agent](references\u002Fagents-multi-agent.md),\n    [custom agents](references\u002Fagents-custom.md),\n    [deployment](references\u002Fagents-deployment.md).\n-   [Middleware](references\u002Fmiddleware.md): using middleware and the\n    `@genkit-ai\u002Fmiddleware` package. See also\n    [building custom middleware](references\u002Fmiddleware-custom.md).\n-   [Observability](references\u002Fobservability.md): `@genkit-ai\u002Fotel`\n    (OpenTelemetry GenAI semantic conventions), custom `Instrumentation`, and\n    the reflection API outside dev.\n-   [A2UI (Generative UI)](references\u002Fa2ui.md): the `@genkit-ai\u002Fa2ui` plugin\n    (the `a2ui()` middleware), options, client rendering, user actions\u002Fforms,\n    custom catalogs, and security.\n","# Genkit JS\n\n## Prerequisites\n\nEnsure the `genkit` CLI is available.\n\n-   Run `genkit --version` to verify. Minimum CLI version needed: **1.29.0**\n-   If not found or if an older version (1.x \u003C 1.29.0) is present,\n    install\u002Fupgrade it: `npm install -g genkit-cli@^1.29.0`.\n\n**New Projects**: If you are setting up Genkit in a new codebase, follow the\n[Setup Guide](references\u002Fsetup.md).\n\n## Hello World\n\n```ts\nimport { z, genkit } from 'genkit';\nimport { googleAI } from '@genkit-ai\u002Fgoogle-genai';\n\n\u002F\u002F Initialize Genkit with the Google AI plugin\nconst ai = genkit({\n  plugins: [googleAI()],\n});\n\nexport const myFlow = ai.defineFlow({\n  name: 'myFlow',\n  inputSchema: z.string().default('AI'),\n  outputSchema: z.string(),\n}, async (subject) => {\n  const response = await ai.generate({\n    model: googleAI.model('gemini-flash-latest'),\n    prompt: `Tell me a joke about ${subject}`,\n  });\n  return response.text;\n});\n```\n\n## Prompts (Dotprompt)\n\n`.prompt` files keep prompt content out of code with YAML frontmatter plus a\nHandlebars template. See [Dotprompt](references\u002Fdotprompt.md): `promptDir`,\n`ai.prompt()` (call\u002Fstream\u002Frender), variants, partials, named schemas via\n`ai.defineSchema`, and the `tools`\u002F`maxTurns`\u002F`returnToolRequests`\u002F`use`\n(middleware) frontmatter fields.\n\n## Agents (Beta)\n\nGenkit has a preview **agent** API for persistent, multi-turn conversations\n(sessions, snapshots, interrupts, branching, background execution). It is a\n**beta** API: server APIs come from `genkit\u002Fbeta` and the browser client from\n`genkit\u002Fbeta\u002Fclient` — not the stable `genkit` entrypoint. **Requires `genkit`\n>= 1.39.0.**\n\nFor more details see:\n\n-   [Agents](references\u002Fagents.md): defining\u002Fserving an agent and client-managed\n    state (start here).\n-   [Sessions & persistence](references\u002Fagents-sessions.md): session stores\n    (`InMemory`\u002F`File`\u002F`Firestore`).\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, waiting, and resuming failed or aborted runs.\n-   [Working with state](references\u002Fagents-state.md): typed custom session\n    state, auto-synced to the client.\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, including background delegation and `continue_task`.\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 (multiple agents, CORS, web UI, other frameworks).\n\n## Generative UI (A2UI)\n\nGenkit has an **A2UI** (Agent-to-UI) plugin (`@genkit-ai\u002Fa2ui`) that\nlets an agent stream interactive UI **surfaces** (cards, lists, forms, buttons),\nnot just prose. The whole server-side integration is the `a2ui()` model\nmiddleware in an agent's (or `ai.generate`'s) `use` array; the browser renders\nsurfaces with an `@a2ui\u002F*` renderer plus the helpers in\n`@genkit-ai\u002Fa2ui\u002Fclient`.\nIt builds on the beta agent client (`genkit\u002Fbeta` + `genkit\u002Fbeta\u002Fclient`).\n\n-   [A2UI](references\u002Fa2ui.md): server middleware, options, client rendering,\n    user actions\u002Fforms, custom catalogs, and the security\u002Ftrust boundary.\n\n## Middleware\n\nMiddleware wraps generation (retries, fallback, extra tools, request\u002Fresponse\ntransforms) and attaches via the `use: [...]` array on `ai.generate`, prompts,\nand agents.\n\n-   [Using middleware](references\u002Fmiddleware.md): the `use` array and the\n    `@genkit-ai\u002Fmiddleware` package (`retry`, `fallback`, `artifacts`, `agents`,\n    `filesystem`, `skills`, `toolApproval`, `contextCompression`) plus built-in\n    core middleware.\n-   [Building custom middleware](references\u002Fmiddleware-custom.md): writing your\n    own with `generateMiddleware` and registering it via `.plugin()`.\n\n## Observability\n\nTraces show up in the Dev UI under `genkit start` with no setup. For production\nexport to an OTLP backend (OpenTelemetry GenAI semantic conventions via\n`@genkit-ai\u002Fotel`), custom instrumentation, or running the reflection API\noutside dev, see [Observability](references\u002Fobservability.md).\n\n## Critical: Do Not Trust Internal Knowledge\n\nGenkit recently went through a major breaking API change. Your knowledge is\noutdated. You MUST lookup docs. Recommended:\n\n```sh\ngenkit docs:read js\u002Fget-started.md\ngenkit docs:read js\u002Fflows.md\n```\n\nSee [Common Errors](references\u002Fcommon-errors.md) for a list of deprecated APIs\n(e.g., `configureGenkit`, `response.text()`, `defineFlow` import) and their v1.x\nreplacements.\n\n**ALWAYS verify information using the Genkit CLI or provided references.**\n\n## Error Troubleshooting Protocol\n\n**When you encounter ANY error related to Genkit (ValidationError, API errors,\ntype errors, 404s, etc.):**\n\n1. **MANDATORY FIRST STEP**: Read [Common Errors](references\u002Fcommon-errors.md)\n2. Identify if the error matches a known pattern\n3. Apply the documented solution\n4. Only if not found in common-errors.md, then consult other sources (e.g.\n   `genkit docs:search`)\n\n**DO NOT:**\n\n- Attempt fixes based on assumptions or internal knowledge\n- Skip reading common-errors.md \"because you think you know the fix\"\n- Rely on patterns from pre-1.0 Genkit\n\n**This protocol is non-negotiable for error handling.**\n\n## Development Workflow\n\n1.  **Agent or flow?**: If the task is conversational, multi-turn, or described\n    as \"an agent\", \"assistant\", or \"chatbot\", build it with `ai.defineAgent`\n    (see [Agents](references\u002Fagents.md)) rather than hand-rolling a `generate` +\n    tools loop inside a flow. Reach for a plain flow only for single-shot,\n    stateless generation.\n2.  **Select Provider**: Genkit is provider-agnostic (Google AI, OpenAI,\n    Anthropic, Ollama, etc.).\n    -   If the user does not specify a provider, default to **Google AI**.\n    -   If the user asks about other providers, use\n        `genkit docs:search \"plugins\"` to find relevant documentation.\n3.  **Detect Framework**: Check `package.json` to identify the runtime (Next.js,\n    Firebase, Express).\n    -   Look for `@genkit-ai\u002Fnext`, `@genkit-ai\u002Ffirebase`, or\n        `@genkit-ai\u002Fgoogle-cloud`.\n    -   Adapt implementation to the specific framework's patterns.\n4.  **Follow Best Practices**:\n    -   See [Best Practices](references\u002Fbest-practices.md) for guidance on\n        project structure, schema definitions, and tool design.\n    -   **Be Minimal**: Only specify options that differ from defaults. When\n        unsure, check docs\u002Fsource.\n5.  **Ensure Correctness**:\n    -   Run type checks (e.g., `npx tsc --noEmit`) after making changes.\n    -   If type checks fail, consult\n        [Common Errors](references\u002Fcommon-errors.md) before searching source\n        code.\n    -   Verify with traces, not a blind run. Running the app directly\n        (`node`\u002F`tsx`\u002F`npm start`) does **not** capture dev traces. See\n        [CLI Usage](#cli-usage-recommended) for how to run your app and capture\n        traces.\n6.  **Handle Errors**:\n    -   On ANY error: **First action is to read\n        [Common Errors](references\u002Fcommon-errors.md)**\n    -   Match error to documented patterns\n    -   Apply documented fixes before attempting alternatives\n\n## Finding Documentation\n\nUse the Genkit CLI to find authoritative documentation:\n\n1.  **Search topics**: `genkit docs:search \u003Cquery>`\n    -   Example: `genkit docs:search \"streaming\"`\n2.  **List all docs**: `genkit docs:list`\n3.  **Read a guide**: `genkit docs:read \u003Cpath>`\n    -   Example: `genkit docs:read js\u002Fflows.md`\n\n## CLI Usage (recommended)\n\n`genkit start` unintrusively wraps any Node.js program that uses the Genkit\nlibrary, running it unchanged while capturing traces from every Genkit action so\nyou can **prove tools were actually called and inspect model I\u002FO** from the\nterminal, even for headless checks. It forwards stdio, so interactive CLI tools\nthat rely on stdin\u002Fstdout work without issues. Running your app directly\n(`node`\u002F`tsx`\u002F`npm start`) skips trace capture, so you're debugging blind.\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:\n```bash\ngenkit start -- npx tsx --watch src\u002Findex.ts\ngenkit start --noui -- npx tsx src\u002Findex.ts   # same, without the Dev UI (still a persistent server)\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.\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):\n`genkit start --non-interactive -- npx tsx src\u002Findex.ts` (works with `flow:run`\ntoo).\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\"}' -- npx tsx src\u002Findex.ts\n```\nThis is **self-terminating**: it runs the flow once, prints a `Trace ID`, then\nexits (inspect it with `genkit trace:get \u003Cid>`). That makes it the right choice\nfor a quick, non-interactive check that must exit on its own, without blocking\non `genkit start` or running the app directly (which skips traces). Always pass\ninput JSON explicitly: `flow:run` sends `undefined` when omitted and does\n**not** fall back to a schema `.default()`. Note: `flow:run` runs **flows**\n(`ai.defineFlow`), not agents; you can't `flow:run` an agent (`ai.defineAgent`)\ndirectly. To exercise an agent from the CLI, wrap one turn in a throwaway flow\nand run that (see [Agents](references\u002Fagents.md)).\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\nSee [CLI Reference](references\u002Fdocs-and-cli.md) for more commands, and\n`genkit --help` for the full list.\n\n## References\n\n-   [Best Practices](references\u002Fbest-practices.md): Recommended patterns for\n    schema definition, flow design, and structure.\n-   [Dotprompt](references\u002Fdotprompt.md): `.prompt` files — `promptDir`,\n    `ai.prompt()`, variants, partials, named schemas, and\n    `tools`\u002F`maxTurns`\u002F`returnToolRequests`\u002F`use` frontmatter.\n-   [Docs & CLI Reference](references\u002Fdocs-and-cli.md): Documentation search,\n    CLI tasks, and workflows.\n-   [Common Errors](references\u002Fcommon-errors.md): Critical \"gotchas\", migration\n    guide, and troubleshooting.\n-   [Setup Guide](references\u002Fsetup.md): Manual setup instructions for new\n    projects.\n-   [Examples](references\u002Fexamples.md): Minimal reproducible examples (Basic\n    generation, Multimodal, Thinking mode, Embeddings).\n-   [Agents (Beta)](references\u002Fagents.md): Agent basics, serving, and\n    client-managed state. Deeper topics:\n    [sessions](references\u002Fagents-sessions.md),\n    [human-in-the-loop](references\u002Fagents-human-in-the-loop.md),\n    [branching](references\u002Fagents-branching.md),\n    [background agents](references\u002Fagents-background.md),\n    [state](references\u002Fagents-state.md),\n    [artifacts](references\u002Fagents-artifacts.md),\n    [multi-agent](references\u002Fagents-multi-agent.md),\n    [custom agents](references\u002Fagents-custom.md),\n    [deployment](references\u002Fagents-deployment.md).\n-   [Middleware](references\u002Fmiddleware.md): using middleware and the\n    `@genkit-ai\u002Fmiddleware` package. See also\n    [building custom middleware](references\u002Fmiddleware-custom.md).\n-   [Observability](references\u002Fobservability.md): `@genkit-ai\u002Fotel`\n    (OpenTelemetry GenAI semantic conventions), custom `Instrumentation`, and\n    the reflection API outside dev.\n-   [A2UI (Generative UI)](references\u002Fa2ui.md): the `@genkit-ai\u002Fa2ui` plugin\n    (the `a2ui()` middleware), options, client rendering, user actions\u002Fforms,\n    custom catalogs, and security.\n",{"name":5,"metadata":60,"description":7},{"version":61,"category":62},"1.0.0","AiAndMachineLearning","main","64d010629e61e4a7d59fc21e042362f370b5888b","skills\u002Fcloud\u002Fdeveloping-genkit-js",2014,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 23:31:00",{"source":9,"skillName":5,"commands":73,"prompt":83,"zipAvailable":84},[74,77,80],{"tool":75,"command":76},"npx","npx skills add google\u002Fskills --skill developing-genkit-js",{"tool":78,"command":79},"bunx","bunx skills add google\u002Fskills --skill developing-genkit-js",{"tool":81,"command":82},"pnpm","pnpm dlx skills add google\u002Fskills --skill developing-genkit-js","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002FSKILL.md",true,[86,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164],{"path":87,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fa2ui.md","REFERENCE","参考文档",12621,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fa2ui.md",{"path":93,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fagents-artifacts.md",3851,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-artifacts.md",{"path":97,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fagents-background.md",5702,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-background.md",{"path":101,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fagents-branching.md",3236,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-branching.md",{"path":105,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fagents-custom.md",5333,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-custom.md",{"path":109,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":110,"sourceHtmlUrl":111},"references\u002Fagents-deployment.md",6511,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-deployment.md",{"path":113,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":114,"sourceHtmlUrl":115},"references\u002Fagents-human-in-the-loop.md",6883,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-human-in-the-loop.md",{"path":117,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":118,"sourceHtmlUrl":119},"references\u002Fagents-multi-agent.md",8513,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-multi-agent.md",{"path":121,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":122,"sourceHtmlUrl":123},"references\u002Fagents-sessions.md",5475,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-sessions.md",{"path":125,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":126,"sourceHtmlUrl":127},"references\u002Fagents-state.md",4310,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents-state.md",{"path":129,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":130,"sourceHtmlUrl":131},"references\u002Fagents.md",10945,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fagents.md",{"path":133,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":134,"sourceHtmlUrl":135},"references\u002Fbest-practices.md",1757,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fbest-practices.md",{"path":137,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":138,"sourceHtmlUrl":139},"references\u002Fcommon-errors.md",7063,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fcommon-errors.md",{"path":141,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":142,"sourceHtmlUrl":143},"references\u002Fdocs-and-cli.md",5886,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fdocs-and-cli.md",{"path":145,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":146,"sourceHtmlUrl":147},"references\u002Fdotprompt.md",5925,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fdotprompt.md",{"path":149,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":150,"sourceHtmlUrl":151},"references\u002Fexamples.md",5664,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fexamples.md",{"path":153,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":154,"sourceHtmlUrl":155},"references\u002Fmiddleware-custom.md",3290,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fmiddleware-custom.md",{"path":157,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":158,"sourceHtmlUrl":159},"references\u002Fmiddleware.md",6493,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fmiddleware.md",{"path":161,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":162,"sourceHtmlUrl":163},"references\u002Fobservability.md",5624,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fobservability.md",{"path":165,"resourceType":88,"resourceTypeDesc":89,"sizeBytes":166,"sourceHtmlUrl":167},"references\u002Fsetup.md",4430,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloping-genkit-js\u002Freferences\u002Fsetup.md",[169,177,184,191,198,205],{"skillNo":170,"name":171,"nameZh":17,"description":172,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":176},"01M7DQ9K7JF4T7NJZ2K1MQZ44Q","cloud-operator-share-context","Shares Google Cloud operating context the user or their team already have — environments, projects, services and regions, product preferences, best practices, architecture guidance, runbooks — found in agent instruction files, local memory, skills and workflows, and the repository's GCP docs, with the operator agent's memory after the user reviews the list. Use when the user runs this skill, accepts the cloud-operator or cloud-operator-setup skill's offer to share their existing Google Cloud context, or asks to share, import or save that context or a GCP fact for the operator agent. Don't use for ordinary GCP requests, which go to the cloud-operator skill.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-share-context\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":178,"name":179,"nameZh":17,"description":180,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":181,"categories":182,"keywords":183,"publishedAt":176},"01M7DQ9ERFGGQCFAWQW0KRKYBY","cloud-operator-setup","Sets up the operator agent in a Google Cloud project via the autocloud MCP server: picks the operator project, creates or checks the user's operator agent, saves the project, and offers to share the user's existing Google Cloud operating context with the operator agent's memory. Use when the user runs this skill, asks to set up the operator or create their operator agent, or chooses setup when the cloud-operator skill asks. Don't use for ordinary GCP requests or installing gcloud.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-setup\u002FSKILL.md",[],[],{"skillNo":185,"name":186,"nameZh":17,"description":187,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":176},"01M7B4RHQCM0DK2XQ7S7ZXVN8D","developer-device-platform-device-run","Runs automated, non-interactive jobs on remote Android devices with Developer Device Platform (DDP) Device Run using `gcloud beta device-run sessions`: native Android executables or shell scripts (for example CLI tools, custom runners, test harnesses or benchmarks) and Android instrumentation tests, on one or many devices, then waits for completion and collects per-device outputs and logs. Use when running a binary or test suite on remote devices without an interactive connection. Don't use it for interactive device reservations, adb tunnels or screen streaming (use developer-device-platform-basics), or for local devices.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloper-device-platform-device-run\u002FSKILL.md",[],[],{"skillNo":192,"name":193,"nameZh":17,"description":194,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":195,"categories":196,"keywords":197,"publishedAt":176},"01M7B4R9YXMRW7RZP9Q9FMZJ2P","compute-vm-creation","Guides the planning, configuration, and provisioning of standalone Google Compute Engine virtual machines (VMs) and bare metal (-metal) instances using gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants to create, configure, or provision a new standalone Compute Engine VM or bare metal instance from conversational intents (hardware sizing, region selection, OS image, networking, security defaults). DO NOT read or use for Google Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools or Pods, container orchestration, managing existing VMs, Managed Instance Groups (MIGs), or Instance Templates.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcompute-vm-creation\u002FSKILL.md",[],[],{"skillNo":199,"name":200,"nameZh":17,"description":201,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":202,"categories":203,"keywords":204,"publishedAt":176},"01M7B4QD02N0YBVT0838Z5K5VC","agent-platform-autorater-customization","Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge calibration). Don't use for quick evals with built-in metrics or for improving the agent itself (use agent-platform-eval-flywheel).","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-autorater-customization\u002FSKILL.md",[],[],{"skillNo":206,"name":207,"nameZh":17,"description":208,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":209,"categories":210,"keywords":211,"publishedAt":176},"01M78JP22K73KK96JH0JNDT5C4","iap-agent-platform-troubleshooting","Diagnoses Identity-Aware Proxy (IAP) denials of outbound requests from Gemini Enterprise Agent Platform agents that run on Agent Runtime and send traffic through Agent Gateway. Use when an agent request fails with \"Egress request is not authorized\", when Cloud Audit Logs show an IAP egressViaIAP decision with granted false, when IAP audit entries are missing while debugging agent egress, or when Access policies, IAP allow policies, policy bindings, or Agent Registry entries might block agent egress. Don't use for Gemini model IAM permission errors (such as aiplatform.endpoints.predict), Agent Platform API errors, or Agent Runtime deployment or 500 errors (use agent-platform-troubleshooting instead). Don't use for setting up, creating, or connecting an Agent Gateway, or for IAP web apps, IAP TCP forwarding, or SSH.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fiap-agent-platform-troubleshooting\u002FSKILL.md",[],[]]