Logo: Check Fallback Strategy

Check Fallback Strategy

Communautéit
dykyi-roman
check-fallback-strategy

Audits fallback and graceful degradation strategies. Checks cache fallback, feature flags, default values, circuit breaker fallbacks, and degraded mode implementations.

Add to TypingMind

Iwwersiicht

Editeurdykyi-roman
Repositoryawesome-claude-code
Skill-Nummcheck-fallback-strategy
Stären
98
Forks
25
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    dykyi-roman huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Check Fallback Strategy an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-fallback-strategy
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-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-fallback-strategy .claude/skills/check-fallback-strategy
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Check Fallback Strategy an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Check Fallback Strategy automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Check Fallback Strategy net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Fallback Strategy Audit

Analyze PHP code for missing or insufficient fallback strategies ensuring graceful degradation under failure conditions.

Detection Patterns

1. No Fallback on External Service Failure

php
// CRITICAL: Exception propagates — no graceful degradation
class ProductService
{
    public function getRecommendations(UserId $userId): array
    {
        return $this->recommendationApi->fetch($userId); // If API down → 500 error
    }
}

// CORRECT: Fallback to cached/default recommendations
class ProductService
{
    public function getRecommendations(UserId $userId): array
    {
        try {
            $recommendations = $this->recommendationApi->fetch($userId);
            $this->cache->set("reco:{$userId}", $recommendations, 3600);
            return $recommendations;
        } catch (ServiceUnavailableException $e) {
            $cached = $this->cache->get("reco:{$userId}");
            if ($cached !== null) {
                return $cached; // Stale but available
            }
            return $this->defaultRecommendations(); // Ultimate fallback
        }
    }
}

2. Missing Cache Fallback (Cache-Aside Without Stale)

php
// ANTIPATTERN: Cache miss + origin failure = error
class PricingService
{
    public function getPrice(ProductId $id): Money
    {
        $cached = $this->cache->get("price:{$id}");
        if ($cached !== null) {
            return $cached;
        }

        $price = $this->pricingApi->fetch($id); // If API fails, no fallback!
        $this->cache->set("price:{$id}", $price, 300);
        return $price;
    }
}

// CORRECT: Stale-while-revalidate pattern
class PricingService
{
    public function getPrice(ProductId $id): Money
    {
        $cached = $this->cache->get("price:{$id}");
        $stale = $this->cache->get("price:stale:{$id}");

        if ($cached !== null) {
            return $cached;
        }

        try {
            $price = $this->pricingApi->fetch($id);
            $this->cache->set("price:{$id}", $price, 300);
            $this->cache->set("price:stale:{$id}", $price, 86400); // 24h stale
            return $price;
        } catch (ServiceUnavailableException $e) {
            if ($stale !== null) {
                return $stale; // Stale but available
            }
            throw new PriceUnavailableException('Cannot determine price', previous: $e);
        }
    }
}

3. Feature Flag Without Fallback

php
// ANTIPATTERN: Feature flag service down = unknown state
class FeatureService
{
    public function isEnabled(string $feature): bool
    {
        return $this->flagService->evaluate($feature); // What if flag service is down?
    }
}

// CORRECT: Default values when flag service unavailable
class FeatureService
{
    private const array DEFAULTS = [
        'new_checkout' => false, // Conservative default
        'dark_mode' => true,     // Safe to enable
    ];

    public function isEnabled(string $feature): bool
    {
        try {
            return $this->flagService->evaluate($feature);
        } catch (FeatureFlagException $e) {
            $this->logger->warning('Feature flag service unavailable', [
                'feature' => $feature,
                'default' => self::DEFAULTS[$feature] ?? false,
            ]);
            return self::DEFAULTS[$feature] ?? false;
        }
    }
}

4. Circuit Breaker Without Fallback

php
// ANTIPATTERN: Circuit breaker opens but no fallback
class PaymentGateway
{
    public function charge(Money $amount): PaymentResult
    {
        return $this->circuitBreaker->call(
            fn () => $this->stripe->charge($amount),
            // No fallback! When circuit opens → exception
        );
    }
}

// CORRECT: Meaningful fallback
class PaymentGateway
{
    public function charge(Money $amount): PaymentResult
    {
        return $this->circuitBreaker->call(
            fn () => $this->stripe->charge($amount),
            fallback: fn () => PaymentResult::deferred(
                reason: 'Payment gateway temporarily unavailable',
                retryAt: new DateTimeImmutable('+5 minutes'),
            ),
        );
    }
}

5. Degraded Mode Not Implemented

php
// ANTIPATTERN: All-or-nothing — no partial functionality
class DashboardService
{
    public function getData(): DashboardDTO
    {
        return new DashboardDTO(
            stats: $this->statsService->getStats(),           // Required
            recommendations: $this->recoService->get(),        // Optional!
            notifications: $this->notificationService->get(),  // Optional!
            weather: $this->weatherApi->current(),             // Optional!
        );
        // If ANY optional service fails → entire dashboard fails
    }
}

// CORRECT: Graceful degradation per component
class DashboardService
{
    public function getData(): DashboardDTO
    {
        return new DashboardDTO(
            stats: $this->statsService->getStats(), // Required — let it throw
            recommendations: $this->tryGet(fn () => $this->recoService->get(), []),
            notifications: $this->tryGet(fn () => $this->notificationService->get(), []),
            weather: $this->tryGet(fn () => $this->weatherApi->current(), null),
        );
    }

    private function tryGet(callable $fn, mixed $default): mixed
    {
        try {
            return $fn();
        } catch (\Throwable $e) {
            $this->logger->warning('Degraded mode', ['error' => $e->getMessage()]);
            return $default;
        }
    }
}

Grep Patterns

bash
# External calls without try-catch
Grep: "->fetch\(|->call\(|->request\(|->send\(" --glob "**/Infrastructure/**/*.php"

# Cache without stale fallback
Grep: "cache->get|cache->set" --glob "**/*.php"
Grep: "stale|fallback|default" --glob "**/*.php"

# Circuit breaker usage (check for fallback parameter)
Grep: "circuitBreaker->call\(" --glob "**/*.php"

# Feature flags
Grep: "isEnabled\(|featureFlag|feature_flag" --glob "**/*.php"

# Multiple service calls in one method
Grep: "\$this->.*Service->.*\n.*\$this->.*Service->" --glob "**/Application/**/*.php"

Severity Classification

PatternSeverity
No fallback on critical service🔴 Critical
Cache without stale data🟠 Major
Circuit breaker without fallback🟠 Major
Feature flags without defaults🟠 Major
All-or-nothing dashboard/page🟡 Minor

Output Format

markdown
### Fallback Strategy: [Description]

**Severity:** 🔴/🟠/🟡
**Location:** `file.php:line`
**Service:** [External service name]

**Issue:**
[Description of missing fallback]

**User Impact:**
- Complete failure when service X is unavailable
- No graceful degradation path

**Code:**
```php
// No fallback

Fix:

php
// With fallback strategy

Fallback Chain:

  1. Primary: Live data from service
  2. Secondary: Cached/stale data
  3. Tertiary: Default values

Heefeg gestallte Froen

Wat mécht de KI-Skill Check Fallback Strategy?

Audits fallback and graceful degradation strategies. Checks cache fallback, feature flags, default values, circuit breaker fallbacks, and degraded mode implementations.

Firwat Check Fallback Strategy op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Check Fallback Strategy besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Check Fallback Strategy an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/dykyi-roman/awesome-claude-code/tree/master/skills/check-fallback-strategy an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Check Fallback Strategy benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Check Fallback Strategy benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Check Fallback Strategy domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Check Fallback Strategy gratis?

Jo. dykyi-roman huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇