agentleFS
Ghost7802Ghost7802/awesome-api-skills/skills/anthropic/SKILL.md

anthropic

Skill13 starsChanged 28 days agoMITView on GitHub

  • Reads credentials
  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 1 is distinctive, and 3 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.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use the x-api-key header with your ANTHROPIC_API_KEY.

    line 13
  2. Very specific:

    Always put long reference documents inside <documents> XML tags.

    line 35
  3. Very specific:

    If the API returns a 'roles must alternate' error, ensure your messages array strictly follows a user -> assistant -> user sequence without …

    line 38
  4. Distinctive:

    Use this when your agent works with anthropic — structured patterns beat pasted docs and prevent common hallucinations.

    line 44

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Anthropic API Skill

Overview

Anthropic's API provides access to the Claude 3 family (Opus, Sonnet, Haiku). This skill focuses on the Messages API, vision capabilities, and strict system prompt isolation.

Installation

npm install @anthropic-ai/sdk
pip install anthropic

Authentication

Use the x-api-key header with your ANTHROPIC_API_KEY. You must also supply the anthropic-version header (e.g., 2023-06-01).

Core Concepts

  • System Prompt: Isolated from the main conversation array for higher adherence.
  • Claude 3.5 Sonnet: The recommended default model for speed and coding intelligence.
  • Max Tokens: Required parameter defining the generation limit (e.g., 4096 or 8192).

Common Workflows

  1. Define the system prompt.
  2. Pass the conversation history alternating precisely between user and assistant.
  3. Process the response blocks.

Error Handling

Handle AnthropicError. The OverloadedError indicates capacity constraints; retry with backoff. AuthenticationError indicates invalid or revoked keys.

Security

Anthropic provides inherent safety filters. Ensure system prompts instruct the model to avoid executing unverified external data.

Rate Limits

Tiered rate limits applied per minute (RPM) and tokens per minute (TPM). Tier 1 for Claude 3 Sonnet is 50 RPM and 40,000 TPM.

Best Practices

Always put long reference documents inside <documents> XML tags. Claude is specifically trained to parse and pay closer attention to XML structures.

Troubleshooting

If the API returns a 'roles must alternate' error, ensure your messages array strictly follows a user -> assistant -> user sequence without duplicate consecutive roles.

References

Why use this skill

Use this when your agent works with anthropic — structured patterns beat pasted docs and prevent common hallucinations.

AI pitfalls

  • Using deprecated model IDs or wrong API endpoints
  • Confusing chat vs completions vs embeddings APIs
  • Omitting rate-limit and token budget handling

Production checklist

  • Secrets in environment variables, not source code
  • Error handling and logging in place
  • Rate limits and timeouts configured

Related skills

  • vercel-ai-sdk — integrates with
  • langchain — integrates with
  • anthropic-mcp — works well with

Last Verified: 2026-07-02

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.