add-review-comment

Post review comments to GitHub pull requests via the GitHub CLI.

1|6|Updated Mar 28, 2025
One-click install
npx skills add https://github.com/mlflow/dev --skill add-review-comment
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-review-comment
Source: https://github.com/mlflow/dev/tree/main/.claude/skills/add-review-comment
Command: npx skills add https://github.com/mlflow/dev --skill add-review-comment

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates posting a targeted review comment to a GitHub pull request, eliminating repetitive manual commenting during code reviews.

Core Features & Use Cases

  • Post a review comment on a specific file line in a PR using the GitHub CLI.
  • Support single-line and multi-line comments with control over line numbers and sides.
  • Useful for automated feedback during code reviews, CI checks, or bot-driven PR guidance.

Quick Start

Use the add-review-comment skill to post a comment on a PR. Example commands: gh api repos/<owner>/<repo>/pulls/<pr_number>/comments
-f body="This is an automated comment 🤖 Generated with Claude"
-f path=<file_path>
-F line=<line_number>
-f side=RIGHT
-f commit_id="$(gh pr view <pr_number> --repo <owner>/<repo> --json headRefOid -q .headRefOid)"
--jq '.html_url' Single-line or multi-line use variants can be constructed by adjusting body, start_line, end_line, and line fields as needed.

Frequently Asked Questions about add-review-comment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I post an automated review comment on a GitHub pull request?

To post an automated review comment on a GitHub pull request, use the GitHub CLI to call the repository API with the target file path, line number, and head commit ID. This targets specific code lines directly.

Can I add multi-line review comments to a PR using the gh CLI?

Yes, you can add multi-line review comments to a PR using the gh CLI. Adjust the body, start_line, end_line, and line fields in your API request to cover the desired code span on the chosen side.

Does posting a PR review comment via GitHub CLI require any special dependencies?

Posting a PR review comment via GitHub CLI requires Bash-based commands using gh api and gh pr view. No additional special dependencies are needed beyond the standard GitHub CLI environment.

What is the best way to automate code review feedback on a specific file line?

The best way to automate code review feedback on a specific file line is using the GitHub CLI API. Fetch the head commit ID and post a targeted comment to the exact file path and line number programmatically.

How do I fetch the head commit ID needed for a GitHub PR review comment?

To fetch the head commit ID needed for a GitHub PR review comment, use the command gh pr view with the pull request number and repository, returning the headRefOid value for the API request.

When should I not use automated PR comments for code reviews?

You should not use automated PR comments for code reviews when manual inspection is required. Use this automated commenting approach for CI checks, bot-driven guidance, and repetitive feedback instead of complex analysis.