graceful-degradation by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill graceful-degradation当可选服务不可用时,通过提供可操作的备用信息实现优雅降级。
在开始时检查可用性,缓存结果,并提供有用的信息,说明缺少什么以及如何修复。
let lmstudioAvailable: boolean | null = null;
let lastCheck = 0;
const CACHE_TTL = 60000; // 60 seconds
async function checkLMStudio(): Promise<boolean> {
const now = Date.now();
if (lmstudioAvailable !== null && now - lastCheck < CACHE_TTL) {
return lmstudioAvailable;
}
try {
const response = await fetch('http://localhost:1234/v1/models', {
signal: AbortSignal.timeout(2000)
});
lmstudioAvailable = response.ok;
} catch {
lmstudioAvailable = false;
}
lastCheck = now;
return lmstudioAvailable;
}
// Usage
if (!await checkLMStudio()) {
return {
result: 'continue',
message: `LMStudio not available at localhost:1234.
To enable Godel-Prover tactic suggestions:
1. Install LMStudio from https://lmstudio.ai/
2. Load "Goedel-Prover-V2-8B" model
3. Start the local server on port 1234
Continuing without AI-assisted tactics...`
};
}
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
[Service] not available at [endpoint].
To enable [feature]:
1. [Step to install/start]
2. [Configuration step if needed]
3. [Verification step]
Continuing without [degraded feature]...
每周安装量
194
代码仓库
GitHub 星标数
3.6K
首次出现
2026年1月22日
安全审计
安装于
opencode189
codex187
gemini-cli185
cursor184
github-copilot182
amp179
When optional services are unavailable, degrade gracefully with actionable fallback messages.
Check availability at the start, cache the result, and provide helpful messages that explain what's missing and how to fix it.
let lmstudioAvailable: boolean | null = null;
let lastCheck = 0;
const CACHE_TTL = 60000; // 60 seconds
async function checkLMStudio(): Promise<boolean> {
const now = Date.now();
if (lmstudioAvailable !== null && now - lastCheck < CACHE_TTL) {
return lmstudioAvailable;
}
try {
const response = await fetch('http://localhost:1234/v1/models', {
signal: AbortSignal.timeout(2000)
});
lmstudioAvailable = response.ok;
} catch {
lmstudioAvailable = false;
}
lastCheck = now;
return lmstudioAvailable;
}
// Usage
if (!await checkLMStudio()) {
return {
result: 'continue',
message: `LMStudio not available at localhost:1234.
To enable Godel-Prover tactic suggestions:
1. Install LMStudio from https://lmstudio.ai/
2. Load "Goedel-Prover-V2-8B" model
3. Start the local server on port 1234
Continuing without AI-assisted tactics...`
};
}
[Service] not available at [endpoint].
To enable [feature]:
1. [Step to install/start]
2. [Configuration step if needed]
3. [Verification step]
Continuing without [degraded feature]...
Weekly Installs
194
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode189
codex187
gemini-cli185
cursor184
github-copilot182
amp179
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
116,600 周安装