trembita-http-client
oleg-koval/trembitaBuild resilient, type-safe HTTP integrations with trembita using Result-based
13 stars
0 forks
TypeScript
31 views
SKILL.md
name: trembita-http-client description: Build resilient, type-safe HTTP integrations with trembita using Result-based error handling, retries, and circuit breaker patterns.
Trembita Skill
Use this repository as a practical reference for agents implementing HTTP
clients with trembita.
When to Use
- Build TypeScript integrations for third-party REST APIs.
- Add robust error handling without exception-driven control flow.
- Implement retries, circuit breakers, and timeouts with minimal dependencies.
- Write testable API code by injecting
fetchImpl.
Core Patterns
- Initialize once with
createTrembita()and handle initResult. - Use
client.request()for parsed JSON body responses. - Use
client.client()when you need HTTP metadata (statusCode,body). - Narrow failures by checking
result.error.kind. - Add resilience via
createRetryingFetchandcircuitBreakerconfig.
Canonical References
README.md- quick overview and install.QUICK_START.md- shortest path to first success.LEARNING_GUIDE.md- concepts and progressive examples.EXAMPLES.md- production-style patterns.ARCHITECTURE.md- request/error flow diagrams.
Agent Guardrails
- Prefer
Resulthandling overtry/catchfor request outcomes. - Keep endpoint configuration explicit and validated.
- Prefer
expectedCodesto document acceptable HTTP outcomes. - Use
client.client()for 404/202 branching by status code. - Inject
fetchImplin tests; avoid global fetch patching.