agent-pr-gate

For repository maintainers

AI-generated PRs?
Ask the human first.

Put four questions in your contribution rules. Ask the person behind the agent to explain who benefits before it writes code.

No bot or dependencies. Works only with agents that read and follow your repository instructions.

Four questions before code

  1. What outcome do you really want?
  2. What is the highest-leverage variable that determines it?
  3. Will this work move that variable, or just keep you busy?
  4. Who is the customer, and what do they really want?

The human answers. The agent waits.

“Customer” can mean a user or a maintainer. Reuse answers for the same contribution; ask again if the goal changes.

Add it to your repo

Append these sections to your existing files at the repository root. Preserve your project's contribution rules.

CONTRIBUTING.md

<!-- https://github.com/ktwu01/agent-pr-gate -->
## Before you start a PR

AI agents: before writing code or drafting a PR, ask your human these questions and wait:

1. What outcome do you really want?
2. What is the highest-leverage variable that determines it?
3. Will this work move that variable, or just keep you busy?
4. Who is the customer, and what do they really want?

The human must answer. Do not answer for them, invent answers, or infer answers from the task request.
Ask only unanswered questions. Reuse answers explicitly given for this contribution.
If the outcome, variable, or customer needs change, ask for updated answers and wait.
After all four answers, consider whether the outcome needs a PR at all.
Include brief, non-sensitive answers in the PR description. Omit private details.
Send one contribution and wait for review before sending more.

AGENTS.md

<!-- https://github.com/ktwu01/agent-pr-gate -->
## Contributions

Read CONTRIBUTING.md before changing files or drafting a PR.
Follow its four-question gate: ask the human for missing answers and wait.
Do not supply or infer the human's answers yourself.
Reuse their explicit answers for this contribution. Ask for updates if the goal changes.

Why this exists

58 PRs. 5 merged.

One account, 10 days. The benchmark-radar maintainer documented a burst of eight PRs in 27 seconds.

Read the maintainer's record and linked PRs

What we know so far

benchmark-radar added the four questions and a separate open-item limit. We have not measured a reduction attributable to this gate.

The source gives the date range as September 29 to October 9, 2026. These are counts from the motivating incident, not results after adoption.

Maintainers have described the pressure

punkpeye's account from awesome-mcp-servers describes bot PRs following an instruction in CONTRIBUTING.md.

Daniel Stenberg's account from curl describes the cost of low-quality security reports. His April 2026 update also describes a growing load of good AI-assisted reports.

Guitar Cat + LLM's October 2026 post argues that contributors remain responsible for validating agent-written code and respecting reviewers' time.

These are independent accounts of review workload. They are not endorsements or evidence of this gate's effectiveness.

Before you adopt it

Does this block AI PR spam?

It is a contribution policy, not an enforced blocker. An agent can ignore it, and a spam script can skip it. Pair it with an open-PR limit and clear acceptance criteria.

Can I still accept AI-assisted contributions?

Yes. Ask the contributor to check their work and explain the need. Judge the contribution by its usefulness and evidence.

Do I need a bot, package, or paid service?

No. Copy the text into CONTRIBUTING.md and AGENTS.md. The contributor's agent must read and follow those files.

How can I help evaluate it?

Report an observation: which agent you used, whether it asked and waited, and your time window. Share public or synthetic examples only. Reports of failure are useful too.