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가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“TypeScript 프로젝트에 Genkit을 설정하고, 주제에 대한 농담을 쓰는 플로우를 만들어 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
먼저 genkit CLI 버전을 확인합니다. 그다음 플로우, 도구, 프롬프트를 위한 Genkit API로 TypeScript 코드를 작성합니다. 설정과 특정 기능에 대한 참조 가이드를 안내합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Genkit JS
Prerequisites
Ensure the genkit CLI is available.
- Run
genkit --versionto 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:
- Agents: defining/serving an agent and client-managed state (start here).
- Sessions & persistence: session stores (
InMemory/File/Firestore). - Human-in-the-loop / interrupts: pausing for approval/input and resuming.
- Branching: forking a conversation from a snapshot.
- Background agents: detaching long-running turns, waiting, and resuming failed or aborted runs.
- Working with state: typed custom session state, auto-synced to the client.
- Artifacts: producing and reading named deliverables.
- Multi-agent orchestration: delegating to sub-agents, including background delegation and
continue_task. - Advanced custom agents:
defineCustomAgentfor full turn control. - Deploying agents: serving agents over HTTP (multiple agents, CORS, web UI, other frameworks).
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
usearray and the@genkit-ai/middlewarepackage (retry,fallback,artifacts,agents,filesystem,skills,toolApproval,contextCompression) plus built-in core middleware. - Building custom middleware: writing your own with
generateMiddlewareand 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.
댓글
- …
이 저장소의 다른 스킬
finding-google-skills
22k에이전트가 호스팅, 데이터베이스, 저장소, 로그인, AI 모델 제공처럼 설정 작업에 맞는 Google 가이드를 찾도록 돕습니다.
gcloud
22k에이전트가 Google Cloud gcloud 명령을 작성하고 확인하도록 돕습니다. 플래그를 추측하지 않도록 무엇이든 실행하기 전에 정확한 문법을 확인합니다.
google-cloud-recipe-auth
22k에이전트가 Google Cloud의 신원과 접근 권한을 안내합니다. 사람과 서비스가 어떻게 로그인하고 어떤 권한을 받는지 포함합니다.
google-cloud-recipe-onboarding
22k새 개발자가 Google Cloud에서 프로젝트 선택, 결제 연결, 첫 리소스 배포 같은 첫 단계를 밟도록 안내합니다.
비슷한 스킬
api-connector-builder
280k에이전트가 기존 패턴을 따라 새로운 API 연결을 만들도록 합니다. 새로운 방식을 도입하지 않고 연동을 하나 더 추가할 때 씁니다.
api-design
280k에이전트가 모범 사례에 따라 REST API를 설계하도록 돕습니다. API가 통신하는 방식, 오류를 보여 주는 방식, 데이터를 정리하는 방식을 정하는 데 유용합니다.
backend-patterns
280k에이전트가 서버 쪽 아키텍처 패턴과 데이터베이스 최적화를 다루도록 돕습니다. 서버에서 실행되는 코드를 만들거나 검토할 때 유용합니다.