Help diagnose and fix bugs in code.
Diagnoses and fixes bugs by analyzing errors, reproducing issues, and proposing verified solutions.
/plugin marketplace add Data-Wise/craft/plugin install data-wise-craft@Data-Wise/craftcode/Help diagnose and fix bugs in code.
Systematic debugging support for:
Understand the problem
Reproduce the issue
Diagnose
Fix
Verify
## Bug Analysis
### Problem Summary
[Clear description of the issue]
### Error Details
[Error message or unexpected output]
### Root Cause
[Explanation of why this is happening]
### Minimal Reproducible Example
```r
# Code that demonstrates the issue
# Fixed code with explanation
[Why this fix works]
## Debugging Strategies
### For R
```r
# Tracing
traceback()
debug(function_name)
browser()
# Inspection
str(object)
class(object)
attributes(object)
# Options
options(error = recover)
options(warn = 2) # Treat warnings as errors
// Console debugging
console.log(variable)
console.trace()
debugger;
// Error inspection
try { } catch (e) { console.error(e.stack) }
Uses these tools when available:
r_execute - Run code snippetsr_inspect - Examine objectsr_session - Interactive debuggingRequest: "Help me debug this error: 'object of type closure is not subsettable'"
Request: "My function returns NULL instead of the expected data frame"
Request: "This code works in RStudio but fails in a script"
Request: "Help me understand why my test is failing"