moai-adk 0.4.4__py3-none-any.whl → 0.4.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of moai-adk might be problematic. Click here for more details.
- moai_adk/__init__.py +1 -1
- moai_adk/core/project/initializer.py +12 -5
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +829 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/SKILL.md +78 -77
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-code-reviewer/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/SKILL.md +87 -77
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-debugger-pro/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +76 -66
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/SKILL.md +86 -59
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-git-workflow/reference.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +87 -73
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/SKILL.md +87 -79
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-performance-optimizer/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/SKILL.md +87 -71
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-refactoring-coach/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/SKILL.md +78 -62
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-spec-metadata-validation/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/SKILL.md +78 -55
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-tag-scanning/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/SKILL.md +78 -64
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-alfred-trust-validation/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/SKILL.md +604 -56
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/examples.md +974 -44
- moai_adk/templates/.claude/skills/moai-alfred-tui-survey/reference.md +801 -0
- moai_adk/templates/.claude/skills/moai-claude-code/SKILL.md +88 -61
- moai_adk/templates/.claude/skills/moai-claude-code/examples.md +16 -500
- moai_adk/templates/.claude/skills/moai-claude-code/reference.md +15 -420
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +234 -43
- moai_adk/templates/.claude/skills/moai-domain-backend/examples.md +1633 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/reference.md +660 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/SKILL.md +97 -69
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-cli-tool/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/SKILL.md +97 -72
- moai_adk/templates/.claude/skills/moai-domain-data-science/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-data-science/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-database/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-domain-database/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-database/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-domain-devops/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-devops/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-domain-frontend/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-frontend/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-domain-ml/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-ml/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/SKILL.md +97 -67
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-mobile-app/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-security/SKILL.md +97 -79
- moai_adk/templates/.claude/skills/moai-domain-security/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-security/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/SKILL.md +97 -71
- moai_adk/templates/.claude/skills/moai-domain-web-api/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-domain-web-api/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/SKILL.md +656 -60
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1107 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1533 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +87 -78
- moai_adk/templates/.claude/skills/moai-essentials-perf/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/SKILL.md +87 -70
- moai_adk/templates/.claude/skills/moai-essentials-refactor/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-refactor/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/SKILL.md +87 -86
- moai_adk/templates/.claude/skills/moai-essentials-review/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-essentials-review/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/SKILL.md +77 -62
- moai_adk/templates/.claude/skills/moai-foundation-ears/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-ears/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/SKILL.md +88 -56
- moai_adk/templates/.claude/skills/moai-foundation-git/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-git/reference.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/SKILL.md +90 -71
- moai_adk/templates/.claude/skills/moai-foundation-langs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-langs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/SKILL.md +78 -58
- moai_adk/templates/.claude/skills/moai-foundation-specs/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-specs/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/SKILL.md +78 -51
- moai_adk/templates/.claude/skills/moai-foundation-tags/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-foundation-tags/reference.md +28 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/SKILL.md +253 -32
- moai_adk/templates/.claude/skills/moai-foundation-trust/examples.md +0 -0
- moai_adk/templates/.claude/skills/moai-foundation-trust/reference.md +1099 -0
- moai_adk/templates/.claude/skills/moai-lang-c/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-c/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-c/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-clojure/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-clojure/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/SKILL.md +98 -76
- moai_adk/templates/.claude/skills/moai-lang-cpp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-cpp/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-csharp/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-csharp/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-dart/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-dart/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-elixir/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-elixir/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-go/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-go/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-go/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-haskell/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-haskell/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-java/SKILL.md +87 -61
- moai_adk/templates/.claude/skills/moai-lang-java/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-java/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/SKILL.md +88 -59
- moai_adk/templates/.claude/skills/moai-lang-javascript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-javascript/reference.md +32 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-julia/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-julia/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-kotlin/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-kotlin/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-lua/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-lua/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-php/SKILL.md +86 -61
- moai_adk/templates/.claude/skills/moai-lang-php/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-php/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-python/SKILL.md +388 -53
- moai_adk/templates/.claude/skills/moai-lang-python/examples.md +624 -0
- moai_adk/templates/.claude/skills/moai-lang-python/reference.md +316 -0
- moai_adk/templates/.claude/skills/moai-lang-r/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-lang-r/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-r/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/SKILL.md +98 -73
- moai_adk/templates/.claude/skills/moai-lang-ruby/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-ruby/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-rust/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-rust/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-scala/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-scala/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/SKILL.md +97 -74
- moai_adk/templates/.claude/skills/moai-lang-shell/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-shell/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/SKILL.md +98 -74
- moai_adk/templates/.claude/skills/moai-lang-sql/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-sql/reference.md +31 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/SKILL.md +97 -73
- moai_adk/templates/.claude/skills/moai-lang-swift/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-swift/reference.md +30 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/SKILL.md +90 -59
- moai_adk/templates/.claude/skills/moai-lang-typescript/examples.md +29 -0
- moai_adk/templates/.claude/skills/moai-lang-typescript/reference.md +34 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/CHECKLIST.md +482 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/EXAMPLES.md +52 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/INTERACTIVE-DISCOVERY.md +524 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/METADATA.md +477 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-UPDATE-ADVISOR.md +577 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL.md +560 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/STRUCTURE.md +583 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/WEB-RESEARCH.md +526 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/reference.md +69 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/scripts/generate-structure.sh +328 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/scripts/validate-skill.sh +312 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/SKILL_TEMPLATE.md +245 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/examples-template.md +285 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/reference-template.md +278 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/templates/scripts-template.sh +303 -0
- moai_adk/templates/CLAUDE.md +43 -11
- moai_adk-0.4.7.dist-info/METADATA +1162 -0
- moai_adk-0.4.7.dist-info/RECORD +275 -0
- moai_adk-0.4.4.dist-info/METADATA +0 -369
- moai_adk-0.4.4.dist-info/RECORD +0 -152
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/WHEEL +0 -0
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.4.4.dist-info → moai_adk-0.4.7.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
2
|
name: moai-essentials-debug
|
|
4
3
|
description: Advanced debugging with stack trace analysis, error pattern detection, and fix suggestions. Use when delivering quick diagnostic support for everyday issues.
|
|
5
4
|
allowed-tools:
|
|
@@ -10,93 +9,690 @@ allowed-tools:
|
|
|
10
9
|
- TodoWrite
|
|
11
10
|
---
|
|
12
11
|
|
|
13
|
-
#
|
|
12
|
+
# MoAI Essentials Debug v2.0
|
|
14
13
|
|
|
15
14
|
## Skill Metadata
|
|
16
15
|
| Field | Value |
|
|
17
16
|
| ----- | ----- |
|
|
18
|
-
|
|
|
17
|
+
| Version | 2.0.0 |
|
|
18
|
+
| Created | 2025-10-22 |
|
|
19
|
+
| Last Updated | 2025-10-22 |
|
|
20
|
+
| Language Coverage | 23 languages + containers + distributed systems |
|
|
21
|
+
| Allowed tools | Read, Write, Edit, Bash, TodoWrite |
|
|
19
22
|
| Auto-load | On demand during Run stage (debug-helper) |
|
|
20
|
-
| Trigger cues | Runtime error triage, stack trace analysis, root cause investigation requests
|
|
23
|
+
| Trigger cues | Runtime error triage, stack trace analysis, root cause investigation requests |
|
|
21
24
|
|
|
22
25
|
## What it does
|
|
23
26
|
|
|
24
|
-
|
|
27
|
+
Comprehensive debugging support across all 23 MoAI-ADK languages with:
|
|
28
|
+
- Language-specific debugger integration
|
|
29
|
+
- Stack trace analysis and error pattern detection
|
|
30
|
+
- Container and Kubernetes debugging
|
|
31
|
+
- Distributed tracing with OpenTelemetry
|
|
32
|
+
- Cloud debugger integration (AWS X-Ray, GCP Cloud Debugger)
|
|
33
|
+
- Performance profiling with Prometheus
|
|
25
34
|
|
|
26
35
|
## When to use
|
|
27
36
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
37
|
+
- Runtime errors, exceptions, crashes
|
|
38
|
+
- Stack trace analysis requests
|
|
39
|
+
- "Why is this failing?", "Debug this error"
|
|
40
|
+
- Container/K8s debugging scenarios
|
|
41
|
+
- Distributed system tracing
|
|
42
|
+
- Performance bottleneck investigation
|
|
43
|
+
- Automatically invoked via debug-helper sub-agent
|
|
44
|
+
|
|
45
|
+
## Debugger Matrix (23 Languages)
|
|
46
|
+
|
|
47
|
+
### Systems Programming
|
|
48
|
+
|
|
49
|
+
#### C
|
|
50
|
+
- **Primary**: `gdb` (GNU Debugger 14.x)
|
|
51
|
+
- **Alternative**: `lldb` (LLVM 17.x)
|
|
52
|
+
- **VSCode**: C/C++ Extension (ms-vscode.cpptools)
|
|
53
|
+
- **CLI**: `gdb ./program`, `break main`, `run`, `bt`, `print var`
|
|
54
|
+
|
|
55
|
+
#### C++
|
|
56
|
+
- **Primary**: `gdb` 14.x with C++23 support
|
|
57
|
+
- **Alternative**: `lldb` 17.x
|
|
58
|
+
- **GUI**: CLion Debugger, VS Code C++ extension
|
|
59
|
+
- **CLI**: `gdb --args ./app arg1 arg2`
|
|
60
|
+
- **Tools**: AddressSanitizer, Valgrind 3.22
|
|
61
|
+
|
|
62
|
+
#### Rust
|
|
63
|
+
- **Primary**: `rust-lldb` (shipped with rustup)
|
|
64
|
+
- **Alternative**: `rust-gdb`, CodeLLDB (VS Code)
|
|
65
|
+
- **CLI**: `rust-gdb target/debug/myapp`
|
|
66
|
+
- **Panic traces**: `RUST_BACKTRACE=1 cargo run`
|
|
67
|
+
- **Tools**: `rust-analyzer` debugger integration
|
|
68
|
+
|
|
69
|
+
#### Go
|
|
70
|
+
- **Primary**: Delve 1.22.x (`dlv`)
|
|
71
|
+
- **VSCode**: Go Extension (golang.go) with Delve
|
|
72
|
+
- **CLI**: `dlv debug`, `dlv test`, `dlv attach <pid>`
|
|
73
|
+
- **Remote**: `dlv debug --headless --listen=:2345`
|
|
74
|
+
- **Goroutine debugging**: `goroutines`, `goroutine <id>`
|
|
75
|
+
|
|
76
|
+
### JVM Ecosystem
|
|
77
|
+
|
|
78
|
+
#### Java
|
|
79
|
+
- **Primary**: `jdb` (built-in with JDK)
|
|
80
|
+
- **IDE**: IntelliJ IDEA Debugger, Eclipse Debugger
|
|
81
|
+
- **Remote**: `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005`
|
|
82
|
+
- **CLI**: `jdb -attach 5005`
|
|
83
|
+
- **Tools**: VisualVM, JProfiler, Java Flight Recorder
|
|
84
|
+
|
|
85
|
+
#### Kotlin
|
|
86
|
+
- **Primary**: IntelliJ IDEA Kotlin Debugger
|
|
87
|
+
- **Coroutines**: Enable "Async stack traces" in IDE
|
|
88
|
+
- **CLI**: Same as Java (`jdb` with Kotlin bytecode)
|
|
89
|
+
- **Tools**: Kotlin Coroutines Debugger, Android Studio profiler
|
|
90
|
+
|
|
91
|
+
#### Scala
|
|
92
|
+
- **Primary**: IntelliJ IDEA Scala Plugin debugger
|
|
93
|
+
- **sbt**: `sbt -jvm-debug 5005`
|
|
94
|
+
- **Remote**: Same JDWP protocol as Java
|
|
95
|
+
- **Tools**: Metals language server debugging
|
|
96
|
+
|
|
97
|
+
#### Clojure
|
|
98
|
+
- **Primary**: CIDER debugger (Emacs), Cursive (IntelliJ)
|
|
99
|
+
- **REPL-based**: `(clojure.tools.trace/trace-ns 'my-ns)`
|
|
100
|
+
- **CLI**: Leiningen with `jdb` attachment
|
|
101
|
+
- **Tools**: `clojure.tools.logging`, `timbre` logging
|
|
102
|
+
|
|
103
|
+
### Scripting Languages
|
|
104
|
+
|
|
105
|
+
#### Python
|
|
106
|
+
- **Primary**: `pdb` (built-in), `debugpy` 1.8.0
|
|
107
|
+
- **Enhanced**: `pudb` 2024.1 (TUI), `ipdb` (IPython)
|
|
108
|
+
- **VSCode**: Python Extension with debugpy
|
|
109
|
+
- **CLI**: `python -m pdb script.py`
|
|
110
|
+
- **Async**: `await` stepping, asyncio task inspection
|
|
111
|
+
- **Remote**: `debugpy.listen(5678)`, `debugpy.wait_for_client()`
|
|
112
|
+
|
|
113
|
+
#### Ruby
|
|
114
|
+
- **Primary**: `debug` gem (Ruby 3.2+ built-in)
|
|
115
|
+
- **Alternative**: `byebug`, `pry-byebug`
|
|
116
|
+
- **VSCode**: Ruby LSP + debug gem
|
|
117
|
+
- **CLI**: `ruby -r debug script.rb`
|
|
118
|
+
- **Rails**: `binding.break` in views/controllers
|
|
119
|
+
|
|
120
|
+
#### PHP
|
|
121
|
+
- **Primary**: Xdebug 3.3.x
|
|
122
|
+
- **Alternative**: `phpdbg` (built-in CLI)
|
|
123
|
+
- **VSCode**: PHP Debug Extension (xdebug.php-debug)
|
|
124
|
+
- **CLI**: `php -dxdebug.mode=debug -dxdebug.start_with_request=yes script.php`
|
|
125
|
+
- **Laravel**: Laravel Debugbar, Telescope
|
|
126
|
+
|
|
127
|
+
#### Lua
|
|
128
|
+
- **Primary**: ZeroBrane Studio debugger
|
|
129
|
+
- **Alternative**: MobDebug, lua-debug (VS Code)
|
|
130
|
+
- **CLI**: `luadebug` module
|
|
131
|
+
- **Tools**: LuaRocks debug packages
|
|
132
|
+
|
|
133
|
+
#### Shell (Bash)
|
|
134
|
+
- **Primary**: `bash -x script.sh` (trace mode)
|
|
135
|
+
- **Interactive**: `set -x`, `set +x` toggle
|
|
136
|
+
- **VSCode**: Bash Debug Extension
|
|
137
|
+
- **Tools**: ShellCheck 0.9.x for static analysis
|
|
138
|
+
- **Trace**: `PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'`
|
|
139
|
+
|
|
140
|
+
### Web & Mobile
|
|
141
|
+
|
|
142
|
+
#### JavaScript
|
|
143
|
+
- **Primary**: Chrome DevTools, Node.js `inspect`
|
|
144
|
+
- **VSCode**: Built-in JavaScript Debugger
|
|
145
|
+
- **CLI**: `node --inspect script.js`, `node --inspect-brk script.js`
|
|
146
|
+
- **Browser**: `debugger;` statement, breakpoints in DevTools
|
|
147
|
+
- **Async**: Async stack traces in Chrome DevTools
|
|
148
|
+
|
|
149
|
+
#### TypeScript
|
|
150
|
+
- **Primary**: Chrome DevTools (via source maps), VS Code TS Debugger
|
|
151
|
+
- **CLI**: `node --inspect -r ts-node/register script.ts`
|
|
152
|
+
- **Source Maps**: Ensure `"sourceMap": true` in `tsconfig.json`
|
|
153
|
+
- **VSCode**: Auto-attaches to Node.js processes
|
|
154
|
+
|
|
155
|
+
#### Dart/Flutter
|
|
156
|
+
- **Primary**: Flutter DevTools, VS Code Dart extension
|
|
157
|
+
- **CLI**: `flutter run --observe`, `dart run --observe`
|
|
158
|
+
- **Hot reload**: `r` (reload), `R` (hot restart)
|
|
159
|
+
- **Observatory**: `http://localhost:port/` for VM profiling
|
|
160
|
+
|
|
161
|
+
#### Swift
|
|
162
|
+
- **Primary**: LLDB (Xcode integrated)
|
|
163
|
+
- **CLI**: `lldb ./MyApp`
|
|
164
|
+
- **Xcode**: Breakpoints, memory graph debugger
|
|
165
|
+
- **SwiftUI**: View hierarchy debugger
|
|
166
|
+
- **Tools**: Instruments for performance profiling
|
|
167
|
+
|
|
168
|
+
### Functional & Concurrency
|
|
169
|
+
|
|
170
|
+
#### Haskell
|
|
171
|
+
- **Primary**: GHCi debugger (`:break`, `:step`, `:trace`)
|
|
172
|
+
- **CLI**: `ghci -fbreak-on-exception script.hs`
|
|
173
|
+
- **Tools**: `Debug.Trace` module, `eventlog2html`
|
|
174
|
+
- **Profiling**: `ghc -prof -fprof-auto`, `hp2ps`
|
|
175
|
+
|
|
176
|
+
#### Elixir
|
|
177
|
+
- **Primary**: IEx debugger (`:debugger.start()`)
|
|
178
|
+
- **Observer**: `:observer.start()` for live system inspection
|
|
179
|
+
- **Tools**: `:sys.trace/2`, `:sys.get_status/1`
|
|
180
|
+
- **Phoenix**: Phoenix LiveDashboard for web apps
|
|
181
|
+
|
|
182
|
+
#### Julia
|
|
183
|
+
- **Primary**: Debugger.jl, Infiltrator.jl
|
|
184
|
+
- **CLI**: `using Debugger; @enter myfunction(args)`
|
|
185
|
+
- **VSCode**: Julia Extension with debug support
|
|
186
|
+
- **Profiling**: `@profile`, ProfileView.jl
|
|
187
|
+
|
|
188
|
+
#### R
|
|
189
|
+
- **Primary**: `browser()`, `debug()`, `debugonce()`
|
|
190
|
+
- **RStudio**: Built-in debugger with breakpoints
|
|
191
|
+
- **CLI**: `traceback()`, `recover()`
|
|
192
|
+
- **Tools**: `profvis` for profiling
|
|
193
|
+
|
|
194
|
+
### Enterprise & Data
|
|
195
|
+
|
|
196
|
+
#### C#
|
|
197
|
+
- **Primary**: Visual Studio Debugger, Rider
|
|
198
|
+
- **CLI**: `dotnet run` with VS Code C# extension
|
|
199
|
+
- **Remote**: `vsdbg` for Linux/macOS
|
|
200
|
+
- **Tools**: PerfView, dotTrace, WinDbg
|
|
201
|
+
- **Async**: Async call stack inspection
|
|
32
202
|
|
|
33
|
-
|
|
203
|
+
#### SQL
|
|
204
|
+
- **PostgreSQL**: `\set VERBOSITY verbose`, EXPLAIN ANALYZE
|
|
205
|
+
- **MySQL**: `SHOW WARNINGS`, slow query log
|
|
206
|
+
- **Tools**: pgAdmin debugger, MySQL Workbench
|
|
207
|
+
- **Profiling**: `pg_stat_statements`, Performance Schema
|
|
208
|
+
|
|
209
|
+
## Container & Kubernetes Debugging
|
|
210
|
+
|
|
211
|
+
### Docker Debugging
|
|
212
|
+
```bash
|
|
213
|
+
# Attach to running container
|
|
214
|
+
docker exec -it <container> /bin/sh
|
|
215
|
+
|
|
216
|
+
# Debug with debugger ports exposed
|
|
217
|
+
docker run -p 5005:5005 -e JAVA_TOOL_OPTIONS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005' myapp
|
|
218
|
+
|
|
219
|
+
# Python remote debugging
|
|
220
|
+
docker run -p 5678:5678 -e DEBUGPY_ENABLE=true myapp
|
|
221
|
+
|
|
222
|
+
# View logs with timestamps
|
|
223
|
+
docker logs --timestamps --follow <container>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Kubernetes Debugging
|
|
227
|
+
```bash
|
|
228
|
+
# Port-forward debugger port
|
|
229
|
+
kubectl port-forward pod/myapp-pod 5005:5005
|
|
230
|
+
|
|
231
|
+
# Exec into pod
|
|
232
|
+
kubectl exec -it myapp-pod -- /bin/bash
|
|
233
|
+
|
|
234
|
+
# Debug with ephemeral container (K8s 1.23+)
|
|
235
|
+
kubectl debug -it myapp-pod --image=busybox --target=myapp
|
|
236
|
+
|
|
237
|
+
# Stream logs
|
|
238
|
+
kubectl logs -f deployment/myapp --all-containers=true
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Debug Container Images
|
|
242
|
+
- **Distroless debugging**: Use `gcr.io/distroless/base:debug` variants
|
|
243
|
+
- **Scratch debugging**: `kubectl debug` with busybox/alpine
|
|
244
|
+
|
|
245
|
+
## Distributed Tracing & Observability
|
|
246
|
+
|
|
247
|
+
### OpenTelemetry 1.24.0+
|
|
248
|
+
```python
|
|
249
|
+
# Python instrumentation
|
|
250
|
+
from opentelemetry import trace
|
|
251
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
252
|
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
253
|
+
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
|
|
254
|
+
|
|
255
|
+
provider = TracerProvider()
|
|
256
|
+
processor = BatchSpanProcessor(OTLPSpanExporter(endpoint="http://localhost:4317"))
|
|
257
|
+
provider.add_span_processor(processor)
|
|
258
|
+
trace.set_tracer_provider(provider)
|
|
259
|
+
|
|
260
|
+
tracer = trace.get_tracer(__name__)
|
|
261
|
+
with tracer.start_as_current_span("operation"):
|
|
262
|
+
# Your code here
|
|
263
|
+
pass
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
```typescript
|
|
267
|
+
// TypeScript instrumentation
|
|
268
|
+
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
|
|
269
|
+
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
270
|
+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
|
271
|
+
|
|
272
|
+
const provider = new NodeTracerProvider();
|
|
273
|
+
provider.addSpanProcessor(new BatchSpanProcessor(new OTLPTraceExporter()));
|
|
274
|
+
provider.register();
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Prometheus 2.48.x Integration
|
|
278
|
+
```yaml
|
|
279
|
+
# Scrape config
|
|
280
|
+
scrape_configs:
|
|
281
|
+
- job_name: 'my-app'
|
|
282
|
+
static_configs:
|
|
283
|
+
- targets: ['localhost:9090']
|
|
284
|
+
metrics_path: '/metrics'
|
|
285
|
+
scrape_interval: 15s
|
|
286
|
+
```
|
|
34
287
|
|
|
35
|
-
**Stack Trace Analysis**:
|
|
36
288
|
```python
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
289
|
+
# Python metrics (prometheus-client 0.19.0)
|
|
290
|
+
from prometheus_client import Counter, Histogram, start_http_server
|
|
291
|
+
|
|
292
|
+
request_count = Counter('app_requests_total', 'Total requests')
|
|
293
|
+
request_duration = Histogram('app_request_duration_seconds', 'Request duration')
|
|
294
|
+
|
|
295
|
+
@request_duration.time()
|
|
296
|
+
def handle_request():
|
|
297
|
+
request_count.inc()
|
|
298
|
+
# Handle request
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Cloud Debuggers
|
|
302
|
+
|
|
303
|
+
#### AWS X-Ray
|
|
304
|
+
```python
|
|
305
|
+
from aws_xray_sdk.core import xray_recorder
|
|
306
|
+
from aws_xray_sdk.core import patch_all
|
|
307
|
+
|
|
308
|
+
patch_all() # Auto-instrument AWS SDK calls
|
|
309
|
+
|
|
310
|
+
@xray_recorder.capture('my_function')
|
|
311
|
+
def my_function():
|
|
312
|
+
pass
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
#### GCP Cloud Debugger
|
|
316
|
+
```python
|
|
317
|
+
try:
|
|
318
|
+
import googleclouddebugger
|
|
319
|
+
googleclouddebugger.enable(
|
|
320
|
+
module='myapp',
|
|
321
|
+
version='v1.0'
|
|
322
|
+
)
|
|
323
|
+
except ImportError:
|
|
324
|
+
pass # Not available in dev environment
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## Stack Trace Analysis Patterns
|
|
328
|
+
|
|
329
|
+
### Python
|
|
330
|
+
```python
|
|
331
|
+
# Traceback example
|
|
332
|
+
Traceback (most recent call last):
|
|
333
|
+
File "app.py", line 42, in process_data
|
|
334
|
+
result = data['missing_key']
|
|
335
|
+
KeyError: 'missing_key'
|
|
336
|
+
|
|
337
|
+
# Analysis
|
|
338
|
+
📍 Location: app.py:42 in process_data()
|
|
339
|
+
🔍 Root Cause: Accessing dictionary key without validation
|
|
340
|
+
💡 Fix Suggestions:
|
|
341
|
+
1. Use data.get('missing_key', default_value)
|
|
342
|
+
2. Add key existence check: if 'missing_key' in data
|
|
343
|
+
3. Use try-except for KeyError handling
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### TypeScript/JavaScript
|
|
347
|
+
```typescript
|
|
348
|
+
// Error example
|
|
349
|
+
TypeError: Cannot read properties of undefined (reading 'name')
|
|
350
|
+
at getUserName (user.service.ts:15:23)
|
|
351
|
+
at processUser (user.controller.ts:42:10)
|
|
352
|
+
|
|
353
|
+
// Analysis
|
|
354
|
+
📍 Location: user.service.ts:15 in getUserName()
|
|
355
|
+
🔍 Root Cause: Object is undefined before property access
|
|
356
|
+
💡 Fix Suggestions:
|
|
357
|
+
1. Add null check: user?.name
|
|
358
|
+
2. Type guard: if (user && 'name' in user)
|
|
359
|
+
3. Use optional chaining throughout call chain
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
### Java
|
|
363
|
+
```java
|
|
364
|
+
// Exception example
|
|
365
|
+
java.lang.NullPointerException: Cannot invoke "String.length()" because "text" is null
|
|
366
|
+
at com.example.TextProcessor.process(TextProcessor.java:23)
|
|
367
|
+
at com.example.Main.main(Main.java:15)
|
|
368
|
+
|
|
369
|
+
// Analysis
|
|
370
|
+
📍 Location: TextProcessor.java:23 in process()
|
|
371
|
+
🔍 Root Cause: Null reference passed to method
|
|
372
|
+
💡 Fix Suggestions:
|
|
373
|
+
1. Use Optional<String> parameter type
|
|
374
|
+
2. Add Objects.requireNonNull(text) guard
|
|
375
|
+
3. Add @NonNull annotation with null-checking framework
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Go
|
|
379
|
+
```go
|
|
380
|
+
// Panic example
|
|
381
|
+
panic: runtime error: invalid memory address or nil pointer dereference
|
|
382
|
+
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x10a4b20]
|
|
383
|
+
|
|
384
|
+
goroutine 1 [running]:
|
|
385
|
+
main.processData(0x0)
|
|
386
|
+
/app/main.go:42 +0x20
|
|
387
|
+
main.main()
|
|
388
|
+
/app/main.go:15 +0x40
|
|
389
|
+
|
|
390
|
+
// Analysis
|
|
391
|
+
📍 Location: main.go:42 in processData()
|
|
392
|
+
🔍 Root Cause: Nil pointer dereference
|
|
393
|
+
💡 Fix Suggestions:
|
|
394
|
+
1. Add nil check: if data != nil { ... }
|
|
395
|
+
2. Initialize pointer before use
|
|
396
|
+
3. Use defensive programming with early returns
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Rust
|
|
400
|
+
```rust
|
|
401
|
+
// Panic example
|
|
402
|
+
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/main.rs:42:23
|
|
403
|
+
stack backtrace:
|
|
404
|
+
0: rust_begin_unwind
|
|
405
|
+
1: core::panicking::panic_fmt
|
|
406
|
+
2: myapp::process_data
|
|
407
|
+
at ./src/main.rs:42
|
|
408
|
+
|
|
409
|
+
// Analysis
|
|
410
|
+
📍 Location: src/main.rs:42 in process_data()
|
|
411
|
+
🔍 Root Cause: Unwrapping None Option without checking
|
|
412
|
+
💡 Fix Suggestions:
|
|
413
|
+
1. Use match expression: match opt { Some(v) => ..., None => ... }
|
|
414
|
+
2. Use if let: if let Some(v) = opt { ... }
|
|
415
|
+
3. Use .unwrap_or(default) or .unwrap_or_else(|| ...)
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
## Common Error Patterns by Language
|
|
419
|
+
|
|
420
|
+
### Memory Safety
|
|
421
|
+
- **C/C++**: Buffer overflow, use-after-free, memory leaks
|
|
422
|
+
- Tools: Valgrind, AddressSanitizer (`-fsanitize=address`)
|
|
423
|
+
- **Rust**: Ownership violations (prevented at compile time)
|
|
424
|
+
- **Go**: Goroutine leaks, improper channel usage
|
|
425
|
+
|
|
426
|
+
### Null/Nil Handling
|
|
427
|
+
- **Java**: NullPointerException → Use Optional<T>
|
|
428
|
+
- **Kotlin**: NullPointerException → Leverage null safety (?.)
|
|
429
|
+
- **TypeScript**: undefined access → Optional chaining (?.)
|
|
430
|
+
- **Go**: Nil pointer → Early nil checks
|
|
431
|
+
- **Rust**: Option<T> unwrap → Pattern matching
|
|
432
|
+
|
|
433
|
+
### Type Errors
|
|
434
|
+
- **Python**: TypeError, AttributeError → Type hints + mypy
|
|
435
|
+
- **JavaScript**: Type coercion bugs → Use TypeScript
|
|
436
|
+
- **Ruby**: NoMethodError → Duck typing checks
|
|
437
|
+
|
|
438
|
+
### Concurrency Issues
|
|
439
|
+
- **Go**: Data races → `go build -race`, proper channel usage
|
|
440
|
+
- **Java**: ConcurrentModificationException → Use concurrent collections
|
|
441
|
+
- **Rust**: Data races (prevented by borrow checker)
|
|
442
|
+
- **Python**: GIL limitations → Use multiprocessing for CPU-bound tasks
|
|
443
|
+
|
|
444
|
+
### Async/Await Pitfalls
|
|
445
|
+
- **Python**: `RuntimeError: Event loop is closed` → Proper asyncio usage
|
|
446
|
+
- **JavaScript**: Unhandled promise rejections → Always catch async errors
|
|
447
|
+
- **Rust**: Send/Sync trait violations → Understand thread safety
|
|
448
|
+
|
|
449
|
+
## Debugging Workflow
|
|
450
|
+
|
|
451
|
+
### 1. Reproduce
|
|
452
|
+
- [ ] Minimal reproducible example (MRE)
|
|
453
|
+
- [ ] Consistent reproduction steps
|
|
454
|
+
- [ ] Document environment (OS, language version, dependencies)
|
|
455
|
+
|
|
456
|
+
### 2. Isolate
|
|
457
|
+
- [ ] Binary search the code (comment out sections)
|
|
458
|
+
- [ ] Check recent changes (git diff, git log)
|
|
459
|
+
- [ ] Verify input data and edge cases
|
|
460
|
+
|
|
461
|
+
### 3. Investigate
|
|
462
|
+
- [ ] Read stack trace from bottom (entry point) to top (error site)
|
|
463
|
+
- [ ] Add logging at key decision points
|
|
464
|
+
- [ ] Use debugger breakpoints before error location
|
|
465
|
+
- [ ] Check variable state in debugger
|
|
466
|
+
|
|
467
|
+
### 4. Hypothesize
|
|
468
|
+
- [ ] Form theory about root cause
|
|
469
|
+
- [ ] Identify 2-3 most likely culprits
|
|
470
|
+
- [ ] Design experiment to test hypothesis
|
|
471
|
+
|
|
472
|
+
### 5. Fix
|
|
473
|
+
- [ ] Implement minimal fix first
|
|
474
|
+
- [ ] Add regression test (RED → GREEN)
|
|
475
|
+
- [ ] Refactor if needed (REFACTOR stage)
|
|
476
|
+
- [ ] Update documentation
|
|
477
|
+
|
|
478
|
+
### 6. Verify
|
|
479
|
+
- [ ] Run full test suite
|
|
480
|
+
- [ ] Test edge cases explicitly
|
|
481
|
+
- [ ] Verify fix in production-like environment
|
|
482
|
+
- [ ] Monitor for recurrence
|
|
483
|
+
|
|
484
|
+
## VSCode Launch Configuration Examples
|
|
485
|
+
|
|
486
|
+
### Python (debugpy)
|
|
487
|
+
```json
|
|
488
|
+
{
|
|
489
|
+
"version": "0.2.0",
|
|
490
|
+
"configurations": [
|
|
491
|
+
{
|
|
492
|
+
"name": "Python: Current File",
|
|
493
|
+
"type": "debugpy",
|
|
494
|
+
"request": "launch",
|
|
495
|
+
"program": "${file}",
|
|
496
|
+
"console": "integratedTerminal",
|
|
497
|
+
"justMyCode": false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"name": "Python: Remote Attach",
|
|
501
|
+
"type": "debugpy",
|
|
502
|
+
"request": "attach",
|
|
503
|
+
"connect": {
|
|
504
|
+
"host": "localhost",
|
|
505
|
+
"port": 5678
|
|
506
|
+
},
|
|
507
|
+
"pathMappings": [
|
|
508
|
+
{
|
|
509
|
+
"localRoot": "${workspaceFolder}",
|
|
510
|
+
"remoteRoot": "/app"
|
|
511
|
+
}
|
|
512
|
+
]
|
|
513
|
+
}
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
### Node.js/TypeScript
|
|
519
|
+
```json
|
|
520
|
+
{
|
|
521
|
+
"version": "0.2.0",
|
|
522
|
+
"configurations": [
|
|
523
|
+
{
|
|
524
|
+
"type": "node",
|
|
525
|
+
"request": "launch",
|
|
526
|
+
"name": "TypeScript: Current File",
|
|
527
|
+
"runtimeArgs": ["-r", "ts-node/register"],
|
|
528
|
+
"args": ["${file}"],
|
|
529
|
+
"cwd": "${workspaceFolder}",
|
|
530
|
+
"protocol": "inspector"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
"type": "node",
|
|
534
|
+
"request": "attach",
|
|
535
|
+
"name": "Attach to Remote",
|
|
536
|
+
"address": "localhost",
|
|
537
|
+
"port": 9229,
|
|
538
|
+
"localRoot": "${workspaceFolder}",
|
|
539
|
+
"remoteRoot": "/app"
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
}
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
### Go (Delve)
|
|
546
|
+
```json
|
|
547
|
+
{
|
|
548
|
+
"version": "0.2.0",
|
|
549
|
+
"configurations": [
|
|
550
|
+
{
|
|
551
|
+
"name": "Launch Package",
|
|
552
|
+
"type": "go",
|
|
553
|
+
"request": "launch",
|
|
554
|
+
"mode": "auto",
|
|
555
|
+
"program": "${workspaceFolder}"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"name": "Attach to Process",
|
|
559
|
+
"type": "go",
|
|
560
|
+
"request": "attach",
|
|
561
|
+
"mode": "local",
|
|
562
|
+
"processId": "${command:pickProcess}"
|
|
563
|
+
}
|
|
564
|
+
]
|
|
565
|
+
}
|
|
566
|
+
```
|
|
567
|
+
|
|
568
|
+
### Rust (CodeLLDB)
|
|
569
|
+
```json
|
|
570
|
+
{
|
|
571
|
+
"version": "0.2.0",
|
|
572
|
+
"configurations": [
|
|
573
|
+
{
|
|
574
|
+
"type": "lldb",
|
|
575
|
+
"request": "launch",
|
|
576
|
+
"name": "Debug executable",
|
|
577
|
+
"cargo": {
|
|
578
|
+
"args": ["build", "--bin=myapp", "--package=myapp"]
|
|
579
|
+
},
|
|
580
|
+
"args": [],
|
|
581
|
+
"cwd": "${workspaceFolder}"
|
|
582
|
+
}
|
|
583
|
+
]
|
|
584
|
+
}
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### Java
|
|
588
|
+
```json
|
|
589
|
+
{
|
|
590
|
+
"version": "0.2.0",
|
|
591
|
+
"configurations": [
|
|
592
|
+
{
|
|
593
|
+
"type": "java",
|
|
594
|
+
"name": "Debug (Launch)",
|
|
595
|
+
"request": "launch",
|
|
596
|
+
"mainClass": "com.example.Main"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
"type": "java",
|
|
600
|
+
"name": "Debug (Attach)",
|
|
601
|
+
"request": "attach",
|
|
602
|
+
"hostName": "localhost",
|
|
603
|
+
"port": 5005
|
|
604
|
+
}
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
## Performance Profiling Integration
|
|
610
|
+
|
|
611
|
+
### Python (cProfile + py-spy)
|
|
612
|
+
```bash
|
|
613
|
+
# CPU profiling
|
|
614
|
+
python -m cProfile -o output.prof script.py
|
|
615
|
+
python -m pstats output.prof
|
|
616
|
+
|
|
617
|
+
# Sampling profiler (production-safe)
|
|
618
|
+
py-spy top --pid <pid>
|
|
619
|
+
py-spy record -o profile.svg --pid <pid>
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
### Go (pprof)
|
|
623
|
+
```bash
|
|
624
|
+
# CPU profiling
|
|
625
|
+
go test -cpuprofile cpu.prof -bench .
|
|
626
|
+
go tool pprof cpu.prof
|
|
627
|
+
|
|
628
|
+
# Memory profiling
|
|
629
|
+
go test -memprofile mem.prof -bench .
|
|
630
|
+
go tool pprof mem.prof
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
### Rust (flamegraph)
|
|
634
|
+
```bash
|
|
635
|
+
cargo install flamegraph
|
|
636
|
+
cargo flamegraph --bin myapp
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
### Java (JFR)
|
|
640
|
+
```bash
|
|
641
|
+
# Start with JFR enabled
|
|
642
|
+
java -XX:StartFlightRecording=duration=60s,filename=recording.jfr -jar app.jar
|
|
643
|
+
|
|
644
|
+
# Analyze with JMC or jfr CLI
|
|
645
|
+
jfr print recording.jfr
|
|
72
646
|
```
|
|
73
647
|
|
|
74
648
|
## Inputs
|
|
75
|
-
-
|
|
76
|
-
-
|
|
649
|
+
- Stack traces, error messages, logs
|
|
650
|
+
- Code context (relevant files)
|
|
651
|
+
- Environment information (versions, config)
|
|
652
|
+
- Reproduction steps
|
|
77
653
|
|
|
78
654
|
## Outputs
|
|
79
|
-
-
|
|
80
|
-
-
|
|
655
|
+
- Root cause analysis with evidence
|
|
656
|
+
- Actionable fix suggestions (1-3 options)
|
|
657
|
+
- Debugging checklist tailored to error type
|
|
658
|
+
- Code snippets demonstrating fix
|
|
81
659
|
|
|
82
660
|
## Failure Modes
|
|
83
|
-
-
|
|
84
|
-
-
|
|
661
|
+
- Insufficient stack trace or log information
|
|
662
|
+
- Unable to reproduce error locally
|
|
663
|
+
- Complex distributed system failures requiring multi-service tracing
|
|
664
|
+
- Race conditions or timing-dependent bugs
|
|
85
665
|
|
|
86
666
|
## Dependencies
|
|
87
|
-
-
|
|
667
|
+
- Works with: tdd-implementer, debug-helper, quality-gate
|
|
668
|
+
- Requires: Language-specific debugger tools installed
|
|
669
|
+
- Optional: OpenTelemetry, Prometheus, cloud debugger SDKs
|
|
88
670
|
|
|
89
671
|
## References
|
|
90
|
-
-
|
|
91
|
-
-
|
|
672
|
+
- OpenTelemetry Documentation. https://opentelemetry.io/docs/ (accessed 2025-10-22)
|
|
673
|
+
- Prometheus Documentation. https://prometheus.io/docs/ (accessed 2025-10-22)
|
|
674
|
+
- Microsoft. "Debugging in Visual Studio Code." https://code.visualstudio.com/docs/editor/debugging (accessed 2025-10-22)
|
|
675
|
+
- JetBrains. "Debugging Code." https://www.jetbrains.com/help/idea/debugging-code.html (accessed 2025-10-22)
|
|
676
|
+
- AWS. "AWS X-Ray Developer Guide." https://docs.aws.amazon.com/xray/ (accessed 2025-10-22)
|
|
677
|
+
- Google Cloud. "Cloud Debugger Documentation." https://cloud.google.com/debugger/docs (accessed 2025-10-22)
|
|
678
|
+
- Delve Debugger Documentation. https://github.com/go-delve/delve (accessed 2025-10-22)
|
|
679
|
+
- Rust Debugging Documentation. https://doc.rust-lang.org/book/ch09-00-error-handling.html (accessed 2025-10-22)
|
|
92
680
|
|
|
93
681
|
## Changelog
|
|
94
|
-
- 2025-
|
|
682
|
+
- 2025-10-22: v2.0.0 - Complete rewrite with 23-language coverage, container debugging, distributed tracing, cloud debuggers
|
|
683
|
+
- 2025-03-29: v1.0.0 - Initial version with Python/TypeScript/Java support
|
|
95
684
|
|
|
96
685
|
## Works well with
|
|
97
|
-
|
|
98
|
-
- moai-essentials-
|
|
686
|
+
- moai-essentials-refactor (clean up code after debugging)
|
|
687
|
+
- moai-essentials-perf (performance bottleneck investigation)
|
|
688
|
+
- moai-alfred-debugger-pro (advanced debugging strategies)
|
|
689
|
+
- moai-foundation-trust (ensure debugging doesn't skip tests)
|
|
99
690
|
|
|
100
691
|
## Best Practices
|
|
101
|
-
-
|
|
102
|
-
-
|
|
692
|
+
- Always create regression test after fixing bug (TDD cycle)
|
|
693
|
+
- Log debugging insights in code comments with @TAG references
|
|
694
|
+
- Use language-appropriate debugger (don't force Python workflow on Go)
|
|
695
|
+
- Enable source maps for compiled/transpiled languages
|
|
696
|
+
- Set up distributed tracing early in microservices projects
|
|
697
|
+
- Use production-safe profilers (py-spy, async-profiler) in live systems
|
|
698
|
+
- Document reproduction steps in issue tracker or SPEC HISTORY
|