一键导入
systematic-debugging
Structured debugging process for bugs. Reproduces, isolates, hypothesizes, tests, fixes minimally, and documents learnings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Structured debugging process for bugs. Reproduces, isolates, hypothesizes, tests, fixes minimally, and documents learnings.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deep verification agent that finds hidden errors in code, analysis, and architecture. Assumes nothing is correct, drills deep, and verifies every claim independently.
Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.
Screen job candidates from your ATS using AI-powered evaluation. Use when asked to "screen candidates", "review applicants", "run candidate screening", "check new applications", or "evaluate candidates".
Expert advisor and thinking partner for strategic situations. Rapidly develops domain expertise, identifies knowledge gaps, and provides radically candid coaching to accelerate learning and decision-making.
Delegate complex reasoning, planning, or deep analysis tasks to OpenAI's GPT-5.2-Codex model. Use when tasks require extended thinking, multi-step planning, or when you need a second opinion on complex problems.
Daily sense-maker digest of newsletters and content feeds
| name | systematic-debugging |
| description | Structured debugging process for bugs. Reproduces, isolates, hypothesizes, tests, fixes minimally, and documents learnings. |
Debug issues through a structured process rather than random changes. Reproduce the bug, isolate the cause, form a hypothesis, write a failing test, make a minimal fix, and document what was learned.
When activated:
| Category | Questions to Answer |
|---|---|
| What | What's the observed vs expected behavior? |
| When | When did it start? What changed recently? |
| Where | Which file/function/line? Which environment? |
| Who | Which users/inputs/scenarios trigger it? |
| Frequency | Always, sometimes, or rarely? |
Goal: Trigger the bug consistently on demand.
Steps:
If bug is intermittent:
## Reproduction
**Environment:** [Node version, OS, etc.]
**Steps:**
1. [Step]
2. [Step]
3. [Step]
**Expected:** [What should happen]
**Actual:** [What happens instead]
**Reproduction rate:** [X/X attempts]
Binary search approach:
Isolation techniques:
| Technique | When to Use |
|---|---|
| Binary search | Large area, unclear location |
| Divide and conquer | Multiple components interacting |
| Minimal input | Simplest data that still triggers bug |
| Environment elimination | Works in some envs, not others |
| Git bisect | Bug introduced recently, known good commit |
Based on gathered evidence, form a clear hypothesis:
## Hypothesis
**Root cause:** [Specific explanation of what's wrong]
**Why this explains the symptoms:**
- [How it accounts for observation 1]
- [How it accounts for observation 2]
**Prediction:** If this hypothesis is correct, then:
- [Testable prediction 1]
- [Testable prediction 2]
Check for these common causes:
| Pattern | Symptoms | Where to Look |
|---|---|---|
| Off-by-one | Works except at boundaries | Loop conditions, array indices |
| Null/undefined | Random crashes | Optional chaining, default values |
| Race condition | Intermittent failures | Async code, shared state |
| Type coercion | Unexpected comparisons | String/number mixing, equality checks |
| State mutation | Works first time only | Object references, caching |
| Missing await | Partial execution | Async functions, promises |
| Wrong scope | Variable has unexpected value | Closures, hoisting |
Before fixing anything, write a test that:
// Example test structure
describe('bugfix: [brief description]', () => {
it('should [expected behavior] when [condition that caused bug]', () => {
// Arrange - set up the buggy scenario
const input = /* minimal input that triggers bug */;
// Act - exercise the buggy code path
const result = functionWithBug(input);
// Assert - verify correct behavior
expect(result).toEqual(/* expected output */);
});
});
Rules:
After the fix:
If the bug reveals something worth remembering:
## YYYY-MM-DD - [repo] - Bug: [Title]
**Symptom:** [What was observed]
**Root cause:** [What was actually wrong]
**Fix:** [What was changed]
**Learning:** [What pattern to avoid or check for in future]
**Prevention:** [How to catch this earlier next time]
If this bug suggests a new rule:
# Debug Report: [Bug Title]
## Summary
**Status:** FIXED / INVESTIGATING / BLOCKED
**Root Cause:** [One-line summary]
**Fix:** [One-line summary of change]
---
## Symptoms
- [Observable problem 1]
- [Observable problem 2]
**Error message:**
[error text if applicable]
---
## Reproduction
**Steps:**
1. [Step]
2. [Step]
**Rate:** X/X attempts
---
## Investigation
### Isolation
[How we narrowed it down]
### Hypothesis
**Theory:** [What we believe is wrong]
**Evidence:**
- [Supporting evidence]
---
## Solution
### Test Added
```typescript
// Test code
- [old code]
+ [new code]
File: path/to/file.ts:line
Why this fixes it: [Brief explanation]
[Any patterns to remember for future]
---
## Debugging Techniques for Claude Code
Since Claude Code can't see console output directly, use these strategies:
### 1. Error Messages for Debugging
```typescript
return { error: `Debug: received ${JSON.stringify(args)}` };
// or
throw new Error(`Debug state: ${JSON.stringify(debugInfo)}`);
import { promises as fs } from "fs";
await fs.writeFile("debug.json", JSON.stringify(debugInfo, null, 2));
cat debug.json
tail -f test-output.log
// Add before suspected area
console.log("DEBUG [location]:", JSON.stringify(relevantData));
// Then check output or capture in tests
This skill should be invoked:
The output feeds into the project diary for significant bugs.
| Severity | Approach | Documentation |
|---|---|---|
| Typo/trivial | Quick fix, skip most steps | None needed |
| Standard bug | Full process | Test + brief note |
| Critical/security | Extra thorough, peer review | Full report + diary |
| Recurring | Deep investigation | Pattern documentation |
If investigation exceeds 30 minutes without progress: