/skills:ai-corefrom skills
Foundation AI layer — configures AI Gateway provider and exports getModel() for all downstream AI skills. Use this skill when the user says "setup AI", "add AI", "configure AI gateway", or "setup ai-core".
Ships in skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Foundation layer that configures Vercel AI Gateway as the unified provider for 200+ models and exports a single getModel() function consumed by all downstream AI skills.
src/ directory and App Routerenv-config skill) with src/env.tsbun add ai @ai-sdk/gateway
Add to .env.local:
# AI Gateway
AI_GATEWAY_API_KEY=your-gateway-api-key-here
AI_GATEWAY_MODEL=google/gemini-2.5-flash-lite
If AI_GATEWAY_API_KEY is empty or a placeholder in .env.local, load it from 1Password:
# Check if already set
grep -q "AI_GATEWAY_API_KEY=your-" .env.local 2>/dev/null && echo "Key is placeholder — load from 1Password"
# Load from 1Password (uses env-from-1password skill)
op item get "Dev Environment" --account=my.1password.com --fields label=notesPlain | tr -d '"' > /tmp/op-env.txt
grep "AI_GATEWAY_API_KEY" /tmp/op-env.txt >> .env.local && rm /tmp/op-env.txt
Or use the /env-from-1password skill to load all keys at once — it writes AI_GATEWAY_API_KEY (and other service keys) to .env.local.
src/env.tsAdd the AI Gateway variables to your environment schema:
src/env.tsAdd to the server object:
server: {
// ... existing variables
AI_GATEWAY_API_KEY: z.string().optional(),
AI_GATEWAY_MODEL: z.string().default("google/gemini-2.5-flash-lite"),
},
Add to the runtimeEnv object:
runtimeEnv: {
// ... existing variables
AI_GATEWAY_API_KEY: process.env.AI_GATEWAY_API_KEY,
AI_GATEWAY_MODEL: process.env.AI_GATEWAY_MODEL,
},
src/
└── lib/
└── ai.ts # gateway() provider, getModel()
src/lib/ai.tsimport { gateway } from "@ai-sdk/gateway";
/**
* Returns an AI model via AI Gateway.
*
* Uses the `AI_GATEWAY_MODEL` env var as the default model.
* Downstream skills can override by passing a specific modelId
* (e.g., `getModel("anthropic/claude-sonnet-4")` for reasoning).
*
* @param modelId - Optional model identifier in "provider/model" format.
* Defaults to `AI_GATEWAY_MODEL` env var, then `google/gemini-2.5-flash-lite`.
* @returns A model object compatible with AI SDK's `streamText`, `generateText`, etc.
*/
export function getModel(modelId?: string) {
return gateway(
modelId ?? process.env.AI_GATEWAY_MODEL ?? "google/gemini-2.5-flash-lite"
);
}
/**
* Returns an embedding model via AI Gateway.
*
* @param modelId - Optional embedding model identifier.
* Defaults to `openai/text-embedding-3-small`.
* @returns An embedding model compatible with AI SDK's `embed()` and `embedMany()`.
*/
export function getEmbeddingModel(modelId?: string) {
return gateway.textEmbeddingModel(
modelId ?? "openai/text-embedding-3-small"
);
}
import { getModel } from "@/lib/ai";
import { streamText, generateText } from "ai";
// Use default model (google/gemini-2.5-flash-lite)
const result = await streamText({
model: getModel(),
prompt: "Hello, world!",
});
// Override with a specific model
const reasoning = await generateText({
model: getModel("anthropic/claude-sonnet-4"),
prompt: "Explain quantum entanglement step by step.",
});
// Generate embeddings
import { getEmbeddingModel } from "@/lib/ai";
import { embed } from "ai";
const { embedding } = await embed({
model: getEmbeddingModel(),
value: "Some text to embed",
});
| Model | Input Cost | Output Cost | Best For |
|---|---|---|---|
google/gemini-2.5-flash-lite | $0.10/M | $0.40/M | Default dev/test, tools, memory |
anthropic/claude-sonnet-4 | $3.00/M | $15.00/M | Reasoning, artifacts, quality |
openai/gpt-4o-mini | $0.07/M | $0.30/M | Fast responses alternative |
To run models locally via Ollama instead of AI Gateway, swap the provider in src/lib/ai.ts:
bun add @ai-sdk/ollama
ollama pull qwen3:8b
import { ollama } from "@ai-sdk/ollama";
export function getModel() {
return ollama("qwen3:8b");
}
qwen3:8bis the Ollama model — best-in-class tool calling at 8B, strong markdown output, and the standard choice for local agentic apps in 2026. No env vars or API keys needed.
For local dev without an AI Gateway account, set OLLAMA_BASE_URL in .env.local and conditionally switch providers:
import { gateway } from "@ai-sdk/gateway";
import { ollama } from "@ai-sdk/ollama";
export function getModel(modelId?: string) {
if (process.env.OLLAMA_BASE_URL) {
return ollama("qwen3:8b");
}
return gateway(
modelId ?? process.env.AI_GATEWAY_MODEL ?? "google/gemini-2.5-flash-lite"
);
}
Add to .env.local to enable Ollama:
OLLAMA_BASE_URL=http://localhost:11434
tsc passes with no errorsgetModel() returns a valid model object usable with streamText() / generateText()getModel("anthropic/claude-sonnet-4") returns a different model than the defaultgetEmbeddingModel() returns a valid embedding model usable with embed()bun run build succeedsWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
84 skills in this plugin
/add-featureParent skill for feature and project workflows. Use when the user wants to build a project, add a feature, polish a skill, test all skills, or browse the skill catalog. Routes to add-project (build project from idea), improve-skill (refine one skill in a sandbox), test-skills (validate full skill composition), or any child skill by name.
/add-projectEnd-to-end project builder: idea → spec → shell → ralph loop → secrets → report. SMS notification after every phase. Creates a project directory with symlinked skills and a ralph execution loop. Does NOT scaffold Next.js — ralph does that as step 1.1 of the plan. Use when the user says "build project", "build a project", "new project", "create project", "build from idea", "scaffold and notify", "spec a project", "plan a project", or "scaffold project".
/add-pwaSetup Progressive Web App (PWA) support for a Next.js project using Serwist. Use when user says "setup pwa", "add pwa", "make it a pwa", "progressive web app", or "enable offline support"./add-seoSetup comprehensive SEO for a Next.js project using built-in metadata APIs. Use when user says "setup seo", "add seo", "configure metadata", "add sitemap", "add open graph", or "improve seo"./add-shadcnSetup a design system using shadcn/ui. Use this skill when the user says "setup design system", "set up design system", "create design system", "setup shadcn", or "initialize design system"./add-specCreate a project spec from an idea using the full brainstorming design workflow, then output a no-frills spec for Ralph loops and add-project. Use when the user says "spec a project", "create a spec", "spec this idea", "plan a project", "write a spec", or when add-project delegates Phase 1 spec generation. Runs brainstorming first (clarify → approaches → design approval → design doc), then writes docs/specs/{name}.md with mission, features, flows, screens, and skills mapping.
npx claudepluginhub mattwoodco/skills --plugin skills