Agent Code Debugger
/install agent-code-debugger
Agent Code Debugger
Debugging assistance for AI-generated code with multi-language support.
When to Use
- Debugging AI-generated code
- Analyzing code for common AI generation issues
- Getting Visual Studio debugging guidance
- Detecting security vulnerabilities in generated code
- Quick fixes for common code issues
Usage
const debugger = require('./skills/agent-code-debugger');
// Analyze code for issues
const analysis = debugger.analyze(code, { language: 'csharp' });
console.log(analysis.summary);
// Get fix suggestions
const fixes = debugger.suggestFixes(analysis.issues);
// Get Visual Studio guidance
const guidance = debugger.getVisualStudioGuidance('csharp');
// Generate debug configuration
const config = debugger.generateDebugConfig('csharp');
// Quick fix common issues
const fixed = debugger.quickFix(code, 'console_writeline_leftover');
API
analyze(code, options?)
Analyze code for issues.
const analysis = analyze(csharpCode, { language: 'csharp' });
// {
// language: 'csharp',
// totalIssues: 5,
// criticalCount: 0,
// highCount: 2,
// mediumCount: 2,
// lowCount: 1,
// issues: [...],
// summary: 'Found 5 issue(s): 2 high, 2 medium, 1 low'
// }
suggestFixes(issues, options?)
Generate fix suggestions for issues.
const fixes = suggestFixes(analysis.issues, { language: 'csharp' });
// [{ type: 'async_void', fixSuggestion: '...', ... }]
getVisualStudioGuidance(language?)
Get Visual Studio debugging guidance.
const guidance = getVisualStudioGuidance('csharp');
// {
// breakpoints: '...',
// watchWindow: '...',
// tips: [...]
// }
generateDebugConfig(language, options?)
Generate debug configuration for VS Code / Visual Studio.
const config = generateDebugConfig('csharp');
// { visualStudio: {...}, vscode: {...} }
detectAIPatterns(code)
Detect common AI-generated code characteristics.
const patterns = detectAIPatterns(code);
// [{ type: 'todo_comments', description: '...', suggestion: '...' }]
quickFix(code, issueType)
Apply quick fix for common issues.
const fixed = quickFix(code, 'console_writeline_leftover');
// { original: '...', fixed: '...', applied: true }
generateReport(analysis)
Generate a markdown debugging report.
const report = generateReport(analysis);
// '# Code Analysis Report\
...'
Supported Languages
- C# / .NET Core - Full support with Visual Studio guidance
- TypeScript - Type safety and async patterns
- JavaScript - Promise and async/await patterns
- Python - Exception handling and best practices
- Java - Exception handling and threading
Common Issues Detected
C# / .NET Core
| Issue | Severity | Description |
|---|---|---|
async_void |
High | async void should only be used for event handlers |
task_result_blocking |
High | .Result blocks thread, potential deadlock |
task_wait_blocking |
High | .Wait() blocks thread |
empty_catch |
High | Empty catch swallows exceptions |
console_writeline_leftover |
Low | Debug Console.WriteLine left in code |
thread_sleep_blocking |
Medium | Thread.Sleep blocks thread |
JavaScript / TypeScript
| Issue | Severity | Description |
|---|---|---|
promise_without_catch |
High | Promise chain without .catch() |
async_without_try_catch |
Medium | Async function without error handling |
console_log_leftover |
Low | Debug console.log left in code |
explicit_any_type |
Medium | Explicit use of any type (TS) |
ts_ignore_comment |
High | @ts-ignore suppresses errors (TS) |
Python
| Issue | Severity | Description |
|---|---|---|
bare_except |
High | Bare except catches all exceptions |
wildcard_import |
Medium | Wildcard import pollutes namespace |
print_statement_leftover |
Low | Debug print left in code |
Visual Studio Debugging Tips
Breakpoints
- F9 - Toggle breakpoint
- F5 - Start debugging
- F10 - Step over
- F11 - Step into
- Shift+F11 - Step out
Debug Windows
- Watch - Monitor variables
- Immediate - Evaluate expressions
- Call Stack - Trace execution
- Locals - View local variables
- Autos - View relevant variables
Advanced Features
- Conditional breakpoints - Right-click breakpoint > Conditions
- Hit count - Break after N hits
- Exception settings - Break on specific exceptions
- Edit and Continue - Modify code while debugging
Example: Debugging AI-Generated C# Code
const debugger = require('./skills/agent-code-debugger');
const aiGeneratedCode = `
public async void ProcessData() {
var result = GetDataAsync().Result;
Console.WriteLine($"Debug: {result}");
try {
// Process result
} catch {
// Handle error
}
}
`;
// Analyze
const analysis = debugger.analyze(aiGeneratedCode, { language: 'csharp' });
console.log(analysis.summary);
// Found 4 issue(s): 3 high, 1 low
// Get fixes
const fixes = debugger.suggestFixes(analysis.issues);
for (const fix of fixes) {
console.log(`Line ${fix.line}: ${fix.type}`);
console.log(`Fix: ${fix.fixSuggestion}`);
}
// Quick fix
const cleaned = debugger.quickFix(aiGeneratedCode, 'console_writeline_leftover');
// Get VS guidance
const guidance = debugger.getVisualStudioGuidance('csharp');
console.log('Tips:', guidance.tips);
Example: Generating Debug Configuration
const debugger = require('./skills/agent-code-debugger');
// For C# / .NET Core
const csharpConfig = debugger.generateDebugConfig('csharp');
console.log(JSON.stringify(csharpConfig.vscode, null, 2));
// For TypeScript
const tsConfig = debugger.generateDebugConfig('typescript');
console.log(JSON.stringify(tsConfig.vscode, null, 2));
Notes
- Pattern detection based on common AI-generated code issues
- Security vulnerability scanning included
- Multi-language support with language-specific patterns
- Visual Studio and VS Code integration guidance
- Quick fixes available for common cleanup tasks
- Reports generated in markdown format
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install agent-code-debugger - After installation, invoke the skill by name or use
/agent-code-debugger - Provide required inputs per the skill's parameter spec and get structured output
What is Agent Code Debugger?
Provides debugging assistance for AI-generated code with pattern detection, common issue identification, and fix suggestions across multiple programming lang... It is an AI Agent Skill for Claude Code / OpenClaw, with 141 downloads so far.
How do I install Agent Code Debugger?
Run "/install agent-code-debugger" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Agent Code Debugger free?
Yes, Agent Code Debugger is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Agent Code Debugger support?
Agent Code Debugger is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Agent Code Debugger?
It is built and maintained by jpengcheng523-netizen (@jpengcheng523-netizen); the current version is v1.0.0.