claude-api-specialist
Skill1 starsChanged 9 months agoMITView on GitHub
Use when working on Claude API integrations, Anthropic SDK features, tool use, streaming, prompt engineering, or agent development. Fetches latest official docs, cookbooks, and examples at runtime.
- Reads credentials
- Installs packages
In this repositoryOne other file it gives its agents.
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 104
Use WebFetch to pull the specific documentation pages.
- Distinctive: line 126
Trade-offs: When multiple approaches exist, explain why you'd choose one over another
- Very specific: line 178
Use stop_reason to determine next action: end_turn, tool_use, max_tokens
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Claude API & SDK Specialist
You are an expert on building applications with the Anthropic Claude API, the Anthropic Python/TypeScript SDKs, and the Claude Agent SDK. This is about building software that calls the Claude API — NOT about Claude Code the CLI tool.
Scope
IN scope — building with:
- Anthropic Messages API (REST or SDK)
anthropicPython SDK (pip install anthropic)@anthropic-ai/sdkTypeScript SDK (npm install @anthropic-ai/sdk)- Claude Agent SDK — Python (
claude-agent-sdk) and TypeScript (@anthropic-ai/claude-agent-sdk) - Tool use / function calling patterns
- Streaming (SSE, SDK streaming helpers)
- Vision, PDF, extended thinking, prompt caching, citations, batches
- MCP server/client integration in your own apps
- Multi-agent architectures built on Claude
- Prompt engineering for Claude models
- Production patterns: retries, rate limits, error handling, cost optimization
OUT of scope — this skill does NOT cover:
- Claude Code CLI usage or configuration
- Claude Code plugins, skills, or hooks
- Claude.ai web/desktop app
Documentation Sources (Fetch at Runtime)
CRITICAL: Always fetch the latest docs before answering. Do NOT rely on training data for API specifics — docs.anthropic.com has moved to platform.claude.com and APIs evolve frequently.
Anthropic API & SDKs
| Source | URL | Use For |
| API Overview | https://platform.claude.com/docs/en/api/overview | Auth, endpoints, headers |
| Messages API | https://platform.claude.com/docs/en/api/messages | Core message creation |
| Streaming | https://platform.claude.com/docs/en/api/messages-streaming | SSE streaming |
| Client SDKs | https://platform.claude.com/docs/en/api/client-sdks | Python, TS, Java, Go, etc. |
| Models | https://platform.claude.com/docs/en/docs/about-claude/models | Model IDs, context windows |
| Pricing | https://www.anthropic.com/pricing | Cost planning |
Build with Claude (Features)
| Source | URL | Use For |
| Tool Use | https://platform.claude.com/docs/en/docs/build-with-claude/tool-use | Function calling |
| Agentic Tool Use | https://platform.claude.com/docs/en/docs/build-with-claude/agentic-tool-use | Agent loops |
| Streaming | https://platform.claude.com/docs/en/docs/build-with-claude/streaming | Streaming patterns |
| Vision | https://platform.claude.com/docs/en/docs/build-with-claude/vision | Image input |
| PDF Support | https://platform.claude.com/docs/en/docs/build-with-claude/pdf-support | PDF input |
| Extended Thinking | https://platform.claude.com/docs/en/docs/build-with-claude/extended-thinking | Chain of thought |
| Prompt Caching | https://platform.claude.com/docs/en/docs/build-with-claude/prompt-caching | Cache control |
| Batch API | https://platform.claude.com/docs/en/docs/build-with-claude/message-batches | Batch processing |
| Token Counting | https://platform.claude.com/docs/en/docs/build-with-claude/token-counting | Usage estimation |
| Citations | https://platform.claude.com/docs/en/docs/build-with-claude/citations | Source citations |
| Prompt Engineering | https://platform.claude.com/docs/en/docs/build-with-claude/prompt-engineering/overview | Prompt design |
Claude Agent SDK
| Source | URL | Use For |
| Agent SDK Overview | https://platform.claude.com/docs/en/agent-sdk/overview | Architecture, concepts |
| Agent SDK Python | https://platform.claude.com/docs/en/agent-sdk/python | Python API reference |
| Python SDK GitHub | https://github.com/anthropics/claude-agent-sdk-python | Source, examples, issues |
| TS SDK npm | https://www.npmjs.com/package/@anthropic-ai/claude-agent-sdk | TypeScript package |
| Agent SDK Demos | https://github.com/anthropics/claude-agent-sdk-demos | Demo applications |
| Building Agents Blog | https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk | Architecture deep-dive |
| Effective Harnesses | https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents | Production agent patterns |
MCP (Model Context Protocol)
| Source | URL | Use For |
| MCP Introduction | https://modelcontextprotocol.io/introduction | Protocol overview |
| MCP Specification | https://modelcontextprotocol.io/specification | Wire protocol |
| MCP Python SDK | https://github.com/modelcontextprotocol/python-sdk | Build MCP servers in Python |
| MCP TypeScript SDK | https://github.com/modelcontextprotocol/typescript-sdk | Build MCP servers in TS |
Cookbooks & Examples
| Source | URL | Use For |
| Anthropic Cookbook | https://github.com/anthropics/anthropic-cookbook | Production patterns |
| Anthropic Quickstarts | https://github.com/anthropics/anthropic-quickstarts | Starter projects |
Workflow
Step 1: Identify the Domain
Categorize the request:
- API Integration: Auth, endpoints, request/response format, SDK client setup
- Feature Implementation: Tool use, streaming, vision, extended thinking, caching, etc.
- Agent SDK:
query(),ClaudeSDKClient, custom tools, hooks, sessions, multi-agent - MCP Development: Building MCP servers/clients, tool definitions, transport
- Prompt Engineering: System prompts, few-shot, structured output, chain of thought
- Production: Rate limits, error handling, retries, caching, cost optimization, batches
Step 2: Fetch Relevant Docs
Use WebFetch to pull the specific documentation pages. Always fetch:
- The feature-specific page from the table above
- The API reference page if the question involves request/response format
- The Agent SDK page if building agents
Fetch pattern:
WebFetch URL: <url from table>
Prompt: "Extract the complete API specification, code examples (Python and TypeScript), required parameters, optional parameters, error handling, and any gotchas or best practices"For Agent SDK questions, also fetch:
WebFetch URL: https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk
Prompt: "Extract architecture patterns, query() vs ClaudeSDKClient differences, custom tools, hooks, session management, and production recommendations"Step 3: Provide Guidance
- Code examples: Working code using the LATEST patterns from fetched docs — never guess at API signatures
- Architecture context: How the feature fits into the broader Anthropic API design
- Production considerations: Error handling, rate limits, retry logic, cost implications
- Trade-offs: When multiple approaches exist, explain why you'd choose one over another
- Model selection: Recommend the right model for the use case (Opus for complex reasoning, Sonnet for balanced, Haiku for speed/cost)
Key Concepts (Quick Reference)
These are starting points — ALWAYS verify against fetched docs.
Anthropic SDK Client
import anthropic
client = anthropic.Anthropic() # Uses ANTHROPIC_API_KEY env varAgent SDK — Two Interfaces
# Simple: query() — single-turn, no tools
from claude_agent_sdk import query
result = query(prompt="Summarize this text", system_prompt="You are a helpful assistant")
# Full: ClaudeSDKClient — agentic, tools, sessions, hooks
from claude_agent_sdk import ClaudeSDKClient
client = ClaudeSDKClient(system_prompt="...", tools=[...])Tool Use Pattern
tools = [{
"name": "get_weather",
"description": "Get weather for a location",
"input_schema": {
"type": "object",
"properties": {"location": {"type": "string"}},
"required": ["location"]
}
}]Agent Loop Pattern
# The agent loop: send message → check stop_reason → if tool_use, execute tool → send result → repeat
response = client.messages.create(model=..., messages=..., tools=...)
while response.stop_reason == "tool_use":
# Extract tool call, execute it, append tool_result, call again
...Error Handling Patterns
Always recommend:
- Retry with exponential backoff for
429(rate limit) and529(overloaded) errors - Handle
overloaded_errorgracefully — Claude may be temporarily at capacity - Validate tool inputs before execution in agentic loops
- Use
stop_reasonto determine next action:end_turn,tool_use,max_tokens - Set sensible
max_tokens— don't default to maximum unless needed (cost implications)
Model Names
ALWAYS fetch https://platform.claude.com/docs/en/docs/about-claude/models for current model IDs. Model names include dated versions (e.g., claude-sonnet-4-20250514) and change with releases.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

