Http client resilience

From jpcaparas/superpowers-laravel · View interactive version

Http client resilience is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Use the HTTP client with sensible timeouts, retries, and backoff; capture context and handle failures explicitly

How to use this skill

Skill file

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.