/py-pit:http-client-integrationfrom py-pit
Creates a centralized async HTTP integration layer using httpx.AsyncClient with explicit timeouts, tenacity retries, typed payload validation, and structured error mapping for Python backend services.
Ships in py-pit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Treat external HTTP APIs as infrastructure boundaries, not ad-hoc utility calls.
This skill creates a centralized async integration layer using httpx.AsyncClient, explicit timeout policy, tenacity-based retries, typed payload validation, structured error mapping, and testable client design.
The goal is not merely to make a request, but to make outbound HTTP calls safe, observable, reusable, and easy to test.
Before changing code, inspect the repo for:
Reuse the repo's established patterns when they are sound. Do not introduce a second HTTP client architecture without a clear reason.
httpx.AsyncClient, not requests or sync clients in async appstenacity for retries; do not hand-roll retry loopsWhen the repo already has a sound shared base client, reuse it.
When the repo has multiple integrations or repeated transport concerns, factor common behavior into a small base client. Keep vendor clients thin and focused on endpoint methods, payload validation, and domain mapping.
httpx.AsyncClientget_entity() or get_entities()Do not build a large framework for a single simple integration. Prefer the smallest structure that cleanly enforces the boundary.
class BaseHttpClient:
async def get(...): ...
async def post(...): ...
def validate(...): ...
class EntitiesClient(BaseHttpClient):
async def get_entity(self, entity_id: str) -> Entity: ...
async def get_entities(self, ids: list[str]) -> list[Entity]: ...
timeout = httpx.Timeout(
connect=settings.http_connect_timeout,
read=settings.http_read_timeout,
write=settings.http_write_timeout,
pool=settings.http_pool_timeout,
)
async for attempt in AsyncRetrying(
stop=stop_after_attempt(settings.http_retry_attempts),
wait=wait_exponential_jitter(initial=settings.http_retry_base, max=settings.http_retry_max),
):
with attempt:
response = await self._request_once(...)
response = await self._request_with_retry(...)
payload = self.validate(response, EntityPayload)
return self._to_domain(payload)
4xx responses (400, 401, 403, 404)429 Too Many Requests as a special case: retry only with deliberate backoff and respect Retry-After when providedraise_for_status() when integrations require domain error mappingrequests in async servicesAsyncClient per requestrespx or httpx.MockTransportWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
http-client, async-integration, httpx, retry-pattern, api-client
Generated from the plugin's indexed repository (robhowley/py-pit-skills) — no native marketplace selected
npx claudepluginhub p/robhowley-py-pit16 skills in this plugin
/alembic-migrationsProduction-safe Alembic migration workflows for SQLAlchemy 2.x projects. Use this skill when adding Alembic, generating migrations, reviewing autogenerate diffs, fixing broken migrations, or establishing a safe schema evolution workflow in a Python backend./background-jobs-boundariesGuardrails for background work in FastAPI and Python services. Prevent misuse of in-process background execution (e.g. FastAPI BackgroundTasks)./click-cliDesign, generate, and improve Python CLIs using the Click library. Focus on idiomatic architecture, command groups, modular layouts, CLI UX conventions, and avoiding common Click anti-patterns./click-cli-linterAudit and improve existing Python Click CLIs by identifying architecture problems, anti-patterns, and CLI UX issues, then proposing minimal, high-value fixes./code-qualityOpinionated code health stack for Python repos using Ruff, pre-commit, and Markdown linting. Prefers consolidation over redundant tooling, preserves working repos unless migration is requested, and provides a simple adoption path for both new and existing projects./dockerize-serviceGenerate a local-development Docker Compose setup for an existing Python project. Produces a multi-stage Dockerfile, Compose file, env config, and dockerignore based on detected project signals.Other plugins' skills for the same job