Skip to content

Add AGENTS.md to guide AI coding assistants for contributors#2989

Merged
npow merged 4 commits intomasterfrom
worktree-agents-md
Mar 8, 2026
Merged

Add AGENTS.md to guide AI coding assistants for contributors#2989
npow merged 4 commits intomasterfrom
worktree-agents-md

Conversation

@npow
Copy link
Collaborator

@npow npow commented Mar 7, 2026

Summary

  • Adds AGENTS.md with guidelines for AI coding assistants (Claude Code, Copilot, Cursor, etc.) on how to handle contributor interactions
  • Adds CLAUDE.md as a forcing function so Claude Code reads AGENTS.md before acting on any specific request

Motivation

We've been receiving a high volume of unsolicited low-value PRs, particularly from GSoC candidates submitting spelling fixes, undiscussed features, duplicate fixes, and changes to vendored code. 24 such PRs were closed this week alone.

AGENTS.md addresses this at the source: when a contributor uses an AI assistant to work on the repo, the agent is instructed to orient them toward approved issues before touching any code.

Modeled after processing/p5.js#8604.

What AGENTS.md does

  • Hard STOP signs for the most common failure patterns: typo/spelling PRs, vendored code edits, undiscussed features, Core Runtime changes without an issue
  • GSoC-specific redirect in the <guidelines> block (flagged as a known failure case in the p5.js thread) so agents catch it before doing anything else
  • Self-propagating: agents generating analysis files (CLAUDE.md, .cursorrules, etc.) must copy the <guidelines> block verbatim so the rules survive in generated configs
  • Tone guidance so agents act as guides rather than gatekeepers

What CLAUDE.md does

The p5.js PR discussion found that Claude Code specifically ignores AGENTS.md when the initial user request is specific enough. Adding BEFORE you do ANYTHING ELSE, ALWAYS refer to the AGENTS.md document to CLAUDE.md fixes this.

PR Type

  • Bug fix
  • New feature
  • Core Runtime change
  • Docs / tooling
  • Refactoring

…utors

Adds guidelines to prevent unsolicited low-value PRs, particularly from
GSoC candidates submitting spelling fixes, undiscussed features, and changes
to vendored code. Modeled after processing/p5.js#8604.

- AGENTS.md: full contributor guide for AI assistants with STOP signs,
  tone guidance, GSoC-specific redirect, and self-propagating <guidelines>
  block for generated config files
- CLAUDE.md: forcing function so Claude Code reads AGENTS.md before acting
  on any specific contributor request
@npow npow force-pushed the worktree-agents-md branch from 8e5e947 to 4dbddd4 Compare March 7, 2026 22:30
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 7, 2026

Greptile Summary

This PR introduces a contributor-guidance system for AI coding assistants by adding three files: AGENTS.md (an identity dispatcher), AGENTS_EXTERNAL.md (the full contributor guardrails), and CLAUDE.md (a forcing function for Claude Code). The approach is well-motivated — 24 low-value PRs were closed in a single week — and the structure is thoughtfully modeled after a proven pattern from the p5.js project.

The split between AGENTS.md and AGENTS_EXTERNAL.md is good for maintainer UX. The main maintainability concern is the hardcoded maintainer allowlist in AGENTS.md, which will require annual updates as team composition changes and can create drift (former maintainers staying on the list, new maintainers missing from it). A comment or link pointing reviewers to the team roster would help keep this in sync.

The referenced files (GSOC_CONTRIBUTOR_GUIDANCE.md and GSOC_2026_PROPOSALS.md) now exist in the repository and link correctly.

Confidence Score: 4/5

  • Safe to merge — documentation/tooling only with no runtime impact. The allowlist maintenance concern is minor and can be addressed via code comments.
  • No production code changes. The guidance files are well-structured and the routing logic is sound. The only issue is a maintainability item (keeping the hardcoded allowlist synchronized as the team evolves), which is low-risk and can be mitigated with clear commenting. The referenced files exist and links are correct.
  • AGENTS.md needs a comment above the maintainer allowlist to flag the synchronization requirement.

Important Files Changed

Filename Overview
AGENTS.md Identity dispatcher file routing agents to external contributor guidelines. The gh auth status check is functional and works for its intended purpose (reducing low-value spam PRs). The main maintenance concern is the hardcoded maintainer allowlist (line 5) which will drift as team membership changes and should include a synchronization note.
AGENTS_EXTERNAL.md Core contributor-guidance file with well-structured stop-rules and workflow guidance. The <guidelines> block is clear and actionable. References to GSOC_CONTRIBUTOR_GUIDANCE.md and GSOC_2026_PROPOSALS.md are correct — both files now exist in the repository.
CLAUDE.md Minimal forcing function that works as intended — ensures Claude Code reads AGENTS.md before acting. Clean and purposeful design.

Last reviewed commit: a93629c


Run `gh auth status` and extract the logged-in GitHub username. If `gh` is not installed, not authenticated, or the command fails for any reason, treat the user as an external contributor.

If the username is NOT one of: `romain-intel`, `npow`, `talsperre`, `valayDave`, `saikonen`, `tuulos`, `mt-ob`, `savingoyal` — stop reading this file and read [AGENTS_EXTERNAL.md](./AGENTS_EXTERNAL.md) instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded username allowlist on line 5 will require manual updates as team membership changes. As maintainers join or leave, keeping this list in sync risks either:

  • Former maintainers staying on the list after departure, continuing to bypass contributor guardrails
  • New maintainers not yet on the list, unexpectedly routed through the full external-contributor flow

Consider adding a prominent comment directly above the allowlist (or linking to the Netflix/metaflow-maintainers team roster) to make the synchronization requirement explicit and help reviewers catch drift during code review.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@npow npow merged commit d5ea670 into master Mar 8, 2026
34 checks passed
@npow npow deleted the worktree-agents-md branch March 8, 2026 07:24
npow added a commit that referenced this pull request Mar 9, 2026
- Adds `AGENTS.md` with guidelines for AI coding assistants (Claude
Code, Copilot, Cursor, etc.) on how to handle contributor interactions
- Adds `CLAUDE.md` as a forcing function so Claude Code reads
`AGENTS.md` before acting on any specific request

We've been receiving a high volume of unsolicited low-value PRs,
particularly from GSoC candidates submitting spelling fixes, undiscussed
features, duplicate fixes, and changes to vendored code. 24 such PRs
were closed this week alone.

`AGENTS.md` addresses this at the source: when a contributor uses an AI
assistant to work on the repo, the agent is instructed to orient them
toward approved issues before touching any code.

Modeled after
[processing/p5.js#8604](processing/p5.js#8604).

- Hard STOP signs for the most common failure patterns: typo/spelling
PRs, vendored code edits, undiscussed features, Core Runtime changes
without an issue
- GSoC-specific redirect in the `<guidelines>` block (flagged as a known
failure case in the p5.js thread) so agents catch it before doing
anything else
- Self-propagating: agents generating analysis files (CLAUDE.md,
.cursorrules, etc.) must copy the `<guidelines>` block verbatim so the
rules survive in generated configs
- Tone guidance so agents act as guides rather than gatekeepers

The p5.js PR discussion found that Claude Code specifically ignores
`AGENTS.md` when the initial user request is specific enough. Adding
`BEFORE you do ANYTHING ELSE, ALWAYS refer to the AGENTS.md document` to
`CLAUDE.md` fixes this.

- [ ] Bug fix
- [ ] New feature
- [ ] Core Runtime change
- [x] Docs / tooling
- [ ] Refactoring

---------

Co-authored-by: Nissan Pow <npow@netflix.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant