From aj-geddes-useful-ai-prompts-4
Debugs sporadic, hard-to-reproduce issues like flaky tests, race conditions, and timing bugs using logging, monitoring, and systematic investigation.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4This skill uses the workspace's default tool permissions.
- [Overview](#overview)
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
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 |