一键导入
cascade-workflow
Graceful degradation through cascading fallback strategies - ensures system always completes while maintaining acceptable functionality
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Graceful degradation through cascading fallback strategies - ensures system always completes while maintaining acceptable functionality
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrate large-scale changes across a codebase in parallel
Review changed code for reuse, quality, and efficiency, then fix any issues found
Consolidated Claude Code sync and parity tracking for RustyClawd. Fetches latest Claude Code features from official sources, compares against the local feature inventory, identifies gaps, and optionally creates GitHub issues. Also supports deep analysis by deminifying the installed Claude Code cli.js.
Track and report agent invocation metrics including usage counts, success/failure rates, and completion times. Use for understanding which agents are utilized, identifying underused agents, and optimizing agent delegation patterns.
Automated dependency conflict detection and resolution. Detects local vs CI environment mismatches, compares versions, and generates pinning recommendations. Run as pre-push check to catch issues early.
Auto-discovers and configures Language Server Protocol (LSP) servers for your project's languages
| name | cascade-workflow |
| version | 1.0.0 |
| description | Graceful degradation through cascading fallback strategies - ensures system always completes while maintaining acceptable functionality |
| auto_activates | ["external API","external service","timeout handling","high availability","fallback strategy","resilient operation"] |
| explicit_triggers | ["/amplihack:cascade"] |
| confirmation_required | false |
| token_budget | 3500 |
Implement graceful degradation through cascading fallback strategies. When optimal approaches fail or timeout, the system automatically falls back to simpler, more reliable alternatives while maintaining acceptable functionality.
USE FOR:
AVOID FOR:
Timeout Strategy:
aggressive - Fast failures, quick degradation (5s / 2s / 1s)balanced - Reasonable attempts (30s / 10s / 5s) - DEFAULTpatient - Thorough attempts before fallback (120s / 30s / 10s)custom - Define your own timeoutsFallback Types:
service - External API → Cached data → Static defaultsquality - Comprehensive → Standard → Minimal analysisfreshness - Real-time → Recent → Historical datacompleteness - Full dataset → Sample → Summaryaccuracy - Precise → Approximate → EstimateDegradation Notification:
silent - Log only, no user notificationwarning - Inform user of degradationexplicit - Detailed explanation of what degraded and whyPRIMARY (Optimal):
SECONDARY (Acceptable):
TERTIARY (Guaranteed):
Example Cascade Definitions:
Code Analysis with AI:
External API Data Fetch:
Test Execution:
# Pseudocode for primary attempt
try:
result = execute_primary_approach(timeout=PRIMARY_TIMEOUT)
log_success(level="PRIMARY", result=result)
return result # DONE - best outcome achieved
except TimeoutError:
log_failure(level="PRIMARY", reason="timeout")
# Continue to Step 3
except ExternalServiceError as e:
log_failure(level="PRIMARY", reason=f"service_error: {e}")
# Continue to Step 3
# Pseudocode for secondary attempt
log_degradation(from_level="PRIMARY", to_level="SECONDARY")
try:
result = execute_secondary_approach(timeout=SECONDARY_TIMEOUT)
log_success(level="SECONDARY", result=result, degraded=True)
return result # DONE - acceptable outcome
except TimeoutError:
log_failure(level="SECONDARY", reason="timeout")
# Continue to Step 4
# Pseudocode for tertiary attempt
log_degradation(from_level="SECONDARY", to_level="TERTIARY")
try:
result = execute_tertiary_approach(timeout=TERTIARY_TIMEOUT)
log_success(level="TERTIARY", result=result, heavily_degraded=True)
return result # DONE - minimal but functional
except Exception as e:
# THIS SHOULD NEVER HAPPEN
log_critical_failure("TERTIARY approach failed - this is a bug!")
raise SystemError("Cascade safety violation: tertiary failed")
Degradation Reporting Templates:
Silent Mode:
[LOG] CASCADE: PRIMARY timeout (30s) → SECONDARY success (6s)
Result: standard_analysis (degraded from comprehensive)
Warning Mode:
⚠️ Using cached data (less than 1 hour old)
Current real-time data unavailable.
Explicit Mode:
ℹ️ Analysis Quality Notice
We attempted to provide comprehensive code analysis using GPT-4,
but encountered slow response times (>30s timeout).
Fallback Applied:
- Used: GPT-3.5 standard analysis (completed in 6s)
- Quality: Standard (vs. Comprehensive)
- Impact: Advanced semantic insights not included
What You're Getting:
✓ Basic pattern detection
✓ Standard recommendations
✓ Code quality assessment
What's Missing:
✗ Complex architectural insights
✗ Deep semantic analysis
✗ Advanced refactoring suggestions
Metrics to Track:
.claude/context/DISCOVERIES.mdOptimization Criteria:
Benefit: System always completes, never fully fails Cost: Users may receive degraded responses Best For: User-facing features where responsiveness matters
Configuration:
Implementation:
async def get_weather(location: str) -> WeatherData:
"""Get weather data with cascade fallback"""
# PRIMARY: Live weather API
try:
return await fetch_weather_api(location, timeout=30)
except (TimeoutError, APIError):
log.warning("PRIMARY weather API failed, trying cache")
# SECONDARY: Cached weather data
try:
cached = await get_cached_weather(location, max_age=3600)
if cached:
notify_user("Using weather data from cache (< 1 hour old)")
return cached
except CacheError:
log.warning("SECONDARY cache failed, using defaults")
# TERTIARY: Default weather data
return get_default_weather(location) # Never fails
Outcome: System always returns weather data, quality degrades gracefully
Configuration:
Cascade Path:
Configuration:
Implementation:
def search_and_rank(query: str) -> List[Result]:
"""Search with ML ranking, fallback to simple ranking"""
results = fetch_results(query)
# PRIMARY: ML-based ranking (sophisticated)
try:
return ml_rank(results, timeout=5)
except TimeoutError:
pass # Silent fallback
# SECONDARY: Heuristic ranking (good enough)
try:
return heuristic_rank(results, timeout=2)
except TimeoutError:
pass
# TERTIARY: Simple text match ranking (basic)
return simple_rank(results) # Always fast
This workflow enforces:
Better to deliver degraded service than no service