denoland/node-compat
Run a Node.js compatibility test, diagnose failures, and either fix the implementation, skip, or ignore the test. Use when asked to work on node compat tests.
npx skills add https://github.com/denoland/deno --skill node-compat
Work on Node.js compatibility test $ARGUMENTS.
./x build
./x test-compat $ARGUMENTS
If the test passes, report success and ensure test is specified in
tests/node_compat/config.jsonc.
Read the test file to understand what it tests:
# Tests live under tests/node_compat/test/
Use Grep and Read to find the test source, then analyze:
ext/node/ (polyfills,ops, internal bindings), runtime/, or cli/.
Read the corresponding Node.js docs and/or source code to understand the
expected behavior.
Determine which category this failure falls into:
The Deno implementation is wrong or incomplete, but can be corrected. This
includes:
Action: Fix the implementation (Step 4).
The test relies on Node.js internals or architecture that Deno fundamentally
cannot or will not support:
internalBinding() calls to Node's C++ layer--inspect, --prof, etc.)Action: Ignore the test with a reason (Step 5).
The test exercises an edge case or behavior that is technically possible but
provides negligible value:
Action: Ignore or skip the test with a reason (Step 5).
If the failure is fixable:
ext/node/ (or elsewhere).code, not just what "seems right."
./x build - this is paramount, changes won'ttake effect until you do.
./x test-compat $ARGUMENTS
tests/node_compat/config.jsonc with an empty config:
"category/test-name.js": {}
The entries in config.jsonc are sorted alphabetically within their category.
Place the new entry in the correct position.
If the test cannot or should not be fixed, update
tests/node_compat/config.jsonc.
"category/test-name.js": {
"ignore": true,
"reason": "Brief, specific explanation of why this can't work in Deno"
}
"reason" must be specified otherwise the lint step will fail!
If the test only fails on certain platforms:
"category/test-name.js": {
"windows": false
}
If you want the test to run but expect a specific failure:
"category/test-name.js": {
"exitCode": 1,
"output": "[WILDCARD]specific error message[WILDCARD]",
"reason": "Brief explanation of why this fails"
}
This is a good middle ground for tests that are generally compatible but have a
specific known issue. If a fix is ever done this assertion will notify the
implementer to update the config.
Reasons should be specific and actionable. Good examples:
not implemented in Deno"
deno --interactive flag (not yet implemented)"arguments"
Bad examples:
Re-run the test one final time to confirm the outcome matches expectations:
./x test-compat $ARGUMENTS
The full schema for config.jsonc entries is in
tests/node_compat/schema.json.
When opening a PR for node-compat work, use the appropriate prefix:
test: — when the PR only updates tests/node_compat/config.jsonc to skip,ignore, or otherwise reclassify tests without changing implementation code.
fix(ext/node): — when the PR actually fixes the implementation so apreviously failing test now passes (typically changes under ext/node/ plus
enabling the test in config.jsonc).
Take denoland/node-compat from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.