moai-adk 0.11.0__py3-none-any.whl → 0.12.1__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/core/issue_creator.py +2 -2
- moai_adk/core/project/detector.py +285 -12
- moai_adk/templates/.claude/agents/alfred/cc-manager.md +316 -0
- moai_adk/templates/.claude/agents/alfred/debug-helper.md +208 -0
- moai_adk/templates/.claude/agents/alfred/doc-syncer.md +214 -0
- moai_adk/templates/.claude/agents/alfred/git-manager.md +406 -0
- moai_adk/templates/.claude/agents/alfred/implementation-planner.md +350 -0
- moai_adk/templates/.claude/agents/alfred/project-manager.md +273 -0
- moai_adk/templates/.claude/agents/alfred/quality-gate.md +343 -0
- moai_adk/templates/.claude/agents/alfred/skill-factory.md +865 -0
- moai_adk/templates/.claude/agents/alfred/spec-builder.md +287 -0
- moai_adk/templates/.claude/agents/alfred/tag-agent.md +287 -0
- moai_adk/templates/.claude/agents/alfred/tdd-implementer.md +326 -0
- moai_adk/templates/.claude/agents/alfred/trust-checker.md +375 -0
- moai_adk/templates/.claude/commands/alfred/0-project.md +1187 -0
- moai_adk/templates/.claude/commands/alfred/1-plan.md +734 -0
- moai_adk/templates/.claude/commands/alfred/2-run.md +551 -0
- moai_adk/templates/.claude/commands/alfred/3-sync.md +689 -0
- moai_adk/templates/.claude/commands/alfred/9-feedback.md +149 -0
- moai_adk/templates/.claude/hooks/alfred/alfred_hooks.py +208 -0
- moai_adk/templates/.claude/hooks/alfred/core/project.py +744 -0
- moai_adk/templates/.claude/hooks/alfred/core/timeout.py +136 -0
- moai_adk/templates/.claude/hooks/alfred/core/ttl_cache.py +109 -0
- moai_adk/templates/.claude/hooks/alfred/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/notification__handle_events.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/post_tool__log_changes.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/pre_tool__auto_checkpoint.py +100 -0
- moai_adk/templates/.claude/hooks/alfred/session_end__cleanup.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/session_start__show_project_info.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/__init__.py +170 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/checkpoint.py +271 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/context.py +67 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/project.py +749 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/tags.py +230 -0
- moai_adk/templates/.claude/hooks/alfred/shared/core/version_cache.py +198 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/__init__.py +21 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/notification.py +156 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/session.py +174 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/tool.py +87 -0
- moai_adk/templates/.claude/hooks/alfred/shared/handlers/user.py +61 -0
- moai_adk/templates/.claude/hooks/alfred/stop__handle_interrupt.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/subagent_stop__handle_subagent_end.py +94 -0
- moai_adk/templates/.claude/hooks/alfred/user_prompt__jit_load_docs.py +111 -0
- moai_adk/templates/.claude/hooks/alfred/utils/__init__.py +1 -0
- moai_adk/templates/.claude/hooks/alfred/utils/timeout.py +136 -0
- moai_adk/templates/.claude/output-styles/alfred/agentic-coding.md +640 -0
- moai_adk/templates/.claude/output-styles/alfred/moai-adk-learning.md +696 -0
- moai_adk/templates/.claude/output-styles/alfred/study-with-alfred.md +474 -0
- moai_adk/templates/.claude/settings.json +144 -0
- moai_adk/templates/.claude/skills/moai-alfred-ears-authoring/SKILL.md +113 -0
- 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 +122 -0
- 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-interactive-questions/SKILL.md +237 -0
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/examples.md +615 -0
- moai_adk/templates/.claude/skills/moai-alfred-interactive-questions/reference.md +653 -0
- moai_adk/templates/.claude/skills/moai-alfred-language-detection/SKILL.md +113 -0
- 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-spec-metadata-validation/SKILL.md +113 -0
- 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 +113 -0
- 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 +113 -0
- 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-cc-agents/SKILL.md +269 -0
- moai_adk/templates/.claude/skills/moai-cc-agents/templates/agent-template.md +32 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/SKILL.md +298 -0
- moai_adk/templates/.claude/skills/moai-cc-claude-md/templates/CLAUDE-template.md +26 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/SKILL.md +307 -0
- moai_adk/templates/.claude/skills/moai-cc-commands/templates/command-template.md +21 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/SKILL.md +252 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/pre-bash-check.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/preserve-permissions.sh +19 -0
- moai_adk/templates/.claude/skills/moai-cc-hooks/scripts/validate-bash-command.py +24 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/SKILL.md +199 -0
- moai_adk/templates/.claude/skills/moai-cc-mcp-plugins/templates/settings-mcp-template.json +39 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/SKILL.md +316 -0
- moai_adk/templates/.claude/skills/moai-cc-memory/templates/session-summary-template.md +18 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/SKILL.md +263 -0
- moai_adk/templates/.claude/skills/moai-cc-settings/templates/settings-complete-template.json +30 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/SKILL.md +291 -0
- moai_adk/templates/.claude/skills/moai-cc-skills/templates/SKILL-template.md +15 -0
- moai_adk/templates/.claude/skills/moai-domain-backend/SKILL.md +290 -0
- 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 +123 -0
- 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 +123 -0
- 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 +123 -0
- 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 +124 -0
- 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 +124 -0
- 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 +123 -0
- 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 +123 -0
- 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 +123 -0
- 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 +123 -0
- 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 +303 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/examples.md +1064 -0
- moai_adk/templates/.claude/skills/moai-essentials-debug/reference.md +1047 -0
- moai_adk/templates/.claude/skills/moai-essentials-perf/SKILL.md +113 -0
- 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 +113 -0
- 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 +113 -0
- 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 +116 -0
- 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 +122 -0
- 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 +113 -0
- 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 +113 -0
- 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 +113 -0
- 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 +307 -0
- 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 +124 -0
- 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-cpp/SKILL.md +124 -0
- 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 +123 -0
- 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 +123 -0
- 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-go/SKILL.md +124 -0
- 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-java/SKILL.md +124 -0
- 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 +125 -0
- 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-kotlin/SKILL.md +124 -0
- 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-php/SKILL.md +123 -0
- 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 +431 -0
- 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 +123 -0
- 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 +124 -0
- 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 +124 -0
- 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 +123 -0
- 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 +123 -0
- 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 +124 -0
- 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 +123 -0
- 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 +127 -0
- 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 +278 -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/PARALLEL-ANALYSIS-REPORT.md +429 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/PYTHON-VERSION-MATRIX.md +391 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/SKILL-FACTORY-WORKFLOW.md +431 -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 +271 -0
- moai_adk/templates/.claude/skills/moai-skill-factory/STEP-BY-STEP-GUIDE.md +466 -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 +465 -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/skills/moai-spec-authoring/README.md +137 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/SKILL.md +219 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples/validate-spec.sh +161 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/examples.md +541 -0
- moai_adk/templates/.claude/skills/moai-spec-authoring/reference.md +622 -0
- moai_adk/templates/.github/workflows/c-tag-validation.yml +83 -0
- moai_adk/templates/.github/workflows/cpp-tag-validation.yml +79 -0
- moai_adk/templates/.github/workflows/csharp-tag-validation.yml +65 -0
- moai_adk/templates/.github/workflows/dart-tag-validation.yml +82 -0
- moai_adk/templates/.github/workflows/java-tag-validation.yml +75 -0
- moai_adk/templates/.github/workflows/kotlin-tag-validation.yml +67 -0
- moai_adk/templates/.github/workflows/php-tag-validation.yml +56 -0
- moai_adk/templates/.github/workflows/ruby-tag-validation.yml +68 -0
- moai_adk/templates/.github/workflows/rust-tag-validation.yml +73 -0
- moai_adk/templates/.github/workflows/shell-tag-validation.yml +65 -0
- moai_adk/templates/.github/workflows/swift-tag-validation.yml +79 -0
- moai_adk/templates/.moai/config.json +113 -0
- moai_adk/templates/.moai/memory/CLAUDE-AGENTS-GUIDE.md +208 -0
- moai_adk/templates/.moai/memory/CLAUDE-PRACTICES.md +369 -0
- moai_adk/templates/.moai/memory/CLAUDE-RULES.md +539 -0
- moai_adk/templates/.moai/memory/DEVELOPMENT-GUIDE.md +344 -0
- moai_adk/templates/.moai/memory/GITFLOW-PROTECTION-POLICY.md +330 -0
- moai_adk/templates/.moai/memory/ISSUE-LABEL-MAPPING.md +150 -0
- moai_adk/templates/.moai/memory/SKILLS-DESCRIPTION-POLICY.md +218 -0
- moai_adk/templates/.moai/memory/SPEC-METADATA.md +356 -0
- moai_adk/templates/.moai/memory/gitflow-protection-policy.md +330 -0
- moai_adk/templates/.moai/memory/spec-metadata.md +356 -0
- moai_adk/templates/.moai/project/product.md +161 -0
- moai_adk/templates/.moai/project/structure.md +156 -0
- moai_adk/templates/.moai/project/tech.md +227 -0
- moai_adk/templates/CLAUDE.md +90 -10
- moai_adk/templates/workflows/go-tag-validation.yml +130 -0
- moai_adk/templates/workflows/javascript-tag-validation.yml +135 -0
- moai_adk/templates/workflows/python-tag-validation.yml +118 -0
- moai_adk/templates/workflows/typescript-tag-validation.yml +154 -0
- {moai_adk-0.11.0.dist-info → moai_adk-0.12.1.dist-info}/METADATA +43 -1
- moai_adk-0.12.1.dist-info/RECORD +330 -0
- moai_adk-0.11.0.dist-info/RECORD +0 -77
- /moai_adk/templates/.github/workflows/{release.yml → moai-adk-release.yml} +0 -0
- /moai_adk/templates/.github/workflows/{spec-issue-sync.yml → moai-adk-spec-issue-sync.yml} +0 -0
- /moai_adk/templates/.github/workflows/{tag-validation.yml → moai-adk-tag-validation.yml} +0 -0
- {moai_adk-0.11.0.dist-info → moai_adk-0.12.1.dist-info}/WHEEL +0 -0
- {moai_adk-0.11.0.dist-info → moai_adk-0.12.1.dist-info}/entry_points.txt +0 -0
- {moai_adk-0.11.0.dist-info → moai_adk-0.12.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,1047 @@
|
|
|
1
|
+
# moai-essentials-debug — 기술 레퍼런스
|
|
2
|
+
|
|
3
|
+
> **Version**: 2.1.0
|
|
4
|
+
> **Last Updated**: 2025-10-27
|
|
5
|
+
|
|
6
|
+
이 문서는 moai-essentials-debug Skill의 상세한 기술 사양, 23개 언어별 디버거 설정, 컨테이너/분산 시스템 디버깅 가이드를 제공합니다.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## 23개 언어별 디버거 매트릭스
|
|
11
|
+
|
|
12
|
+
### Systems Programming
|
|
13
|
+
|
|
14
|
+
#### C/C++
|
|
15
|
+
**디버거**: GDB 14.x, LLDB 17.x, AddressSanitizer
|
|
16
|
+
|
|
17
|
+
**CLI 명령어**:
|
|
18
|
+
```bash
|
|
19
|
+
# GDB 기본 사용
|
|
20
|
+
gdb ./myapp
|
|
21
|
+
(gdb) break main
|
|
22
|
+
(gdb) run
|
|
23
|
+
(gdb) next
|
|
24
|
+
(gdb) print variable
|
|
25
|
+
(gdb) backtrace
|
|
26
|
+
|
|
27
|
+
# LLDB 사용
|
|
28
|
+
lldb ./myapp
|
|
29
|
+
(lldb) b main
|
|
30
|
+
(lldb) run
|
|
31
|
+
(lldb) n
|
|
32
|
+
(lldb) p variable
|
|
33
|
+
(lldb) bt
|
|
34
|
+
|
|
35
|
+
# AddressSanitizer (메모리 오류 감지)
|
|
36
|
+
gcc -fsanitize=address -g myapp.c -o myapp
|
|
37
|
+
./myapp
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**VSCode launch.json**:
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"version": "0.2.0",
|
|
44
|
+
"configurations": [
|
|
45
|
+
{
|
|
46
|
+
"name": "C++ Debug",
|
|
47
|
+
"type": "cppdbg",
|
|
48
|
+
"request": "launch",
|
|
49
|
+
"program": "${workspaceFolder}/build/myapp",
|
|
50
|
+
"args": [],
|
|
51
|
+
"stopAtEntry": false,
|
|
52
|
+
"cwd": "${workspaceFolder}",
|
|
53
|
+
"environment": [],
|
|
54
|
+
"externalConsole": false,
|
|
55
|
+
"MIMode": "gdb",
|
|
56
|
+
"setupCommands": [
|
|
57
|
+
{
|
|
58
|
+
"description": "Enable pretty-printing",
|
|
59
|
+
"text": "-enable-pretty-printing",
|
|
60
|
+
"ignoreFailures": true
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
#### Rust
|
|
69
|
+
**디버거**: rust-lldb, rust-gdb, RUST_BACKTRACE
|
|
70
|
+
|
|
71
|
+
**CLI 명령어**:
|
|
72
|
+
```bash
|
|
73
|
+
# 백트레이스 활성화
|
|
74
|
+
RUST_BACKTRACE=1 cargo run
|
|
75
|
+
RUST_BACKTRACE=full cargo run # 전체 백트레이스
|
|
76
|
+
|
|
77
|
+
# rust-lldb 사용
|
|
78
|
+
rust-lldb target/debug/myapp
|
|
79
|
+
(lldb) b main
|
|
80
|
+
(lldb) run
|
|
81
|
+
|
|
82
|
+
# rust-gdb 사용
|
|
83
|
+
rust-gdb target/debug/myapp
|
|
84
|
+
(gdb) break main
|
|
85
|
+
(gdb) run
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**VSCode launch.json**:
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"version": "0.2.0",
|
|
92
|
+
"configurations": [
|
|
93
|
+
{
|
|
94
|
+
"name": "Rust Debug",
|
|
95
|
+
"type": "lldb",
|
|
96
|
+
"request": "launch",
|
|
97
|
+
"program": "${workspaceFolder}/target/debug/${workspaceFolderBasename}",
|
|
98
|
+
"args": [],
|
|
99
|
+
"cwd": "${workspaceFolder}",
|
|
100
|
+
"env": {
|
|
101
|
+
"RUST_BACKTRACE": "1"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
#### Go
|
|
109
|
+
**디버거**: Delve 1.22.x
|
|
110
|
+
|
|
111
|
+
**CLI 명령어**:
|
|
112
|
+
```bash
|
|
113
|
+
# Delve 디버깅
|
|
114
|
+
dlv debug
|
|
115
|
+
(dlv) break main.main
|
|
116
|
+
(dlv) continue
|
|
117
|
+
(dlv) next
|
|
118
|
+
(dlv) print variable
|
|
119
|
+
(dlv) goroutines # 고루틴 목록
|
|
120
|
+
(dlv) goroutine 1 # 특정 고루틴 전환
|
|
121
|
+
|
|
122
|
+
# 실행 중인 프로세스에 연결
|
|
123
|
+
dlv attach <pid>
|
|
124
|
+
|
|
125
|
+
# 테스트 디버깅
|
|
126
|
+
dlv test -- -test.run TestName
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**VSCode launch.json**:
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"version": "0.2.0",
|
|
133
|
+
"configurations": [
|
|
134
|
+
{
|
|
135
|
+
"name": "Go Debug",
|
|
136
|
+
"type": "go",
|
|
137
|
+
"request": "launch",
|
|
138
|
+
"mode": "debug",
|
|
139
|
+
"program": "${workspaceFolder}",
|
|
140
|
+
"env": {},
|
|
141
|
+
"args": []
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
### JVM Ecosystem
|
|
150
|
+
|
|
151
|
+
#### Java
|
|
152
|
+
**디버거**: jdb, IntelliJ IDEA, Remote JDWP
|
|
153
|
+
|
|
154
|
+
**CLI 명령어**:
|
|
155
|
+
```bash
|
|
156
|
+
# jdb 사용
|
|
157
|
+
jdb -classpath . MyApp
|
|
158
|
+
> stop at MyClass:42
|
|
159
|
+
> run
|
|
160
|
+
> step
|
|
161
|
+
> print variable
|
|
162
|
+
|
|
163
|
+
# 원격 디버깅 활성화
|
|
164
|
+
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 MyApp
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**원격 디버깅 설정**:
|
|
168
|
+
```bash
|
|
169
|
+
# IntelliJ/VSCode 원격 디버거 연결
|
|
170
|
+
Host: localhost
|
|
171
|
+
Port: 5005
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
#### Kotlin
|
|
175
|
+
**디버거**: IntelliJ Kotlin Debugger, Coroutines Debugger
|
|
176
|
+
|
|
177
|
+
**코루틴 디버깅**:
|
|
178
|
+
```kotlin
|
|
179
|
+
// 코루틴 디버그 정보 활성화
|
|
180
|
+
kotlinOptions {
|
|
181
|
+
freeCompilerArgs += ["-Xdebug"]
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
**IntelliJ 코루틴 뷰어**: View → Tool Windows → Kotlin Coroutines
|
|
186
|
+
|
|
187
|
+
#### Scala
|
|
188
|
+
**디버거**: IntelliJ Scala Plugin, sbt debug mode
|
|
189
|
+
|
|
190
|
+
**sbt 디버그 모드**:
|
|
191
|
+
```bash
|
|
192
|
+
# sbt 디버그 모드 실행
|
|
193
|
+
sbt -jvm-debug 5005 run
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### Clojure
|
|
197
|
+
**디버거**: CIDER, Cursive, REPL-based debugging
|
|
198
|
+
|
|
199
|
+
**CIDER 디버깅**:
|
|
200
|
+
```clojure
|
|
201
|
+
;; 브레이크포인트 설정
|
|
202
|
+
#break
|
|
203
|
+
(defn my-function [x]
|
|
204
|
+
#break ; 여기서 중단
|
|
205
|
+
(+ x 1))
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### Scripting Languages
|
|
211
|
+
|
|
212
|
+
#### Python
|
|
213
|
+
**디버거**: pdb, debugpy 1.8.0, pudb (TUI)
|
|
214
|
+
|
|
215
|
+
**CLI 명령어**:
|
|
216
|
+
```bash
|
|
217
|
+
# pdb 사용
|
|
218
|
+
python -m pdb script.py
|
|
219
|
+
(Pdb) break module.py:42
|
|
220
|
+
(Pdb) continue
|
|
221
|
+
(Pdb) next
|
|
222
|
+
(Pdb) print(variable)
|
|
223
|
+
(Pdb) where # 스택 트레이스
|
|
224
|
+
|
|
225
|
+
# pudb TUI 디버거
|
|
226
|
+
python -m pudb script.py
|
|
227
|
+
|
|
228
|
+
# debugpy 원격 디버깅
|
|
229
|
+
python -m debugpy --listen 5678 script.py
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**코드 내 브레이크포인트**:
|
|
233
|
+
```python
|
|
234
|
+
# 코드에서 pdb 시작
|
|
235
|
+
import pdb; pdb.set_trace()
|
|
236
|
+
|
|
237
|
+
# Python 3.7+ breakpoint()
|
|
238
|
+
breakpoint()
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**VSCode launch.json**:
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"version": "0.2.0",
|
|
245
|
+
"configurations": [
|
|
246
|
+
{
|
|
247
|
+
"name": "Python Debug",
|
|
248
|
+
"type": "debugpy",
|
|
249
|
+
"request": "launch",
|
|
250
|
+
"program": "${file}",
|
|
251
|
+
"console": "integratedTerminal",
|
|
252
|
+
"justMyCode": false
|
|
253
|
+
}
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
#### Ruby
|
|
259
|
+
**디버거**: debug gem (built-in), byebug, pry-byebug
|
|
260
|
+
|
|
261
|
+
**CLI 명령어**:
|
|
262
|
+
```bash
|
|
263
|
+
# Ruby 3.1+ 내장 디버거
|
|
264
|
+
ruby -r debug script.rb
|
|
265
|
+
debugger # 코드 내
|
|
266
|
+
|
|
267
|
+
# byebug 사용
|
|
268
|
+
gem install byebug
|
|
269
|
+
# 코드 내에서
|
|
270
|
+
require 'byebug'
|
|
271
|
+
byebug
|
|
272
|
+
|
|
273
|
+
# pry-byebug 사용
|
|
274
|
+
gem install pry-byebug
|
|
275
|
+
# 코드 내에서
|
|
276
|
+
require 'pry-byebug'
|
|
277
|
+
binding.pry
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### PHP
|
|
281
|
+
**디버거**: Xdebug 3.3.x, phpdbg
|
|
282
|
+
|
|
283
|
+
**Xdebug 설정** (php.ini):
|
|
284
|
+
```ini
|
|
285
|
+
[xdebug]
|
|
286
|
+
zend_extension=xdebug
|
|
287
|
+
xdebug.mode=debug
|
|
288
|
+
xdebug.start_with_request=yes
|
|
289
|
+
xdebug.client_port=9003
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**phpdbg 사용**:
|
|
293
|
+
```bash
|
|
294
|
+
phpdbg -e script.php
|
|
295
|
+
phpdbg> break script.php:42
|
|
296
|
+
phpdbg> run
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
#### Lua
|
|
300
|
+
**디버거**: ZeroBrane Studio, MobDebug
|
|
301
|
+
|
|
302
|
+
**MobDebug 사용**:
|
|
303
|
+
```lua
|
|
304
|
+
require("mobdebug").start()
|
|
305
|
+
-- 브레이크포인트
|
|
306
|
+
require("mobdebug").pause()
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
#### Shell (Bash)
|
|
310
|
+
**디버깅 모드**:
|
|
311
|
+
```bash
|
|
312
|
+
# 디버그 모드 실행
|
|
313
|
+
bash -x script.sh
|
|
314
|
+
|
|
315
|
+
# 스크립트 내 토글
|
|
316
|
+
set -x # 디버그 모드 활성화
|
|
317
|
+
# ... 코드 ...
|
|
318
|
+
set +x # 디버그 모드 비활성화
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
### Web & Mobile
|
|
324
|
+
|
|
325
|
+
#### JavaScript
|
|
326
|
+
**디버거**: Chrome DevTools, node --inspect
|
|
327
|
+
|
|
328
|
+
**Node.js 디버깅**:
|
|
329
|
+
```bash
|
|
330
|
+
# 디버그 모드 실행
|
|
331
|
+
node --inspect script.js
|
|
332
|
+
# 또는 첫 줄에서 중단
|
|
333
|
+
node --inspect-brk script.js
|
|
334
|
+
|
|
335
|
+
# Chrome DevTools 연결
|
|
336
|
+
chrome://inspect
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**코드 내 브레이크포인트**:
|
|
340
|
+
```javascript
|
|
341
|
+
debugger; // 여기서 중단
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
#### TypeScript
|
|
345
|
+
**디버거**: Chrome DevTools + Source Maps, VS Code
|
|
346
|
+
|
|
347
|
+
**tsconfig.json 소스맵 설정**:
|
|
348
|
+
```json
|
|
349
|
+
{
|
|
350
|
+
"compilerOptions": {
|
|
351
|
+
"sourceMap": true,
|
|
352
|
+
"inlineSources": true
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
**VSCode launch.json**:
|
|
358
|
+
```json
|
|
359
|
+
{
|
|
360
|
+
"version": "0.2.0",
|
|
361
|
+
"configurations": [
|
|
362
|
+
{
|
|
363
|
+
"name": "TypeScript Debug",
|
|
364
|
+
"type": "node",
|
|
365
|
+
"request": "launch",
|
|
366
|
+
"program": "${workspaceFolder}/src/index.ts",
|
|
367
|
+
"preLaunchTask": "tsc: build - tsconfig.json",
|
|
368
|
+
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
|
|
369
|
+
"sourceMaps": true
|
|
370
|
+
}
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
#### Dart/Flutter
|
|
376
|
+
**디버거**: Flutter DevTools, Hot Reload
|
|
377
|
+
|
|
378
|
+
**CLI 명령어**:
|
|
379
|
+
```bash
|
|
380
|
+
# Flutter 디버그 모드 실행
|
|
381
|
+
flutter run --debug
|
|
382
|
+
|
|
383
|
+
# DevTools 열기
|
|
384
|
+
flutter pub global activate devtools
|
|
385
|
+
flutter pub global run devtools
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
#### Swift
|
|
389
|
+
**디버거**: LLDB (Xcode), Instruments
|
|
390
|
+
|
|
391
|
+
**LLDB 사용**:
|
|
392
|
+
```bash
|
|
393
|
+
lldb MyApp.app
|
|
394
|
+
(lldb) breakpoint set --name viewDidLoad
|
|
395
|
+
(lldb) run
|
|
396
|
+
(lldb) po variable # Print Object
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
---
|
|
400
|
+
|
|
401
|
+
### Functional & Concurrency
|
|
402
|
+
|
|
403
|
+
#### Haskell
|
|
404
|
+
**디버거**: GHCi debugger, Debug.Trace
|
|
405
|
+
|
|
406
|
+
**GHCi 디버깅**:
|
|
407
|
+
```haskell
|
|
408
|
+
-- GHCi에서
|
|
409
|
+
:break module.function
|
|
410
|
+
:trace expression
|
|
411
|
+
:step
|
|
412
|
+
:continue
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
**Debug.Trace 사용**:
|
|
416
|
+
```haskell
|
|
417
|
+
import Debug.Trace
|
|
418
|
+
|
|
419
|
+
myFunction x = trace ("x = " ++ show x) $ x + 1
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
#### Elixir
|
|
423
|
+
**디버거**: IEx debugger, :observer.start()
|
|
424
|
+
|
|
425
|
+
**IEx 디버깅**:
|
|
426
|
+
```elixir
|
|
427
|
+
# 코드 내
|
|
428
|
+
require IEx
|
|
429
|
+
IEx.pry()
|
|
430
|
+
|
|
431
|
+
# Observer 실행
|
|
432
|
+
:observer.start()
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
#### Julia
|
|
436
|
+
**디버거**: Debugger.jl, Infiltrator.jl
|
|
437
|
+
|
|
438
|
+
**Debugger.jl 사용**:
|
|
439
|
+
```julia
|
|
440
|
+
using Debugger
|
|
441
|
+
|
|
442
|
+
@enter myfunction(args)
|
|
443
|
+
# 또는
|
|
444
|
+
@bp # 브레이크포인트
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
#### R
|
|
448
|
+
**디버거**: browser(), debug(), RStudio Debugger
|
|
449
|
+
|
|
450
|
+
**CLI 명령어**:
|
|
451
|
+
```r
|
|
452
|
+
# 함수 디버깅
|
|
453
|
+
debug(my_function)
|
|
454
|
+
my_function(args)
|
|
455
|
+
|
|
456
|
+
# 코드 내 브레이크포인트
|
|
457
|
+
browser()
|
|
458
|
+
|
|
459
|
+
# 디버그 모드 해제
|
|
460
|
+
undebug(my_function)
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
### Enterprise & Data
|
|
466
|
+
|
|
467
|
+
#### C#
|
|
468
|
+
**디버거**: Visual Studio Debugger, Rider, vsdbg
|
|
469
|
+
|
|
470
|
+
**vsdbg 사용** (Linux/macOS):
|
|
471
|
+
```bash
|
|
472
|
+
# vsdbg 설치
|
|
473
|
+
curl -sSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l ~/.vsdbg
|
|
474
|
+
```
|
|
475
|
+
|
|
476
|
+
**VSCode launch.json**:
|
|
477
|
+
```json
|
|
478
|
+
{
|
|
479
|
+
"version": "0.2.0",
|
|
480
|
+
"configurations": [
|
|
481
|
+
{
|
|
482
|
+
"name": ".NET Core Debug",
|
|
483
|
+
"type": "coreclr",
|
|
484
|
+
"request": "launch",
|
|
485
|
+
"program": "${workspaceFolder}/bin/Debug/net8.0/MyApp.dll",
|
|
486
|
+
"args": [],
|
|
487
|
+
"cwd": "${workspaceFolder}",
|
|
488
|
+
"stopAtEntry": false
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
#### SQL
|
|
495
|
+
**디버거**: EXPLAIN ANALYZE, pg_stat_statements
|
|
496
|
+
|
|
497
|
+
**PostgreSQL 디버깅**:
|
|
498
|
+
```sql
|
|
499
|
+
-- 쿼리 플랜 분석
|
|
500
|
+
EXPLAIN ANALYZE SELECT * FROM users WHERE id = 1;
|
|
501
|
+
|
|
502
|
+
-- 느린 쿼리 추적
|
|
503
|
+
CREATE EXTENSION pg_stat_statements;
|
|
504
|
+
SELECT * FROM pg_stat_statements ORDER BY total_exec_time DESC LIMIT 10;
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## 컨테이너 디버깅 완전 가이드
|
|
510
|
+
|
|
511
|
+
### Docker 디버깅
|
|
512
|
+
|
|
513
|
+
#### 기본 디버깅 패턴
|
|
514
|
+
```bash
|
|
515
|
+
# 1. 실행 중인 컨테이너에 접속
|
|
516
|
+
docker exec -it <container_name> /bin/sh
|
|
517
|
+
|
|
518
|
+
# 2. 로그 확인
|
|
519
|
+
docker logs <container_name>
|
|
520
|
+
docker logs -f <container_name> # 실시간
|
|
521
|
+
|
|
522
|
+
# 3. 컨테이너 상태 확인
|
|
523
|
+
docker inspect <container_name>
|
|
524
|
+
docker stats <container_name>
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
#### 언어별 원격 디버깅
|
|
528
|
+
|
|
529
|
+
**Java (JDWP)**:
|
|
530
|
+
```dockerfile
|
|
531
|
+
# Dockerfile
|
|
532
|
+
ENV JAVA_TOOL_OPTIONS='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005'
|
|
533
|
+
EXPOSE 5005
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
```bash
|
|
537
|
+
# 컨테이너 실행
|
|
538
|
+
docker run -p 5005:5005 -p 8080:8080 myapp
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
**Python (debugpy)**:
|
|
542
|
+
```dockerfile
|
|
543
|
+
# Dockerfile
|
|
544
|
+
RUN pip install debugpy
|
|
545
|
+
ENV DEBUGPY_ENABLE=true
|
|
546
|
+
EXPOSE 5678
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
```python
|
|
550
|
+
# app.py
|
|
551
|
+
import debugpy
|
|
552
|
+
|
|
553
|
+
if os.environ.get('DEBUGPY_ENABLE'):
|
|
554
|
+
debugpy.listen(("0.0.0.0", 5678))
|
|
555
|
+
print("Debugger listening on port 5678")
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
```bash
|
|
559
|
+
# 컨테이너 실행
|
|
560
|
+
docker run -p 5678:5678 -p 8000:8000 myapp
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Node.js (--inspect)**:
|
|
564
|
+
```dockerfile
|
|
565
|
+
# Dockerfile
|
|
566
|
+
EXPOSE 9229
|
|
567
|
+
CMD ["node", "--inspect=0.0.0.0:9229", "app.js"]
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
```bash
|
|
571
|
+
# 컨테이너 실행
|
|
572
|
+
docker run -p 9229:9229 -p 3000:3000 myapp
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
**Go (Delve)**:
|
|
576
|
+
```dockerfile
|
|
577
|
+
# Dockerfile
|
|
578
|
+
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
|
579
|
+
EXPOSE 2345
|
|
580
|
+
CMD ["dlv", "debug", "--headless", "--listen=:2345", "--api-version=2", "--accept-multiclient"]
|
|
581
|
+
```
|
|
582
|
+
|
|
583
|
+
```bash
|
|
584
|
+
# 컨테이너 실행
|
|
585
|
+
docker run -p 2345:2345 -p 8080:8080 myapp
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
#### 멀티스테이지 빌드 디버깅
|
|
589
|
+
```dockerfile
|
|
590
|
+
# 디버그 스테이지
|
|
591
|
+
FROM golang:1.22 AS debug
|
|
592
|
+
RUN go install github.com/go-delve/delve/cmd/dlv@latest
|
|
593
|
+
COPY . .
|
|
594
|
+
CMD ["dlv", "debug", "--headless", "--listen=:2345"]
|
|
595
|
+
|
|
596
|
+
# 프로덕션 스테이지
|
|
597
|
+
FROM golang:1.22 AS production
|
|
598
|
+
COPY . .
|
|
599
|
+
RUN go build -o app
|
|
600
|
+
CMD ["./app"]
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
```bash
|
|
604
|
+
# 디버그 빌드
|
|
605
|
+
docker build --target debug -t myapp:debug .
|
|
606
|
+
docker run -p 2345:2345 myapp:debug
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
---
|
|
610
|
+
|
|
611
|
+
### Kubernetes 디버깅
|
|
612
|
+
|
|
613
|
+
#### 기본 디버깅 커맨드
|
|
614
|
+
```bash
|
|
615
|
+
# 1. Pod 로그 확인
|
|
616
|
+
kubectl logs <pod-name>
|
|
617
|
+
kubectl logs -f <pod-name> # 실시간
|
|
618
|
+
kubectl logs <pod-name> -c <container-name> # 특정 컨테이너
|
|
619
|
+
kubectl logs <pod-name> --previous # 이전 컨테이너 로그
|
|
620
|
+
|
|
621
|
+
# 2. Pod에 접속
|
|
622
|
+
kubectl exec -it <pod-name> -- /bin/sh
|
|
623
|
+
kubectl exec -it <pod-name> -c <container-name> -- /bin/bash
|
|
624
|
+
|
|
625
|
+
# 3. Pod 상태 확인
|
|
626
|
+
kubectl describe pod <pod-name>
|
|
627
|
+
kubectl get pod <pod-name> -o yaml
|
|
628
|
+
```
|
|
629
|
+
|
|
630
|
+
#### 포트 포워딩 (디버거 연결)
|
|
631
|
+
```bash
|
|
632
|
+
# Java JDWP
|
|
633
|
+
kubectl port-forward pod/<pod-name> 5005:5005
|
|
634
|
+
|
|
635
|
+
# Python debugpy
|
|
636
|
+
kubectl port-forward pod/<pod-name> 5678:5678
|
|
637
|
+
|
|
638
|
+
# Node.js --inspect
|
|
639
|
+
kubectl port-forward pod/<pod-name> 9229:9229
|
|
640
|
+
|
|
641
|
+
# Go Delve
|
|
642
|
+
kubectl port-forward pod/<pod-name> 2345:2345
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
#### Ephemeral 컨테이너 (K8s 1.23+)
|
|
646
|
+
```bash
|
|
647
|
+
# 디버그 도구가 있는 임시 컨테이너 추가
|
|
648
|
+
kubectl debug -it <pod-name> --image=busybox --target=<container-name>
|
|
649
|
+
|
|
650
|
+
# 또는 디버그 도구 이미지 사용
|
|
651
|
+
kubectl debug -it <pod-name> --image=nicolaka/netshoot --target=<container-name>
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
#### 네트워크 디버깅
|
|
655
|
+
```bash
|
|
656
|
+
# 네트워크 정책 확인
|
|
657
|
+
kubectl get networkpolicies
|
|
658
|
+
|
|
659
|
+
# Service 엔드포인트 확인
|
|
660
|
+
kubectl get endpoints <service-name>
|
|
661
|
+
|
|
662
|
+
# DNS 확인 (Pod 내부에서)
|
|
663
|
+
kubectl exec -it <pod-name> -- nslookup <service-name>
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
#### 리소스 디버깅
|
|
667
|
+
```bash
|
|
668
|
+
# 리소스 사용량 확인
|
|
669
|
+
kubectl top pod <pod-name>
|
|
670
|
+
kubectl top node <node-name>
|
|
671
|
+
|
|
672
|
+
# 이벤트 확인
|
|
673
|
+
kubectl get events --sort-by='.lastTimestamp'
|
|
674
|
+
kubectl get events --field-selector involvedObject.name=<pod-name>
|
|
675
|
+
```
|
|
676
|
+
|
|
677
|
+
---
|
|
678
|
+
|
|
679
|
+
## 분산 추적 (Distributed Tracing)
|
|
680
|
+
|
|
681
|
+
### OpenTelemetry 1.24.0+ 설정
|
|
682
|
+
|
|
683
|
+
#### Python 설정
|
|
684
|
+
```python
|
|
685
|
+
from opentelemetry import trace
|
|
686
|
+
from opentelemetry.sdk.trace import TracerProvider
|
|
687
|
+
from opentelemetry.sdk.trace.export import BatchSpanProcessor
|
|
688
|
+
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
|
|
689
|
+
|
|
690
|
+
# Tracer Provider 설정
|
|
691
|
+
trace.set_tracer_provider(TracerProvider())
|
|
692
|
+
tracer = trace.get_tracer(__name__)
|
|
693
|
+
|
|
694
|
+
# OTLP Exporter 설정
|
|
695
|
+
otlp_exporter = OTLPSpanExporter(
|
|
696
|
+
endpoint="http://localhost:4317",
|
|
697
|
+
insecure=True
|
|
698
|
+
)
|
|
699
|
+
trace.get_tracer_provider().add_span_processor(
|
|
700
|
+
BatchSpanProcessor(otlp_exporter)
|
|
701
|
+
)
|
|
702
|
+
|
|
703
|
+
# 사용 예제
|
|
704
|
+
with tracer.start_as_current_span("my-operation"):
|
|
705
|
+
# 작업 수행
|
|
706
|
+
pass
|
|
707
|
+
```
|
|
708
|
+
|
|
709
|
+
#### TypeScript/Node.js 설정
|
|
710
|
+
```typescript
|
|
711
|
+
import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
|
|
712
|
+
import { BatchSpanProcessor } from '@opentelemetry/sdk-trace-base';
|
|
713
|
+
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';
|
|
714
|
+
|
|
715
|
+
// Tracer Provider 설정
|
|
716
|
+
const provider = new NodeTracerProvider();
|
|
717
|
+
const exporter = new OTLPTraceExporter({
|
|
718
|
+
url: 'http://localhost:4317',
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
provider.addSpanProcessor(new BatchSpanProcessor(exporter));
|
|
722
|
+
provider.register();
|
|
723
|
+
|
|
724
|
+
// 사용 예제
|
|
725
|
+
import { trace } from '@opentelemetry/api';
|
|
726
|
+
|
|
727
|
+
const tracer = trace.getTracer('my-service');
|
|
728
|
+
const span = tracer.startSpan('my-operation');
|
|
729
|
+
// 작업 수행
|
|
730
|
+
span.end();
|
|
731
|
+
```
|
|
732
|
+
|
|
733
|
+
#### Go 설정
|
|
734
|
+
```go
|
|
735
|
+
import (
|
|
736
|
+
"go.opentelemetry.io/otel"
|
|
737
|
+
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
|
|
738
|
+
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
|
739
|
+
)
|
|
740
|
+
|
|
741
|
+
// Tracer Provider 설정
|
|
742
|
+
exporter, _ := otlptracegrpc.New(ctx,
|
|
743
|
+
otlptracegrpc.WithEndpoint("localhost:4317"),
|
|
744
|
+
otlptracegrpc.WithInsecure(),
|
|
745
|
+
)
|
|
746
|
+
|
|
747
|
+
tp := sdktrace.NewTracerProvider(
|
|
748
|
+
sdktrace.WithBatcher(exporter),
|
|
749
|
+
)
|
|
750
|
+
otel.SetTracerProvider(tp)
|
|
751
|
+
|
|
752
|
+
// 사용 예제
|
|
753
|
+
tracer := otel.Tracer("my-service")
|
|
754
|
+
ctx, span := tracer.Start(ctx, "my-operation")
|
|
755
|
+
defer span.End()
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
---
|
|
759
|
+
|
|
760
|
+
### Prometheus 2.48.x 통합
|
|
761
|
+
|
|
762
|
+
#### Python (prometheus-client 0.19.0)
|
|
763
|
+
```python
|
|
764
|
+
from prometheus_client import Counter, Histogram, Gauge, start_http_server
|
|
765
|
+
|
|
766
|
+
# 메트릭 정의
|
|
767
|
+
request_count = Counter('http_requests_total', 'Total HTTP requests')
|
|
768
|
+
request_duration = Histogram('http_request_duration_seconds', 'HTTP request duration')
|
|
769
|
+
active_connections = Gauge('active_connections', 'Active connections')
|
|
770
|
+
|
|
771
|
+
# 사용 예제
|
|
772
|
+
request_count.inc()
|
|
773
|
+
with request_duration.time():
|
|
774
|
+
# 작업 수행
|
|
775
|
+
pass
|
|
776
|
+
active_connections.set(42)
|
|
777
|
+
|
|
778
|
+
# 메트릭 서버 시작 (포트 8000)
|
|
779
|
+
start_http_server(8000)
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
#### Go (prometheus/client_golang)
|
|
783
|
+
```go
|
|
784
|
+
import (
|
|
785
|
+
"github.com/prometheus/client_golang/prometheus"
|
|
786
|
+
"github.com/prometheus/client_golang/prometheus/promhttp"
|
|
787
|
+
)
|
|
788
|
+
|
|
789
|
+
var (
|
|
790
|
+
requestCount = prometheus.NewCounter(prometheus.CounterOpts{
|
|
791
|
+
Name: "http_requests_total",
|
|
792
|
+
Help: "Total HTTP requests",
|
|
793
|
+
})
|
|
794
|
+
|
|
795
|
+
requestDuration = prometheus.NewHistogram(prometheus.HistogramOpts{
|
|
796
|
+
Name: "http_request_duration_seconds",
|
|
797
|
+
Help: "HTTP request duration",
|
|
798
|
+
})
|
|
799
|
+
)
|
|
800
|
+
|
|
801
|
+
func init() {
|
|
802
|
+
prometheus.MustRegister(requestCount)
|
|
803
|
+
prometheus.MustRegister(requestDuration)
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// 메트릭 엔드포인트
|
|
807
|
+
http.Handle("/metrics", promhttp.Handler())
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
---
|
|
811
|
+
|
|
812
|
+
### Cloud Debugger 통합
|
|
813
|
+
|
|
814
|
+
#### AWS X-Ray
|
|
815
|
+
```python
|
|
816
|
+
from aws_xray_sdk.core import xray_recorder
|
|
817
|
+
from aws_xray_sdk.ext.flask.middleware import XRayMiddleware
|
|
818
|
+
|
|
819
|
+
app = Flask(__name__)
|
|
820
|
+
XRayMiddleware(app, xray_recorder)
|
|
821
|
+
|
|
822
|
+
# 커스텀 서브세그먼트
|
|
823
|
+
@xray_recorder.capture('my_function')
|
|
824
|
+
def my_function():
|
|
825
|
+
# 작업 수행
|
|
826
|
+
pass
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
#### GCP Cloud Debugger
|
|
830
|
+
```python
|
|
831
|
+
try:
|
|
832
|
+
import googleclouddebugger
|
|
833
|
+
googleclouddebugger.enable()
|
|
834
|
+
except ImportError:
|
|
835
|
+
pass
|
|
836
|
+
```
|
|
837
|
+
|
|
838
|
+
---
|
|
839
|
+
|
|
840
|
+
## 성능 프로파일링
|
|
841
|
+
|
|
842
|
+
### CPU 프로파일링
|
|
843
|
+
|
|
844
|
+
#### Python (cProfile, py-spy)
|
|
845
|
+
```bash
|
|
846
|
+
# cProfile
|
|
847
|
+
python -m cProfile -o output.prof script.py
|
|
848
|
+
python -m pstats output.prof
|
|
849
|
+
|
|
850
|
+
# py-spy (프로덕션 안전)
|
|
851
|
+
py-spy record -o profile.svg -- python script.py
|
|
852
|
+
py-spy top --pid <pid>
|
|
853
|
+
```
|
|
854
|
+
|
|
855
|
+
#### Go (pprof)
|
|
856
|
+
```go
|
|
857
|
+
import _ "net/http/pprof"
|
|
858
|
+
|
|
859
|
+
// HTTP 서버에 pprof 엔드포인트 자동 추가
|
|
860
|
+
go func() {
|
|
861
|
+
log.Println(http.ListenAndServe("localhost:6060", nil))
|
|
862
|
+
}()
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
```bash
|
|
866
|
+
# CPU 프로파일 수집
|
|
867
|
+
go tool pprof http://localhost:6060/debug/pprof/profile?seconds=30
|
|
868
|
+
|
|
869
|
+
# 프로파일 분석
|
|
870
|
+
go tool pprof -http=:8080 cpu.prof
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
#### Rust (flamegraph)
|
|
874
|
+
```toml
|
|
875
|
+
[dependencies]
|
|
876
|
+
pprof = { version = "0.13", features = ["flamegraph"] }
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
```bash
|
|
880
|
+
# Flamegraph 생성
|
|
881
|
+
cargo flamegraph
|
|
882
|
+
```
|
|
883
|
+
|
|
884
|
+
#### Java (JFR)
|
|
885
|
+
```bash
|
|
886
|
+
# JFR 활성화
|
|
887
|
+
java -XX:+FlightRecorder -XX:StartFlightRecording=duration=60s,filename=recording.jfr MyApp
|
|
888
|
+
|
|
889
|
+
# JFR 파일 분석 (JDK Mission Control)
|
|
890
|
+
jmc recording.jfr
|
|
891
|
+
```
|
|
892
|
+
|
|
893
|
+
---
|
|
894
|
+
|
|
895
|
+
### 메모리 프로파일링
|
|
896
|
+
|
|
897
|
+
#### Python (memory_profiler, tracemalloc)
|
|
898
|
+
```python
|
|
899
|
+
from memory_profiler import profile
|
|
900
|
+
|
|
901
|
+
@profile
|
|
902
|
+
def my_function():
|
|
903
|
+
# 작업 수행
|
|
904
|
+
pass
|
|
905
|
+
```
|
|
906
|
+
|
|
907
|
+
```bash
|
|
908
|
+
python -m memory_profiler script.py
|
|
909
|
+
```
|
|
910
|
+
|
|
911
|
+
**tracemalloc (내장)**:
|
|
912
|
+
```python
|
|
913
|
+
import tracemalloc
|
|
914
|
+
|
|
915
|
+
tracemalloc.start()
|
|
916
|
+
# 작업 수행
|
|
917
|
+
snapshot = tracemalloc.take_snapshot()
|
|
918
|
+
top_stats = snapshot.statistics('lineno')
|
|
919
|
+
|
|
920
|
+
for stat in top_stats[:10]:
|
|
921
|
+
print(stat)
|
|
922
|
+
```
|
|
923
|
+
|
|
924
|
+
#### Go (pprof heap)
|
|
925
|
+
```bash
|
|
926
|
+
# 힙 프로파일 수집
|
|
927
|
+
go tool pprof http://localhost:6060/debug/pprof/heap
|
|
928
|
+
|
|
929
|
+
# 메모리 할당 추적
|
|
930
|
+
go tool pprof http://localhost:6060/debug/pprof/allocs
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
#### C/C++ (Valgrind massif)
|
|
934
|
+
```bash
|
|
935
|
+
# Massif 실행
|
|
936
|
+
valgrind --tool=massif ./myapp
|
|
937
|
+
|
|
938
|
+
# Massif 시각화
|
|
939
|
+
ms_print massif.out.<pid>
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
#### Rust (heaptrack)
|
|
943
|
+
```bash
|
|
944
|
+
# heaptrack 실행
|
|
945
|
+
heaptrack ./target/release/myapp
|
|
946
|
+
|
|
947
|
+
# 결과 분석
|
|
948
|
+
heaptrack_gui heaptrack.myapp.<pid>.gz
|
|
949
|
+
```
|
|
950
|
+
|
|
951
|
+
---
|
|
952
|
+
|
|
953
|
+
## Advanced 디버깅 기법
|
|
954
|
+
|
|
955
|
+
### 조건부 브레이크포인트
|
|
956
|
+
|
|
957
|
+
**Python (pdb)**:
|
|
958
|
+
```python
|
|
959
|
+
# 조건부 브레이크포인트
|
|
960
|
+
(Pdb) break script.py:42, x > 100
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
**GDB**:
|
|
964
|
+
```bash
|
|
965
|
+
(gdb) break main.c:42 if x > 100
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
**LLDB**:
|
|
969
|
+
```bash
|
|
970
|
+
(lldb) breakpoint set --file main.c --line 42 --condition 'x > 100'
|
|
971
|
+
```
|
|
972
|
+
|
|
973
|
+
---
|
|
974
|
+
|
|
975
|
+
### 역방향 디버깅 (Time Travel Debugging)
|
|
976
|
+
|
|
977
|
+
**GDB 역방향 실행**:
|
|
978
|
+
```bash
|
|
979
|
+
(gdb) target record-full
|
|
980
|
+
(gdb) continue
|
|
981
|
+
# 오류 발생 후
|
|
982
|
+
(gdb) reverse-continue # 역방향 실행
|
|
983
|
+
(gdb) reverse-step
|
|
984
|
+
```
|
|
985
|
+
|
|
986
|
+
**WinDbg Time Travel Debugging** (Windows):
|
|
987
|
+
```bash
|
|
988
|
+
# TTD 트레이스 수집
|
|
989
|
+
ttd.exe -out trace.run myapp.exe
|
|
990
|
+
|
|
991
|
+
# 트레이스 디버깅
|
|
992
|
+
windbg -z trace.run
|
|
993
|
+
```
|
|
994
|
+
|
|
995
|
+
---
|
|
996
|
+
|
|
997
|
+
### 동적 계측 (Dynamic Instrumentation)
|
|
998
|
+
|
|
999
|
+
**DTrace (macOS/FreeBSD)**:
|
|
1000
|
+
```bash
|
|
1001
|
+
# 함수 호출 추적
|
|
1002
|
+
sudo dtrace -n 'pid$target::my_function:entry { printf("Called with arg=%d", arg0); }' -p <pid>
|
|
1003
|
+
```
|
|
1004
|
+
|
|
1005
|
+
**SystemTap (Linux)**:
|
|
1006
|
+
```bash
|
|
1007
|
+
# 함수 호출 추적
|
|
1008
|
+
stap -e 'probe process("/path/to/binary").function("my_function") { println("Called") }'
|
|
1009
|
+
```
|
|
1010
|
+
|
|
1011
|
+
**BPF/eBPF (Linux)**:
|
|
1012
|
+
```bash
|
|
1013
|
+
# bpftrace 사용
|
|
1014
|
+
bpftrace -e 'uprobe:/path/to/binary:my_function { printf("Called\n"); }'
|
|
1015
|
+
```
|
|
1016
|
+
|
|
1017
|
+
---
|
|
1018
|
+
|
|
1019
|
+
## Best Practices 요약
|
|
1020
|
+
|
|
1021
|
+
### 1. 디버거 선택
|
|
1022
|
+
- 언어에 적합한 디버거 사용 (Python → debugpy, Go → Delve)
|
|
1023
|
+
- 프로덕션 환경에서는 안전한 프로파일러 사용 (py-spy, async-profiler)
|
|
1024
|
+
|
|
1025
|
+
### 2. 로깅 전략
|
|
1026
|
+
- 구조화된 로깅 사용 (JSON 형식)
|
|
1027
|
+
- 로그 레벨 적절히 설정 (DEBUG, INFO, WARNING, ERROR)
|
|
1028
|
+
- 분산 시스템에서는 Correlation ID 추가
|
|
1029
|
+
|
|
1030
|
+
### 3. 성능 고려
|
|
1031
|
+
- 디버그 심볼 포함 (-g 플래그)
|
|
1032
|
+
- 소스맵 생성 (TypeScript, JavaScript)
|
|
1033
|
+
- 프로파일링 전 워밍업 수행
|
|
1034
|
+
|
|
1035
|
+
### 4. 보안
|
|
1036
|
+
- 프로덕션 디버그 포트는 방화벽으로 보호
|
|
1037
|
+
- 민감 정보 로그에 기록 금지
|
|
1038
|
+
- 디버그 모드는 환경 변수로 제어
|
|
1039
|
+
|
|
1040
|
+
### 5. 자동화
|
|
1041
|
+
- CI/CD 파이프라인에 디버그 빌드 추가
|
|
1042
|
+
- 자동 스택 트레이스 수집 (Sentry, Rollbar)
|
|
1043
|
+
- 메트릭 자동 수집 (Prometheus, Datadog)
|
|
1044
|
+
|
|
1045
|
+
---
|
|
1046
|
+
|
|
1047
|
+
**End of Reference** | moai-essentials-debug v2.1.0
|