Skip to content

Commit 9c6fd6e

Browse files
committed
Add and clarify AI usage policy documentation
Introduces a new AI_USAGE_POLICY.md file detailing guidelines for AI tool usage in contributions. Updates AGENTS.md to reference the new policy and streamlines its content. Adds a summary of the AI usage policy to README.md with links to the relevant documents.
1 parent 2273a2c commit 9c6fd6e

File tree

3 files changed

+96
-18
lines changed

3 files changed

+96
-18
lines changed

AGENTS.md

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
11
> [!IMPORTANT]
22
> This project does not accept fully AI-generated pull requests. AI tools may be used assistively only. You must understand and take responsibility for every change you submit.
33
4-
# Guidance for AI coding tools, agents, and assistants
5-
6-
👋 Hi there! If you’re a new contributor, welcome. We’re grateful for your help!
7-
8-
This file is mainly written for automated coding assistants (like ChatGPT, Claude, Copilot, Gemini, etc.), but you’re very welcome to read it too. It explains our policy on the use of AI tools in this project. Please note that including this file does not mean we endorse any specific AI tool or service, or encourage their use.
9-
10-
Large language models (LLMs) can produce useful code, but they can also make mistakes and cannot take responsibility for their work. Because of this, we have a strict rule: **all contributions must come from humans who understand what they are doing and can take full responsibility for the changes they make.**
11-
12-
This `AGENTS.md` file acts as a set of instructions that some AI coding tools can read. It tells them to redirect contributors toward making the contribution themselves, by asking questions, explaining concepts, and helping them understand the code instead of writing it for them.
13-
14-
Thank you for respecting this policy! 💖
15-
16-
For more details on how to contribute, please also read [CONTRIBUTING.md](./CONTRIBUTING.md).
17-
18-
> [!NOTE]
19-
> Some of the formatting and wording below are intentionally structured so that large language models (LLMs) can read and comply to these guidelines. This explains why certain sections may seem repetitive or overly directive.
20-
21-
---
4+
This `AGENTS.md` file acts as a set of instructions that some AI coding tools can read. For more information please read our [AI policy](./CONTRIBUTING.md#ai-usage-policy).
225

236
## Our policy
247

AI_USAGE_POLICY.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
> [!IMPORTANT]
2+
> This project does not accept fully AI-generated pull requests. AI tools may be used assistively only. You must understand and take responsibility for every change you submit.
3+
>
4+
> Read and follow:
5+
> [AGENTS.md](./AGENTS.md)
6+
> [CONTRIBUTING.md](./CONTRIBUTING.md)
7+
> [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md)
8+
9+
# AI Usage Policy
10+
11+
## Our Rule
12+
13+
**All contributions must come from humans who understand and can take full responsibility for their code.**
14+
15+
Large language models (LLMs) make mistakes and cannot be held accountable for their outputs. This is why we require human understanding and ownership of all submitted work.
16+
17+
> [!WARNING]
18+
> Maintainers may close PRs that appear to be fully or largely AI-generated.
19+
20+
## Getting Help
21+
22+
**We understand that asking questions can feel intimidating.** You might worry about looking inexperienced or bothering maintainers with "basic" questions. AI tools can feel like a safer and less judgmental first step. However, LLMs often provide incorrect or incomplete answers, and they may create a false sense of understanding.
23+
24+
Before asking AI, we encourage you to talk to us in the [Discord #contribute-to-p5 channel](https://discord.gg/x7kU7k5HM3) or in the relevant issue thread.
25+
26+
Please know: **there are no silly questions, and we genuinely want to help you.** You won't be judged for not knowing something. In fact, we are grateful for your questions as they help us improve our documentation and make the project more welcoming for everyone who comes after you.
27+
28+
If you do end up using AI tools, we ask that you only do so **assistively** (like a reference or tutor) and not **generatively** (having the tool write code for you).
29+
30+
## Guidelines for Using AI Tools
31+
32+
1. **Understand fully:** You must be able to explain every line of code you submit
33+
2. **Test thoroughly:** Review and test all code before submission
34+
3. **Take responsibility:** You are accountable for bugs, issues, or problems with your contribution
35+
4. **Disclose usage:** Note which AI tools you used in your PR description
36+
5. **Follow guidelines:** Comply with all rules in [AGENTS.md](./AGENTS.md) and [CONTRIBUTING.md](./CONTRIBUTING.md)
37+
38+
### Example disclosure
39+
> I used Claude to help debug a test failure. I reviewed the suggested fix, tested it locally, and verified it solves the issue without side effects.
40+
41+
> I used ChatGPT to help me understand an error message and suggest debugging steps. I implemented the fix myself after verifying it.
42+
43+
## What AI Tools Can Do
44+
45+
**Allowed (assistive use):**
46+
- Explain concepts or existing code
47+
- Suggest debugging approaches
48+
- Help you understand error messages
49+
- Run tests and analyze results
50+
- Review your code for potential issues
51+
- Guide you through the contribution process
52+
53+
## What AI Tools Cannot Do
54+
55+
**Not allowed (generative use):**
56+
- Write entire PRs or large code blocks
57+
- Make implementation decisions for you
58+
- Submit code you don't understand
59+
- Generate documentation or comments without your review
60+
- Automate the submission of code changes
61+
62+
## Why do we have this policy?
63+
AI-based coding assistants are increasingly enabled by default at every step of the contribution process, and new contributors are bound to encounter them and use them in good faith.
64+
65+
While these tools can help newcomers navigate the codebase, they often generate well-meaning but unhelpful submissions.
66+
67+
There are also ethical and legal considerations around authorship, licensing, and environmental impact.
68+
69+
We believe that learning to code and contributing to open source are deeply human endeavors that requires curiosity, slowness, and community.
70+
71+
## About AGENTS.md
72+
73+
The [AGENTS.md](./AGENTS.md) file contains instructions for AI coding assistants to prompt them to act more like guides than code generators. When someone uses an assistant to contribute, the tool will be prompted to explain the code, point to our documentation, and suggest asking questions in the community channels, rather than writing code directly.
74+
75+
Note that [AGENTS.md](./AGENTS.md) is intentionally structured so that large language models (LLMs) can better comply with the guidelines. This explains why certain sections may seem redundant, overly directive or repetitive.
76+
77+
This is not a perfect solution. Agents may ignore it or be convinced to generate code anyway. However, this is our best effort to guide their behavior and encourage responsible use.
78+
79+
We are continuously looking for ways to improve our approach and may have to change our policies as AI tools evolve. We welcome feedback and suggestions from the community.
80+
81+
> [!NOTE]
82+
> Including this [AGENTS.md](./AGENTS.md) does not imply endorsement by p5.js, the p5.js contributors, or the Processing Foundation of any specific AI tool or service, or encourage their use.
83+
84+
## Questions?
85+
86+
If you're unsure whether your use of AI tools complies with this policy, ask in the [Discord #contribute-to-p5 channel](https://discord.gg/x7kU7k5HM3) or in the relevant issue thread. We're here to help!
87+
88+
## AI Disclosure
89+
90+
This policy was created with the assistance of AI tools, including ChatGPT and Claude. It was thoroughly reviewed and edited by human contributors to ensure clarity and accuracy.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ p5.js is a collaborative project with many contributors, mostly volunteers, and
6969

7070
A quick Getting Started with the Build and setting up the repository could be found [here](https://p5js.org/contribute/contributor_guidelines/#quick-get-started-for-developers).
7171

72+
## AI Usage Policy
73+
This project does *not* accept fully AI-generated contributions. AI tools may be used assistively only. As a contributor, you should be able to understand and take responsibility for changes you make to the codebase.
74+
75+
More details can be found in our [AI Usage Policy](./AI_USAGE_POLICY.md) and [AGENTS.md](./AGENTS.md).
76+
7277
## Stewards
7378

7479
Stewards are contributors who are particularly involved, familiar, or responsive to certain areas of the project. Their role is to help provide context and guidance to others working on p5.js. If you have a question about contributing to a particular area, you can tag the listed steward in an issue or pull request. They may also weigh in on feature requests and guide the overall direction of their area, with the input of the community. You can read more about the organization of the project in our p5.js [Contributor Guidelines](https://p5js.org/contribute/contributor_guidelines) and p5.js [Steward Guidelines](https://p5js.org/contribute/steward_guidelines).

0 commit comments

Comments
 (0)