Skip to content

feat(pr-reviewer): read the repo's AGENTS.md and guideline docs before reviewing - #474

Draft
smolpaws wants to merge 1 commit into
OpenHands:mainfrom
smolpaws:feat/reviewer-read-agents-md
Draft

feat(pr-reviewer): read the repo's AGENTS.md and guideline docs before reviewing#474
smolpaws wants to merge 1 commit into
OpenHands:mainfrom
smolpaws:feat/reviewer-read-agents-md

Conversation

@smolpaws

Copy link
Copy Markdown
Contributor
  • A human has tested these changes.

Why

The PR reviewer does not reliably see a repository's own guidance (AGENTS.md,
contributing/coding guidelines). The cron automation clones the target repo into
a subdirectory of the workspace, so the SDK never loads that repo's
AGENTS.md into the agent's context as an always-on repo skill — and the
reviewer prompt never told the agent to read it. So a repo's documented rules
(e.g. "endpoint access belongs in the client repo, not here") don't influence
the automated review.

Follow-up to the community request that agents respect per-repo guidance
(the AGENTS.md repository-map work): reviews should honor the same docs that
steer working agents.

Summary

  • Instruct both reviewer prompt surfaces that they MUST read the
    repository's own guidance before reviewing:
    • the cron automation prompt (skills/github-pr-reviewer/scripts/main.py,
      _build_review_prompt) — a new workflow step after checkout;
    • the /codereview plugin prompt (plugins/pr-review/scripts/prompt.py).
  • Read AGENTS.md (repo root + any nested one covering the changed files) plus
    other relevant docs when present (CONTRIBUTING.md, CLAUDE.md,
    .cursorrules, review/coding guidelines) and apply that guidance.
  • Add a test asserting the plugin prompt carries the instruction.

Issue Number

N/A — requested in the community #general thread on agents implementing in
the wrong repository (review-guidelines half).

How to Test

Unit tests: python3 -m pytest tests/ — 542 passed, 6 skipped; ruff clean.
The new test_prompt_instructs_reading_repo_guidance asserts the plugin prompt
now instructs reading AGENTS.md / CONTRIBUTING.md. The automation change is a
prompt-text addition (a new review-workflow step); no runtime behaviour beyond
what the agent reads during a review.

Video/Screenshots

N/A — prompt/guidance change, no UI surface.

…e reviewing

The PR reviewer did not reliably see a repository's own guidance. The
cron automation clones the target repo into a workspace subdirectory, so its
AGENTS.md is never loaded into the agent's context as an always-on repo skill;
the reviewer had no instruction to read it either.

Tell both reviewer prompt surfaces — the automation's _build_review_prompt and
the /codereview plugin prompt — that they MUST read the repository's AGENTS.md
(root + any nested one covering the changed files) plus other relevant docs
(CONTRIBUTING.md, CLAUDE.md, .cursorrules, review/coding guidelines) and apply
that guidance. This lets a repo steer reviews via AGENTS.md, matching how it
steers working agents.

Co-authored-by: smolpaws <engel@enyst.org>
@github-actions github-actions Bot added the type: feat A new feature label Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants