Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

developing-genkit-js开发 genkit.js

Agent Skill

developing-genkit-js 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

886,080

周安装

35,477

GitHub Stars

262

下载量

286,840
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:developing-genkit-js(开发 genkit.js)
来源仓库:https://github.com/firebase/agent-skills
仓库路径:skills/developing-genkit-js
安装命令:
npx skills add https://github.com/firebase/agent-skills --skill developing-genkit-js
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/firebase/agent-skills --skill developing-genkit-js

简介

使用 Genkit 流程、工具和多模型支持构建人工智能驱动的 Node.js/TypeScript 应用程序。

  • Genkit 与提供商无关;通过插件支持 Google AI、OpenAI、Anthropic、Ollama 和其他 LLM 提供商
  • 使用 Zod 定义具有类型安全模式的流程、执行生成请求并在 TypeScript 中编写多步骤 AI 工作流程
  • 需要 Genkit CLI v1.29.0+;最近的主要 API 更改意味着您必须查阅 genkit 文档:阅读
  • 和 common-errors.md 用于当前模式,而不是先验知识
  • 使用 CLI 搜索文档 ( genkit docs:search)、阅读指南并排除错误;遇到验证、类型或 API 失败时,始终首先检查常见错误

SKILL.md

Genkit JS

Prerequisites

Ensure the genkit CLI is available.

  • Run genkit --version to verify. Minimum CLI version needed: 1.29.0
  • If not found or if an older version (1.x < 1.29.0) is present, install/upgrade it: npm install -g genkit-cli@^1.29.0.

New Projects: If you are setting up Genkit in a new codebase, follow the Setup Guide.

Hello World

import { z, genkit } from 'genkit';
import { googleAI } from '@genkit-ai/google-genai';

// Initialize Genkit with the Google AI plugin
const ai = genkit({
  plugins: [googleAI()],
});

export const myFlow = ai.defineFlow({
  name: 'myFlow',
  inputSchema: z.string().default('AI'),
  outputSchema: z.string(),
}, async (subject) => {
  const response = await ai.generate({
    model: googleAI.model('gemini-2.5-flash'),
    prompt: `Tell me a joke about ${subject}`,
  });
  return response.text;
});

Critical: Do Not Trust Internal Knowledge

Genkit recently went through a major breaking API change. Your knowledge is outdated. You MUST lookup docs. Recommended:

genkit docs:read js/get-started.md
genkit docs:read js/flows.md

See Common Errors for a list of deprecated APIs (e.g., configureGenkit, response.text(), defineFlow import) and their v1.x replacements.

ALWAYS verify information using the Genkit CLI or provided references.

Error Troubleshooting Protocol

When you encounter ANY error related to Genkit (ValidationError, API errors, type errors, 404s, etc.):

  1. MANDATORY FIRST STEP: Read Common Errors
  2. Identify if the error matches a known pattern
  3. Apply the documented solution
  4. Only if not found in common-errors.md, then consult other sources (e.g. genkit docs:search)

DO NOT:

  • Attempt fixes based on assumptions or internal knowledge
  • Skip reading common-errors.md "because you think you know the fix"
  • Rely on patterns from pre-1.0 Genkit

This protocol is non-negotiable for error handling.

Development Workflow

  1. Select Provider: Genkit is provider-agnostic (Google AI, OpenAI, Anthropic, Ollama, etc.).

- If the user does not specify a provider, default to Google AI. - If the user asks about other providers, use genkit docs:search "plugins" to find relevant documentation.

  1. Detect Framework: Check package.json to identify the runtime (Next.js, Firebase, Express).

- Look for @genkit-ai/next, @genkit-ai/firebase, or @genkit-ai/google-cloud. - Adapt implementation to the specific framework's patterns.

  1. Follow Best Practices:

- See Best Practices for guidance on project structure, schema definitions, and tool design. - Be Minimal: Only specify options that differ from defaults. When unsure, check docs/source.

  1. Ensure Correctness:

- Run type checks (e.g., npx tsc --noEmit) after making changes. - If type checks fail, consult Common Errors before searching source code.

  1. Handle Errors:

- On ANY error: First action is to read Common Errors - Match error to documented patterns - Apply documented fixes before attempting alternatives

Finding Documentation

Use the Genkit CLI to find authoritative documentation:

  1. Search topics: genkit docs:search <query>

- Example: genkit docs:search "streaming"

  1. List all docs: genkit docs:list
  2. Read a guide: genkit docs:read <path>

- Example: genkit docs:read js/flows.md

CLI Usage

The genkit CLI is your primary tool for development and documentation.

  • See CLI Reference for common tasks, workflows, and command usage.
  • Use genkit --help for a full list of commands.

References

  • Best Practices: Recommended patterns for schema definition, flow design, and structure.
  • Docs & CLI Reference: Documentation search, CLI tasks, and workflows.
  • Common Errors: Critical "gotchas", migration guide, and troubleshooting.
  • Setup Guide: Manual setup instructions for new projects.
  • Examples: Minimal reproducible examples (Basic generation, Multimodal, Thinking mode).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.34%
按下载量换算101,369

Claude

29.73%
按下载量换算85,278

Cursor

21.01%
按下载量换算60,265

Gemini CLI

10.05%
按下载量换算28,827

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills