About add-review-comment
A skill for adding review comments to specific lines in a GitHub pull request. It supports single-line and multi-line comments, with guidance on actionable suggestions and concise reporting of repeated issues.
Key features
- 01Posts single-line comments
- 02Posts multi-line comments
- 03Targets added or deleted lines
- 04Supports suggestion blocks
Use cases
- 01Commenting on a specific changed line
- 02Suggesting an inline fix maintainers can apply
- 03Reporting one representative instance of a repeated issue
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ mlflow/ mlflow --skill add-review-commentAfter installing, type/add-review-commentin Claude Code to confirm it loaded.
Details
From the project READMEAdd Review Comment
Adds a review comment to a specific line in a GitHub pull request.
Step 1: Locate the line to comment on
Use the fetch-diff skill (optionally piped through grep) to locate the line to comment on.
Step 2: Post the comment
Single-line comment:
gh api repos/<owner>/<repo>/pulls/<pr_number>/comments \
# Body must end with "🤖 Generated with Claude" on a separate line
-f body=<comment> \
-f path=<file_path> \
-F line=<line_number> \
-f side=<side> \
-f commit_id="$(gh pr view <pr_number> --repo <owner>/<repo> --json headRefOid -q .headRefOid)" \
--jq '.html_url'
Multi-line comment:
gh api repos/<owner>/<repo>/pulls/<pr_number>/comments \
# Body must end with "🤖 Generated with Claude" on a separate line
-f body=<comment> \
-f path=<file_path> \
-F start_line=<first_line> \
-f start_side=<side> \
-F line=<last_line> \
-f side=<side> \
-f commit_id="$(gh pr view <pr_number> --repo <owner>/<repo> --json headRefOid -q .headRefOid)" \
--jq '.html_url'
Parameters
line: Line number in the file (for multi-line, the last line)side:RIGHTfor added/modified lines (+),LEFTfor deleted lines (-)start_line/start_side: For multi-line comments, the first line of the range
Best Practices
-
Use suggestion blocks (three backticks + "suggestion") for simple fixes that maintainers can apply with one click
```suggestion <suggested code here> ```Note: Preserve original indentation exactly in suggestion blocks
-
For repetitive issues, leave one representative comment instead of flagging every instance
-
For bugs, explain the potential problem and suggested fix clearly