|
| 1 | +# AI use policy and guidelines |
| 2 | + |
| 3 | +* [Core principle](#core-principle) |
| 4 | +* [Using AI for code contributions](#using-ai-for-code-contributions) |
| 5 | +* [Using AI for communication](#using-ai-for-communication) |
| 6 | + |
| 7 | +## Core principle |
| 8 | + |
| 9 | +Node.js expects contributors to understand and take full responsibility for |
| 10 | +every change they propose. The answer to "Why is X an improvement?" should |
| 11 | +never be "I'm not sure. The AI did it." |
| 12 | + |
| 13 | +Pull requests that consist of AI-generated code the contributor has not |
| 14 | +personally understood, tested, and verified waste collaborator time and |
| 15 | +will be closed without review. |
| 16 | + |
| 17 | +## Using AI for code contributions |
| 18 | + |
| 19 | +AI tools may assist contributors, but must not replace contributor judgment. |
| 20 | +When using AI as a coding assistant: |
| 21 | + |
| 22 | +* **Understand the codebase first.** Do not skip familiarizing yourself with |
| 23 | + the relevant subsystem. LLMs frequently produce inaccurate descriptions of |
| 24 | + Node.js internals — always verify against the actual source. |
| 25 | + |
| 26 | +* **Own every line you submit.** You are responsible for all code in your |
| 27 | + pull request, regardless of how it was generated. Be prepared to explain |
| 28 | + any change in detail during review. |
| 29 | + |
| 30 | +* **Keep logical commits.** Structure commits coherently even when an LLM |
| 31 | + generates multiple changes at once. Follow the existing |
| 32 | + [commit message guidelines][]. |
| 33 | + |
| 34 | +* **Test thoroughly.** AI-generated code must pass the full test suite and |
| 35 | + any manually written tests relevant to the change. Do not rely on the LLM |
| 36 | + to assess correctness. |
| 37 | + |
| 38 | +* **Edit generated comments critically.** LLM-produced comments are often |
| 39 | + verbose or inaccurate. Remove comments that simply restate what the code |
| 40 | + does; add comments only where the logic is non-obvious. |
| 41 | + |
| 42 | +## Using AI for communication |
| 43 | + |
| 44 | +Node.js values concise, precise communication that respects collaborator time. |
| 45 | + |
| 46 | +* **Do not post AI-generated messages** in pull requests, issues, or the |
| 47 | + project's communication channels. |
| 48 | +* **Verify accuracy** of any LLM-generated content before including it in a |
| 49 | + PR description or comment. |
| 50 | +* **Complete pull request templates fully** rather than replacing them with |
| 51 | + LLM-generated summaries. |
| 52 | +* **Link to primary sources** — code, documentation, specifications — rather |
| 53 | + than quoting LLM answers. |
| 54 | +* Grammar and spell-check tools are acceptable when they improve clarity and |
| 55 | + conciseness. |
| 56 | + |
| 57 | +[commit message guidelines]: ./pull-requests.md#commit-message-guidelines |
0 commit comments