$npx -y skills add parcadei/Continuous-Claude-v3 --skill graceful-degradationGraceful Degradation with Helpful Messages
| 1 | # Graceful Degradation with Helpful Messages |
| 2 | |
| 3 | When optional services are unavailable, degrade gracefully with actionable fallback messages. |
| 4 | |
| 5 | ## Pattern |
| 6 | |
| 7 | Check availability at the start, cache the result, and provide helpful messages that explain what's missing and how to fix it. |
| 8 | |
| 9 | ## DO |
| 10 | |
| 11 | - Check service availability early (before wasting compute) |
| 12 | - Cache health check results for the session (e.g., 60s TTL) |
| 13 | - Provide actionable fallback messages: |
| 14 | - What service is missing |
| 15 | - What features are degraded |
| 16 | - How to enable the service |
| 17 | - Continue with reduced functionality when possible |
| 18 | |
| 19 | ## DON'T |
| 20 | |
| 21 | - Silently fail or return empty results |
| 22 | - Check availability on every call (cache it) |
| 23 | - Assume the user knows how to start missing services |
| 24 | |
| 25 | ## Example: LMStudio Check Pattern |
| 26 | |
| 27 | ```typescript |
| 28 | let lmstudioAvailable: boolean | null = null; |
| 29 | let lastCheck = 0; |
| 30 | const CACHE_TTL = 60000; // 60 seconds |
| 31 | |
| 32 | async function checkLMStudio(): Promise<boolean> { |
| 33 | const now = Date.now(); |
| 34 | if (lmstudioAvailable !== null && now - lastCheck < CACHE_TTL) { |
| 35 | return lmstudioAvailable; |
| 36 | } |
| 37 | |
| 38 | try { |
| 39 | const response = await fetch('http://localhost:1234/v1/models', { |
| 40 | signal: AbortSignal.timeout(2000) |
| 41 | }); |
| 42 | lmstudioAvailable = response.ok; |
| 43 | } catch { |
| 44 | lmstudioAvailable = false; |
| 45 | } |
| 46 | lastCheck = now; |
| 47 | return lmstudioAvailable; |
| 48 | } |
| 49 | |
| 50 | // Usage |
| 51 | if (!await checkLMStudio()) { |
| 52 | return { |
| 53 | result: 'continue', |
| 54 | message: `LMStudio not available at localhost:1234. |
| 55 | |
| 56 | To enable Godel-Prover tactic suggestions: |
| 57 | 1. Install LMStudio from https://lmstudio.ai/ |
| 58 | 2. Load "Goedel-Prover-V2-8B" model |
| 59 | 3. Start the local server on port 1234 |
| 60 | |
| 61 | Continuing without AI-assisted tactics...` |
| 62 | }; |
| 63 | } |
| 64 | ``` |
| 65 | |
| 66 | ## Fallback Message Template |
| 67 | |
| 68 | ``` |
| 69 | [Service] not available at [endpoint]. |
| 70 | |
| 71 | To enable [feature]: |
| 72 | 1. [Step to install/start] |
| 73 | 2. [Configuration step if needed] |
| 74 | 3. [Verification step] |
| 75 | |
| 76 | Continuing without [degraded feature]... |
| 77 | ``` |
| 78 | |
| 79 | ## Source Sessions |
| 80 | |
| 81 | - This session: LMStudio availability check with 60s caching and helpful fallback |
| 82 | - 174e0ff3: Environment variable debugging - print computed paths for troubleshooting |