Skip to content

Update AGENTS.md on selecting issues - #33066

Merged
StefanieSenger merged 8 commits into
scikit-learn:mainfrom
AnneBeyer:update_agentsMD
Jul 21, 2026
Merged

StefanieSenger merged 8 commits into
scikit-learn:mainfrom
AnneBeyer:update_agentsMD

Conversation

@AnneBeyer

Copy link
Copy Markdown
Member

Reference Issues/PRs

#31679 (comment)

What does this implement/fix? Explain your changes.

First I added a section on how (not) to select issues. Then I asked Claude Haiku 4.5 to reformulate the file so that AI agents will follow it. (It did generate the requested AI disclosure line at the end 🥳 )

I playes around with it by asking all available Copilot models to suggest issues to work on or to create a solution for an issue that is currently labelled "Needs Triage". GPT-5 mini did not follow the instructions, and when asked why responded that the text was optimized for humans and that it should include model parsable instructions in the beginning, so I added its suggestions as well.

I don't think there is a single way to address all agents, but it might help at least with some. If anyone want's to play around with it further, feel free. I exceeded my free quota for now. 😅

@betatim @StefanieSenger

AI usage disclosure

I used AI assistance for:

  • Text generation and refinement

Any other comments?

@betatim

betatim commented Jan 13, 2026

Copy link
Copy Markdown
Member

For me it is fine to try this out. I think there are no great ways of validating this other than trying it out :-/

A question: did you add the --- between headings or was it one of the things a model added when asked to make it "more machine readable"? Is this something we should be doing?

One thing to start thinking about, but not needed for this PR, is that there is a limit to how much we can put into AGENTS.md. At some point it gets far too long (for humans or agents). A pattern I've seen used and use myself is to have a section in AGENTS.md that refers to a directory of documents. For example:

## Before Starting Work

Read relevant `agents/designs/*.md` for architecture context (why decisions were made)


## Designs

Design and architecture decisions are in `agents/designs/`. Use it to record learnings and why decisions were made. Refer to it when planning and implementing work.

And in agents/designs/ there are markdown files that describe design decisions. Right now I only have documents on the array API, but if I start working on other things I would add design documents on other topics as well.

@betatim

betatim commented Jan 13, 2026

Copy link
Copy Markdown
Member

As a side comment: is there a guide or something about using copilot to work on an issue? It sounds like there is some UI that lets me click "Copilot please start working on this issue with me"? My way of using AI agents must be out of date already because I check out a new branch and then tell it about what I want to work on, ask it to make a plan, iterate on the plan, etc. So the idea of asking an agent to suggest what to work on is a new idea to me, and I'm interested to learn how people do that

@AnneBeyer

Copy link
Copy Markdown
Member Author

A question: did you add the --- between headings or was it one of the things a model added when asked to make it "more machine readable"? Is this something we should be doing?

It looks like this was already there in your version (#32584) and Claude added it consistently. I'm not sure if it makes a difference.

@AnneBeyer

Copy link
Copy Markdown
Member Author

So the idea of asking an agent to suggest what to work on is a new idea to me, and I'm interested to learn how people do that

To be honest, this is based solely on a hunch that people might be using it for that. Sometimes we get comments or PRs so fast after an issue was opened that this suggests some form of automation, but I'm not sure if this is actually done with agents.

@StefanieSenger StefanieSenger left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it is worth a try and our best shot at the moment.
Thanks for taking care of this, @AnneBeyer!

I only have a little comment on distinguishing between linked issues and linked issues that are either "open" or "closed as completed". I think it is fine to allow an agent to suggest a PR on an issue with PRs closed unfinished. If you think that complicates the matter too much or would not be easily understood by an LLM, feel free to ignore my comment.

Comment thread AGENTS.md Outdated

- **Issues labeled "Needs Triage"** — These issues require initial review and categorization by maintainers before ANY work should begin. Working on them without approval will result in rejected work. See [Needs Triage guidance](https://scikit-learn.org/dev/developers/contributing.html#issues-tagged-needs-triage).

- **Issues with linked PRs** — If an issue already has one or more PRs linked to it, someone is actively working on it. Duplicating effort on the same issue is wasteful and unprofessional. **Always check for linked PRs first.**

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- **Issues with linked PRs** — If an issue already has one or more PRs linked to it, someone is actively working on it. Duplicating effort on the same issue is wasteful and unprofessional. **Always check for linked PRs first.**
- **Issues with linked PRs** — If an issue already has one or more PRs linked to it that are "open" or "closed as completed", someone has actively been working on it. Duplicating effort on the same issue is wasteful and unprofessional. **Always check for linked PRs first.**

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't have a strong opinion on this. It might be too complex, because if there is a linked PR that is "closed as completed" (or should it rather be "merged" for PRs?), but the issue is not closed, that means there is still work left to do, right?
So maybe we could just change it to "open PRs" instead?

@StefanieSenger

StefanieSenger commented Jan 14, 2026 •

Copy link
Copy Markdown
Member

So the idea of asking an agent to suggest what to work on is a new idea to me, and I'm interested to learn how people do that

This is indeed more a deduction, but I also share it. Often automated PRs don't even reference the issue in the PR description and rather repeat the problem stated there as if they had come up with it. They ignore any discussion that had happened on the issue, including the fact that other people started to work on it and have opened PRs (see for instance #32946.)

I can only deduce that the human who operated the agent didn't interact at all with the issue and didn't read it themselves.
How else would you miss these obvious things?

Edit: also I think this contributor who has opened 16 PR within 6 hours yesterday would probably have asked their LLM what to work on.

@AnneBeyer

Copy link
Copy Markdown
Member Author

Should we add a short version of this also to the HUMAN.md (aka CONTRIBUTING.md)?
It seems this could still be made more explicit for humans as well (see for example #33034).

@StefanieSenger

Copy link
Copy Markdown
Member

I think that's what we have Issues tagged “Needs Triage” for.

@AnneBeyer

Copy link
Copy Markdown
Member Author

Agreed, but unfortunately that section is quite hard to find if you don't have the link to it, unless I'm overlooking something?

If you search for "Needs Triage" using the search in the docs, you don't get that section directly, but have to click on any but the first or last match, and then click on another reference link (or search and scroll) again.
It is also not explicitly part of the FAQs (only hidden in How do I improve my issue or pull request?)

I agree that ideally new contributors should start by reading the required docs, but since they obviously don't, and it is annoying us, shouldn't we make the information easier to find?

@StefanieSenger

Copy link
Copy Markdown
Member

It is also linked quite prominently in New Contributors.
Personally I think, new contributors who don't read that, probably don't read any docs at all.

@lucyleeow

Copy link
Copy Markdown
Member

our best shot at the moment.

Just wondering, we've floated the idea of adding a workflow to prevent new contributors from opening a PR that e.g., does not link an issue/issue that has 'needs triage' label - I think stdlib may do something similar. I feel like this would be a more 'sure' approach. But I am not sure if there is resistance to the idea? What do we think?

(I know such a workflow would be a bigger undertaking, but I think it would be more impactful, but there has to be agreement)

@AnneBeyer

Copy link
Copy Markdown
Member Author

Just wondering, we've floated the idea of adding a workflow to prevent new contributors from opening a PR that e.g., does not link an issue/issue that has 'needs triage' label - I think stdlib may do something similar. I feel like this would be a more 'sure' approach. But I am not sure if there is resistance to the idea? What do we think?

(I know such a workflow would be a bigger undertaking, but I think it would be more impactful, but there has to be agreement)

I think a more rule-based approach could indeed make sense in this case, but this is probably best discussed in a separate issue?

@StefanieSenger

StefanieSenger commented Jan 18, 2026 •

Copy link
Copy Markdown
Member

Just in case you didn't see the message on the GHA migration on Discord (you probably did): In order to have the checks complete, you need to pull from main, @AnneBeyer.

@betatim

betatim commented Apr 15, 2026

Copy link
Copy Markdown
Member

https://jacobtomlinson.dev/posts/2026/guiding-your-contributors-agents-to-better-behaviours/ is an interesting take on the topic of this issue. The main take away is to move "how to choose an issue to work on" Into a skill instead of having it in the AGENTS.md.

I don't know if we want to restructure this PR to make a "select an issue" skill or not. Maybe this is something to do in the future. I came here to link Jacob's blog post because of #33708

@AnneBeyer

Copy link
Copy Markdown
Member Author

+1 for following Jacob's suggestion and converting this into a separate skill.
I'll follow your approach in #33708 and will try to convert this into something with a similar structure.

@adrinjalali adrinjalali added this to Labs Apr 20, 2026
@adrinjalali adrinjalali moved this to Todo in Labs Apr 20, 2026
@AnneBeyer

Copy link
Copy Markdown
Member Author

Based on this line from @ogrisel's PR

AI agents should never be in charge of deciding which issues or PRs to work on.

creating a skill for exactly that is probably not what we actually want.

Jacob created a separate skill for resolving issues in NVIDIA's sphinx-llm, which includes checking if it is "ready". Do we want to adapt this skill in general instead? What are your experiences @adrinjalali @betatim?

@AnneBeyer

Copy link
Copy Markdown
Member Author

Side note: Relating back to previous discussions, maybe using a positive label like "ready" (like sphinx-llm does) could be a simplification of our checks, which currently are:

  • no "Needs ..." Label
  • description does not contain "This issue is not yet ready for a PR"
  • no one already commented "I'm (interested in) working on this/I'll open a PR"
  • no other open PRs that contain "closes/fixes" for this issue

but then, this would also require us to re-label all existing issues that are worth fixing.

@adrinjalali

Copy link
Copy Markdown
Member

Honestly, at this point I'm like, if it's ready for AI, we can ask our copilot-(like) AI to solve it ourselves. Don't need a third party to do that 🤔

@AnneBeyer

Copy link
Copy Markdown
Member Author

Fair enough.

Do we want to spend more effort in reducing the slop by

  • making the checks explicit in AGENTS.md (shifting the focus from guidelines for selecting issues to guidelines on which issues to refuse to work on)
  • or follow a more rule based approach using GitHub actions as suggested by @lucyleeow above?

The new warning does not seem to have any impact.

@adrinjalali

Copy link
Copy Markdown
Member

The new warning #33757.

It does give a very easy basis to block folks though 😅

@betatim

betatim commented Apr 22, 2026

Copy link
Copy Markdown
Member

AI agents should never be in charge of deciding which issues or PRs to work on.

creating a skill for exactly that is probably not what we actually want.

I'm less sure. I agree that in the end a human needs to decide what they want to work on, but that doesn't mean that having a guide (in the form of a skill) that helps me pick something is useless. I think a skill that is like a "workflow" or interactive version of documentation that walks the user through a process (picking an issue, debugging a failure, choosing an estimator) is a useful thing to have.

As a maintainer I would enjoy a skill/app that helps me answer the question "where should I start reviewing PRs today?". Many of us have even built little apps to help with that. It doesn't mean that I blindly start reviewing what ever the app/skill/agent tells me, but it is still useful to have.

A skill for picking an issue could check automatically "has this user contributed before?" and use that information to pick an issue (in this case maybe "good first issue"). Or ask the user some questions to help figure out what issues could be a good match.

Having a human that gets presented with an issue, uses AI to solve it (or not), reviews the work and then makes a PR is a useful thing. So I'd push back on the "if the issue is ready we might as well just use our own AI agent to do it". The equation changes if the human user doesn't engage their brain while using AI, but hopefully they do.

I am not sure we want to change our labelling strategy yet again. We have done a lot there already and the cynic in me feels like we are just rearranging the labels on the deckchairs of the Titanic.

The reason I'm thinking of this as "a skill that picks an issue" and not "a skill that resolves an issue" is that I think the latter encourages "set it to auto and forget about it". The resolve skill includes instructions on how to go about coding the solution and such. I'm not sure yet if I am ready for having something like that. It could be a good idea because it lets us harness other people's Claude/Cursor subscription by guiding their agent, but it also feels like it encourages people to not use their brain.

@lucyleeow

Copy link
Copy Markdown
Member

We have done a lot there already and the cynic in me feels like we are just rearranging the labels on the deckchairs of the Titanic.

🤣

Or ask the user some questions to help figure out what issues could be a good match.

This may be nice if we get it working

@AnneBeyer

Copy link
Copy Markdown
Member Author

I just came across this:
avinashkamat48/avinashkamat48#2
where it seems codex was used to build a rule based gh action that suggests issues to work on. I'm not sure if we have a chance to interact with something like this in any way to implant our selection criteria.

@jeremiedbb jeremiedbb moved this from Todo to Stalled in Labs Jun 29, 2026
@AnneBeyer

Copy link
Copy Markdown
Member Author

This might become redundant with #34252, but after seeing more and more of these issue radars mentioning issues labelled "Needs Triage", I thought it couldn't hurt to add at least a short note on this in our AGENTS.md. It will most likely not be taken into account by the radars, but it might at least notify people using agents to work inside our repo.

I undid the changes from before and just added a short paragraph including the specific command to run to check the label (which was a suggestion from Claude) before working on an issue.

@AnneBeyer
AnneBeyer marked this pull request as ready for review July 18, 2026 11:51
@AnneBeyer AnneBeyer moved this from PR Stalled to PR waiting for reviews in Labs Jul 18, 2026
@StefanieSenger
StefanieSenger merged commit 279f9e7 into scikit-learn:main Jul 21, 2026
33 checks passed
@github-project-automation github-project-automation Bot moved this from PR waiting for reviews to Done in Labs Jul 21, 2026
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@AnneBeyer
AnneBeyer deleted the update_agentsMD branch September 2, 2026 11:59
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks done
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.

5 participants