Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion automations/bundle-index.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions plugins/pr-review/scripts/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@

For dependency update PRs, do **NOT** approve a target version that was published less than 7 days ago. First-party packages maintained by the same organization as the reviewed repository are intentionally excluded from this 7-day waiting rule, but still scrutinize them for supply-chain risk.

Before reviewing, you MUST read the repository's own guidance to understand the repo first: read `AGENTS.md` at the repository root (and any nested `AGENTS.md` covering the changed files), plus other relevant docs when present — e.g. `CONTRIBUTING.md`, `CLAUDE.md`, `.cursorrules`, and any review or coding-guideline docs. Apply that guidance to your review.
Comment thread
smolpaws marked this conversation as resolved.

Review the PR changes below and identify issues that need to be addressed.

## Pull Request Information
Expand Down
7 changes: 6 additions & 1 deletion skills/github-pr-reviewer/scripts/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,12 @@ def _build_review_prompt(repo: str, pr: dict, head_sha: str, label_event: dict,
"Required workflow:\n"
"1. The workspace is already the repository root at the exact Head SHA above. "
"Do not clone, fetch, check out, or delete the repository.\n"
"2. Inspect the PR discussion, existing review comments, changed files, and the diff, "
"2. Before reviewing, you MUST read the repository's own guidance to understand the repo first.\n"
Comment thread
smolpaws marked this conversation as resolved.
" Read `AGENTS.md` at the repository root (and any nested `AGENTS.md` covering the "
"changed files), plus other relevant docs when present - e.g. `CONTRIBUTING.md`, "
"`CLAUDE.md`, `.cursorrules`, and any review or coding-guideline docs. Apply that "
"guidance to your review.\n"
" Then inspect the PR discussion, existing review comments, changed files, and the diff, "
"together with the surrounding code in the workspace.\n"
" Use `gh` or GitHub REST API calls with `GITHUB_PERSONAL_ACCESS_TOKEN`; never print secret values.\n"
"3. Ground every finding in the workspace code. Before using an inline location, verify that "
Expand Down
13 changes: 13 additions & 0 deletions skills/github-pr-reviewer/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,19 @@ def test_no_guide_section_when_guide_is_none(self):
)
self.assertNotIn("Repo-specific review guide", prompt)

def test_prompt_requires_reading_repository_guidance(self):
prompt = main._build_review_prompt(
"owner/repo",
self._pr(),
"0123456789abcdef",
{"id": "1", "created_at": "t"},
)

self.assertIn("MUST read", prompt)
self.assertIn("AGENTS.md", prompt)
self.assertIn("CONTRIBUTING.md", prompt)
self.assertIn("nested `AGENTS.md`", prompt)


class TestNormalizeRepo(unittest.TestCase):
"""A repository is written down in more than one way, and every API path in
Expand Down
2 changes: 1 addition & 1 deletion skills/index.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions skills/openhands-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ Source: [`examples/`](https://github.com/OpenHands/software-agent-sdk/tree/main/
- [`55_persistent_memory.py`](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/55_persistent_memory.py)
- [`56_structured_output.py`](https://github.com/OpenHands/software-agent-sdk/blob/main/examples/01_standalone_sdk/56_structured_output.py)
- [`57_prompt_hooks`](https://github.com/OpenHands/software-agent-sdk/tree/main/examples/01_standalone_sdk/57_prompt_hooks)
- [`58_ask_oracle_tool`](https://github.com/OpenHands/software-agent-sdk/tree/main/examples/01_standalone_sdk/58_ask_oracle_tool)

### [`02_remote_agent_server/`](https://github.com/OpenHands/software-agent-sdk/tree/main/examples/02_remote_agent_server)

Expand Down
10 changes: 10 additions & 0 deletions tests/test_pr_review_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ def test_prompt_with_roasted_trigger():
assert "/codereview-roasted" in prompt


def test_prompt_instructs_reading_repo_guidance():
"""The reviewer must be told to read AGENTS.md (and other guideline docs)
to understand the repo before reviewing."""
prompt = _format_prompt(require_evidence=False)

assert "AGENTS.md" in prompt
assert "MUST read" in prompt
assert "CONTRIBUTING.md" in prompt


def test_format_prompt_omits_evidence_requirements_by_default():
prompt = _format_prompt(require_evidence=False)

Expand Down
Loading