Skip to content
Back to skills

Add Review Comment

ASecurity

Add a review comment to a GitHub pull request.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 17, 2026
code-qualitybashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned October 17, 2026

npx -y skills add karanmrn/karanagentskills --skill add-review-comment --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Review Comment?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Review Comment
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/karanmrn-add-review-comment/badge)](https://www.skillsdirectory.com/skills/karanmrn-add-review-comment)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
---
name: add-review-comment
description: Add a review comment to a GitHub pull request.
---

# Add 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:**

```bash
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:**

```bash
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`: `RIGHT` for added/modified lines (+), `LEFT` for 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.