본문으로 건너뛰기
Skillpedia
API 및 서버 (백엔드)22k · #10257

developing-genkit-js

하는 일

이 스킬은 Genkit SDK로 JavaScript와 TypeScript에서 AI 기능을 만들도록 돕습니다. 웹과 Node.js 팀이 에이전트나 모델 호출을 추가하려는 경우를 위한 스킬입니다.

사용하는 경우

  • ✓Genkit을 써서 JavaScript 또는 TypeScript로 AI 에이전트, 플로우 또는 도구를 만들고 싶을 때.
  • ✓Node.js 프로젝트에서 Genkit 오류, 검증 문제 또는 타입 오류를 고쳐야 할 때.
  • ✓Genkit 앱에서 프롬프트 파일과 여러 턴의 에이전트 대화가 필요할 때.

스킬 링크

https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-js/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-js/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“TypeScript 프로젝트에 Genkit을 설정하고, 주제에 대한 농담을 쓰는 플로우를 만들어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

먼저 genkit CLI 버전을 확인합니다. 그다음 플로우, 도구, 프롬프트를 위한 Genkit API로 TypeScript 코드를 작성합니다. 설정과 특정 기능에 대한 참조 가이드를 안내합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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-flash-latest'),
    prompt: `Tell me a joke about ${subject}`,
  });
  return response.text;
});

Prompts (Dotprompt)

.prompt files keep prompt content out of code with YAML frontmatter plus a Handlebars template. See Dotprompt: promptDir, ai.prompt() (call/stream/render), variants, partials, named schemas via ai.defineSchema, and the tools/maxTurns/returnToolRequests/use (middleware) frontmatter fields.

Agents (Beta)

Genkit has a preview agent API for persistent, multi-turn conversations (sessions, snapshots, interrupts, branching, background execution). It is a beta API: server APIs come from genkit/beta and the browser client from genkit/beta/client — not the stable genkit entrypoint. **Requires genkit

= 1.39.0.**

For more details see:

Generative UI (A2UI)

Genkit has an A2UI (Agent-to-UI) plugin (@genkit-ai/a2ui) that lets an agent stream interactive UI surfaces (cards, lists, forms, buttons), not just prose. The whole server-side integration is the a2ui() model middleware in an agent's (or ai.generate's) use array; the browser renders surfaces with an @a2ui/* renderer plus the helpers in @genkit-ai/a2ui/client. It builds on the beta agent client (genkit/beta + genkit/beta/client).

  • A2UI: server middleware, options, client rendering, user actions/forms, custom catalogs, and the security/trust boundary.

Middleware

Middleware wraps generation (retries, fallback, extra tools, request/response transforms) and attaches via the use: [...] array on ai.generate, prompts, and agents.

  • Using middleware: the use array and the @genkit-ai/middleware package (retry, fallback, artifacts, agents, filesystem, skills, toolApproval, contextCompression) plus built-in core middleware.
  • Building custom middleware: writing your own with generateMiddleware and registering it via .plugin().

Observability

Traces show up in the Dev UI under genkit start with no setup. For production export to an OTLP backend (OpenTelemetry GenAI semantic conventions via @genkit-ai/otel), custom instrumentation, or running the reflection API outside dev, see Observability.

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
g
자주 묻는 질문

genkit CLI는 어떤 버전이 필요한가요?

1.29.0 이상이 필요하며, 스킬이 설치하거나 업그레이드해 줄 수 있습니다.

프롬프트 파일도 다루나요?

네. 템플릿과 스키마가 있는 Dotprompt 파일을 다룹니다.

에이전트를 지원하나요?

네. 여러 턴의 대화를 위한 미리 보기 에이전트 API를 다룹니다.

상세 정보

작성자의 원본 설명

Develop AI-powered applications using Genkit in Node.js/TypeScript. Use when the user asks about Genkit, AI agents, flows, or tools in JavaScript/TypeScript, or when encountering Genkit errors, validation issues, type errors, or API problems.

repo: google/skills

인기도

GitHub 스타
22k
순위
#10257
라이선스
Apache-2.0
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬