willkelly/deno-debug-skill
An attempt to get claude code connected to a remote debugger to troubleshoot typescript problems in deno
2 stars0 forksUpdated Nov 14, 2025
npx skills add willkelly/deno-debug-skillREADME
Deno Debugger Skill for Claude
Transform Claude into an interactive debugger for Deno/TypeScript applications.
This skill enables Claude to act as a debugging assistant that connects to Deno via the V8 Inspector Protocol, conducts systematic investigations, and generates comprehensive Markdown reports with evidence-based analysis.
šÆ What This Skill Does
Claude becomes your debugging partner that:
- Connects to your Deno app via Chrome DevTools Protocol
- Investigates using breakpoints, heap snapshots, and CPU profiling
- Tracks investigation reasoning with breadcrumbs (for complex cases)
- Analyzes data with native TypeScript (no external dependencies)
- Reports findings in clear Markdown with specific recommendations
š Quick Start
1. Install the Skill
# Copy to Claude's skills directory
cp -r deno-debugger/ ~/.claude/skills/
# That's it! No dependencies to install - uses Deno stdlib only
2. Launch Your Deno App with Inspector
# Start with --inspect (attaches on port 9229)
deno run --inspect --allow-net --allow-read your-app.ts
# Or use --inspect-brk to pause at start
deno run --inspect-brk --allow-net --allow-read your-app.ts
3. Ask Claude to Debug
You: "My Deno app is leaking memory when processing file uploads. Can you investigate?"
Claude: *connects via CDP, systematically investigates, generates REPORT.md*
š Usage Examples
Memory Leak Investigation
You: "Memory grows with each upload and never gets released"
Claude will:
1. Connect to your Deno process (port 9229)
2. Capture baseline heap snapshot
3. Trigger the leak (asks you or does it programmatically)
4. Capture comparison snapshot
5. Calculate growth rate and project OOM timeline
6. Examine source code for retention patterns
7. Generate REPORT.md with:
- Root cause analysis
- Code snippets showing the bug
- Named anti-pattern (e.g., "retain-and-forget")
- Production impact ("OOM after 22,543 uploads")
- Specific fix with reasoning
Performance Bottleneck
You: "My API responses are slow, can you profile it?"
Claude will:
1. Start CPU profiling
2. Exercise the slow endpoint
3. Identify hot functions
4. Analyze algorithm complexity
5. Generate REPORT.md with:
- Performance measurements (2.5s ā 0.02s)
- Hot path analysis
- Algorithm complexity comparison (O(n²) ā O(n log n))
- Optimized implementation
- Speedup projection (~100x)
Race Condition / Async Bug
You: "Sometimes my async operations complete in wrong order"
Claude will:
1. Set breakpoints at async boundaries
2. Trace execution flow
3. Check for missing awaits
4. Identify the race condition
5. Generate REPORT.md with fix and synchronization strategy
š Output Artifacts
Every investigation generates output in a directory of your choice (commonly investigation_output/):
REPORT.md- Main investigation report (Markdown)baseline.heapsnapshot- Heap before (for memory issues)after.heapsnapshot- Heap after (for memory issues)profile.cpuprofile- CPU profile data (for performance issues)flamegraph.html- Interactive flamegraph visualization (optional)investigation.json- Breadcrumb timeline (if used)
Example Report Structure
# Investigation Report
**Date**: 2025-11-08
**Issue**: Memory leak in file upload handler
## Summary
Upload handler retains ArrayBuffer objects in global array without cleanup.
## Root Cause
The `handleUpload()` function pushes buffers to `leakedBuffers[]` but never
removes them. Each upload adds ~47 KB that persists for the app lifetime.
## Details
[Code snippet showing the bug with context]
[Anti-pattern explanation]
[Production impact: "OOM after 22,543 uploads (~225 hours)"]
## Location
- File: `app.ts`
- Line: 22
- Function: `handleUpload()`
## Fix
[Optimized code with clear reasoning]
[Why this solution works]
## Data
- Growth: 47 KB per upload
- Projected OOM: After ~22,543 uploads
šļø Architecture
deno-debug-skill/
āāā deno-debugger/ # The actual skill (copy this to ~/.claude/skills/)
ā āāā SKILL.md # Instructions Claude reads (workflow + patterns)
ā āāā README.md # Installation guide (for users)
ā āāā deno.json # Deno configuration with tasks
ā āāā scripts/ # Pre-written debugging infrastructure (TypeScript)
ā āāā cdp_client.ts # Chrome DevTools Protocol client
ā āāā heap_analyzer.ts # Heap snapshot parsing (fast mode for 900MB heaps)
ā āāā cpu_profiler.ts # CPU profiling with O(n²) detection & flamegraphs
ā āāā concurrent_helper.ts # Race condition testing utilities
ā āāā breadcrumbs.ts # Investigation tracking (optional)
ā āāā report_gen.ts # Markdown report generation
ā āāā types.ts # V8 and CDP type definitions
ā āāā deps.ts # Deno stdlib dependencies
ā
āāā examples/
...
Publisher
Statistics
Stars2
Forks0
Open Issues0
CreatedNov 7, 2025