node-inspect-debugger
できること
このスキルは、組み込みのデバッガーと関連するツールを使って、Node.jsプログラムのバグを見つける方法をエージェントに教えます。ハング、不安定なテスト、メモリの問題など、見つけにくい問題に直面している開発者向けです。
使う場面
- ✓Node.jsプログラムが止まる、または奇妙に動き、原因がはっきりしないとき。
- ✓テストが不安定で、失敗する正確な箇所で止めたいとき。
- ✓Node.jsアプリの遅い箇所やメモリリークを見つけるために、メモリのスナップショットやCPUのプロファイルが必要なとき。
スキルのリンク
https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/node-inspect-debugger/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のNode.jsスクリプトはときどき止まります。正しい行で止めて、原因を見つける手伝いをしてもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、Nodeの組み込みインスペクターでプログラムを起動し、ブレークポイントを設定して、各停止箇所で値を調べます。スクリプト化された確認では、ローカルのポートを通じてインスペクターに接続することもできます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Node Inspect Debugger
Use when Node.js debugging requires hidden locals, async hangs, flaky tests, child processes, startup races, memory analysis, or CPU profiling.
Default to node inspect first. Use Chrome DevTools Protocol only for scripted breakpoints, automated state capture, heap snapshots, or CPU profiles.
Quick start
node inspect path/to/script.js
node --inspect-brk --import tsx path/to/script.ts
kill -SIGUSR1 <pid>
node inspect -p <pid>
curl -s http://127.0.0.1:9229/json/list | jq
For a test runner such as Vitest, debug one file with one worker and avoid worker pools while stepping.
Debugger REPL
- Continue and 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: enter
repl, evaluate locals, then pressCtrl+Cto exit REPL mode. - Exit safely: use
contbefore quitting if the process should keep running; otherwise usekill.
Safe setup
- Prefer
127.0.0.1inspector binds. Do not expose--inspect=0.0.0.0unless the network is isolated. - Use
--enable-source-mapswhen TypeScript source breakpoints need it. NODE_OPTIONS=--inspect-brkcan propagate the inspector to child processes, but each process needs a unique port.- For a long-lived service, confirm the PID and
/json/listtarget before attaching.
Programmatic CDP
Install temporary tooling outside the project unless it is already a dependency:
mkdir -p /tmp/cdp-tools
npm --prefix /tmp/cdp-tools install 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 a.cpuprofile, then open it in Chrome DevTools. - Heap: enable
HeapProfiler, collectaddHeapSnapshotChunk, calltakeHeapSnapshot, then write a.heapsnapshot.
Pitfalls
--inspectdoes not pause; use--inspect-brkwhen startup code matters.- Port
9229is the default; use--inspect=0or a unique port for parallel targets. - If a breakpoint misses, confirm the path, source maps, and whether execution already passed the line.
- A process that appears frozen after detach may still be paused in the debugger.
よくある質問
デバッガーをネットワークに開いたままにしても安全ですか?
このスキルは、インスペクターを127.0.0.1に結び付け、すべてのネットワークアドレスに公開しないよう勧めています。
TypeScriptでも使えますか?
はい。ソースマップがあれば、ブレークポイントはTypeScriptのソースを指せます。
子プロセスもデバッグできますか?
はい。ただし、各プロセスにはそれぞれ別のポートが必要です。
詳細
作者による元の説明
Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools Protocol, heap snapshots, and CPU profiles.
repo: EKKOLearnAI/ekko-studio
人気
- GitHubのスター
- 12k
- ランキング
- #11570
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
1password
12kエージェントが、1PasswordのCLIを使って、コマンドや設定ファイルに必要な秘密情報を、チャット、ログ、保存されたファイルに表示せずに取得できるよう支援します。
apple-notes
12kエージェントが、memoコマンドラインツールを使って、Macのメモ(Apple Notes)を作成、検索、読み取り、編集、移動、削除できるよう支援します。
apple-reminders
12kエージェントが、remindctlツールを使って、Macのリマインダーとリマインダーのリストを一覧表示、作成、編集、完了、削除できるよう支援します。
document-to-action-items
12kエージェントが、文書、会議の書き起こし、メモを、タスク、担当者、期限、決定事項の明確な表に変換できるよう支援します。
似ているスキル
api-connector-builder
280kエージェントが既存のパターンに従って、新しいAPI連携を構築します。新しい方式を作らずに、もう一つ連携を追加したいときに使います。
api-design
280kエージェントがベストプラクティスに沿ってREST APIを設計できるようにします。APIの通信方法、エラーの表示方法、データの整理方法を決めるのに役立ちます。
backend-patterns
280kエージェントのサーバーサイドのアーキテクチャパターンとデータベースの最適化を支援します。サーバー上で動くコードを作成またはレビューするときに役立ちます。