anth-reference-architecture
'Implement Claude API reference architectures for common use cases.
Install / Use
npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-reference-architectureInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
Development & EngineeringSupported Platforms
Our assessment of anth-reference-architecture
anth-reference-architecture scores 90/100 on our quality scale, 1034th of 3,845 Development & Engineering skills we index (top 27%).
Its SKILL.md is 7.0 KB long, well organised into 16 sections with 7 code examples: a thorough specification that gives an agent plenty to work with.
With 2,785 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 6 days ago, so anth-reference-architecture is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
anth-reference-architecture compared with similar skills
All 4 of these similar skills score higher than anth-reference-architecture; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| anth-reference-architecture (this skill)by jeremylongshore | 90 | 2.8k | 6d ago | SKILL.md |
| Agent-Reachby Panniantong | 100 | 86.3k | 14d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.1k | today | CLAUDE.md |
| ai-job-searchby MadsLorentzen | 100 | 44.5k | today | CLAUDE.md |
| claude-howtoby luongnv89 | 100 | 41.7k | 4d ago | CLAUDE.md |
Frequently asked questions
- How do I install anth-reference-architecture?
- Run
npx skills add jeremylongshore/tons-of-skills-marketplace --skill anth-reference-architecture. The install tabs above show the steps for each supported agent. - Which AI agents does anth-reference-architecture work with?
- It is written for Claude Code, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is anth-reference-architecture safe to use?
- It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is anth-reference-architecture still maintained?
- The repository was last updated 6 days ago, so anth-reference-architecture is actively maintained.
Skill content
View source on GitHubname: anth-reference-architecture description: 'Implement Claude API reference architectures for common use cases.
Use when designing a Claude-powered application, choosing between
direct API vs queue-based, or planning a multi-model architecture.
Trigger with phrases like "anthropic architecture", "claude system design",
"anthropic reference architecture", "design claude integration".
' allowed-tools: Read, Write, Edit, Grep version: 1.7.0 license: MIT author: Jeremy Longshore jeremy@intentsolutions.io tags:
- saas
- ai
- anthropic compatibility: Designed for Claude Code
Anthropic Reference Architecture
Overview
Three validated architecture patterns for Claude API integrations: synchronous API gateway, async queue-based processing, and multi-model routing.
Architecture 1: Sync API Gateway (Simple)
User → API Gateway → Claude Service → Messages API
↓
Response → User
# Best for: chatbots, interactive tools, low-volume (<100 RPM)
from fastapi import FastAPI
import anthropic
app = FastAPI()
client = anthropic.Anthropic(max_retries=3, timeout=60.0)
@app.post("/chat")
async def chat(prompt: str):
msg = client.messages.create(
model="claude-sonnet-4-20250514",
max_tokens=1024,
messages=[{"role": "user", "content": prompt}]
)
return {"text": msg.content[0].text, "tokens": msg.…[redacted]}
Architecture 2: Async Queue-Based (Scalable)
User → API → Queue (Redis/SQS) → Worker Pool → Messages API
↑ ↓
└──────────── Status/Result ←── Result Store ←───┘
# Best for: batch processing, high-volume, background tasks
from redis import Redis
from rq import Queue
import anthropic
redis = Redis()
task_queue = Queue("claude-tasks", connection=redis)
result_store = Redis(db=1)
def process_task(task_id: str, prompt: str, model: str):
client = anthropic.Anthropic()
msg = client.messages.create(
model=model,
max_tokens=1024,
messages=[{"role": "user", "content": prompt}]
)
result_store.setex(f"result:{task_id}", 3600, msg.content[0].text)
# Enqueue
import uuid
task_id = str(uuid.uuid4())
task_queue.enqueue(process_task, task_id, prompt, "claude-sonnet-4-20250514")
Architecture 3: Multi-Model Router
User → Router → Haiku (classify/extract)
→ Sonnet (general/code)
→ Opus (research/complex)
→ Batches (bulk/offline)
class ModelRouter:
def __init__(self):
self.client = anthropic.Anthropic()
self.classifier = anthropic.Anthropic() # Can be same client
def route_and_execute(self, prompt: str, context: dict) -> str:
# Step 1: Classify with Haiku (cheap, fast)
classification = self.classifier.messages.create(
model="claude-haiku-4-20250514",
max_tokens=32,
messages=[{
"role": "user",
"content": f"Classify this request as: simple|moderate|complex|bulk\n\n{prompt[:200]}"
}]
)
complexity = classification.content[0].text.strip().lower()
# Step 2: Route to appropriate model
model_map = {
"simple": "claude-haiku-4-20250514",
"moderate": "claude-sonnet-4-20250514",
"complex": "claude-opus-4-20250514",
}
model = model_map.get(complexity, "claude-sonnet-4-20250514")
# Step 3: Execute with selected model
msg = self.client.messages.create(
model=model,
max_tokens=4096,
messages=[{"role": "user", "content": prompt}]
)
return msg.content[0].text
Project Layout
my-claude-app/
├── src/
│ ├── main.py # FastAPI app
│ ├── claude/
│ │ ├── client.py # Singleton + config
│ │ ├── router.py # Model routing logic
│ │ ├── tools.py # Tool definitions
│ │ └── prompts/ # System prompts as files
│ ├── workers/
│ │ └── claude_worker.py # Queue consumer
│ └── middleware/
│ ├── rate_limiter.py # App-level rate limiting
│ └── cost_tracker.py # Spend monitoring
├── tests/
│ ├── unit/ # Mocked tests
│ └── integration/ # Live API tests
└── config/
├── .env.development
├── .env.staging
└── .env.production
Error Handling
| Architecture | Failure Mode | Mitigation | |-------------|-------------|------------| | Sync Gateway | 429/5xx blocks user | Circuit breaker + fallback response | | Queue-Based | Worker crashes | Dead-letter queue + retry policy | | Multi-Model | Router misclassifies | Default to Sonnet (safest middle) |
Prerequisites
- Choose the workload class, availability/latency SLOs, data classification, approved destinations, and synchronous versus asynchronous behavior with an owner.
- Provide an isolated workspace, least-privileged secret-manager credential, synthetic fixtures, bounded queue/concurrency settings, and a tested rollback/circuit-breaker plan.
- Define idempotency, retention, dead-letter, and redacted evidence requirements before selecting an architecture.
Instructions
- Select the smallest architecture that meets the workload: gateway for interactive calls, queue for asynchronous work, or a router only when model policy and quality tests justify it.
- Keep credentials and policy enforcement at the service boundary. Validate model, token, rate, data-class, source, and destination scope before enqueueing or sending a request.
- Exercise success, timeout, 429/5xx, duplicate, queue-retry, tool-use, and partial-response paths with synthetic fixtures. Ensure traces and result stores exclude prompts, responses, and secrets.
- Canary the selected topology in an isolated workspace, observe SLOs/cost/rate limits, and require approval before production traffic. Preserve the prior topology and configuration.
- On policy, reliability, or cost regression, open the circuit or pause workers, drain/quarantine unsafe work, roll back, and retain a redacted architecture receipt.
Output
Produce an architecture receipt naming the selected pattern, component/config digests, workspace and model classes, scope/idempotency/retention controls, synthetic test results, canary and SLO outcomes, approval, and rollback reference. Exclude request content, user identifiers, credentials, and raw queue payloads.
Examples
For 100 synthetic asynchronous classification jobs, use a sandbox queue with a bounded worker pool, assert duplicate_jobs=0; contacts_exported=0; content_logged=0, and canary one internal consumer. A queue failure yields paused=true; dead_letter=synthetic-only; rollback=worker-v1.
Resources
Next Steps
For multi-environment setup, see anth-multi-env-setup.
Related Skills
Agent-Reach
86.3kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
headroom
74.1kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
ai-job-search
44.5kThe job search that runs on your machine. AI job application framework built on Claude Code: evaluate postings, tailor CVs, write cover letters, prep interviews. Fork it and own it.
claude-howto
41.7kA visual, example-driven guide to Claude Code — from basic concepts to advanced agents, with copy-paste templates that bring immediate value.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
