Saltar al contenido
Skillpedia
APIs y servidores (backend)22 mil · #10257

developing-genkit-js

Qué hace

Esta skill ayuda a los desarrolladores a crear funciones de IA en JavaScript y TypeScript con el SDK de Genkit. Es para equipos web y de Node.js que quieren añadir agentes o llamadas a modelos.

Cuándo usarla

  • ✓Cuando quieres crear un agente, un flujo o una herramienta de IA en JavaScript o TypeScript con Genkit.
  • ✓Cuando estás corrigiendo errores de Genkit, problemas de validación o errores de tipos en un proyecto de Node.js.
  • ✓Cuando quieres archivos de prompts y conversaciones de agente de varios turnos en una app de Genkit.

Link de la skill

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

Cópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.

Cómo usar

La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.

Mensaje listo para pegar

Usa esta skill para ayudarme: https://github.com/google/skills/blob/main/skills/cloud/developing-genkit-js/SKILL.md Lee el archivo SKILL.md de ese link y sigue sus instrucciones en mi tarea.
¿Quieres que tu IA encuentre skills como esta por sí sola?Instala el MCP gratis de Skillpedia: una línea, y busca entre 15.000+ skills antes de cada tarea.Instalar en 1 minuto →

Ejemplo de qué pedirle a la IA

“Configura Genkit en mi proyecto de TypeScript y crea un flujo que escriba un chiste sobre un tema.”

5 skills nuevas por semana. 1 minuto de lectura.

Cómo funciona

Primero comprueba la versión de la CLI de genkit y después escribe código TypeScript usando las API de Genkit para flujos, herramientas y prompts. Señala las guías de referencia para la configuración y las funciones concretas.

Contenido técnico (SKILL.md original)

Texto original del autor, en inglés, directo de 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
Preguntas frecuentes

¿Qué versión de la CLI de genkit se necesita?

La versión 1.29.0 o posterior. La skill puede instalarla o actualizarla por ti.

¿Cubre los archivos de prompts?

Sí. Cubre los archivos Dotprompt con plantillas y esquemas.

¿Admite agentes?

Sí. Cubre la API de agentes en versión preliminar para conversaciones de varios turnos.

Detalles

Descripción original del autor

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

Popularidad

Estrellas en GitHub
22 mil
Posición en el ranking
#10257
Licencia
Apache-2.0
Actualizada
2/11/2026

¿Te sirve esta skill?

0

Entra para votar.

Comentarios

  • …

Más skills de este repositorio

Skills parecidas