Generates LLM API integration code for OpenAI, Anthropic, and Google. Includes prompt engineering patterns, streaming responses, error handling, cost estimation, and RAG pipeline setup.
From forged-claude-codenpx claudepluginhub dokkabei97/forged-claude-code --plugin forged-claude-codeThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Generates production-ready LLM API integration code. From basic chat completion to RAG pipelines, with cost tracking and error handling.
| Trigger | Behavior |
|---|---|
| Adding AI/LLM features | Full integration setup |
| "OpenAI", "Anthropic", "RAG" | Provider-specific integration |
| AI feature architecture | Pattern recommendation |
import OpenAI from 'openai'
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
async function chat(prompt: string): Promise<string> {
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: prompt }],
max_tokens: 1000,
})
return response.choices[0].message.content ?? ''
}
import Anthropic from '@anthropic-ai/sdk'
const anthropic = new Anthropic({ apiKey: process.env.ANTHROPIC_API_KEY })
async function chat(prompt: string): Promise<string> {
const response = await anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
max_tokens: 1024,
messages: [{ role: 'user', content: prompt }],
})
return response.content[0].type === 'text' ? response.content[0].text : ''
}
// app/api/chat/route.ts
import { streamText } from 'ai'
import { openai } from '@ai-sdk/openai'
export async function POST(req: Request) {
const { messages } = await req.json()
const result = streamText({
model: openai('gpt-4o'),
messages,
})
return result.toDataStreamResponse()
}
import { z } from 'zod'
const schema = z.object({
sentiment: z.enum(['positive', 'negative', 'neutral']),
confidence: z.number().min(0).max(1),
summary: z.string(),
})
const response = await openai.chat.completions.create({
model: 'gpt-4o',
messages: [{ role: 'user', content: text }],
response_format: { type: 'json_object' },
})
const result = schema.parse(JSON.parse(response.choices[0].message.content!))
1. Document ingestion → chunk → embed → store in vector DB
2. Query → embed query → similarity search → retrieve chunks
3. Augment prompt with retrieved context → generate response
async function callWithRetry<T>(
fn: () => Promise<T>,
maxRetries = 3,
baseDelay = 1000
): Promise<T> {
for (let i = 0; i <= maxRetries; i++) {
try {
return await fn()
} catch (error: any) {
if (i === maxRetries) throw error
if (error.status === 429 || error.status >= 500) {
await new Promise(r => setTimeout(r, baseDelay * Math.pow(2, i)))
continue
}
throw error // Don't retry client errors
}
}
throw new Error('Unreachable')
}
| Model | Input (1K tokens) | Output (1K tokens) |
|---|---|---|
| GPT-4o | $0.0025 | $0.01 |
| GPT-4o-mini | $0.00015 | $0.0006 |
| Claude Sonnet | $0.003 | $0.015 |
| Claude Haiku | $0.0008 | $0.004 |
Rule of thumb: Start with cheaper models, upgrade only when quality demands it.
| Tool | Purpose |
|---|---|
| Write | Generate integration code |
| Read | Analyze existing codebase |
| Bash | Install SDKs (npm install openai) |
Will:
Will Not: