Post review comments

From dyoshikawa/rulesync · View interactive version

Post review comments is an AI agent skill from the GitHub repository dyoshikawa/rulesync. Post line-level review comments and an overall review comment on a PR in English with a natural, concise writing style

How to use this skill

Skill file

target_pr = the user's request

If target_pr is not provided, use the PR of the current branch.

Step 1: Understand the PR

Read the PR diff and description to understand:

Step 2: Prepare Line-Level Comments

Identify specific lines in the diff that deserve feedback — bugs, potential issues, style concerns, suggestions for improvement, or questions about intent.

For each comment, note:

Step 3: Prepare an Overall Review Comment

Write a brief overall assessment of the PR. This is a summary-level comment, not a repeat of line-level feedback.

Step 4: Post the Review

Use a single gh api call to submit both line-level comments and the overall comment together as one review:

gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews \
  --method POST \
  -f event="COMMENT" \
  -f body="<overall comment>" \
  -f 'comments[]={...}' ...

Each line comment requires: path, line (line number in the diff's new file), and body.

If you have no line-level comments, fall back to:

gh pr review <pr_number> --comment --body "<overall comment>"

Writing Style

Write in English only.

Style guidelines — write like a human teammate, not a bot:

Step 5: Report

Output the PR number, a count of line-level comments posted, and a brief summary of the overall comment.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.