Logo van Check Cascading Failures

Check Cascading Failures

Community
dykyi-roman
check-cascading-failures

Detects cascading failure risks in PHP systems. Identifies shared resources, unbounded queues, missing backpressure, thread pool exhaustion, and failure propagation paths.

Add to TypingMind

Overzicht

Uitgeverdykyi-roman
Repositoryawesome-claude-code
Skillnaamcheck-cascading-failures
Sterren
98
Forks
25
Meegeleverde bestanden
Alleen instructies
LicentieMIT
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door dykyi-roman op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Check Cascading Failures in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-cascading-failures
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code.git /tmp/awesome-claude-code
mkdir -p .claude/skills
cp -r /tmp/awesome-claude-code/skills/check-cascading-failures .claude/skills/check-cascading-failures
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Check Cascading Failures in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Check Cascading Failures automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Check Cascading Failures niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Cascading Failure Detection

Analyze PHP code for patterns that can cause cascading failures across services and components.

Detection Patterns

1. Shared Resource Without Isolation

php
// CRITICAL: Single connection pool shared by all services
final class DatabasePool
{
    private static array $connections = [];

    public static function getConnection(): PDO
    {
        // All services compete for same pool
        // If one service hogs connections, all others starve
        return self::$connections[array_rand(self::$connections)];
    }
}

// CORRECT: Isolated pools per service (Bulkhead pattern)
final readonly class IsolatedDatabasePool
{
    public function __construct(
        private string $serviceName,
        private int $maxConnections,
    ) {}
}

2. Unbounded Queue Growth

php
// CRITICAL: No size limit on in-memory queue
class EventQueue
{
    private array $events = []; // Grows without bound

    public function push(Event $event): void
    {
        $this->events[] = $event; // Memory exhaustion risk
    }
}

// CRITICAL: No consumer backpressure
while (true) {
    $message = $producer->produce($data);
    // No check if consumer is keeping up
    // Queue grows → memory fills → OOM → crash
}

// CORRECT: Bounded queue with backpressure
final class BoundedEventQueue
{
    private SplQueue $events;

    public function __construct(
        private readonly int $maxSize = 10000,
    ) {
        $this->events = new SplQueue();
    }

    public function push(Event $event): void
    {
        if ($this->events->count() >= $this->maxSize) {
            throw new QueueFullException('Backpressure: queue at capacity');
        }
        $this->events->enqueue($event);
    }
}

3. Synchronous Chain Without Circuit Breaker

php
// CRITICAL: Cascading synchronous calls
class OrderService
{
    public function createOrder(OrderData $data): Order
    {
        $inventory = $this->inventoryService->reserve($data->items());    // If this hangs...
        $payment = $this->paymentService->charge($data->total());         // ...this waits...
        $shipping = $this->shippingService->schedule($data->address());   // ...everything stops
        $notification = $this->notificationService->send($data->email()); // ...cascade!
    }
}

// CORRECT: Each call protected with circuit breaker + timeout
class OrderService
{
    public function createOrder(OrderData $data): Order
    {
        $inventory = $this->circuitBreaker->call(
            fn () => $this->inventoryService->reserve($data->items()),
            fallback: fn () => $this->reserveLater($data->items()),
        );
    }
}

4. Retry Storm (Thundering Herd)

php
// CRITICAL: All instances retry at same time
class ApiClient
{
    public function call(string $endpoint): Response
    {
        for ($i = 0; $i < 3; $i++) {
            try {
                return $this->http->get($endpoint);
            } catch (Exception $e) {
                sleep(1); // Fixed delay — all instances retry simultaneously!
            }
        }
        throw new ApiException('Failed after 3 retries');
    }
}

// CORRECT: Exponential backoff with jitter
$delay = min($baseDelay * (2 ** $attempt) + random_int(0, 1000), $maxDelay);

5. Missing Health Checks

php
// CRITICAL: Serving traffic while dependencies are down
class ApiController
{
    public function handle(Request $request): Response
    {
        // No check if database/cache/external services are available
        // Returns 500 errors, load balancer keeps sending traffic
        return $this->service->process($request);
    }
}

// CORRECT: Health check endpoint
class HealthController
{
    public function check(): Response
    {
        $checks = [
            'database' => $this->checkDatabase(),
            'redis' => $this->checkRedis(),
            'queue' => $this->checkQueue(),
        ];

        $healthy = !in_array(false, $checks, true);
        return new Response(
            json_encode($checks),
            $healthy ? 200 : 503,
        );
    }
}

6. Resource Leak Under Failure

php
// CRITICAL: Connection not released on exception
class MessageProcessor
{
    public function process(): void
    {
        $connection = $this->pool->acquire();
        $this->doWork($connection); // If this throws...
        $this->pool->release($connection); // ...connection is leaked!
    }
}

// CORRECT: Always release in finally
class MessageProcessor
{
    public function process(): void
    {
        $connection = $this->pool->acquire();
        try {
            $this->doWork($connection);
        } finally {
            $this->pool->release($connection);
        }
    }
}

Grep Patterns

bash
# Shared static resources
Grep: "private static.*\$.*=.*\[\]|protected static.*pool|static.*\$connections" --glob "**/*.php"

# Unbounded collections
Grep: "\$this->.*\[\].*=|\[\].*events|array_push" --glob "**/Infrastructure/**/*.php"

# Synchronous chains (multiple service calls in one method)
Grep: "\$this->.*Service->.*\n.*\$this->.*Service->" --glob "**/Application/**/*.php"

# Fixed retry delays (no jitter)
Grep: "sleep\([0-9]+\)|usleep\([0-9]+\)" --glob "**/*.php"

# Missing finally blocks
Grep: "->acquire\(\)|->lock\(" --glob "**/*.php"
Grep: "finally" --glob "**/*.php"

# Missing health checks
Grep: "class.*HealthCheck|function.*health|/health" --glob "**/*.php"

Severity Classification

PatternSeverity
Shared pool without isolation🔴 Critical
Unbounded queue in memory🔴 Critical
Synchronous chain without breaker🔴 Critical
Retry storm (no jitter)🟠 Major
Missing health checks🟠 Major
Resource leak on failure🟠 Major
No backpressure mechanism🟡 Minor

Output Format

markdown
### Cascading Failure Risk: [Description]

**Severity:** 🔴/🟠/🟡
**Location:** `file.php:line`
**Failure Path:** ServiceA → ServiceB → ServiceC

**Issue:**
[Description of the cascading failure risk]

**Blast Radius:**
- Direct: [immediately affected components]
- Indirect: [downstream components that will fail]

**Code:**
```php
// Vulnerable pattern

Fix:

php
// With isolation/circuit breaker/backpressure

Veelgestelde vragen

Wat doet de AI-skill Check Cascading Failures?

Detects cascading failure risks in PHP systems. Identifies shared resources, unbounded queues, missing backpressure, thread pool exhaustion, and failure propagation paths.

Waarom Check Cascading Failures gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Check Cascading Failures bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Check Cascading Failures in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-cascading-failures. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Check Cascading Failures gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Check Cascading Failures gebruiken?

Zoveel als je wilt. Je kunt Check Cascading Failures gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Check Cascading Failures gratis?

Ja. Deze skill is door dykyi-roman op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇