Zero-Shot Code Bug Detection

Zero-shot code bug detection across null errors, type mismatches, logic errors, resource leaks, and security vulnerabilities.

169 copies0 forks
Share this prompt:
Detect potential bugs in this code without any examples, using only bug category definitions.

## Code to Analyze
{{code_snippet}}

## Bug Categories to Check

**Null/Undefined Errors**: Missing null checks, undefined access
**Type Errors**: Type mismatches, invalid conversions
**Logic Errors**: Incorrect conditions, off-by-one, wrong operators
**Resource Leaks**: Unclosed connections, memory leaks, file handles
**Concurrency Issues**: Race conditions, deadlocks, missing locks
**Security Vulnerabilities**: Injection, exposure, validation gaps

## Analysis Instructions

1. Scan code systematically for each bug category.

2. For each potential bug:
   - Line number(s)
   - Bug category
   - Description of issue
   - Potential impact
   - Suggested fix

3. Rate severity: Critical/High/Medium/Low

4. Assess confidence: High/Medium/Low

**Output Format:**
```json
{
  "bugs": [
    {
      "line": 42,
      "category": "null_error",
      "description": "...",
      "severity": "high",
      "fix": "..."
    }
  ]
}
```

Details

Category

Coding

Use Cases

Bug detectionCode analysisQuality assurance

Works Best With

claude-sonnet-4-20250514gpt-4o
Created Updated Shared

Related Prompts

Create your own prompt vault and start sharing