node-inspect-debugger
하는 일
AI 에이전트가 Node.js 인스펙터로 코드를 멈추고, 변수를 살펴보고, 메모리와 CPU 프로파일을 캡처하도록 안내합니다. 일반 로그로는 드러나지 않는 버그를 찾아야 하는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓Node.js 프로그램이 멈추거나 충돌하거나, 실행할 때마다 다르게 동작할 때.
- ✓Node.js 프로그램의 메모리 사용량이 계속 늘어나는 것 같을 때.
- ✓코드를 특정 줄에서 멈추고 변수 값을 보고 싶을 때.
스킬 링크
https://github.com/openclaw/openclaw/blob/main/skills/node-inspect-debugger/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“제 Node.js 스크립트가 몇 초 뒤에 멈춥니다. 실행을 멈추고 무엇이 막혀 있는지 보여 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
스킬은 인스펙터와 함께 프로그램을 시작하고, 중단점을 설정한 뒤 상태를 살펴봅니다. 더 어려운 경우에는 힙이나 CPU 프로파일을 캡처하고 확인한 다음에 결론을 내립니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Node Inspect Debugger
Use for Node.js debugging that needs inspector access: hidden locals, async hangs, flaky tests, child processes, startup races, memory growth, or CPU hot paths.
Default to node inspect first. Use Chrome DevTools Protocol only when you need scripted breakpoints, automated state capture, heap snapshots, or CPU profiles.
Quick start
- Pause on entry:
node inspect path/to/script.js - TypeScript:
node --inspect-brk --import tsx path/to/script.ts - Existing PID:
kill -SIGUSR1 <pid>thennode inspect -p <pid> - Inspect target list:
curl -s http://127.0.0.1:9229/json/list | jq - OpenClaw CLI path:
node --inspect-brk openclaw.mjs ... - OpenClaw test path:
OPENCLAW_VITEST_MAX_WORKERS=1 node --inspect-brk scripts/run-vitest.mjs <file>
Debugger REPL
- Continue/step:
cont,next,step,out,pause - Breakpoints:
sb('file.js', 42),sb(42),sb('functionName'),breakpoints,cb('file.js', 42) - Inspect:
bt,list(8),watch('expr'),exec expr - Current scope:
repl, then evaluate locals directly;Ctrl+Cexits repl mode. - Exit safely:
contbefore quitting if the process should continue; otherwisekill.
OpenClaw tips
- Prefer
127.0.0.1inspector binds. Do not expose--inspect=0.0.0.0unless the network is isolated. - For Vitest, debug one file with one worker. Avoid worker pools while stepping.
- For TS source breakpoints, use
--enable-source-mapswhen useful;node inspectcan still show emitted paths. - For child processes,
NODE_OPTIONS=--inspect-brkcan propagate the inspector, but each child needs its own port. - For long-lived gateway or dev processes, attach by PID after confirming the target with
/json/list.
Programmatic CDP
Install tooling outside the repo unless the project already depends on it:
mkdir -p /tmp/cdp-tools
npm --prefix /tmp/cdp-tools i chrome-remote-interface
NODE_PATH=/tmp/cdp-tools/node_modules node /tmp/cdp-debug.cjs
Minimal driver:
const CDP = require("chrome-remote-interface");
(async () => {
const client = await CDP({ port: 9229 });
const { Debugger, Runtime } = client;
Debugger.paused(async ({ callFrames, reason }) => {
const top = callFrames[0];
console.log("paused", reason, top.url, top.location.lineNumber + 1);
const { result } = await Debugger.evaluateOnCallFrame({
callFrameId: top.callFrameId,
expression: "JSON.stringify({ pid: process.pid })",
});
console.log(result.value ?? result.description);
await Debugger.resume();
});
await Runtime.enable();
await Debugger.enable();
await Debugger.setBreakpointByUrl({ urlRegex: ".*target\\.js$", lineNumber: 41 });
await Runtime.runIfWaitingForDebugger();
})();
Profiles
- CPU: enable
Profiler,start, wait,stop, write/tmp/profile.cpuprofile, open in Chrome DevTools. - Heap: enable
HeapProfiler, collectaddHeapSnapshotChunk, calltakeHeapSnapshot, write/tmp/heap.heapsnapshot.
Pitfalls
--inspectdoes not pause; use--inspect-brkwhen setup must happen before code runs.- Default port is
9229; use--inspect=0or a unique port for parallel targets. - If a breakpoint misses, confirm file path, source map behavior, and whether execution already passed the line.
- If the process appears frozen after detaching, it may still be paused in the debugger.
자주 묻는 질문
디버거 명령을 알아야 하나요?
아닙니다. 스킬이 일반적인 명령을 대신 실행하고, 각 단계가 무엇을 보여 주는지 설명합니다.
네트워크에서 디버거를 열어도 안전한가요?
네트워크가 격리되어 있지 않다면 인스펙터를 127.0.0.1에 묶어 두세요. 노출하면 위험할 수 있습니다.
힙 스냅샷이란 무엇인가요?
특정 순간에 프로그램이 메모리에 담고 있는 내용을 찍은 그림으로, 해제되지 않는 메모리를 찾는 데 씁니다.
상세 정보
작성자의 원본 설명
Debug Node.js with node inspect, --inspect, breakpoints, CDP, heap, and CPU profiles.
repo: openclaw/openclaw
인기도
- GitHub 스타
- 394k
- 순위
- #67
- 라이선스
- MIT
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
discord-user-post
394k에이전트가 승인한 메시지를 정확한 채널을 확인한 뒤 Discord 데스크톱 앱에서 내 계정으로 올리도록 돕습니다.
discrawl
394k에이전트가 저장된 로컬 Discord 메시지 보관본을 검색하고 요약하며, 최신 상태를 확인하고 다이렉트 메시지를 읽도록 돕습니다.
gitcrawl
394k에이전트가 저장된 GitHub 이슈와 풀 리퀘스트 보관본을 검색하고, 중복 항목을 묶고, GitHub에서 현재 상태를 확인하도록 돕습니다.
graincrawl
394k에이전트가 저장된 Granola 회의 메모와 기록을 검색하고, 최신 상태를 확인하며, 일정 기간 동안 개수를 세도록 돕습니다.
비슷한 스킬
executing-plans
311k에이전트가 작성된 구현 계획을 현재 세션에서 단계별로 실행하고, 각 단계를 테스트한 뒤 다음으로 넘어가도록 돕습니다.
finishing-a-development-branch
311k에이전트가 완성된 코드의 테스트를 실행한 뒤, 병합, 풀 리퀘스트 열기, 브랜치 유지 중에서 고를 수 있도록 명확한 선택지를 제시하도록 돕습니다.
receiving-code-review
311k에이전트가 코드 리뷰 피드백을 신중하게 검토하도록 돕습니다. 무엇이든 바꾸기 전에 각 지적을 실제 코드와 대조합니다.