L
laravel:http-client-resilience
About laravel:http-client-resilience
laravel:http-client-resilience is a skill for designing predictable and observable outbound HTTP calls in Laravel. It is intended for developers building services that need controlled timeouts, retries, and request logging.
Key features
- 01Explicit request timeouts
- 02Limited retries for transient failures
- 03Dependency injection for testability
- 04Contextual request and response logs
- 05Concurrent calls with pool()
Use cases
- 01Set a timeout for an outbound API call
- 02Retry transient request failures
- 03Test HTTP integrations through injected dependencies
- 04Call multiple endpoints concurrently
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ jpcaparas/ superpowers-laravel --skill laravel:http-client-resilienceAfter installing, type/laravel:http-client-resiliencein Claude Code to confirm it loaded.
Details
From the project READMEHTTP Client Resilience
Design outbound calls to be predictable and observable.
Commands
use Illuminate\Support\Facades\Http;
$res = Http::baseUrl(config('services.foo.url'))
->timeout(5)
->retry(3, 200, throw: false)
->withHeaders(['Accept' => 'application/json'])
->get('/v1/things', ['q' => 'bar']);
if (!$res->successful()) {
Log::warning('foo api failure', [
'status' => $res->status(),
'body' => substr($res->body(), 0, 500),
]);
}
Patterns
- Set timeouts explicitly (client and server defaults differ)
- Use limited retries with backoff for transient failures only
- Prefer dependency injection for testability
- Add request/response context to logs (redact sensitive data)
- Use
pool()for concurrency when calling multiple endpoints
Comments
Markdown supported