Workflow de test de compatibilité Node.js

VérifiéPrudence

Guide pour exécuter les tests de compatibilité Node.js, diagnostiquer les échecs et les corriger ou ignorer.

Spar Skills Guide Bot
DeveloppementAvancé
30/08/2026
Claude Code
#node-compat#deno#compatibility-testing#polyfills#test-debugging

Recommandé pour

Synthèse automatique

Compétence pour exécuter les tests de compatibilité Node.js de Deno, classer les échecs en catégories (corrigeable, incompatibilité inhérente, faible valeur) et mettre à jour l'implémentation ou la configuration des tests en conséquence.

Points forts

  • Processus clair et structuré en étapes: construction, lancement, diagnostic, classification, action.
  • Classification explicite des échecs avec des actions appropriées pour chaque type.
  • Insistance sur la fidélité au comportement de Node.js en consultant sa documentation et son code source.
  • Gestion détaillée du fichier config.jsonc pour ignorer, sauter ou marquer les tests avec échec attendu.

Limites

  • Nécessite un environnement de build Deno complet et des reconstructions fréquentes.
  • Se concentre uniquement sur les tests de compatibilité Node.js dans le dépôt Deno.
  • Peut exiger une connaissance approfondie des internals de Node.js et de Deno pour diagnostiquer certains échecs.
Quand l'utiliser

Lorsque vous devez exécuter, diagnostiquer ou corriger un test de compatibilité Node.js dans le dépôt Deno.

Quand l'éviter

Pour le débogage de tests généraux dans d'autres projets ou de fonctionnalités sans rapport avec la compatibilité Node.js.

Analyse de sécurité

Prudence
Score qualité92/100

The skill instructs the agent to run development commands via Bash for a legitimate purpose (Node.js compatibility testing and fixing). No destructive or exfiltrating actions are present, but Bash execution is powerful and should be monitored.

Points d'attention
  • •Uses Bash to execute build and test commands (./x build, ./x test-compat).
Comment cette analyse est faite

Exemples

Run a specific compat test
Run the Node.js compatibility test for test-fs-readfile.js and fix it if it fails.
Diagnose a failing test
Why does the node-compat test test-querystring.js fail? Investigate and fix the Deno implementation.
Skip a test due to inherent incompatibility
Mark test-internalBinding.js as ignored in the node-compat config with an appropriate reason since it uses Node.js internals.

name: node-compat description: 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. argument-hint: <test-name> allowed-tools: Bash Read Write Edit Glob Grep Agent

Node Compat Test

Work on Node.js compatibility test $ARGUMENTS.

Step 1: Build and run the test

./x build
./x test-compat $ARGUMENTS

If the test passes, report success and ensure test is specified in tests/node_compat/config.jsonc.

Step 2: Diagnose the failure

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:

  1. What Node.js API or behavior is being tested?
  2. What is the actual error or assertion failure?
  3. Where is the relevant Deno implementation? Check ext/node/ (polyfills, ops, internal bindings), runtime/, or cli/.

Read the corresponding Node.js docs and/or source code to understand the expected behavior.

Step 3: Classify the failure

Determine which category this failure falls into:

A. Fixable bug

The Deno implementation is wrong or incomplete, but can be corrected. This includes:

  • Missing method/property on a polyfill
  • Wrong return value or error type
  • Missing event emission
  • Incorrect argument handling
  • Hard-to-fix but still fundamentally implementable behaviors

Action: Fix the implementation (Step 4).

B. Inherent incompatibility

The test relies on Node.js internals or architecture that Deno fundamentally cannot or will not support:

  • internalBinding() calls to Node's C++ layer
  • Node.js-specific CLI flags (--inspect, --prof, etc.)
  • V8 internals exposed through Node-specific APIs
  • Node.js-specific build/addon tooling (node-gyp internals)
  • Tests for Node.js's own test infrastructure

Action: Ignore the test with a reason (Step 5).

C. Not worth fixing

The test exercises an edge case or behavior that is technically possible but provides negligible value:

  • Extremely obscure error message wording differences
  • Node.js-specific deprecation warnings
  • Behavior that no real-world code depends on

Action: Ignore or skip the test with a reason (Step 5).

Step 4: Fix the implementation

If the failure is fixable:

  1. Locate the relevant code in ext/node/ (or elsewhere).
  2. Implement the fix. Match Node.js behavior - check Node.js docs and/or source code, not just what "seems right."
  3. Use lazy-loaded imports where possible.
  4. Use primordials for internal JS code to avoid prototype pollution.
  5. Rebuild the source code with ./x build - this is paramount, changes won't take effect until you do.
  6. Re-run the test to verify the fix:
./x test-compat $ARGUMENTS
  1. Once the test passes, make sure the test is listed in 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.

Step 5: Skip or ignore the test

If the test cannot or should not be fixed, update tests/node_compat/config.jsonc.

Ignore (test should never run — inherent incompatibility)

"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!

Platform-specific skip

If the test only fails on certain platforms:

"category/test-name.js": {
  "windows": false
}

Expected failure (test runs but fails with known output)

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.

Writing good reasons

Reasons should be specific and actionable. Good examples:

  • "Tests Node.js internal C++ binding (internalBinding('zlib').Zlib) which is not implemented in Deno"
  • "requires deno --interactive flag (not yet implemented)"
  • "URL.createObjectURL does not throw ERR_INVALID_ARG_TYPE for non-Blob arguments"

Bad examples:

  • "Not supported" (too vague)
  • "Doesn't work" (says nothing)
  • "Node-specific" (which part?)

Step 6: Verify

Re-run the test one final time to confirm the outcome matches expectations:

./x test-compat $ARGUMENTS

Config reference

The full schema for config.jsonc entries is in tests/node_compat/schema.json.

PR title conventions

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 a previously failing test now passes (typically changes under ext/node/ plus enabling the test in config.jsonc).

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/node-js-compat-test-workflow-mtfbwk50' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/node-js-compat-test-workflow-mtfbwk50/download' --output '.skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md.part' && mv '.skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md.part' '.skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Outils déclarés par l’auteur (à vérifier dans votre agent) : Bash Read Write Edit Glob Grep Agent

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md' && test -s '.skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/node-compat' && cp -R '.skill-downloads/node-js-compat-test-workflow-mtfbwk50' '.claude/skills/node-compat'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/node-js-compat-test-workflow-mtfbwk50'

openskills read 'node-js-compat-test-workflow-mtfbwk50'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/node-js-compat-test-workflow-mtfbwk50/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires