intermittent-issue-debugging by aj-geddes/useful-ai-prompts
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill intermittent-issue-debugging间歇性问题是最难调试的,因为它们并非持续发生。系统化的方法和全面的监控至关重要。
最小工作示例:
// Strategy 1: Comprehensive Logging
// Add detailed logging around suspected code
function processPayment(orderId) {
const startTime = Date.now();
console.log(`[${startTime}] Payment start: order=${orderId}`);
try {
const result = chargeCard(orderId);
console.log(`[${Date.now()}] Payment success: ${orderId}`);
return result;
} catch (error) {
const duration = Date.now() - startTime;
console.error(`[${Date.now()}] Payment FAILED:`, {
order: orderId,
error: error.message,
duration_ms: duration,
error_type: error.constructor.name,
stack: error.stack,
});
throw error;
}
}
// Strategy 2: Correlation IDs
// ... (see reference guides for full implementation)
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/ 目录下的详细实现:
每周安装数
106
代码仓库
GitHub 星标数
116
首次出现
Jan 21, 2026
安全审计
安装于
opencode87
gemini-cli85
codex83
claude-code82
cursor80
github-copilot69
Intermittent issues are the most difficult to debug because they don't occur consistently. Systematic approach and comprehensive monitoring are essential.
Minimal working example:
// Strategy 1: Comprehensive Logging
// Add detailed logging around suspected code
function processPayment(orderId) {
const startTime = Date.now();
console.log(`[${startTime}] Payment start: order=${orderId}`);
try {
const result = chargeCard(orderId);
console.log(`[${Date.now()}] Payment success: ${orderId}`);
return result;
} catch (error) {
const duration = Date.now() - startTime;
console.error(`[${Date.now()}] Payment FAILED:`, {
order: orderId,
error: error.message,
duration_ms: duration,
error_type: error.constructor.name,
stack: error.stack,
});
throw error;
}
}
// Strategy 2: Correlation IDs
// ... (see reference guides for full implementation)
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| Capturing Intermittent Issues | Capturing Intermittent Issues |
| Common Intermittent Issues | Common Intermittent Issues |
| Systematic Investigation Process | Systematic Investigation Process |
| Monitoring & Prevention | Monitoring & Prevention |
Weekly Installs
106
Repository
GitHub Stars
116
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode87
gemini-cli85
codex83
claude-code82
cursor80
github-copilot69
Dogfood - Vercel Labs 自动化 Web 应用探索与问题报告工具
18,700 周安装