Agent skill
integrations
External API integrations with OAuth2, async HTTP, and proper error handling
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/security/integrations-omerlefaruk-casarerpa
Metadata
Additional technical details for this skill
- audience
- developers
- workflow
- integrations
SKILL.md
What I do
- Create external API integration clients
- Implement OAuth2 authentication flows
- Build async HTTP clients with proper error handling
- Handle rate limiting, retries, and connection pooling
When to use me
Use this when you need to:
- Add a new external API integration
- Implement OAuth2 authentication
- Create async HTTP clients
- Handle API errors gracefully
MCP-First Workflow
Always use MCP servers in this order:
-
codebase - Search for integration patterns
pythonsearch_codebase("OAuth2 async HTTP client REST API patterns", top_k=10) -
filesystem - view_file existing clients
pythonread_file("src/casare_rpa/infrastructure/clients/base.py") -
git - Check similar integrations
pythongit_log("--oneline", path="src/casare_rpa/infrastructure/clients/") -
exa - API documentation research
pythonweb_search("OAuth2 best practices 2025", num_results=5) -
ref - Official API docs
pythonsearch_documentation("API", library="google-auth")
Integration Pattern
python
from casare_rpa.infrastructure.clients.base import BaseAsyncClient
class ServiceNameClient(BaseAsyncClient):
"""Client for Service API."""
BASE_URL = "https://api.service.com/v1"
async def authenticate(self) -> None:
"""Setup authentication."""
pass
async def make_request(self, method: str, endpoint: str, **kwargs) -> dict:
"""Make authenticated API request."""
url = f"{self.BASE_URL}/{endpoint}"
async with self.session.request(method, url, **kwargs) as resp:
resp.raise_for_status()
return await resp.json()
Error Handling
python
from casare_rpa.infrastructure.exceptions import RateLimitError, AuthenticationError
try:
result = await client.call_api()
except RateLimitError:
await asyncio.sleep(self.retry_delay)
result = await client.call_api()
except AuthenticationError:
await client.refresh_token()
result = await client.call_api()
OAuth2 Flow
python
from google.oauth2.credentials import Credentials
from google.auth.transport.requests import Request
async def get_creds(token_data: dict) -> Credentials:
creds = Credentials(**token_data)
if creds.expired:
await creds.refresh(Request())
return creds
Best Practices
- Use async for all network operations
- Implement retry with exponential backoff
- Handle rate limits gracefully
- Store credentials securely (env vars)
- Log API calls for debugging
- Use connection pooling
Didn't find tool you were looking for?