Установка
SKILL.md
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 and polling.
- 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.
- Advanced custom agents:
defineCustomAgentfor full turn control. - Deploying agents: serving agents over HTTP (multiple agents, CORS, web UI, other frameworks).
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) plus built-in core middleware. - Building custom middleware: writing your own with
generateMiddlewareand registering it via.plugin().
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.):
- MANDATORY FIRST STEP: Read Common Errors
- Identify if the error matches a known pattern
- Apply the documented solution
- 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
- 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.
- Detect Framework: Check
package.jsonto 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.
- Look for
- 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.
- Ensure Correctness:<!-- -->
- Run type checks (e.g.,
npx tsc --noEmit) after making changes. - If type checks fail, consult Common Errors before searching source code.
- Run type checks (e.g.,
- 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:
- Search topics:
genkit docs:search <query>- Example:
genkit docs:search "streaming"
- Example:
- List all docs:
genkit docs:list - Read a guide:
genkit docs:read <path>- Example:
genkit docs:read js/flows.md
- Example:
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 --helpfor a full list of commands.
References
- Best Practices: Recommended patterns for schema definition, flow design, and structure.
- Dotprompt:
.promptfiles —promptDir,ai.prompt(), variants, partials, named schemas, andtools/maxTurns/returnToolRequests/usefrontmatter. - 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).
- Agents (Beta): Agent basics, serving, and client-managed state. Deeper topics: sessions, human-in-the-loop, branching, background agents, state, artifacts, multi-agent, custom agents, deployment.
- Middleware: using middleware and the
@genkit-ai/middlewarepackage. See also building custom middleware.
Вставить в README
Ссылка на карточку для вашего README — без картинок и счётчиков.
[DarkPlay: developing-genkit-js](https://darkplay.ru/ai/skills/skills-developing-genkit-js)
Похожие скиллы и другие разделы каталога
Та же категория — сравните, что ещё подойдёт под вашу задачу.
agent-evalcolbymchenry · Оценивает качество поиска CodeGraph на реальной кодовой базе, сравнивая поведение агента…
supermemorysupermemoryai · Supermemory: инфраструктура памяти и контекста для ИИ-агентов.
openai-knowledgeopenai · Используйте при работе с OpenAI API (Responses API) или функциями платформы OpenAI…
ai-sdkvercel · Ответы на вопросы об AI SDK и помощь в создании ИИ-функций: generateText, streamText…
context-engineering-collectionmuratcankoylan · Сборник навыков по контекстной инженерии, harness-инженерии, мультиагентным архитектурам…
get-api-docsandrewyng · Используйте этот навык, чтобы получить документацию по сторонним API, SDK или библиотекам…
mcp-apps-buildermcp-use · Обязательные практики и паттерны фреймворка mcp-use для любой работы с MCP-серверами.
google-agents-cli-adk-codegoogle · Помогает писать код агентов на ADK: добавление инструментов, колбэки, определение агента…
evevercel · Создание надёжных бэкенд-агентов на фреймворке eve. Для создания, редактирования и…
gemini-api-devgoogle-gemini · Работа с моделями Gemini API: мультимодальный контент, вызов функций, структурированный…Самые востребованные скиллов раздела по установкам и звёздам.
find-skillsvercel-labs · Помогает находить и устанавливать навыки агентов по запросам вроде «как сделать X»…
grill-memattpocock · Настойчивое интервью для доработки плана или дизайна.
hyperframesheygen-com · Обязательная точка входа для любых задач по видео, анимации и motion-графике в…
hyperframes-cliheygen-com · Цикл разработки HyperFrames CLI: init, add, render, preview, publish и другие команды.
agent-browservercel-labs · CLI для автоматизации браузера для ИИ-агентов: навигация по страницам, заполнение форм…
media-useheygen-com · Agent Media OS: единый навык для медиа в HyperFrames — BGM, SFX, изображения, голос, LUT.
hyperframes-registryheygen-com · Установка и подключение блоков реестра в композиции HyperFrames через add и catalog.
grill-with-docsmattpocock · Настойчивое интервью для доработки плана или дизайна, попутно создающее документацию (ADR…
improve-codebase-architecturemattpocock · Поиск в кодовой базе возможностей для углубления, визуальный HTML-отчёт о них и детальный…
tddmattpocock · Разработка через тестирование (TDD): red-green-refactor и интеграционные тесты.Соседние разделы каталога: возможно, нужный инструмент живёт там.
plugin-devanthropics · Полный набор инструментов для разработки плагинов Claude Code. Включает 7 экспертных…
grafana-assistantanthropics · Навыки и правила для разработки и использования приложения и CLI Grafana Assistant.
plugin-devanthropics · Набор инструментов для разработки плагинов Claude Code: 7 экспертных навыков по хукам…
rillanthropics · Навыки для разработки и запросов к проектам в платформе бизнес-аналитики Rill.
grafana-assistantanthropics · Навыки и правила для разработки и использования приложения и CLI Grafana Assistant.
AEM Front-End Specialistgithub · Экспертный помощник по разработке компонентов AEM с использованием HTL, Tailwind CSS и…
C# MCP Server Expertgithub · Экспертный помощник по разработке серверов Model Context Protocol (MCP) на C#.
Python MCP Server Expertgithub · Экспертный помощник по разработке серверов Model Context Protocol (MCP) на Python.
TypeScript MCP Server Expertgithub · Экспертный помощник по разработке серверов Model Context Protocol (MCP) на TypeScript.
agentforce-adlcanthropics · Создание, тестирование и оптимизация агентов Salesforce Agentforce в Claude Code. Три…Лучшие ИИ-инструменты для автоматизации и ассистентов
Подборка ИИ-ассистентов для автоматизации рутины и ускорения рабочих процессов. Сервисы, которые берут на себя переписку, анализ данных, ведение базы знаний и подготовку продаж, эк
Give Me Public
AITunnelAitunnel
STIVAStiva
Wikibot (Викибот)Wikibot
mymeet.aiMymeet
InsighterInsighter
TGHuntTghunt
LegiscanLegiscan
RouterAIRouterai
Wikibot 1.0 (Викибот)WikibotЛучшие ИИ-инструменты для программирования
Подборка нейросетей и ИИ-ассистентов для разработки и автоматизации кода. Сервисы, которые ускоряют написание, ревью и отладку, экономят часы рутины и снижают порог входа в сложные
GenAPIGenapi
Notepad++ AINotepad-plus-plus
Creatium MaxCremax
Emacs AIGnu
KiteKite
Amazon Q DeveloperAmazonЛучшие ИИ-инструменты для генерации видео
Подборка нейросетей для генерации и монтажа видео. Инструменты, которые превращают текст в готовые ролики, экономят часы на съемках и постпродакшне. Подходит для SMM-специалистов,
VEED.IOVeed
MootionMootion
Sora (OpenAI)OpenAI
viralpulse.appViralpulse
Viral Maker AIViral-maker