Token导航 LogoToken导航TokenDH.com
AI 工具敏感数据github未标认证来源可访问clear审计提醒

anthropic-claude-developmentAnthropic Claude 开发

Agent Skill

anthropic-claude-development 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

5,538

周安装

250

GitHub Stars

87

下载量

1,794
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:anthropic-claude-development(Anthropic Claude 开发)
来源仓库:https://github.com/mindrally/skills
仓库路径:skills/anthropic-claude-development
安装命令:
npx skills add https://github.com/mindrally/skills --skill anthropic-claude-development
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/mindrally/skills --skill anthropic-claude-development

简介

anthropic-claude-development 聚焦 Anthropic Claude API 开发,涵盖 Messages API、工具使用与提示工程。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中构建生产级 Claude 应用与集成。
  • 提供 Python SDK 示例、类型提示、错误处理与重试逻辑,推荐使用环境变量管理密钥。
  • 安装前需确认项目语言栈,注意 API 调用频率与配额,避免硬编码敏感信息。
  • 适用于需要稳定、可扩展 AI 服务集成的团队,建议结合日志与监控完善运维。

SKILL.md

Anthropic Claude API Development

You are an expert in Anthropic Claude API development, including the Messages API, tool use, prompt engineering, and building production-ready applications with Claude models.

Key Principles

  • Write concise, technical responses with accurate Python examples
  • Use type hints for all function signatures
  • Follow Claude's usage policies and guidelines
  • Implement proper error handling and retry logic
  • Never hardcode API keys; use environment variables

Setup and Configuration

Environment Setup

import os
from anthropic import Anthropic

# Always use environment variables for API keys
client = Anthropic(api_key=os.environ.get("ANTHROPIC_API_KEY"))

Best Practices

  • Store API keys in .env files, never commit them
  • Use python-dotenv for local development
  • Set up separate keys for development and production
  • Configure proper timeout settings for your use case

Messages API

Basic Usage

from anthropic import Anthropic

client = Anthropic()

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    system="You are a helpful assistant.",
    messages=[
        {"role": "user", "content": "Hello, Claude!"}
    ]
)

print(message.content[0].text)

Streaming Responses

with client.messages.stream(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write a story"}]
) as stream:
    for text in stream.text_stream:
        print(text, end="", flush=True)

Model Selection

  • Use claude-opus-4-20250514 for complex reasoning and analysis
  • Use claude-sonnet-4-20250514 for balanced performance and cost
  • Use claude-3-5-haiku-20241022 for fast, efficient responses
  • Consider task complexity when selecting models

Tool Use (Function Calling)

Defining Tools

tools = [
    {
        "name": "get_weather",
        "description": "Get the current weather in a given location",
        "input_schema": {
            "type": "object",
            "properties": {
                "location": {
                    "type": "string",
                    "description": "The city and state, e.g., San Francisco, CA"
                },
                "unit": {
                    "type": "string",
                    "enum": ["celsius", "fahrenheit"],
                    "description": "The unit of temperature"
                }
            },
            "required": ["location"]
        }
    }
]

response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    tools=tools,
    messages=[{"role": "user", "content": "What's the weather in London?"}]
)

Handling Tool Calls

import json

def process_tool_use(response, messages, tools):
    # Check if Claude wants to use a tool
    if response.stop_reason == "tool_use":
        tool_use_block = next(
            block for block in response.content
            if block.type == "tool_use"
        )

        tool_name = tool_use_block.name
        tool_input = tool_use_block.input

        # Execute the tool
        tool_result = execute_tool(tool_name, tool_input)

        # Continue the conversation
        messages.append({"role": "assistant", "content": response.content})
        messages.append({
            "role": "user",
            "content": [{
                "type": "tool_result",
                "tool_use_id": tool_use_block.id,
                "content": json.dumps(tool_result)
            }]
        })

        # Get final response
        return client.messages.create(
            model="claude-sonnet-4-20250514",
            max_tokens=1024,
            tools=tools,
            messages=messages
        )

    return response

Vision and Multimodal

Image Analysis

import base64

# From URL
message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {
                    "type": "url",
                    "url": "https://example.com/image.jpg"
                }
            },
            {
                "type": "text",
                "text": "Describe this image in detail."
            }
        ]
    }]
)

# From base64
with open("image.png", "rb") as f:
    image_data = base64.standard_b64encode(f.read()).decode("utf-8")

message = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    messages=[{
        "role": "user",
        "content": [
            {
                "type": "image",
                "source": {
                    "type": "base64",
                    "media_type": "image/png",
                    "data": image_data
                }
            },
            {
                "type": "text",
                "text": "What do you see?"
            }
        ]
    }]
)

Prompt Engineering for Claude

System Prompts

  • Be clear and specific about the assistant's role
  • Include relevant context and constraints
  • Specify output format when needed
  • Use XML tags for structured instructions
system_prompt = """You are a technical documentation writer.

<guidelines>
- Write clear, concise documentation
- Use proper markdown formatting
- Include code examples where appropriate
- Follow the Google developer documentation style guide
</guidelines>

<output_format>
Always structure your response with:
1. Overview
2. Prerequisites
3. Step-by-step instructions
4. Examples
5. Troubleshooting
</output_format>
"""

Prompting Best Practices

  • Use XML tags to structure complex prompts
  • Provide examples for few-shot learning
  • Be explicit about what you want and don't want
  • Use chain-of-thought prompting for complex reasoning
  • Specify the desired output format clearly

Error Handling

Retry Logic

from anthropic import RateLimitError, APIError
import time

def call_with_retry(func, max_retries=3, base_delay=1):
    for attempt in range(max_retries):
        try:
            return func()
        except RateLimitError:
            delay = base_delay * (2 ** attempt)
            print(f"Rate limited. Retrying in {delay}s...")
            time.sleep(delay)
        except APIError as e:
            if attempt == max_retries - 1:
                raise
            time.sleep(base_delay)
    raise Exception("Max retries exceeded")

Common Error Types

  • RateLimitError: Implement exponential backoff
  • APIError: Check API status, retry with backoff
  • AuthenticationError: Verify API key
  • BadRequestError: Validate input parameters

Prompt Caching

Using Caching

# Enable caching for frequently used context
response = client.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    system=[{
        "type": "text",
        "text": "Large context that should be cached...",
        "cache_control": {"type": "ephemeral"}
    }],
    messages=[{"role": "user", "content": "Question about the context"}]
)

Caching Best Practices

  • Cache large, static content like documentation
  • Place cached content at the beginning of the prompt
  • Monitor cache hit rates for optimization
  • Use caching for repeated similar queries

Message Batches API

Batch Processing

# Create a batch for non-time-sensitive requests
batch = client.messages.batches.create(
    requests=[
        {
            "custom_id": "request-1",
            "params": {
                "model": "claude-sonnet-4-20250514",
                "max_tokens": 1024,
                "messages": [{"role": "user", "content": "Question 1"}]
            }
        },
        {
            "custom_id": "request-2",
            "params": {
                "model": "claude-sonnet-4-20250514",
                "max_tokens": 1024,
                "messages": [{"role": "user", "content": "Question 2"}]
            }
        }
    ]
)

Cost Optimization

  • Use appropriate models for task complexity
  • Implement prompt caching for repeated context
  • Use batches for non-urgent requests
  • Set reasonable max_tokens limits
  • Cache responses when appropriate
  • Monitor token usage patterns

Security Best Practices

  • Never expose API keys in client-side code
  • Implement rate limiting on your endpoints
  • Validate and sanitize user inputs
  • Log API usage for monitoring and auditing
  • Follow Anthropic's acceptable use policy

Dependencies

  • anthropic
  • python-dotenv
  • pydantic (for input validation)
  • tenacity (for retry logic)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenCode

29.31%
按下载量换算526

Claude Code

24.48%
按下载量换算439

Antigravity

19.6%
按下载量换算352

Codex

12.74%
按下载量换算229

Gemini CLI

8.28%
按下载量换算149

github-copilot

3.31%
按下载量换算59

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills