Skip to content
Build Your Agent Integration Skill logo

Build Your Agent Integration Skill

Create your agent-integration skill from OpenAI SDK and LiteLLM documentation before learning framework integration

SKILL.md

Full skill instructions

Build Your Agent Integration Skill

Your Task API model is deployed and running via Ollama. Now you need to connect it to agent frameworks like OpenAI Agents SDK, Claude Code, and MCP servers.

Before learning integration patterns, you will own an agent-integration skill. This skill becomes your reusable reference for connecting custom models to any framework.

This lesson follows the Skill-First Learning Pattern: build the skill, then learn what it knows.

Why Skill-First for Agent Integration?

Agent framework integration involves multiple interconnected patterns:

PatternWhat It Handles
LiteLLM ProxyUnified OpenAI-compatible API for any backend
Base URL ConfigRedirect SDK calls to custom endpoints
Tool CallingStructured outputs for function invocation
Error FallbackGraceful degradation to foundation models
MCP IntegrationModel Context Protocol server setup

Learning these patterns without a reference leads to trial-and-error debugging. Your skill captures verified patterns from official documentation, giving you a reliable starting point.

Step 1: Get the Skills Lab

If you completed Chapter 70, you already have the skills-lab. If not:

  1. Go to github.com/​panaversity/​claude-code-skills-lab
  2. Click the green Code button
  3. Select Download ZIP
  4. Extract the ZIP file
  5. Open the extracted folder in your terminal
cd claude-code-skills-lab
claude

Step 2: Create Your Agent Integration Skill

Copy and paste this prompt:

Using your skill creator skill, create a new skill called "agent-integration"
for connecting custom LLM backends to agent frameworks.

I need patterns for:
- LiteLLM proxy configuration for OpenAI SDK compatibility
- OpenAI Agents SDK with custom base_url
- Tool calling with custom models (structured outputs)
- Error handling and fallback to foundation models
- MCP server integration with custom backends

Use context7 skill to study:
- OpenAI Python SDK documentation
- LiteLLM documentation
- FastMCP documentation

Build from official docs only, no assumed knowledge.

Claude will:

  1. Fetch OpenAI SDK, LiteLLM, and FastMCP documentation via Context7
  2. Ask clarifying questions about your deployment setup (Ollama vs vLLM, local vs cloud)
  3. Create a comprehensive skill with patterns, templates, and troubleshooting guides

Your skill appears at .claude/​skills/​agent-integration/.

Step 3: Verify Your Skill

Check that your skill exists:

ls .claude/​skills/​agent-integration/

Expected Output:

SKILL.md

Open the skill and confirm it includes:

  • LiteLLM proxy configuration examples
  • OpenAI SDK base_url patterns
  • Tool calling JSON schema templates
  • Error handling patterns
  • MCP server integration code

What Your Skill Contains

A well-built agent-integration skill includes these sections:

LiteLLM Proxy Setup

# config.yaml for LiteLLM
model_list:
  - model_name: task-api-model
    litellm_params:
      model: ollama/​task-api-model
      api_base: http://localhost:11434

OpenAI SDK Configuration

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:4000/​v1",  # LiteLLM proxy
    api_key="sk-local"  # Placeholder for local
)

Tool Calling Schema

tools = [{
    "type": "function",
    "function": {
        "name": "create_task",
        "description": "Create a new task",
        "parameters": {
            "type": "object",
            "properties": {
                "title": {"type": "string"},
                "priority": {"type": "string", "enum": ["low", "medium", "high"]}
            },
            "required": ["title"]
        }
    }
}]

Error Fallback Pattern

def call_with_fallback(prompt, tools):
    try:
        return custom_client.chat.completions.create(
            model="task-api-model",
            messages=[{"role": "user", "content": prompt}],
            tools=tools
        )
    except Exception:
        return openai_client.chat.completions.create(
            model="gpt-4o-mini",
            messages=[{"role": "user", "content": prompt}],
            tools=tools
        )

Done

You now own an agent-integration skill built from official OpenAI SDK, LiteLLM, and FastMCP documentation.

The rest of this chapter teaches you what your skill knows:

  • Lessons 1-3: Integration fundamentals (backends, proxy, SDK)
  • Lessons 4-6: Production patterns (tool calling, MCP, error handling)
  • Lesson 7: Capstone that combines everything into a complete Task API Agent

As you complete each lesson, your skill improves. By the chapter's end, you have a production-ready integration skill for any custom model.

Try With AI

Prompt 1: Examine Your Skill

Open my agent-integration skill at .claude/​skills/​agent-integration/​SKILL.md
and explain its structure. What sections does it have? What patterns are
included? Are there any gaps I should fill in as I complete this chapter?

What you're learning: Understanding skill structure and identifying improvement opportunities.

Prompt 2: Compare to Your Setup

I have my Task API model running on Ollama at localhost:11434. Review my
agent-integration skill and tell me which patterns apply to my setup.
What configuration changes would I need for a different setup (like vLLM
or cloud deployment)?

What you're learning: Mapping general patterns to your specific deployment context.

Prompt 3: Identify Learning Path

Based on what's in my agent-integration skill, which patterns do I already
understand from previous chapters, and which are new? Help me prioritize
what to focus on in the upcoming lessons.

What you're learning: Self-assessment and learning prioritization through skill analysis.

More skills from diegosouzapw

accessibility logo
diegosouzapw/awesome-omni-skill

accessibility

Accessibility guidelines for VS Code features — covers accessibility help dialogs, accessible views, verbosity settings, accessibility signals, ARIA alerts/status announcements, keyboard navigation, and ARIA labels/roles. Applies to both new interactive UI surfaces and updates to existing feature...

62 1
View
mermaid-diagrams logo
diegosouzapw/awesome-omni-skill

mermaid-diagrams

Mermaid diagram creation for flowcharts, sequences, ERDs, and more. Generate diagrams from text in markdown files. Use for documentation, architecture diagrams, and visual representations. Triggers on mermaid, flowchart, sequence diagram, ERD, entity relationship, gantt chart, pie chart, class di...

62 1
View
tauri2-react-rust logo
diegosouzapw/awesome-omni-skill

tauri2-react-rust

Guides development of cross-platform desktop apps with Tauri 2, TypeScript, React, and Rust. Use when building Tauri apps, implementing IPC, designing Rust backend or TypeScript/React frontend, when researching or cloning a website (open site, snapshot elements), when verifying local dev or built...

62 1
View
fp-ts-errors logo
diegosouzapw/awesome-omni-skill

fp-ts-errors

Handle errors as values using fp-ts Either and TaskEither for cleaner, more predictable TypeScript code. Use when implementing error handling patterns with fp-ts.

62 0
View
ring:pre-dev-research logo
diegosouzapw/awesome-omni-skill

ring:pre-dev-research

Gate 0 research phase for pre-dev workflow. Dispatches 3 parallel research agents to gather codebase patterns, external best practices, and framework documentation BEFORE creating PRD/TRD. Outputs research.md with file:line references.

62 0
View
create-assistant logo
diegosouzapw/awesome-omni-skill

create-assistant

Create and configure Vapi voice AI assistants with models, voices, transcribers, tools, hooks, and advanced settings. Use when building voice agents, phone bots, customer support assistants, or any conversational AI that handles phone or web calls.

62 0
View
codex-headless logo
diegosouzapw/awesome-omni-skill

codex-headless

Delegiere Aufgaben an OpenAI Codex CLI im Headless-Mode. Nutzt ChatGPT Subscription (KEIN API Key). Nur Workspace-Zugriff, KEIN System-Zugriff. Auto-Accept mit --full-auto. Web-Recherche mit --search.

62 0
View
social-media-scheduler logo
diegosouzapw/awesome-omni-skill

social-media-scheduler

Generate a full week of social media content for any topic. Outputs platform-optimized posts for Twitter/X, LinkedIn, and Instagram with hashtags and posting times.

62 0
View
Data Privacy Compliance logo
diegosouzapw/awesome-omni-skill

Data Privacy Compliance

Data privacy and regulatory compliance specialist for GDPR, CCPA, HIPAA, and international data protection laws. Use when implementing privacy controls, conducting data protection impact assessments, ensuring regulatory compliance, or managing data subject rights. Expert in consent management, da...

62 0
View
triple-review logo
diegosouzapw/awesome-omni-skill

triple-review

Reviews a task using the TRIPLE protocol, as the review agent.

62 0
View
Tech Stack & Architecture Decision logo
diegosouzapw/awesome-omni-skill

Tech Stack & Architecture Decision

Define and document the technology stack and architecture decisions for a project. Use when the user needs to choose a tech stack, make architecture decisions, define infrastructure choices, or document technology selections. Triggers on requests like "define the tech stack", "choose technologies...

62 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View