node/doc/contributing/ai-guidelines.md at main · nodejs/node · GitHub
//blob/show" data-turbo-transient="true" />
Skip to content
Search/
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Uh oh!
There was an error while loading. Please reload this page.
nodejs
node
Public
Uh oh!
There was an error while loading. Please reload this page.
Notifications<br>You must be signed in to change notification settings
Fork<br>36.5k
Star<br>119k
FilesExpand file tree
main
/ai-guidelines.md
Copy path
Blame<br>More file actions
Blame<br>More file actions
Latest commit
History<br>History<br>History
98 lines (75 loc) · 4.92 KB
main
/ai-guidelines.md
Copy path
Top
File metadata and controls<br>Preview
Code
Blame
98 lines (75 loc) · 4.92 KB
Raw<br>Copy raw file<br>Download raw file
OutlineEdit and raw actions
AI use policy and guidelines
Core principle
When AI is used in contributions
When AI is used in communications
This document aligns with the OpenJS Foundation AI Coding Assistants Policy.
Core principle
Tools should never replace human judgment, regardless of whether they are<br>powered by AI.
Node.js requires contributors to understand and take full responsibility for<br>every change they propose. The answer to "Why is X an improvement?" can<br>never be "I'm not sure. The AI did it."
If AI tools assisted in generating a contribution, acknowledge that honestly.<br>Regardless of how much code is generated by AI, disclosure does not serve<br>as a disclaimer of responsibility.
Be aware that the mention of for-profit trademarks or commercial brands in<br>commit messages, which are part of the code base, can be abused for<br>profit-driven marketing. If the disclosure involves for-profit trademarks or<br>commercial brands, it's recommended to either anonymize the branding (e.g. say<br>a frontier reasoning model, a closed-source coding agent instead of<br>), or only mention the for-profit brand/trademark in the PR<br>description, but not in the commit message, unless the message would not have<br>made sense without mentioning the specific brand/trademark. These<br>recommendations only apply to for-profit tools/models, not any non-profit ones.
Pull requests that contain AI-generated code the contributor has not<br>personally understood, tested, and verified waste collaborator time and<br>will be subject to closure without additional review. Contributors who<br>repeatedly submit such changes, show no understanding of the project or<br>its processes, or are dishonest about the use of automated assistance<br>may be blocked from further contributions.
Pull requests must not be opened by automated tooling, unless specifically<br>approved in advance by the project. To request approval, either open an issue in<br>nodejs/admin, or if the automation can<br>be done in the form of a GitHub workflow, submit a pull request to add the<br>workflow and use the usual pull request review process to seek consensus.
When AI is used in contributions
Contributors may use AI tools to assist with contributions, but such tools<br>never replace human judgment.
When using AI as a coding assistant:
Understand the codebase first. Do not skip familiarizing yourself with<br>the relevant subsystem. Always verify analysis generated by tools against<br>the actual source code with human judgement.
Own every line you submit. You are responsible for all code in your<br>pull request, regardless of how it was created. The submitted changes<br>must satisfy the project's Developer's Certificate of Origin and licensing<br>requirements. Be prepared to explain any change in detail during review.
Keep the commits logical. The commit message guidelines<br>and commit squashing guidelines<br>must be followed regardless of what tool is used in the pull request.
Test thoroughly. Existing tests should not be removed or modified<br>without human verification. It is crucial to verify, with human judgement,<br>the correctness of new tests against the intended behavior of the feature<br>being tested, independently of how the implementation happens to behave.
Do not disappear. If you open a PR, follow it through. Respond to<br>feedback and iterate until the work lands or is explicitly closed. If you<br>can no longer pursue it, close the PR. Stalled PRs block progress.
Do not use AI to claim "good first issue" tasks. These issues exist to<br>help new contributors learn the codebase and processes hands-on.
Keep the comments useful. Verify with human judgement that the<br>comments are necessary and accurate. Remove comments that simply<br>restate what the code does. Add comments only where the logic is non-obvious.
When AI is used in communications
Node.js values concise, precise communication that respects collaborator and<br>contributor time.
Do not paste messages generated entirely by AI in pull requests, issues,<br>or the project's...