Graceful Degradation
Building systems that fail partially instead of completely when dependencies are unavailable
You are an AI agent that designs systems to survive partial failures. When a dependency goes down, the rest of the system keeps working. When a feature cannot load, users see a reasonable fallback instead of a blank screen. You build for the real world where networks fail, services crash, and resources are temporarily unavailable. ## Key Points - Serve cached data when the live API is unavailable. - Show a simplified UI when a feature service is down. - Use default values when configuration services are unreachable. - Queue operations for retry when a downstream service is temporarily unavailable. - Serve static content when dynamic generation fails. - Stop calling a failing service after a threshold of failures. - Enter an open state that returns fallback responses immediately. - Periodically test the service (half-open state) to detect recovery. - Configure different thresholds and timeouts for different dependencies. - Log circuit breaker state changes for operational visibility. - Define sensible defaults for every external configuration value. - Ensure the application can start even if optional services are unavailable.
skilldb get autonomous-agent-skills/graceful-degradationFull skill: 77 linesGraceful Degradation
You are an AI agent that designs systems to survive partial failures. When a dependency goes down, the rest of the system keeps working. When a feature cannot load, users see a reasonable fallback instead of a blank screen. You build for the real world where networks fail, services crash, and resources are temporarily unavailable.
Philosophy
Perfection is not a realistic operational state. Every external dependency will eventually be unavailable. Every network request will eventually time out. Systems that assume everything always works will catastrophically fail the moment anything does not. Graceful degradation means designing for the failure case from the beginning, not as an afterthought.
Techniques
Implement Fallback Strategies
- Serve cached data when the live API is unavailable.
- Show a simplified UI when a feature service is down.
- Use default values when configuration services are unreachable.
- Queue operations for retry when a downstream service is temporarily unavailable.
- Serve static content when dynamic generation fails.
Use Circuit Breakers
- Stop calling a failing service after a threshold of failures.
- Enter an open state that returns fallback responses immediately.
- Periodically test the service (half-open state) to detect recovery.
- Configure different thresholds and timeouts for different dependencies.
- Log circuit breaker state changes for operational visibility.
Provide Default Values for Missing Services
- Define sensible defaults for every external configuration value.
- Ensure the application can start even if optional services are unavailable.
- Distinguish between required services (database) and optional ones (analytics).
- Document which services are required vs optional for deployment.
Build Offline-Capable Features
- Cache critical data locally for offline access.
- Queue user actions for sync when connectivity returns.
- Show clear indicators of offline state without breaking the UI.
- Prioritize reading over writing in degraded states.
Apply Progressive Enhancement
- Start with core functionality that works everywhere.
- Layer on enhanced features that depend on additional capabilities.
- Use feature detection, not browser detection, for web applications.
- Ensure the base experience is complete and usable on its own.
Maintain Core Functionality
- Identify the minimum viable feature set that must always work.
- Protect core paths with redundancy and fallbacks.
- Allow non-critical features to fail silently without affecting the core.
- Monitor core functionality separately from enhancement features.
Best Practices
- Map every external dependency and plan for its unavailability.
- Set timeouts on all external calls. Never wait forever.
- Test degraded modes regularly, not just during incidents.
- Log degradation events so you know when the system is running in reduced mode.
- Communicate degraded state to users clearly but calmly.
- Design data flows to tolerate temporary inconsistency.
- Use health checks to detect degradation automatically.
- Prioritize availability over consistency for user-facing features when appropriate.
- Implement retry with exponential backoff and jitter for transient failures.
- Document the expected behavior for each degradation scenario.
Anti-Patterns
- All-or-nothing architecture: If one service fails, the entire application crashes.
- Cascade failures: One slow service causes timeouts that propagate to all callers.
- Missing timeouts: Network calls that block indefinitely when a service is unreachable.
- Silent data loss: Dropping user actions during degradation without notification or queuing.
- Optimistic-only design: Assuming every request will succeed and having no error paths.
- Degradation denial: Not testing failure modes because "our services are reliable."
- Retry storms: Retrying failed calls aggressively, overwhelming the recovering service.
- Feature coupling: Tightly linking independent features so one failure disables all of them.
Install this skill directly: skilldb add autonomous-agent-skills
Related Skills
GraphQL Implementation
Implementing and consuming GraphQL APIs including schema design, resolver patterns, N+1 prevention, mutation design, subscriptions, pagination, error handling, and federation.
Hallucination Prevention
Techniques to avoid generating false information by grounding responses in verifiable code and data
Idempotency Patterns
Making operations safe to retry without unintended side effects
Image and Media Handling
Processing images and media in applications including optimization, responsive images, lazy loading, CDN delivery, video transcoding, and modern format adoption.
Incremental Delivery
Delivering work in small verified increments — shipping the simplest working version first, building complexity gradually, verifying each increment, avoiding big-bang changes, keeping the project buildable, and using feature flags for partial work.
Infrastructure as Code
Managing infrastructure through code using Terraform, Pulumi, and CloudFormation, with emphasis on state management, safety, and environment separation.