ai-integration

ai-integration is a skill for Claude Code from Dokkabei97/forged-claude-code. It costs 41 tokens per session (1,155 once invoked), scanned A, original, MIT.

A guide and code generator for adding large-language-model features from OpenAI, Anthropic, or Google to an application. It covers common chat integrations as well as RAG, a method that lets a model answer using information retrieved from your own documents or data.

In plain words
What is it for?
Use it to generate integration code for AI chat features, choose provider-specific patterns, add streamed responses and error handling, estimate usage costs, or set up a RAG pipeline.
Why use it?
It removes much of the repeated setup involved in connecting to model APIs. It also addresses streaming replies, error handling, prompt structure, cost estimation, and RAG setup.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the forged-claude-code plugin — 29 skills, 14 commands, 9 agents, 2 hooks shipped together

Good fit Use it to generate integration code for AI chat features, choose provider-specific…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dokkabei97/forged-claude-code/ai-integration
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Dokkabei97/forged-claude-code --skill ai-integration
Clone the repo
git clone --depth 1 https://github.com/Dokkabei97/forged-claude-code

Made for: Claude Code.

Or install forged-claude-code, the plugin that ships this one along with the rest of its 29 skills, 14 commands, 9 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-integration

README.md
[![agentmods](https://agentmods.dev/badge/skills/dokkabei97/forged-claude-code/ai-integration.svg)](https://agentmods.dev/skills/dokkabei97/forged-claude-code/ai-integration)
Your own site
<a href="https://agentmods.dev/skills/dokkabei97/forged-claude-code/ai-integration"><img src="https://agentmods.dev/badge/skills/dokkabei97/forged-claude-code/ai-integration.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,155 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00041 $0.01155
Opus 5 $0.00020 $0.00577
Sonnet 5 $0.00008 $0.00231
Haiku 4.5 $0.00004 $0.00115

Measured 6d ago against content hash 5d551978049a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

ai-integration scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/cto/ai-integration/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Integration - LLM API Integration Guide

Overview

Generates production-ready LLM API integration code. From basic chat completion to RAG pipelines, with cost tracking and error handling.


1. When to Apply

Trigger Behavior
Adding AI/LLM features Full integration setup
"OpenAI", "Anthropic", "RAG" Provider-specific integration
AI feature architecture Pattern recommendation

2. Provider Quick Start

OpenAI (TypeScript)

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 ?? ''
}

Anthropic (TypeScript)

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 : ''
}

Streaming Response (Next.js)

// 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()
}

3. Common Patterns

Structured Output

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!))

Read the full file on GitHub · 178 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 178 lines · 41 tokens per session scan A 5d551978049a

Subscribe to this mod's changes

ai-integration is a skill published in the GitHub repository Dokkabei97/forged-claude-code (2 stars, last pushed 6mo ago), licensed MIT. It adds 41 tokens to every session and 1,155 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories