From mcollina-skills-1
Debugs Node.js native module crashes, optimizes V8 performance, configures node-gyp builds, writes N-API/node-addon-api bindings, diagnoses libuv event loop issues. For C++ addons, segfaults, memory leaks, build failures.
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin mcollina-skills-1This skill uses the workspace's default tool permissions.
Use this skill when you need deep Node.js internals expertise, including:
rules/build-and-test-workflow.mdrules/build-system.mdrules/child-process-internals.mdrules/cli-options.mdrules/commit-messages.mdrules/configure.mdrules/contributing.mdrules/crypto-internals.mdrules/debugging-native.mdrules/documentation.mdrules/fs-internals.mdrules/libuv-async-io.mdrules/libuv-event-loop.mdrules/libuv-thread-pool.mdrules/memory-debugging.mdrules/napi.mdrules/native-memory.mdrules/net-internals.mdrules/node-addon-api.mdrules/primordials.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Use this skill when you need deep Node.js internals expertise, including:
Read individual rule files for detailed explanations and code examples:
lib/internal/)./configure flags for debug builds, ASan, Ninja, etc.Node.js embeds lib/ JavaScript files into the binary at compile time via
js2c. After ANY change to src/ or lib/, you MUST rebuild before
running tests. Without a rebuild, tests run against stale code and results
are meaningless.
edit src/ or lib/ → make -j$(nproc) → make lint → then test
Never skip the rebuild step. Never run ./node test/... after editing
without building first.
Before starting work, ask the user about their build configuration
(Make vs Ninja, debug vs release, what configure flags they use). Do not
assume a specific setup. Most of the time, ./configure has already been
run and only make -j$(nproc) is needed to rebuild.
See rules/build-and-test-workflow.md for the full workflow including configure flags, lint targets, and test commands.
Apply deep knowledge of Node.js internals across these domains:
V8 optimization tracing:
node --trace-opt --trace-deopt script.js
# Checkpoint: confirm no unexpected deoptimization warnings before proceeding to profiling
node --prof script.js && node --prof-process isolate-*.log > processed.txt
Event loop lag detection:
node --trace-event-categories v8,node,node.async_hooks script.js
Native addon debugging (gdb):
gdb --args node --napi-modules ./build/Release/addon.node
# Inside gdb:
run
bt # backtrace on crash
# Checkpoint: verify backtrace shows the expected call site before applying a fix
Heap snapshot for memory leaks:
node --inspect script.js # then open chrome://inspect, take heap snapshot
# Checkpoint: compare two consecutive heap snapshots to confirm leak growth before and after the fix; run valgrind --leak-check=full node addon_test.js to confirm no native leaks remain
Segfault / crash in native addon:
node --napi-modules? → Run gdb, capture btbt point to a V8 handle scope issue? → Check HandleScope / EscapableHandleScope usage in the addonuv_close() sequencingV8 deoptimization / performance regression:
--trace-opt --trace-deopt → identify the deoptimized function and reason (e.g., "not a Smi", "wrong map")--trace-ic) and fix property addition order or type inconsistencies--trace-opt to confirm the function is now optimizedBuild failure (node-gyp / binding.gyp):
include_dirs in binding.gyp and Node.js header installationlibraries and link_settings entries; confirm ABI compatibilityrules/build-system.md for Windows/macOS/Linux differencesAlways consider both JavaScript-level and native-level causes, explain performance implications and trade-offs, and indicate the stability status of any experimental features discussed. Code examples should demonstrate Node.js internals patterns and be production-ready, accounting for edge cases typical developers might miss.