Skip to content
Closed
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
29 changes: 25 additions & 4 deletions skills/github-pr-review/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@ gh api \
-f comments[][body]='🟡 Suggestion: Another comment.'
```

### Confirm completion with a PR issue comment

After the review API call succeeds, post a short issue comment on the PR conversation confirming that the review finished. This gives the PR timeline a durable marker that the review was actually submitted on a specific commit, which is useful when an agent analyzed the PR but might otherwise fail before leaving visible proof that the review API call succeeded.

```bash
gh api -X POST repos/{owner}/{repo}/issues/{pr_number}/comments \
-f body='Completed OpenHands review: submitted a COMMENT review on commit {commit_sha}.'
```

Replace `COMMENT` with the same value you sent in the review request's `event` field (`COMMENT`, `APPROVE`, or `REQUEST_CHANGES`). Replace `{commit_sha}` with the same SHA you used for `commit_id`.

**Mandatory:** The review is only complete after both API calls succeed:
1. create the PR review object, and
2. post the completion comment on the PR issue.

If you found no actionable issues, post a short `APPROVE` review and a matching completion comment rather than ending silently without posting a review.

If the review API call fails, do not post the completion comment. If the review succeeds but the completion comment fails, tell the user that the review was submitted but completion reporting failed, include the review event and commit SHA in that response, and keep trying or ask for help instead of claiming success.

### Parameters

| Parameter | Description |
Expand Down Expand Up @@ -139,7 +158,9 @@ curl -X POST \

1. Analyze the code and identify issues
2. Post **ONE** review with all inline comments bundled
3. Use priority labels (🔴🟠🟡🟢) on every comment
4. Use suggestion syntax for concrete code changes
5. Keep the review body brief (details go in inline comments)
6. If no issues: post a short approval message
3. Post a short PR issue comment confirming the review was submitted on the same event and commit SHA
4. Use priority labels (🔴🟠🟡) on every comment
5. Use suggestion syntax for concrete code changes
6. Keep the review body brief (details go in inline comments)
7. If no issues: post a short approval message, then post the matching completion comment
8. Do not finish unless both the review object and completion comment were created successfully

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Style: File should end with a newline character (POSIX standard).

Suggested change
8. Do not finish unless both the review object and completion comment were created successfully
8. Do not finish unless both the review object and completion comment were created successfully

31 changes: 26 additions & 5 deletions skills/github-pr-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,25 @@ EOF
gh api -X POST repos/{owner}/{repo}/pulls/{pr_number}/reviews --input /tmp/review.json
```

### Step 3: Confirm completion with a PR issue comment

After the review API call succeeds, post a short issue comment on the PR conversation confirming that the review finished. This gives the PR timeline a durable marker that the review was actually submitted on a specific commit, which is useful when an agent analyzed the PR but might otherwise fail before leaving visible proof that the review API call succeeded.

```bash
gh api -X POST repos/{owner}/{repo}/issues/{pr_number}/comments \
-f body='Completed OpenHands review: submitted a COMMENT review on commit {commit_sha}.'
```

Replace `COMMENT` with the same value you sent in the review payload's `event` field (`COMMENT`, `APPROVE`, or `REQUEST_CHANGES`). Replace `{commit_sha}` with the same SHA you used in `commit_id`.

**Mandatory:** The review is only complete after both API calls succeed:
1. create the PR review object, and
2. post the completion comment on the PR issue.

If you found no actionable issues, post a short `APPROVE` review and a matching completion comment rather than ending silently without posting a review.

If the review API call fails, do not post the completion comment. If the review succeeds but the completion comment fails, tell the user that the review was submitted but completion reporting failed, include the review event and commit SHA in that response, and keep trying or ask for help instead of claiming success.
Comment on lines +69 to +71

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Suggestion: The error guidance "keep trying or ask for help" is underspecified. Consider clarifying:

  • Retry logic (how many attempts? exponential backoff?)
  • Which HTTP status codes warrant retry (e.g., 429, 502, 503) vs abort (e.g., 401, 403, 404)?
  • How to avoid posting duplicate comments if retrying

This matters because agents need concrete retry contracts, not open-ended "keep trying" instructions.


### Parameters

| Parameter | Description |
Expand Down Expand Up @@ -141,8 +160,10 @@ curl -X POST \
1. Analyze the code and identify important issues (minimize nits)
2. Write review data to a JSON file (e.g., `/tmp/review.json`)
3. Post **ONE** review using `gh api --input /tmp/review.json`
4. Use priority labels (🔴🟠🟡) on every comment
5. Do NOT post comments for code that is acceptable — only comment when action is needed
6. Use suggestion syntax for concrete code changes
7. Keep the review body brief (details go in inline comments)
8. If no issues: post a short approval message with no inline comments
4. Post a short PR issue comment confirming the review was submitted on the same event and commit SHA
5. Use priority labels (🔴🟠🟡) on every comment
6. Do NOT post comments for code that is acceptable - only comment when action is needed
7. Use suggestion syntax for concrete code changes
8. Keep the review body brief (details go in inline comments)
9. If no issues: post a short approval message with no inline comments, then post the matching completion comment
10. Do not finish unless both the review object and completion comment were created successfully

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Style: File should end with a newline character (POSIX standard).

Suggested change
10. Do not finish unless both the review object and completion comment were created successfully
10. Do not finish unless both the review object and completion comment were created successfully

Loading