一键导入
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 职业分类
| 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:
amplihack memory store-discovery CLI commandOptimization 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
Builds comprehensive, living code-atlases as multi-layer architecture documents derived from code-first truth. Defaults to both Graphviz DOT and Mermaid. User can override to single format. Language-agnostic (Go, TypeScript, Python, .NET, Rust, Java). Files issues with 'code-atlas-bughunt' label. Treats atlas-building as a multi-agent bug-hunting journey: graph-form reasoning exposes structural bugs, route/DTO mismatches, orphaned env vars, dead code paths, and stale documentation that linear review misses. Three-pass bug hunt with per-journey PASS/FAIL/NEEDS_ATTENTION verdicts. Use when: creating architecture documentation, investigating unfamiliar codebases, hunting structural bugs, setting up CI/CD diagram refresh, or publishing to GitHub Pages/mkdocs.
Move the active amplihack CLI session (Copilot/Claude/Amplifier) to a fresh azlin-managed VM, preserving auth, plugins, skills, plan.md, todos, and conversation history. Resumes the session in a detached tmux on the destination host.
Development workflow for features, bugs, refactoring. Normally executed as a sub-recipe by dev-orchestrator/smart-orchestrator. Supports direct invocation via recipe runner for standalone use.
Generates an illustrated, plain-language walkthrough document for a pull request — problem statement, approach overview, step-by-step code tour with mermaid diagrams, deep diff links, key decisions, and testing summary. Use when explaining, documenting, or summarizing a PR, creating a reviewer-friendly illustrated guide, or producing walkthrough notes at the end of default-workflow. Works with GitHub and Azure DevOps.
Checks whether a PR/pull request satisfies the project's merge criteria and records the required evidence in the PR/pull request description. Use with `/merge-ready` before review or merge when QA-team scenarios, docs links, quality-audit convergence, checks/build validation status, and diff scope must be verified.
Expert project manager orchestrating backlog-curator, work-delegator, workstream-coordinator, and roadmap-strategist sub-skills. Coordinates complex software projects through delegation and strategic oversight. Activates when managing projects, coordinating work, or tracking overall progress.