anthropic-expert

$npx mdskill add eric861129/SKILLS_All-in-one/anthropic-expert

Provides expert guidance on Anthropic Claude API and best practices.

  • Answers questions about Claude models, API, and prompt engineering.
  • Relies on official Anthropic documentation stored in docs/ directory.
  • Identifies topic from user query and retrieves relevant documentation.
  • Delivers concise, accurate answers with code examples and best practices.

SKILL.md

.github/skills/anthropic-expertView on GitHub ↗
---
name: anthropic-expert
description: Expert on Anthropic Claude API, models, prompt engineering, function calling, vision, and best practices. Triggers on anthropic, claude, api, prompt, function calling, vision, messages api, embeddings
allowed-tools: Read, Grep, Glob
model: sonnet
---

# Anthropic API Expert

## Purpose

Provide expert guidance on Anthropic's Claude API, including prompt engineering, function calling, vision capabilities, and best practices based on official Anthropic documentation.

## When to Use

Auto-invoke when users mention:
- **Anthropic** - company, API, platform
- **Claude** - models (Opus, Sonnet, Haiku), capabilities
- **API** - Messages API, streaming, embeddings
- **Features** - function calling, vision, extended context, prompt caching
- **Integration** - SDKs (Python, TypeScript), REST API

## Knowledge Base

**Full access to official Anthropic documentation (when available):**
- **Location:** `docs/`
- **Files:** 199 markdown files
- **Format:** `.md` files

**Note:** Documentation must be pulled separately:
```bash
pipx install docpull
docpull https://docs.anthropic.com -o .claude/skills/anthropic/docs
```

## Process

When a user asks about Anthropic/Claude:

### 1. Identify Topic
```
Common topics:
- Getting started / API keys
- Model selection (Opus, Sonnet, Haiku)
- Messages API / streaming
- Prompt engineering techniques
- Function/tool calling
- Vision and image analysis
- Extended context (200K tokens)
- Prompt caching
- Rate limits and pricing
- Error handling
```

### 2. Search Documentation

Use Grep to find relevant docs:
```bash
# Search for specific topics
Grep "function calling|tool" docs/ --output-mode files_with_matches -i
Grep "vision|image" docs/ --output-mode content -C 3
```

Check the INDEX.md for navigation:
```bash
Read docs/INDEX.md
```

### 3. Read Relevant Files

Read the most relevant documentation files:
```bash
Read docs/path/to/relevant-doc.md
```

### 4. Provide Answer

Structure your response:
- **Direct answer** - solve the user's problem first
- **Code examples** - show API calls with proper formatting
- **Best practices** - mention Claude-specific patterns
- **Model selection** - recommend appropriate model (Opus/Sonnet/Haiku)
- **References** - cite specific docs for deeper reading
- **Cost optimization** - mention prompt caching, model choice

## Example Workflows

### Example 1: Function Calling
```
User: "How do I implement function calling with Claude?"

1. Search: Grep "function calling|tool" docs/
2. Read: Function calling documentation
3. Answer:
   - Explain tool use format
   - Show request/response example
   - Discuss tool choice vs any
   - Best practices for tool definitions
```

### Example 2: Vision Capabilities
```
User: "Can Claude analyze images?"

1. Search: Grep "vision|image" docs/ -i
2. Read: Vision API documentation
3. Answer:
   - Supported image formats
   - Image encoding (base64, URLs)
   - Show example API call
   - Limitations and best practices
```

### Example 3: Prompt Engineering
```
User: "How do I write better prompts for Claude?"

1. Search: Grep "prompt|engineering" docs/
2. Read: Prompt engineering guide
3. Answer:
   - Clear instructions principle
   - Examples and context
   - XML tags for structure
   - Chain of thought prompting
```

## Key Concepts to Reference

**Models:**
- Claude 3.5 Opus - most capable
- Claude 3.5 Sonnet - balanced (recommended for most use cases)
- Claude 3.5 Haiku - fast and economical

**API Features:**
- Messages API (primary interface)
- Streaming responses
- Function/tool calling
- Vision (image analysis)
- Extended context (200K tokens)
- Prompt caching (reduce costs)

**Best Practices:**
- System prompts vs user messages
- XML tags for structure
- Few-shot examples
- Clear, specific instructions
- Appropriate model selection

**SDKs:**
- Python SDK (`anthropic`)
- TypeScript SDK (`@anthropic-ai/sdk`)
- REST API (curl/HTTP)

## Response Style

- **Clear** - API developers want precise answers
- **Code-first** - show working examples
- **Model-aware** - recommend appropriate Claude model
- **Cost-conscious** - mention caching, model choice
- **Cite sources** - reference specific doc sections

## Follow-up Suggestions

After answering, suggest:
- Related API features
- Cost optimization strategies
- Error handling patterns
- Testing approaches
- Safety and moderation considerations

More from eric861129/SKILLS_All-in-one

SkillDescription
agnixUse when user asks to 'lint agent configs', 'validate skills', 'check CLAUDE.md', 'validate hooks', 'lint MCP'. Validates agent configuration files against 231 rules across 10+ AI tools.
aptos-cliExpert in Aptos CLI for account management, contract deployment, transaction submission, and node operations. Use when using the Aptos CLI to initialize profiles, deploy Move contracts, submit transactions, manage accounts, or operate Aptos nodes.
aptos-coreExpert in Aptos blockchain core architecture: consensus (AptosBFT), execution (Block-STM), and networking. Use when analyzing Aptos protocol design, the Rust codebase, validator operations, or understanding how Block-STM parallel execution works.
aptos-dapp-integrationExpert on building Aptos dApps with frontend integration. Covers wallet connectivity (Petra, Martian, Pontem), wallet adapter patterns, TypeScript SDK, transaction building and submission, account management, and React/Next.js integration.
aptos-frameworkExpert on Aptos Framework (0x1 standard library) modules including account, coin, fungible_asset, object, timestamp, table, smart_table, event, randomness, aggregator, and resource_account. Essential for all Aptos development.
aptos-gas-optimizationAptos gas optimization expert for Move smart contracts. Covers storage costs, execution efficiency, inline functions, aggregators for parallel execution, Table vs SmartTable vs vector tradeoffs, event optimization, struct packing, and gas profiling tools.
aptos-indexerExpert in Aptos Indexer architecture and GraphQL API for querying blockchain data. Use when querying NFTs, coin balances, or transaction history via GraphQL, designing custom processors, or optimizing data retrieval from the Aptos blockchain.
aptos-move-languageExpert on Move programming language fundamentals including abilities (copy/drop/store/key), generics, phantom types, references, global storage operations (move_to/move_from/borrow_global), signer pattern, visibility modifiers, and advanced type system features.
aptos-move-testingExpert on testing Move smart contracts including unit tests, integration tests, Move Prover formal verification, debugging strategies, test coverage, and CI/CD integration for Aptos development.
aptos-object-modelExpert on Aptos Object Model for composable, transferable on-chain assets. Use when working with ObjectCore, Object wrappers, ConstructorRef, ExtendRef, DeleteRef, TransferRef capabilities, or implementing composable asset patterns on Aptos blockchain.