ワンクリックで
debug
Comprehensive debugging assistance with error analysis, log parsing, debugging strategies, and performance profiling
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Comprehensive debugging assistance with error analysis, log parsing, debugging strategies, and performance profiling
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Summarize and condense content effectively
Translate content between languages with context awareness
API testing best practices, tools, and workflows for RESTful API testing.
Code quality standards, metrics, and practices for maintaining clean, maintainable codebases.
Code review best practices, guidelines, and checklists for effective peer reviews.
Go debugging best practices, tools, and techniques for effective troubleshooting.
| name | debug |
| description | Comprehensive debugging assistance with error analysis, log parsing, debugging strategies, and performance profiling |
| version | 1.0.0 |
| author | go-magic |
| tags | ["debug","error-analysis","logging","profiling","troubleshooting"] |
| tools | ["read_file","file_search","analyze_error","suggest_fix","trace_execution"] |
Load this skill when:
Systematic error investigation:
Log analysis techniques:
Systematic debugging approaches:
Performance investigation:
| Severity | Description | Response Time |
|---|---|---|
| Critical | System down, data loss | Immediate |
| High | Major feature broken | < 1 hour |
| Medium | Feature degraded | < 4 hours |
| Low | Minor issue, workaround | < 24 hours |
Pattern: Cannot read property 'X' of undefined
Cause: Accessing property on null/undefined object
Fix: Add null checks or optional chaining
Pattern: TypeError: X is not a function
Cause: Calling non-function or wrong type
Fix: Validate types before operations
Pattern: Out of memory, connection timeout
Cause: Resource leaks or insufficient resources
Fix: Resource cleanup, pooling, scaling
Pattern: Intermittent failures, inconsistent state
Cause: Unsynchronized concurrent access
Fix: Proper locking, atomic operations
DEBUG: Detailed information for debugging
INFO: General operational information
WARN: Warning conditions that don't affect operation
ERROR: Error conditions that affect operation
FATAL: Severe errors causing termination
2024-01-15T10:30:00Z ERROR handler.go:42: failed to process request: connection timeout
Pattern: TIMESTAMP LEVEL FILE:LINE: MESSAGE
2024-01-15 10:30:00,000 - module.name - ERROR - failed to process request
Pattern: TIMESTAMP - LOGGER - LEVEL - MESSAGE
[2024-01-15T10:30:00.000Z] ERROR (app/12345): failed to process request
Pattern: [TIMESTAMP] LEVEL (CONTEXT): MESSAGE
Always include correlation IDs for distributed tracing:
request_id=abc123 user_id=456 method=GET path=/api/users
Describe the problem
Examine the context
Break down the problem
Understand the code
Generate hypotheses
[ ] Reproduce the issue consistently
[ ] Check recent code changes
[ ] Verify environment configuration
[ ] Review relevant logs
[ ] Check resource usage (CPU, memory, disk)
[ ] Verify network connectivity
[ ] Test with minimal data/config
[ ] Isolate to specific component
[ ] Check for race conditions
[ ] Verify error handling paths
# CPU profiling
go test -cpuprofile=cpu.prof -bench=.
go tool pprof cpu.prof
# Memory profiling
go test -memprofile=mem.prof -bench=.
go tool pprof mem.prof
# Trace
go test -trace=trace.out
# cProfile
python -m cProfile -o output.prof script.py
# line_profiler
kernprof -l -v script.py
# memory_profiler
python -m memory_profiler script.py
# Built-in profiler
node --prof script.js
node --prof-process isolate-0x*.log
# Clinic.js
clinic doctor -- node script.js
clinic flame -- node script.js
| Metric | Good | Warning | Critical |
|---|---|---|---|
| CPU Usage | < 70% | 70-85% | > 85% |
| Memory Usage | < 70% | 70-85% | > 85% |
| Response Time | < 200ms | 200-500ms | > 500ms |
| Error Rate | < 0.1% | 0.1-1% | > 1% |
Symptoms: Gradual memory increase, eventual OOM
Detection: Memory profiling, heap dumps
Causes: Unclosed resources, global caches, event listeners
Symptoms: High CPU usage, slow response times
Detection: CPU profiling, flame graphs
Causes: Inefficient algorithms, tight loops, regex
Symptoms: Waiting on external services, timeouts
Detection: I/O tracing, latency histograms
Causes: Synchronous I/O, missing caching, N+1 queries
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x123456]
goroutine 1 [running]:
main.processUser(0x0, 0xc000012345)
/app/main.go:42 +0x25
main.main()
/app/main.go:15 +0x45
Analysis:
1. Nil pointer dereference at main.go:42
2. processUser called with nil user
3. Check caller at main.go:15
4. Add nil check before calling processUser
Traceback (most recent call last):
File "/app/handler.py", line 42, in handle_request
result = process_data(data)
File "/app/processor.py", line 15, in process_data
return data['key'] / data['value']
ZeroDivisionError: division by zero
Analysis:
1. Division by zero in processor.py:15
2. data['value'] is 0
3. Add validation before division
4. Consider default value or error handling
TypeError: Cannot read property 'name' of undefined
at UserProfile.render (/app/components/UserProfile.jsx:25)
at processChild (/app/node_modules/react-dom/cjs/react-dom.development.js:1234)
Analysis:
1. Accessing .name on undefined object
2. User data not loaded when component renders
3. Add loading state or optional chaining: user?.name
4. Check data fetching logic
Parses error messages and stack traces to:
Analyzes code and errors to:
Traces program execution to: