跳到正文
Skillpedia
API 与服务器(后端)48k · #4142

claude-api

它能做什么

这个工具可以帮你使用 Claude API 或 Anthropic SDK 开发应用。它会识别你项目所用的编程语言,并提供对应的正确代码示例,帮你快速上手。

适用场景

  • ✓当你开始一个基于 Claude API 的新项目时。
  • ✓当你的代码已经在使用 `anthropic` 或 `@anthropic-ai/sdk` 等库时。
  • ✓当你想在自己的应用中加入人工智能功能时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/claude-api/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/claude-api/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想用 Python 调用 Claude API 来总结一段很长的文本,该怎么做?”

每周 5 个新技能,1 分钟读完。

工作原理

工具会检查你的项目文件,判断使用的编程语言(比如 Python、TypeScript、Java 等)。然后,它会用该语言给出代码示例,并采用最新的 Claude 模型版本和处理复杂任务的推荐设置。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Building LLM-Powered Applications with Claude

This skill helps you build LLM-powered applications with Claude. Choose the right surface based on your needs, detect the project language, then read the relevant language-specific documentation.

When to Use

  • Use when building with the Claude API, Anthropic SDKs, or the Agent SDK.
  • Use when code imports anthropic, @anthropic-ai/sdk, or related Claude SDK packages.
  • Do not use for general coding work unrelated to Claude integrations.

Defaults

Unless the user requests otherwise:

For the Claude model version, please use Claude Opus 5, which you can access via the exact model string claude-opus-5. Please default to using adaptive thinking (thinking: {type: "adaptive"}) for anything remotely complicated. And finally, please default to streaming for any request that may involve long input, long output, or high max_tokens — it prevents hitting request timeouts. Use the SDK's .get_final_message() / .finalMessage() helper to get the complete response if you don't need to handle individual stream events


Language Detection

Before reading code examples, determine which language the user is working in:

  1. Look at project files to infer the language:

    • *.py, requirements.txt, pyproject.toml, setup.py, Pipfile → Python — read from python/
    • *.ts, *.tsx, package.json, tsconfig.json → TypeScript — read from typescript/
    • *.js, *.jsx (no .ts files present) → TypeScript — JS uses the same SDK, read from typescript/
    • *.java, pom.xml, build.gradle → Java — read from java/
    • *.kt, *.kts, build.gradle.kts → Java — Kotlin uses the Java SDK, read from java/
    • *.scala, build.sbt → Java — Scala uses the Java SDK, read from java/
    • *.go, go.mod → Go — read from go/
    • *.rb, Gemfile → Ruby — read from ruby/
    • *.cs, *.csproj → C# — read from csharp/
    • *.php, composer.json → PHP — read from php/
  2. If multiple languages detected (e.g., both Python and TypeScript files):

    • Check which language the user's current file or question relates to
    • If still ambiguous, ask: "I detected both Python and TypeScript files. Which language are you using for the Claude API integration?"
  3. If language can't be inferred (empty project, no source files, or unsupported language):

    • Use AskUserQuestion with options: Python, TypeScript, Java, Go, Ruby, cURL/raw HTTP, C#, PHP
    • If AskUserQuestion is unavailable, default to Python examples and note: "Showing Python examples. Let me know if you need a different language."
  4. If unsupported language detected (Rust, Swift, C++, Elixir, etc.):

    • Suggest cURL/raw HTTP examples from curl/ and note that community SDKs may exist
    • Offer to show Python or TypeScript examples as reference implementations
  5. If user needs cURL/raw HTTP examples, read from curl/.

Language-Specific Feature Support

Language Tool Runner Agent SDK Notes
Python Yes (beta) Yes Full support — @beta_tool decorator
TypeScript Yes (beta) Yes Full support — betaZodTool + Zod
Java Yes (beta) No Beta tool use with annotated classes
Go Yes (beta) No BetaToolRunner in toolrunner pkg
Ruby Yes (beta) No BaseTool + tool_runner in beta
cURL N/A N/A Raw HTTP, no SDK features
C# No No Official SDK
PHP No No Official SDK

Which Surface Should I Use?

Start simple. Default to the simplest tier that meets your needs. Single API calls and workflows handle most use cases — only reach for agents when the task genuinely requires open-ended, model-driven exploration.

Use Case Tier Recommended Surface Why

…

常见问题

应该使用哪个 Claude 模型版本?

默认情况下,这个工具会建议使用 Claude Opus 5 模型(`claude-opus-5`),这是一个功能较强的版本。

什么是“自适应思考”(adaptive thinking)?

这是一种设置,可以让 AI 更灵活地进行思考,从而更好地解决较复杂的问题。

为什么回复有时会分段返回(流式输出)?

对于较长的回复,或者在占用较多资源的情况下,“流式输出”会逐段发送内容,避免连接中断或等待时间过长。

详情

作者的原始描述

Build apps with the Claude API or Anthropic SDK. TRIGGER when: code imports `anthropic`/`@anthropic-ai/sdk`/`claude_agent_sdk`, or user asks to use Claude API, Anthropic SDKs, or Agent SDK. DO NOT TRIGGER when: code imports `openai`/other AI SDK, general programming, or ML/data-science tasks.

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#4142
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能