opencode-skills-antigravity 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/bundled-skills/ad-creative/SKILL.md +371 -0
  2. package/bundled-skills/ad-creative/evals/evals.json +90 -0
  3. package/bundled-skills/ad-creative/references/generative-tools.md +637 -0
  4. package/bundled-skills/ad-creative/references/platform-specs.md +213 -0
  5. package/bundled-skills/ai-seo/SKILL.md +407 -0
  6. package/bundled-skills/ai-seo/evals/evals.json +90 -0
  7. package/bundled-skills/ai-seo/references/content-patterns.md +285 -0
  8. package/bundled-skills/ai-seo/references/platform-ranking-factors.md +152 -0
  9. package/bundled-skills/backend-dev-guidelines/SKILL.md +1 -1
  10. package/bundled-skills/cc-skill-security-review/SKILL.md +1 -1
  11. package/bundled-skills/churn-prevention/SKILL.md +433 -0
  12. package/bundled-skills/churn-prevention/evals/evals.json +93 -0
  13. package/bundled-skills/churn-prevention/references/cancel-flow-patterns.md +316 -0
  14. package/bundled-skills/churn-prevention/references/dunning-playbook.md +408 -0
  15. package/bundled-skills/claude-api/LICENSE.txt +202 -0
  16. package/bundled-skills/claude-api/SKILL.md +252 -0
  17. package/bundled-skills/claude-api/csharp/claude-api.md +70 -0
  18. package/bundled-skills/claude-api/curl/examples.md +164 -0
  19. package/bundled-skills/claude-api/go/claude-api.md +146 -0
  20. package/bundled-skills/claude-api/java/claude-api.md +128 -0
  21. package/bundled-skills/claude-api/php/claude-api.md +88 -0
  22. package/bundled-skills/claude-api/python/agent-sdk/README.md +269 -0
  23. package/bundled-skills/claude-api/python/agent-sdk/patterns.md +319 -0
  24. package/bundled-skills/claude-api/python/claude-api/README.md +404 -0
  25. package/bundled-skills/claude-api/python/claude-api/batches.md +182 -0
  26. package/bundled-skills/claude-api/python/claude-api/files-api.md +162 -0
  27. package/bundled-skills/claude-api/python/claude-api/streaming.md +162 -0
  28. package/bundled-skills/claude-api/python/claude-api/tool-use.md +587 -0
  29. package/bundled-skills/claude-api/ruby/claude-api.md +87 -0
  30. package/bundled-skills/claude-api/shared/error-codes.md +205 -0
  31. package/bundled-skills/claude-api/shared/live-sources.md +121 -0
  32. package/bundled-skills/claude-api/shared/models.md +68 -0
  33. package/bundled-skills/claude-api/shared/tool-use-concepts.md +305 -0
  34. package/bundled-skills/claude-api/typescript/agent-sdk/README.md +220 -0
  35. package/bundled-skills/claude-api/typescript/agent-sdk/patterns.md +150 -0
  36. package/bundled-skills/claude-api/typescript/claude-api/README.md +313 -0
  37. package/bundled-skills/claude-api/typescript/claude-api/batches.md +106 -0
  38. package/bundled-skills/claude-api/typescript/claude-api/files-api.md +98 -0
  39. package/bundled-skills/claude-api/typescript/claude-api/streaming.md +178 -0
  40. package/bundled-skills/claude-api/typescript/claude-api/tool-use.md +477 -0
  41. package/bundled-skills/codex-review/SKILL.md +1 -1
  42. package/bundled-skills/cold-email/SKILL.md +167 -0
  43. package/bundled-skills/cold-email/evals/evals.json +94 -0
  44. package/bundled-skills/cold-email/references/benchmarks.md +83 -0
  45. package/bundled-skills/cold-email/references/follow-up-sequences.md +81 -0
  46. package/bundled-skills/cold-email/references/frameworks.md +90 -0
  47. package/bundled-skills/cold-email/references/personalization.md +79 -0
  48. package/bundled-skills/cold-email/references/subject-lines.md +53 -0
  49. package/bundled-skills/content-strategy/SKILL.md +374 -0
  50. package/bundled-skills/content-strategy/evals/evals.json +90 -0
  51. package/bundled-skills/content-strategy/references/headless-cms.md +194 -0
  52. package/bundled-skills/context7-auto-research/SKILL.md +1 -1
  53. package/bundled-skills/dbos-golang/SKILL.md +1 -1
  54. package/bundled-skills/dbos-python/SKILL.md +1 -1
  55. package/bundled-skills/dbos-typescript/SKILL.md +1 -1
  56. package/bundled-skills/debug-buttercup/SKILL.md +1 -1
  57. package/bundled-skills/defuddle/SKILL.md +50 -0
  58. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  59. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  60. package/bundled-skills/docs/integrations/jetski-gemini-loader/package.json +1 -0
  61. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  62. package/bundled-skills/docs/maintainers/skills-import-2026-03-21.md +81 -0
  63. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  64. package/bundled-skills/docs/users/bundles.md +1 -1
  65. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  66. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  67. package/bundled-skills/docs/users/getting-started.md +1 -1
  68. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  69. package/bundled-skills/docs/users/usage.md +4 -4
  70. package/bundled-skills/docs/users/visual-guide.md +4 -4
  71. package/bundled-skills/evaluation/SKILL.md +1 -1
  72. package/bundled-skills/exa-search/SKILL.md +1 -1
  73. package/bundled-skills/firecrawl-scraper/SKILL.md +1 -1
  74. package/bundled-skills/frontend-dev-guidelines/SKILL.md +1 -1
  75. package/bundled-skills/gha-security-review/SKILL.md +2 -1
  76. package/bundled-skills/git-pushing/SKILL.md +1 -1
  77. package/bundled-skills/internal-comms/LICENSE.txt +202 -0
  78. package/bundled-skills/internal-comms/SKILL.md +35 -0
  79. package/bundled-skills/internal-comms/examples/3p-updates.md +47 -0
  80. package/bundled-skills/internal-comms/examples/company-newsletter.md +65 -0
  81. package/bundled-skills/internal-comms/examples/faq-answers.md +30 -0
  82. package/bundled-skills/internal-comms/examples/general-comms.md +16 -0
  83. package/bundled-skills/json-canvas/SKILL.md +253 -0
  84. package/bundled-skills/json-canvas/references/EXAMPLES.md +329 -0
  85. package/bundled-skills/lead-magnets/SKILL.md +319 -0
  86. package/bundled-skills/lead-magnets/references/benchmarks.md +129 -0
  87. package/bundled-skills/lead-magnets/references/format-guide.md +196 -0
  88. package/bundled-skills/memory-systems/SKILL.md +1 -1
  89. package/bundled-skills/obsidian-bases/SKILL.md +506 -0
  90. package/bundled-skills/obsidian-bases/references/FUNCTIONS_REFERENCE.md +173 -0
  91. package/bundled-skills/obsidian-cli/SKILL.md +115 -0
  92. package/bundled-skills/obsidian-markdown/SKILL.md +205 -0
  93. package/bundled-skills/obsidian-markdown/references/CALLOUTS.md +58 -0
  94. package/bundled-skills/obsidian-markdown/references/EMBEDS.md +63 -0
  95. package/bundled-skills/obsidian-markdown/references/PROPERTIES.md +61 -0
  96. package/bundled-skills/product-marketing-context/SKILL.md +250 -0
  97. package/bundled-skills/product-marketing-context/evals/evals.json +85 -0
  98. package/bundled-skills/react-best-practices/SKILL.md +1 -1
  99. package/bundled-skills/revops/SKILL.md +352 -0
  100. package/bundled-skills/revops/evals/evals.json +91 -0
  101. package/bundled-skills/revops/references/automation-playbooks.md +290 -0
  102. package/bundled-skills/revops/references/lifecycle-definitions.md +278 -0
  103. package/bundled-skills/revops/references/routing-rules.md +203 -0
  104. package/bundled-skills/revops/references/scoring-models.md +247 -0
  105. package/bundled-skills/sales-enablement/SKILL.md +358 -0
  106. package/bundled-skills/sales-enablement/evals/evals.json +91 -0
  107. package/bundled-skills/sales-enablement/references/deck-frameworks.md +263 -0
  108. package/bundled-skills/sales-enablement/references/demo-scripts.md +355 -0
  109. package/bundled-skills/sales-enablement/references/objection-library.md +270 -0
  110. package/bundled-skills/sales-enablement/references/one-pager-templates.md +208 -0
  111. package/bundled-skills/seo/SKILL.md +139 -0
  112. package/bundled-skills/seo/references/cwv-thresholds.md +108 -0
  113. package/bundled-skills/seo/references/eeat-framework.md +214 -0
  114. package/bundled-skills/seo/references/quality-gates.md +155 -0
  115. package/bundled-skills/seo/references/schema-types.md +118 -0
  116. package/bundled-skills/seo-competitor-pages/SKILL.md +229 -0
  117. package/bundled-skills/seo-content/SKILL.md +186 -0
  118. package/bundled-skills/seo-dataforseo/SKILL.md +395 -0
  119. package/bundled-skills/seo-geo/SKILL.md +254 -0
  120. package/bundled-skills/seo-hreflang/SKILL.md +209 -0
  121. package/bundled-skills/seo-image-gen/SKILL.md +183 -0
  122. package/bundled-skills/seo-images/SKILL.md +193 -0
  123. package/bundled-skills/seo-page/SKILL.md +103 -0
  124. package/bundled-skills/seo-plan/SKILL.md +136 -0
  125. package/bundled-skills/seo-plan/assets/agency.md +175 -0
  126. package/bundled-skills/seo-plan/assets/ecommerce.md +167 -0
  127. package/bundled-skills/seo-plan/assets/generic.md +144 -0
  128. package/bundled-skills/seo-plan/assets/local-service.md +160 -0
  129. package/bundled-skills/seo-plan/assets/publisher.md +153 -0
  130. package/bundled-skills/seo-plan/assets/saas.md +135 -0
  131. package/bundled-skills/seo-programmatic/SKILL.md +184 -0
  132. package/bundled-skills/seo-schema/SKILL.md +178 -0
  133. package/bundled-skills/seo-sitemap/SKILL.md +129 -0
  134. package/bundled-skills/seo-technical/SKILL.md +175 -0
  135. package/bundled-skills/site-architecture/SKILL.md +366 -0
  136. package/bundled-skills/site-architecture/evals/evals.json +88 -0
  137. package/bundled-skills/site-architecture/references/mermaid-templates.md +216 -0
  138. package/bundled-skills/site-architecture/references/navigation-patterns.md +305 -0
  139. package/bundled-skills/site-architecture/references/site-type-templates.md +293 -0
  140. package/bundled-skills/skill-improver/SKILL.md +1 -1
  141. package/bundled-skills/tavily-web/SKILL.md +1 -1
  142. package/bundled-skills/test-fixing/SKILL.md +1 -1
  143. package/bundled-skills/tool-design/SKILL.md +1 -1
  144. package/bundled-skills/ui-ux-pro-max/SKILL.md +1 -1
  145. package/bundled-skills/verification-before-completion/SKILL.md +1 -1
  146. package/bundled-skills/wiki-changelog/SKILL.md +1 -1
  147. package/bundled-skills/wiki-onboarding/SKILL.md +1 -1
  148. package/bundled-skills/wiki-qa/SKILL.md +1 -1
  149. package/bundled-skills/wiki-researcher/SKILL.md +1 -1
  150. package/bundled-skills/wiki-vitepress/SKILL.md +1 -1
  151. package/package.json +1 -1
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: claude-api
3
+ description: "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."
4
+ risk: unknown
5
+ source: "https://github.com/anthropics/skills"
6
+ date_added: "2026-03-21"
7
+ license: Complete terms in LICENSE.txt
8
+ ---
9
+
10
+ # Building LLM-Powered Applications with Claude
11
+
12
+ 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.
13
+
14
+ ## When to Use
15
+
16
+ - Use when building with the Claude API, Anthropic SDKs, or the Agent SDK.
17
+ - Use when code imports `anthropic`, `@anthropic-ai/sdk`, or related Claude SDK packages.
18
+ - Do not use for general coding work unrelated to Claude integrations.
19
+
20
+ ## Defaults
21
+
22
+ Unless the user requests otherwise:
23
+
24
+ For the Claude model version, please use Claude Opus 4.6, which you can access via the exact model string `claude-opus-4-6`. 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
25
+
26
+ ---
27
+
28
+ ## Language Detection
29
+
30
+ Before reading code examples, determine which language the user is working in:
31
+
32
+ 1. **Look at project files** to infer the language:
33
+
34
+ - `*.py`, `requirements.txt`, `pyproject.toml`, `setup.py`, `Pipfile` → **Python** — read from `python/`
35
+ - `*.ts`, `*.tsx`, `package.json`, `tsconfig.json` → **TypeScript** — read from `typescript/`
36
+ - `*.js`, `*.jsx` (no `.ts` files present) → **TypeScript** — JS uses the same SDK, read from `typescript/`
37
+ - `*.java`, `pom.xml`, `build.gradle` → **Java** — read from `java/`
38
+ - `*.kt`, `*.kts`, `build.gradle.kts` → **Java** — Kotlin uses the Java SDK, read from `java/`
39
+ - `*.scala`, `build.sbt` → **Java** — Scala uses the Java SDK, read from `java/`
40
+ - `*.go`, `go.mod` → **Go** — read from `go/`
41
+ - `*.rb`, `Gemfile` → **Ruby** — read from `ruby/`
42
+ - `*.cs`, `*.csproj` → **C#** — read from `csharp/`
43
+ - `*.php`, `composer.json` → **PHP** — read from `php/`
44
+
45
+ 2. **If multiple languages detected** (e.g., both Python and TypeScript files):
46
+
47
+ - Check which language the user's current file or question relates to
48
+ - If still ambiguous, ask: "I detected both Python and TypeScript files. Which language are you using for the Claude API integration?"
49
+
50
+ 3. **If language can't be inferred** (empty project, no source files, or unsupported language):
51
+
52
+ - Use AskUserQuestion with options: Python, TypeScript, Java, Go, Ruby, cURL/raw HTTP, C#, PHP
53
+ - If AskUserQuestion is unavailable, default to Python examples and note: "Showing Python examples. Let me know if you need a different language."
54
+
55
+ 4. **If unsupported language detected** (Rust, Swift, C++, Elixir, etc.):
56
+
57
+ - Suggest cURL/raw HTTP examples from `curl/` and note that community SDKs may exist
58
+ - Offer to show Python or TypeScript examples as reference implementations
59
+
60
+ 5. **If user needs cURL/raw HTTP examples**, read from `curl/`.
61
+
62
+ ### Language-Specific Feature Support
63
+
64
+ | Language | Tool Runner | Agent SDK | Notes |
65
+ | ---------- | ----------- | --------- | ------------------------------------- |
66
+ | Python | Yes (beta) | Yes | Full support — `@beta_tool` decorator |
67
+ | TypeScript | Yes (beta) | Yes | Full support — `betaZodTool` + Zod |
68
+ | Java | Yes (beta) | No | Beta tool use with annotated classes |
69
+ | Go | Yes (beta) | No | `BetaToolRunner` in `toolrunner` pkg |
70
+ | Ruby | Yes (beta) | No | `BaseTool` + `tool_runner` in beta |
71
+ | cURL | N/A | N/A | Raw HTTP, no SDK features |
72
+ | C# | No | No | Official SDK |
73
+ | PHP | No | No | Official SDK |
74
+
75
+ ---
76
+
77
+ ## Which Surface Should I Use?
78
+
79
+ > **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.
80
+
81
+ | Use Case | Tier | Recommended Surface | Why |
82
+ | ----------------------------------------------- | --------------- | ------------------------- | --------------------------------------- |
83
+ | Classification, summarization, extraction, Q&A | Single LLM call | **Claude API** | One request, one response |
84
+ | Batch processing or embeddings | Single LLM call | **Claude API** | Specialized endpoints |
85
+ | Multi-step pipelines with code-controlled logic | Workflow | **Claude API + tool use** | You orchestrate the loop |
86
+ | Custom agent with your own tools | Agent | **Claude API + tool use** | Maximum flexibility |
87
+ | AI agent with file/web/terminal access | Agent | **Agent SDK** | Built-in tools, safety, and MCP support |
88
+ | Agentic coding assistant | Agent | **Agent SDK** | Designed for this use case |
89
+ | Want built-in permissions and guardrails | Agent | **Agent SDK** | Safety features included |
90
+
91
+ > **Note:** The Agent SDK is for when you want built-in file/web/terminal tools, permissions, and MCP out of the box. If you want to build an agent with your own tools, Claude API is the right choice — use the tool runner for automatic loop handling, or the manual loop for fine-grained control (approval gates, custom logging, conditional execution).
92
+
93
+ ### Decision Tree
94
+
95
+ ```
96
+ What does your application need?
97
+
98
+ 1. Single LLM call (classification, summarization, extraction, Q&A)
99
+ └── Claude API — one request, one response
100
+
101
+ 2. Does Claude need to read/write files, browse the web, or run shell commands
102
+ as part of its work? (Not: does your app read a file and hand it to Claude —
103
+ does Claude itself need to discover and access files/web/shell?)
104
+ └── Yes → Agent SDK — built-in tools, don't reimplement them
105
+ Examples: "scan a codebase for bugs", "summarize every file in a directory",
106
+ "find bugs using subagents", "research a topic via web search"
107
+
108
+ 3. Workflow (multi-step, code-orchestrated, with your own tools)
109
+ └── Claude API with tool use — you control the loop
110
+
111
+ 4. Open-ended agent (model decides its own trajectory, your own tools)
112
+ └── Claude API agentic loop (maximum flexibility)
113
+ ```
114
+
115
+ ### Should I Build an Agent?
116
+
117
+ Before choosing the agent tier, check all four criteria:
118
+
119
+ - **Complexity** — Is the task multi-step and hard to fully specify in advance? (e.g., "turn this design doc into a PR" vs. "extract the title from this PDF")
120
+ - **Value** — Does the outcome justify higher cost and latency?
121
+ - **Viability** — Is Claude capable at this task type?
122
+ - **Cost of error** — Can errors be caught and recovered from? (tests, review, rollback)
123
+
124
+ If the answer is "no" to any of these, stay at a simpler tier (single call or workflow).
125
+
126
+ ---
127
+
128
+ ## Architecture
129
+
130
+ Everything goes through `POST /v1/messages`. Tools and output constraints are features of this single endpoint — not separate APIs.
131
+
132
+ **User-defined tools** — You define tools (via decorators, Zod schemas, or raw JSON), and the SDK's tool runner handles calling the API, executing your functions, and looping until Claude is done. For full control, you can write the loop manually.
133
+
134
+ **Server-side tools** — Anthropic-hosted tools that run on Anthropic's infrastructure. Code execution is fully server-side (declare it in `tools`, Claude runs code automatically). Computer use can be server-hosted or self-hosted.
135
+
136
+ **Structured outputs** — Constrains the Messages API response format (`output_config.format`) and/or tool parameter validation (`strict: true`). The recommended approach is `client.messages.parse()` which validates responses against your schema automatically. Note: the old `output_format` parameter is deprecated; use `output_config: {format: {...}}` on `messages.create()`.
137
+
138
+ **Supporting endpoints** — Batches (`POST /v1/messages/batches`), Files (`POST /v1/files`), and Token Counting feed into or support Messages API requests.
139
+
140
+ ---
141
+
142
+ ## Current Models (cached: 2026-02-17)
143
+
144
+ | Model | Model ID | Context | Input $/1M | Output $/1M |
145
+ | ----------------- | ------------------- | -------------- | ---------- | ----------- |
146
+ | Claude Opus 4.6 | `claude-opus-4-6` | 200K (1M beta) | $5.00 | $25.00 |
147
+ | Claude Sonnet 4.6 | `claude-sonnet-4-6` | 200K (1M beta) | $3.00 | $15.00 |
148
+ | Claude Haiku 4.5 | `claude-haiku-4-5` | 200K | $1.00 | $5.00 |
149
+
150
+ **ALWAYS use `claude-opus-4-6` unless the user explicitly names a different model.** This is non-negotiable. Do not use `claude-sonnet-4-6`, `claude-sonnet-4-5`, or any other model unless the user literally says "use sonnet" or "use haiku". Never downgrade for cost — that's the user's decision, not yours.
151
+
152
+ **CRITICAL: Use only the exact model ID strings from the table above — they are complete as-is. Do not append date suffixes.** For example, use `claude-sonnet-4-5`, never `claude-sonnet-4-5-20250514` or any other date-suffixed variant you might recall from training data. If the user requests an older model not in the table (e.g., "opus 4.5", "sonnet 3.7"), read `shared/models.md` for the exact ID — do not construct one yourself.
153
+
154
+ A note: if any of the model strings above look unfamiliar to you, that's to be expected — that just means they were released after your training data cutoff. Rest assured they are real models; we wouldn't mess with you like that.
155
+
156
+ ---
157
+
158
+ ## Thinking & Effort (Quick Reference)
159
+
160
+ **Opus 4.6 — Adaptive thinking (recommended):** Use `thinking: {type: "adaptive"}`. Claude dynamically decides when and how much to think. No `budget_tokens` needed — `budget_tokens` is deprecated on Opus 4.6 and Sonnet 4.6 and must not be used. Adaptive thinking also automatically enables interleaved thinking (no beta header needed). **When the user asks for "extended thinking", a "thinking budget", or `budget_tokens`: always use Opus 4.6 with `thinking: {type: "adaptive"}`. The concept of a fixed token budget for thinking is deprecated — adaptive thinking replaces it. Do NOT use `budget_tokens` and do NOT switch to an older model.**
161
+
162
+ **Effort parameter (GA, no beta header):** Controls thinking depth and overall token spend via `output_config: {effort: "low"|"medium"|"high"|"max"}` (inside `output_config`, not top-level). Default is `high` (equivalent to omitting it). `max` is Opus 4.6 only. Works on Opus 4.5, Opus 4.6, and Sonnet 4.6. Will error on Sonnet 4.5 / Haiku 4.5. Combine with adaptive thinking for the best cost-quality tradeoffs. Use `low` for subagents or simple tasks; `max` for the deepest reasoning.
163
+
164
+ **Sonnet 4.6:** Supports adaptive thinking (`thinking: {type: "adaptive"}`). `budget_tokens` is deprecated on Sonnet 4.6 — use adaptive thinking instead.
165
+
166
+ **Older models (only if explicitly requested):** If the user specifically asks for Sonnet 4.5 or another older model, use `thinking: {type: "enabled", budget_tokens: N}`. `budget_tokens` must be less than `max_tokens` (minimum 1024). Never choose an older model just because the user mentions `budget_tokens` — use Opus 4.6 with adaptive thinking instead.
167
+
168
+ ---
169
+
170
+ ## Compaction (Quick Reference)
171
+
172
+ **Beta, Opus 4.6 only.** For long-running conversations that may exceed the 200K context window, enable server-side compaction. The API automatically summarizes earlier context when it approaches the trigger threshold (default: 150K tokens). Requires beta header `compact-2026-01-12`.
173
+
174
+ **Critical:** Append `response.content` (not just the text) back to your messages on every turn. Compaction blocks in the response must be preserved — the API uses them to replace the compacted history on the next request. Extracting only the text string and appending that will silently lose the compaction state.
175
+
176
+ See `{lang}/claude-api/README.md` (Compaction section) for code examples. Full docs via WebFetch in `shared/live-sources.md`.
177
+
178
+ ---
179
+
180
+ ## Reading Guide
181
+
182
+ After detecting the language, read the relevant files based on what the user needs:
183
+
184
+ ### Quick Task Reference
185
+
186
+ **Single text classification/summarization/extraction/Q&A:**
187
+ → Read only `{lang}/claude-api/README.md`
188
+
189
+ **Chat UI or real-time response display:**
190
+ → Read `{lang}/claude-api/README.md` + `{lang}/claude-api/streaming.md`
191
+
192
+ **Long-running conversations (may exceed context window):**
193
+ → Read `{lang}/claude-api/README.md` — see Compaction section
194
+
195
+ **Function calling / tool use / agents:**
196
+ → Read `{lang}/claude-api/README.md` + `shared/tool-use-concepts.md` + `{lang}/claude-api/tool-use.md`
197
+
198
+ **Batch processing (non-latency-sensitive):**
199
+ → Read `{lang}/claude-api/README.md` + `{lang}/claude-api/batches.md`
200
+
201
+ **File uploads across multiple requests:**
202
+ → Read `{lang}/claude-api/README.md` + `{lang}/claude-api/files-api.md`
203
+
204
+ **Agent with built-in tools (file/web/terminal):**
205
+ → Read `{lang}/agent-sdk/README.md` + `{lang}/agent-sdk/patterns.md`
206
+
207
+ ### Claude API (Full File Reference)
208
+
209
+ Read the **language-specific Claude API folder** (`{language}/claude-api/`):
210
+
211
+ 1. **`{language}/claude-api/README.md`** — **Read this first.** Installation, quick start, common patterns, error handling.
212
+ 2. **`shared/tool-use-concepts.md`** — Read when the user needs function calling, code execution, memory, or structured outputs. Covers conceptual foundations.
213
+ 3. **`{language}/claude-api/tool-use.md`** — Read for language-specific tool use code examples (tool runner, manual loop, code execution, memory, structured outputs).
214
+ 4. **`{language}/claude-api/streaming.md`** — Read when building chat UIs or interfaces that display responses incrementally.
215
+ 5. **`{language}/claude-api/batches.md`** — Read when processing many requests offline (not latency-sensitive). Runs asynchronously at 50% cost.
216
+ 6. **`{language}/claude-api/files-api.md`** — Read when sending the same file across multiple requests without re-uploading.
217
+ 7. **`shared/error-codes.md`** — Read when debugging HTTP errors or implementing error handling.
218
+ 8. **`shared/live-sources.md`** — WebFetch URLs for fetching the latest official documentation.
219
+
220
+ > **Note:** For Java, Go, Ruby, C#, PHP, and cURL — these have a single file each covering all basics. Read that file plus `shared/tool-use-concepts.md` and `shared/error-codes.md` as needed.
221
+
222
+ ### Agent SDK
223
+
224
+ Read the **language-specific Agent SDK folder** (`{language}/agent-sdk/`). Agent SDK is available for **Python and TypeScript only**.
225
+
226
+ 1. **`{language}/agent-sdk/README.md`** — Installation, quick start, built-in tools, permissions, MCP, hooks.
227
+ 2. **`{language}/agent-sdk/patterns.md`** — Custom tools, hooks, subagents, MCP integration, session resumption.
228
+ 3. **`shared/live-sources.md`** — WebFetch URLs for current Agent SDK docs.
229
+
230
+ ---
231
+
232
+ ## When to Use WebFetch
233
+
234
+ Use WebFetch to get the latest documentation when:
235
+
236
+ - User asks for "latest" or "current" information
237
+ - Cached data seems incorrect
238
+ - User asks about features not covered here
239
+
240
+ Live documentation URLs are in `shared/live-sources.md`.
241
+
242
+ ## Common Pitfalls
243
+
244
+ - Don't truncate inputs when passing files or content to the API. If the content is too long to fit in the context window, notify the user and discuss options (chunking, summarization, etc.) rather than silently truncating.
245
+ - **Opus 4.6 / Sonnet 4.6 thinking:** Use `thinking: {type: "adaptive"}` — do NOT use `budget_tokens` (deprecated on both Opus 4.6 and Sonnet 4.6). For older models, `budget_tokens` must be less than `max_tokens` (minimum 1024). This will throw an error if you get it wrong.
246
+ - **Opus 4.6 prefill removed:** Assistant message prefills (last-assistant-turn prefills) return a 400 error on Opus 4.6. Use structured outputs (`output_config.format`) or system prompt instructions to control response format instead.
247
+ - **128K output tokens:** Opus 4.6 supports up to 128K `max_tokens`, but the SDKs require streaming for large `max_tokens` to avoid HTTP timeouts. Use `.stream()` with `.get_final_message()` / `.finalMessage()`.
248
+ - **Tool call JSON parsing (Opus 4.6):** Opus 4.6 may produce different JSON string escaping in tool call `input` fields (e.g., Unicode or forward-slash escaping). Always parse tool inputs with `json.loads()` / `JSON.parse()` — never do raw string matching on the serialized input.
249
+ - **Structured outputs (all models):** Use `output_config: {format: {...}}` instead of the deprecated `output_format` parameter on `messages.create()`. This is a general API change, not 4.6-specific.
250
+ - **Don't reimplement SDK functionality:** The SDK provides high-level helpers — use them instead of building from scratch. Specifically: use `stream.finalMessage()` instead of wrapping `.on()` events in `new Promise()`; use typed exception classes (`Anthropic.RateLimitError`, etc.) instead of string-matching error messages; use SDK types (`Anthropic.MessageParam`, `Anthropic.Tool`, `Anthropic.Message`, etc.) instead of redefining equivalent interfaces.
251
+ - **Don't define custom types for SDK data structures:** The SDK exports types for all API objects. Use `Anthropic.MessageParam` for messages, `Anthropic.Tool` for tool definitions, `Anthropic.ToolUseBlock` / `Anthropic.ToolResultBlockParam` for tool results, `Anthropic.Message` for responses. Defining your own `interface ChatMessage { role: string; content: unknown }` duplicates what the SDK already provides and loses type safety.
252
+ - **Report and document output:** For tasks that produce reports, documents, or visualizations, the code execution sandbox has `python-docx`, `python-pptx`, `matplotlib`, `pillow`, and `pypdf` pre-installed. Claude can generate formatted files (DOCX, PDF, charts) and return them via the Files API — consider this for "report" or "document" type requests instead of plain stdout text.
@@ -0,0 +1,70 @@
1
+ # Claude API — C#
2
+
3
+ > **Note:** The C# SDK is the official Anthropic SDK for C#. Tool use is supported via the Messages API. A class-annotation-based tool runner is not available; use raw tool definitions with JSON schema. The SDK also supports Microsoft.Extensions.AI IChatClient integration with function invocation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ dotnet add package Anthropic
9
+ ```
10
+
11
+ ## Client Initialization
12
+
13
+ ```csharp
14
+ using Anthropic;
15
+
16
+ // Default (uses ANTHROPIC_API_KEY env var)
17
+ AnthropicClient client = new();
18
+
19
+ // Explicit API key (use environment variables — never hardcode keys)
20
+ AnthropicClient client = new() {
21
+ ApiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY")
22
+ };
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Basic Message Request
28
+
29
+ ```csharp
30
+ using Anthropic.Models.Messages;
31
+
32
+ var parameters = new MessageCreateParams
33
+ {
34
+ Model = Model.ClaudeOpus4_6,
35
+ MaxTokens = 1024,
36
+ Messages = [new() { Role = Role.User, Content = "What is the capital of France?" }]
37
+ };
38
+ var message = await client.Messages.Create(parameters);
39
+ Console.WriteLine(message);
40
+ ```
41
+
42
+ ---
43
+
44
+ ## Streaming
45
+
46
+ ```csharp
47
+ using Anthropic.Models.Messages;
48
+
49
+ var parameters = new MessageCreateParams
50
+ {
51
+ Model = Model.ClaudeOpus4_6,
52
+ MaxTokens = 1024,
53
+ Messages = [new() { Role = Role.User, Content = "Write a haiku" }]
54
+ };
55
+
56
+ await foreach (RawMessageStreamEvent streamEvent in client.Messages.CreateStreaming(parameters))
57
+ {
58
+ if (streamEvent.TryPickContentBlockDelta(out var delta) &&
59
+ delta.Delta.TryPickText(out var text))
60
+ {
61
+ Console.Write(text.Text);
62
+ }
63
+ }
64
+ ```
65
+
66
+ ---
67
+
68
+ ## Tool Use (Manual Loop)
69
+
70
+ The C# SDK supports raw tool definitions via JSON schema. See the [shared tool use concepts](../shared/tool-use-concepts.md) for the tool definition format and agentic loop pattern.
@@ -0,0 +1,164 @@
1
+ # Claude API — cURL / Raw HTTP
2
+
3
+ Use these examples when the user needs raw HTTP requests or is working in a language without an official SDK.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ export ANTHROPIC_API_KEY="your-api-key"
9
+ ```
10
+
11
+ ---
12
+
13
+ ## Basic Message Request
14
+
15
+ ```bash
16
+ curl https://api.anthropic.com/v1/messages \
17
+ -H "Content-Type: application/json" \
18
+ -H "x-api-key: $ANTHROPIC_API_KEY" \
19
+ -H "anthropic-version: 2023-06-01" \
20
+ -d '{
21
+ "model": "claude-opus-4-6",
22
+ "max_tokens": 1024,
23
+ "messages": [
24
+ {"role": "user", "content": "What is the capital of France?"}
25
+ ]
26
+ }'
27
+ ```
28
+
29
+ ---
30
+
31
+ ## Streaming (SSE)
32
+
33
+ ```bash
34
+ curl https://api.anthropic.com/v1/messages \
35
+ -H "Content-Type: application/json" \
36
+ -H "x-api-key: $ANTHROPIC_API_KEY" \
37
+ -H "anthropic-version: 2023-06-01" \
38
+ -d '{
39
+ "model": "claude-opus-4-6",
40
+ "max_tokens": 1024,
41
+ "stream": true,
42
+ "messages": [{"role": "user", "content": "Write a haiku"}]
43
+ }'
44
+ ```
45
+
46
+ The response is a stream of Server-Sent Events:
47
+
48
+ ```
49
+ event: message_start
50
+ data: {"type":"message_start","message":{"id":"msg_...","type":"message",...}}
51
+
52
+ event: content_block_start
53
+ data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}
54
+
55
+ event: content_block_delta
56
+ data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"Hello"}}
57
+
58
+ event: content_block_stop
59
+ data: {"type":"content_block_stop","index":0}
60
+
61
+ event: message_delta
62
+ data: {"type":"message_delta","delta":{"stop_reason":"end_turn"},"usage":{"output_tokens":12}}
63
+
64
+ event: message_stop
65
+ data: {"type":"message_stop"}
66
+ ```
67
+
68
+ ---
69
+
70
+ ## Tool Use
71
+
72
+ ```bash
73
+ curl https://api.anthropic.com/v1/messages \
74
+ -H "Content-Type: application/json" \
75
+ -H "x-api-key: $ANTHROPIC_API_KEY" \
76
+ -H "anthropic-version: 2023-06-01" \
77
+ -d '{
78
+ "model": "claude-opus-4-6",
79
+ "max_tokens": 1024,
80
+ "tools": [{
81
+ "name": "get_weather",
82
+ "description": "Get current weather for a location",
83
+ "input_schema": {
84
+ "type": "object",
85
+ "properties": {
86
+ "location": {"type": "string", "description": "City name"}
87
+ },
88
+ "required": ["location"]
89
+ }
90
+ }],
91
+ "messages": [{"role": "user", "content": "What is the weather in Paris?"}]
92
+ }'
93
+ ```
94
+
95
+ When Claude responds with a `tool_use` block, send the result back:
96
+
97
+ ```bash
98
+ curl https://api.anthropic.com/v1/messages \
99
+ -H "Content-Type: application/json" \
100
+ -H "x-api-key: $ANTHROPIC_API_KEY" \
101
+ -H "anthropic-version: 2023-06-01" \
102
+ -d '{
103
+ "model": "claude-opus-4-6",
104
+ "max_tokens": 1024,
105
+ "tools": [{
106
+ "name": "get_weather",
107
+ "description": "Get current weather for a location",
108
+ "input_schema": {
109
+ "type": "object",
110
+ "properties": {
111
+ "location": {"type": "string", "description": "City name"}
112
+ },
113
+ "required": ["location"]
114
+ }
115
+ }],
116
+ "messages": [
117
+ {"role": "user", "content": "What is the weather in Paris?"},
118
+ {"role": "assistant", "content": [
119
+ {"type": "text", "text": "Let me check the weather."},
120
+ {"type": "tool_use", "id": "toolu_abc123", "name": "get_weather", "input": {"location": "Paris"}}
121
+ ]},
122
+ {"role": "user", "content": [
123
+ {"type": "tool_result", "tool_use_id": "toolu_abc123", "content": "72°F and sunny"}
124
+ ]}
125
+ ]
126
+ }'
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Extended Thinking
132
+
133
+ > **Opus 4.6 and Sonnet 4.6:** Use adaptive thinking. `budget_tokens` is deprecated on both Opus 4.6 and Sonnet 4.6.
134
+ > **Older models:** Use `"type": "enabled"` with `"budget_tokens": N` (must be < `max_tokens`, min 1024).
135
+
136
+ ```bash
137
+ # Opus 4.6: adaptive thinking (recommended)
138
+ curl https://api.anthropic.com/v1/messages \
139
+ -H "Content-Type: application/json" \
140
+ -H "x-api-key: $ANTHROPIC_API_KEY" \
141
+ -H "anthropic-version: 2023-06-01" \
142
+ -d '{
143
+ "model": "claude-opus-4-6",
144
+ "max_tokens": 16000,
145
+ "thinking": {
146
+ "type": "adaptive"
147
+ },
148
+ "output_config": {
149
+ "effort": "high"
150
+ },
151
+ "messages": [{"role": "user", "content": "Solve this step by step..."}]
152
+ }'
153
+ ```
154
+
155
+ ---
156
+
157
+ ## Required Headers
158
+
159
+ | Header | Value | Description |
160
+ | ------------------- | ------------------ | -------------------------- |
161
+ | `Content-Type` | `application/json` | Required |
162
+ | `x-api-key` | Your API key | Authentication |
163
+ | `anthropic-version` | `2023-06-01` | API version |
164
+ | `anthropic-beta` | Beta feature IDs | Required for beta features |
@@ -0,0 +1,146 @@
1
+ # Claude API — Go
2
+
3
+ > **Note:** The Go SDK supports the Claude API and beta tool use with `BetaToolRunner`. Agent SDK is not yet available for Go.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ go get github.com/anthropics/anthropic-sdk-go
9
+ ```
10
+
11
+ ## Client Initialization
12
+
13
+ ```go
14
+ import (
15
+ "github.com/anthropics/anthropic-sdk-go"
16
+ "github.com/anthropics/anthropic-sdk-go/option"
17
+ )
18
+
19
+ // Default (uses ANTHROPIC_API_KEY env var)
20
+ client := anthropic.NewClient()
21
+
22
+ // Explicit API key
23
+ client := anthropic.NewClient(
24
+ option.WithAPIKey("your-api-key"),
25
+ )
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Basic Message Request
31
+
32
+ ```go
33
+ response, err := client.Messages.New(context.TODO(), anthropic.MessageNewParams{
34
+ Model: anthropic.ModelClaudeOpus4_6,
35
+ MaxTokens: 1024,
36
+ Messages: []anthropic.MessageParam{
37
+ anthropic.NewUserMessage(anthropic.NewTextBlock("What is the capital of France?")),
38
+ },
39
+ })
40
+ if err != nil {
41
+ log.Fatal(err)
42
+ }
43
+ fmt.Println(response.Content[0].Text)
44
+ ```
45
+
46
+ ---
47
+
48
+ ## Streaming
49
+
50
+ ```go
51
+ stream := client.Messages.NewStreaming(context.TODO(), anthropic.MessageNewParams{
52
+ Model: anthropic.ModelClaudeOpus4_6,
53
+ MaxTokens: 1024,
54
+ Messages: []anthropic.MessageParam{
55
+ anthropic.NewUserMessage(anthropic.NewTextBlock("Write a haiku")),
56
+ },
57
+ })
58
+
59
+ for stream.Next() {
60
+ event := stream.Current()
61
+ switch eventVariant := event.AsAny().(type) {
62
+ case anthropic.ContentBlockDeltaEvent:
63
+ switch deltaVariant := eventVariant.Delta.AsAny().(type) {
64
+ case anthropic.TextDelta:
65
+ fmt.Print(deltaVariant.Text)
66
+ }
67
+ }
68
+ }
69
+ if err := stream.Err(); err != nil {
70
+ log.Fatal(err)
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Tool Use
77
+
78
+ ### Tool Runner (Beta — Recommended)
79
+
80
+ **Beta:** The Go SDK provides `BetaToolRunner` for automatic tool use loops via the `toolrunner` package.
81
+
82
+ ```go
83
+ import (
84
+ "context"
85
+ "fmt"
86
+ "log"
87
+
88
+ "github.com/anthropics/anthropic-sdk-go"
89
+ "github.com/anthropics/anthropic-sdk-go/toolrunner"
90
+ )
91
+
92
+ // Define tool input with jsonschema tags for automatic schema generation
93
+ type GetWeatherInput struct {
94
+ City string `json:"city" jsonschema:"required,description=The city name"`
95
+ }
96
+
97
+ // Create a tool with automatic schema generation from struct tags
98
+ weatherTool, err := toolrunner.NewBetaToolFromJSONSchema(
99
+ "get_weather",
100
+ "Get current weather for a city",
101
+ func(ctx context.Context, input GetWeatherInput) (anthropic.BetaToolResultBlockParamContentUnion, error) {
102
+ return anthropic.BetaToolResultBlockParamContentUnion{
103
+ OfText: &anthropic.BetaTextBlockParam{
104
+ Text: fmt.Sprintf("The weather in %s is sunny, 72°F", input.City),
105
+ },
106
+ }, nil
107
+ },
108
+ )
109
+ if err != nil {
110
+ log.Fatal(err)
111
+ }
112
+
113
+ // Create a tool runner that handles the conversation loop automatically
114
+ runner := client.Beta.Messages.NewToolRunner(
115
+ []anthropic.BetaTool{weatherTool},
116
+ anthropic.BetaToolRunnerParams{
117
+ BetaMessageNewParams: anthropic.BetaMessageNewParams{
118
+ Model: anthropic.ModelClaudeOpus4_6,
119
+ MaxTokens: 1024,
120
+ Messages: []anthropic.BetaMessageParam{
121
+ anthropic.NewBetaUserMessage(anthropic.NewBetaTextBlock("What's the weather in Paris?")),
122
+ },
123
+ },
124
+ MaxIterations: 5,
125
+ },
126
+ )
127
+
128
+ // Run until Claude produces a final response
129
+ message, err := runner.RunToCompletion(context.Background())
130
+ if err != nil {
131
+ log.Fatal(err)
132
+ }
133
+ fmt.Println(message.Content[0].Text)
134
+ ```
135
+
136
+ **Key features of the Go tool runner:**
137
+
138
+ - Automatic schema generation from Go structs via `jsonschema` tags
139
+ - `RunToCompletion()` for simple one-shot usage
140
+ - `All()` iterator for processing each message in the conversation
141
+ - `NextMessage()` for step-by-step iteration
142
+ - Streaming variant via `NewToolRunnerStreaming()` with `AllStreaming()`
143
+
144
+ ### Manual Loop
145
+
146
+ For fine-grained control, use raw tool definitions via JSON schema. See the [shared tool use concepts](../shared/tool-use-concepts.md) for the tool definition format and agentic loop pattern.