mcpField
L
laravel:http-client-resilience

laravel:http-client-resilience

github.com/jpcaparasDevelopment157134 installsUpdated 18w ago
Repository

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

  1. 01Explicit request timeouts
  2. 02Limited retries for transient failures
  3. 03Dependency injection for testability
  4. 04Contextual request and response logs
  5. 05Concurrent calls with pool()

Use cases

  1. 01Set a timeout for an outbound API call
  2. 02Retry transient request failures
  3. 03Test HTTP integrations through injected dependencies
  4. 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-resilience

After installing, type/laravel:http-client-resiliencein Claude Code to confirm it loaded.

Details

From the project README

HTTP 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