기존 프로젝트의 코드와 설정을 조사해 기술 구성, 구조, 아키텍처, 규칙, 연동, 테스트, 우려 사항을 다루는 문서 7개를 작성합니다. 근거 파일을 연결하고 미확인 항목을 표시하며, 계획과 실제 구현의 차이를 드러냅니다.
- 익숙하지 않은 코드베이스 파악하기
- 프로젝트 인수인계 문서 준비하기
- 설계 문서와 실제 구현 비교하기
재현 가능한 확인과 가설 검증으로 Java 예외, 예상 밖 동작, 테스트 실패를 조사합니다. 로그, 스택 추적, 디버거 연결로 원인을 좁히고 재발 방지 테스트를 추가합니다.
Debug Java applications systematically: JDWP remote debugging, jdb, VS Code and IntelliJ attach, debugging Maven/Gradle tests, Spring Boot and Quarkus dev mode, containers, breakpoints/logpoints, and reading stack traces. Use when the user needs to find the cause of a Java bug, exception, wrong behavior, or failing test, or asks how to attach a debugger.
실행 점수 미검증
설치 방법 보기java-debugging은 Java 애플리케이션의 문제를 재현하고 가설을 하나씩 검증해 원인을 좁히도록 돕습니다. 예외가 발생했을 때의 호출 기록인 스택 추적을 읽고, 로그와 로그 포인트를 활용하며, 필요하면 중단점으로 실행 상태를 살펴보는 방법을 다룹니다. jdb, VS Code, IntelliJ IDEA를 통한 디버거 연결과 Maven 및 Gradle 테스트, Spring Boot, Quarkus, 컨테이너의 조사 절차도 안내합니다.
예외의 원인을 알기 어렵거나 테스트가 실패할 때, 로그만으로 처리 흐름을 따라가기 힘들 때 사용할 수 있습니다. 문제를 작은 단위로 재현하고 원인을 확인한 뒤 재발 방지 테스트를 추가하며, 임시 로그와 디버그 설정을 제거하는 흐름을 안내합니다.
NullPointerException의 원인을 찾아 주세요.”연결하려면 적절한 JDK와 사용할 IDE 또는 도구가 필요합니다. 디버그 포트를 외부에 공개하지 말고, 원격 연결에는 터널을 사용해야 합니다. 운영 환경 연결은 명시적으로 요청된 경우에만 진행합니다. 설정은 JDK 및 Gradle 버전에 따라 다르며, 실행을 일시 정지하면 타이밍이나 시간 초과에 영향을 줄 수 있습니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 25일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
Find the root cause of a Java defect with a reproducible, hypothesis-driven loop, and attach a debugger safely when logs are not enough.
127.0.0.1). Never bind *:5005 on a reachable network; use an SSH tunnel or kubectl port-forward for remote hosts.suspend=n for running applications. suspend=y is acceptable only for short local test runs bound to loopback (waiting for the IDE to attach). Never leave a debug agent enabled on production; JDWP gives full code execution to whoever connects.java-diagnostics skill).JAVA_TOOL_OPTIONS is picked up by every JVM started in that environment (build tools, forked test JVMs, child processes), causing Address already in use clashes. Prefer scoping the flag to the one process you want to debug.Reproduce deterministically, minimize, read the evidence (stack traces), test one falsifiable hypothesis with the least intrusive tool (log line or logpoint before breakpoints), then add a regression test and remove debug flags and temporary logging.
-XX:+ShowCodeDetailsInExceptionMessages) and on by default from JDK 15 (JEP 358 documents the message format). Source: https://openjdk.org/jeps/358.address=5005 binds all interfaces before JDK 9 and loopback from JDK 9 (see below).--debug-jvm passes a bare address, so on JDK 8 it listens on all interfaces.Start the JVM:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005 -jar app.jar
Always write the explicit 127.0.0.1:5005 on every JDK version: a bare address=5005 listens on all interfaces before JDK 9 and only on loopback from JDK 9. On JDK 8 and older, the host:port form may not be honored, so also restrict access with a firewall or tunnel.
Attach with jdb:
jdb -attach 127.0.0.1:5005
# stop in com.example.OrderService.place | stop at com.example.OrderService:42
# cont | next | step | locals | print order | where | catch java.lang.NullPointerException
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Attach to JVM",
"request": "attach",
"hostName": "127.0.0.1",
"port": 5005
}
]
}
Run | Edit Configurations | + | Remote JVM Debug; host 127.0.0.1, port 5005, debugger mode Attach. The dialog shows the matching JVM argument string.
| Scenario | Command (port 5005) |
|---|---|
| Maven Surefire unit test | mvn test -Dmaven.surefire.debug -Dtest=OrderServiceTest |
| Maven Failsafe IT | mvn verify -Dmaven.failsafe.debug -Dit.test=OrderIT |
| Gradle test | gradle test --debug-jvm --tests '*OrderServiceTest' |
| Spring Boot (Maven) | mvn spring-boot:run -Dspring-boot.run.jvmArguments="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005" |
| Spring Boot (Gradle) | Configure bootRun as below, then gradle bootRun (loopback, no suspend) |
| Quarkus dev mode | mvn quarkus:dev (debug port 5005 open by default; -Ddebug=5006 changes it, -Ddebug=false disables) |
Surefire/Failsafe debug mode and --debug-jvm suspend until a debugger attaches, which is fine for a local run. Surefire and Failsafe accept a custom agent string instead of the bare flag, e.g. -Dmaven.surefire.debug="-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=127.0.0.1:5005". Verified listeners on 127.0.0.1 (via lsof -nP -iTCP:5005 -sTCP:LISTEN) for Gradle 9.7 --debug-jvm, Maven Surefire 3.5 -Dmaven.surefire.debug and Quarkus 3.40 dev mode on JDK 26; Gradle 7.6.4, 8.0.2 (JDK 17), 8.5 (JDK 21) and 8.14.3 also listened on 127.0.0.1. Gradle passes a bare address=5005 (no host), so the bind address comes from the JDK: loopback on JDK 9+, but all interfaces (0.0.0.0:5005, checked in an eclipse-temurin:8-jdk container with Gradle 7.6.4 and 8.14.3) on JDK 8. Older Gradle/plugin versions were not tested; run the same lsof check and use an explicit loopback agent on shared networks or JDK 8.
Explicit Gradle configuration (Gradle 7.6+; debugOptions.host was added in 7.6; Kotlin DSL):
tasks.withType<Test> {
debugOptions { enabled.set(true); host.set("127.0.0.1"); port.set(5005); server.set(true); suspend.set(true) }
}
// BootRun extends JavaExec, not Test; configure it separately when the Boot plugin is applied.
tasks.named<JavaExec>("bootRun") {
debugOptions { enabled.set(true); host.set("127.0.0.1"); port.set(5005); server.set(true); suspend.set(false) }
}
Then run gradle test --tests '*OrderServiceTest' or gradle bootRun, without --debug-jvm (which enables suspension). Configure only the task you are debugging; do not run both listeners on port 5005 at once. For Gradle before 7.6, use jvmArgs("-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=127.0.0.1:5005") on the target task instead (suspend=y for local tests), without also enabling debugOptions or --debug-jvm. On JDK 8 and older, retain the firewall/tunnel precaution above.
Publish the port to loopback only and let the JVM listen inside the container:
docker run --rm -p 127.0.0.1:5005:5005 \
-e JAVA_TOOL_OPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005" my-app
Inside the container the agent must bind * for the port mapping to work, so JDWP (full code execution) is reachable by every other container on the same Docker network; the 127.0.0.1: mapping only blocks access from other hosts. Use this only on a developer machine where no untrusted containers share the network: run it on a dedicated user-defined network (not the shared default bridge) containing only this container, or keep the agent on 127.0.0.1 inside the container and reach it with docker exec/kubectl port-forward style forwarding instead of publishing it. For Kubernetes use kubectl port-forward pod/<name> 5005:5005 against a dev/staging pod only.
-g shows unavailable variables (Maven and Gradle include it by default). In lambdas, step into the lambda body.Hooks.onOperatorDebug() in dev only.jcmd <pid> Thread.dump_to_file -format=json file.json for an overview.toString(), which may trigger lazy loading or mutate state.If the Copilot CLI lsp tool is configured (see the lsp-setup skill), go-to-definition, find-references, and call hierarchy help trace the execution path. It is optional; grep and reading code work as well.
java-diagnostics skill.Official tool docs (prefer them over this skill for the JDK in use; change 21 to your version): jcmd https://docs.oracle.com/en/java/javase/21/docs/specs/man/jcmd.html, JDK troubleshooting guide https://docs.oracle.com/en/java/javase/21/troubleshoot/.
아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
기존 프로젝트의 코드와 설정을 조사해 기술 구성, 구조, 아키텍처, 규칙, 연동, 테스트, 우려 사항을 다루는 문서 7개를 작성합니다. 근거 파일을 연결하고 미확인 항목을 표시하며, 계획과 실제 구현의 차이를 드러냅니다.
AgentRC로 저장소의 AI 에이전트 활용 준비도를 평가하고 독립 실행형 HTML 보고서를 생성합니다. 9개 영역의 점수와 우선순위별 개선안을 확인하고, 조직에 맞춘 채점 정책도 적용할 수 있습니다.
프로젝트의 실제 코드에서 언어, 프레임워크, 개발 관례를 파악해 AI 코딩 에이전트용 지침 파일을 생성하거나 갱신합니다. 하나의 파일에 모으거나 주제와 프로젝트 영역별로 나누며, 쓰기 전에 변경 내용을 미리 볼 수 있습니다.
AgentRC 준비도 평가를 팀이나 조직의 기준에 맞게 조정합니다. JSON 정책에서 검사 중요도와 수준을 바꾸고, 불필요한 검사를 끄며, 통과율을 설정해 CI 자동 검사에도 적용할 수 있습니다.
제공한 광고 성과 데이터를 분석해 낭비되는 지출과 성과가 좋은 광고를 찾고, 중단·예산 증액·추가 테스트 후보를 정리합니다. 여러 플랫폼을 비교하고 A/B 테스트의 차이를 평가해 예산 재배분 방안도 제시합니다.
지정한 코드 파일에 학습용 주석을 추가해 문법, 프로그래밍 개념, 설계 선택의 이유를 설명합니다. 독자의 지식에 맞춰 설명의 깊이와 반복 정도를 조절하며 파일 구조와 형식을 유지합니다.