genkit
Build production-ready AI workflows using Firebase Genkit. Use when creating flows, tool-calling agents, RAG pipelines, multi-agent systems, or deploying AI to Firebase/Cloud Run. Supports TypeScript, Go, and Python with Gemini, OpenAI, Anthropic, Ollama, and Vertex AI plugins.
What this skill does
# Firebase Genkit
## When to use this skill
- **AI workflow orchestration**: Building multi-step AI pipelines with type-safe inputs/outputs
- **Flow-based APIs**: Wrapping LLM calls into deployable HTTP endpoints
- **Tool calling / agents**: Equipping models with custom tools and implementing agentic loops
- **RAG pipelines**: Retrieval-augmented generation with vector databases (Pinecone, pgvector, Firestore, Chroma, etc.)
- **Multi-agent systems**: Coordinating multiple specialized AI agents
- **Streaming responses**: Real-time token-by-token output for chat or long-form content
- **Firebase/Cloud Run deployment**: Deploying AI functions to Google Cloud
- **Prompt management**: Managing prompts as versioned `.prompt` files with Dotprompt
---
## Installation & Setup
### Step 1: Install the Genkit CLI
```bash
# npm (recommended for JavaScript/TypeScript)
npm install -g genkit-cli
# macOS/Linux binary
curl -sL cli.genkit.dev | bash
```
### Step 2: Create a TypeScript project
```bash
mkdir my-genkit-app && cd my-genkit-app
npm init -y
npm pkg set type=module
npm install -D typescript tsx
npx tsc --init
mkdir src && touch src/index.ts
```
### Step 3: Install Genkit core and a model plugin
```bash
# Core + Google AI (Gemini) — free tier, no credit card required
npm install genkit @genkit-ai/google-genai
# Or: Vertex AI (requires GCP project)
npm install genkit @genkit-ai/vertexai
# Or: OpenAI
npm install genkit genkitx-openai
# Or: Anthropic (Claude)
npm install genkit genkitx-anthropic
# Or: Ollama (local models)
npm install genkit genkitx-ollama
```
### Step 4: Configure API Key
```bash
# Google AI (Gemini)
export GEMINI_API_KEY=your_key_here
# OpenAI
export OPENAI_API_KEY=your_key_here
# Anthropic
export ANTHROPIC_API_KEY=your_key_here
```
---
## Core Concepts
### Initializing Genkit
```typescript
import { googleAI } from '@genkit-ai/google-genai';
import { genkit } from 'genkit';
const ai = genkit({
plugins: [googleAI()],
model: googleAI.model('gemini-2.5-flash'), // default model
});
```
### Defining Flows
Flows are the core primitive: type-safe, observable, deployable AI functions.
```typescript
import { genkit, z } from 'genkit';
import { googleAI } from '@genkit-ai/google-genai';
const ai = genkit({ plugins: [googleAI()] });
// Input/output schemas with Zod
const SummaryInputSchema = z.object({
text: z.string().describe('Text to summarize'),
maxWords: z.number().optional().default(100),
});
const SummaryOutputSchema = z.object({
summary: z.string(),
keyPoints: z.array(z.string()),
});
export const summarizeFlow = ai.defineFlow(
{
name: 'summarizeFlow',
inputSchema: SummaryInputSchema,
outputSchema: SummaryOutputSchema,
},
async ({ text, maxWords }) => {
const { output } = await ai.generate({
model: googleAI.model('gemini-2.5-flash'),
prompt: `Summarize the following text in at most ${maxWords} words and extract key points:\n\n${text}`,
output: { schema: SummaryOutputSchema },
});
if (!output) throw new Error('No output generated');
return output;
}
);
// Call the flow
const result = await summarizeFlow({
text: 'Long article content here...',
maxWords: 50,
});
console.log(result.summary);
```
### Generating Content
```typescript
// Simple text generation
const { text } = await ai.generate({
model: googleAI.model('gemini-2.5-flash'),
prompt: 'Explain quantum computing in one sentence.',
});
// Structured output
const { output } = await ai.generate({
prompt: 'List 3 programming languages with their use cases',
output: {
schema: z.object({
languages: z.array(z.object({
name: z.string(),
useCase: z.string(),
})),
}),
},
});
// With system prompt
const { text: response } = await ai.generate({
system: 'You are a senior TypeScript engineer. Be concise.',
prompt: 'What is the difference between interface and type in TypeScript?',
});
// Multimodal (image + text)
const { text: description } = await ai.generate({
prompt: [
{ text: 'What is in this image?' },
{ media: { url: 'https://example.com/image.jpg', contentType: 'image/jpeg' } },
],
});
```
### Streaming Flows
```typescript
export const streamingFlow = ai.defineFlow(
{
name: 'streamingFlow',
inputSchema: z.object({ topic: z.string() }),
streamSchema: z.string(), // type of each chunk
outputSchema: z.object({ full: z.string() }),
},
async ({ topic }, { sendChunk }) => {
const { stream, response } = ai.generateStream({
prompt: `Write a detailed essay about ${topic}.`,
});
for await (const chunk of stream) {
sendChunk(chunk.text); // stream each token to client
}
const { text } = await response;
return { full: text };
}
);
// Client-side consumption
const stream = streamingFlow.stream({ topic: 'AI ethics' });
for await (const chunk of stream.stream) {
process.stdout.write(chunk);
}
const finalOutput = await stream.output;
```
### Tool Calling (Agents)
```typescript
import { z } from 'genkit';
// Define tools
const getWeatherTool = ai.defineTool(
{
name: 'getWeather',
description: 'Get current weather for a city',
inputSchema: z.object({ city: z.string() }),
outputSchema: z.object({ temp: z.number(), condition: z.string() }),
},
async ({ city }) => {
// Call real weather API
return { temp: 22, condition: 'sunny' };
}
);
const searchWebTool = ai.defineTool(
{
name: 'searchWeb',
description: 'Search the web for information',
inputSchema: z.object({ query: z.string() }),
outputSchema: z.string(),
},
async ({ query }) => {
// Call search API
return `Search results for: ${query}`;
}
);
// Agent flow with tools
export const agentFlow = ai.defineFlow(
{
name: 'agentFlow',
inputSchema: z.object({ question: z.string() }),
outputSchema: z.string(),
},
async ({ question }) => {
const { text } = await ai.generate({
prompt: question,
tools: [getWeatherTool, searchWebTool],
returnToolRequests: false, // auto-execute tools
});
return text;
}
);
```
### Prompts with Dotprompt
Manage prompts as versioned `.prompt` files:
```
# src/prompts/summarize.prompt
---
model: googleai/gemini-2.5-flash
input:
schema:
text: string
style?: string
output:
schema:
summary: string
sentiment: string
---
Summarize the following text in a {{style, default: "professional"}} tone:
{{text}}
Return JSON with summary and sentiment (positive/negative/neutral).
```
```typescript
// Load and use dotprompt
const summarizePrompt = ai.prompt('summarize');
const { output } = await summarizePrompt({
text: 'Article content here...',
style: 'casual',
});
```
### RAG — Retrieval-Augmented Generation
```typescript
import { devLocalVectorstore } from '@genkit-ai/dev-local-vectorstore';
import { textEmbedding004 } from '@genkit-ai/google-genai';
const ai = genkit({
plugins: [
googleAI(),
devLocalVectorstore([{
indexName: 'documents',
embedder: textEmbedding004,
}]),
],
});
// Index documents
await ai.index({
indexer: devLocalVectorstoreIndexer('documents'),
docs: [
{ content: [{ text: 'Document 1 content...' }], metadata: { source: 'doc1' } },
{ content: [{ text: 'Document 2 content...' }], metadata: { source: 'doc2' } },
],
});
// RAG flow
export const ragFlow = ai.defineFlow(
{
name: 'ragFlow',
inputSchema: z.object({ question: z.string() }),
outputSchema: z.string(),
},
async ({ question }) => {
// Retrieve relevant documents
const docs = await ai.retrieve({
retriever: devLocalVectorstoreRetriever('documents'),
query: question,
options: { k: 3 },
});
// Generate answer grounded in retrieved docs
const { text } = await ai.generate({
system: 'Answer questions using only the provided context.',
prompt: question,
docs,
});
return texRelated in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.