Skip to content

Commit 8fa167d

Browse files
RafaelGSSBethGriggs
andcommitted
doc: create ai-guidelines and include to CONTRIBUTING
Co-Authored-By: Beth Griggs <bethanyngriggs@gmail.com>
1 parent 5536325 commit 8fa167d

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ works.
1919
* [Code of Conduct](#code-of-conduct)
2020
* [Issues](#issues)
2121
* [Pull Requests](#pull-requests)
22+
* [AI Use Policy and Guidelines](#ai-use-policy-and-guidelines)
2223
* [Developer's Certificate of Origin 1.1](#developers-certificate-of-origin-11)
2324

2425
## [Code of Conduct](./doc/contributing/code-of-conduct.md)
@@ -47,6 +48,15 @@ dependencies, and tools contained in the `nodejs/node` repository.
4748
* [Reviewing Pull Requests](./doc/contributing/pull-requests.md#reviewing-pull-requests)
4849
* [Notes](./doc/contributing/pull-requests.md#notes)
4950

51+
## [AI Use Policy and Guidelines](./doc/contributing/ai-guidelines.md)
52+
53+
Node.js expects contributors to understand and take full responsibility for
54+
every change they propose. Pull requests consisting of AI-generated code the
55+
contributor has not personally understood, tested, and verified will be closed
56+
without review.
57+
58+
See [details on our AI use policy and guidelines](./doc/contributing/ai-guidelines.md).
59+
5060
## Developer's Certificate of Origin 1.1
5161

5262
```text

doc/contributing/ai-guidelines.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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

Comments
 (0)