diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..788ab8c10a --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,5 @@ +# AI Agent Guidelines + +AI agents contributing to this repository must read and follow the guidelines in the developer documentation: + +[Guidelines for AI-Assisted Development](doc/dev/ai-usage-guidelines.md) diff --git a/CLAUDE.md b/CLAUDE.md new file mode 120000 index 0000000000..47dc3e3d86 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +AGENTS.md \ No newline at end of file diff --git a/doc/dev/ai-usage-guidelines.md b/doc/dev/ai-usage-guidelines.md new file mode 100644 index 0000000000..4496136254 --- /dev/null +++ b/doc/dev/ai-usage-guidelines.md @@ -0,0 +1,23 @@ +# Guidelines for AI-Assisted Development + +## Guiding Principle + +A human must ultimately take responsibility for all aspects of library code. + +## Project Policies + +1. **Human Manager Responsibility:** The human manager is responsible for reviewing and fully understanding all contributed code. + +2. **Commit Attribution:** Commits may be attributed to an agentic AI tool, but all commit messages should include the `@username` of the human manager who is ultimately responsible for them. For small features, consider squash merges to condense work into a single joint-authored commit to indicate the human associated with any AI contributions. + +3. **Pull Request Review Process:** Pull requests involving LLM-assisted code generation or attributed to an agentic AI tool should go through the usual peer review process, with the human manager responsible for the PR completing a pull request code review process first before requesting peer review. + +4. **Effort Balance:** The effort contributed by the human manager responsible for LLM-generated code and commits should exceed the effort requested from peer reviewers. + +5. **Limits on extent of Agentic AI use:** Agentic AI may be used to perform simple maintenance tasks (e.g., figuring out we need to update a version number) but not to generate new core-library source code. + +6. **Energy Safeguards for Agentic AI use:** Agentic AI should not be run automatically without first reaching a consensus among primary developers, and there should be restrictions added to ensure it stops promptly if it is not able to solve a problem. + +7. **In-code citations:** Any code that was added via an AI should be clearly marked and ideally include a link to the chat session that generated it. + +8. **Standard of oversight:** Contributors and reviewers are expected to have mentally stepped through the code and made sense of it before requesting or approving a review. Exemptions should be requested explicitly where the judged effort tradeoff is not worthwhile. This standard will be subject to further consideration and possible future adjustment. diff --git a/doc/index.md b/doc/index.md index c9c98d30ac..1645c3fe2c 100644 --- a/doc/index.md +++ b/doc/index.md @@ -55,6 +55,7 @@ bibliography dev/empirical-development-practices dev/getting-started dev/contribution-guidelines-and-review +dev/ai-usage-guidelines dev/adding-documentation dev/guide-to-testing ```