Skip to content
Skills Library
Programming · Writing

pr-comment

/pr-comment

Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review. Use when: posting code review comments, giving PR feedback, sending inline suggestions. Not for: reading existing reviews (use load-pr-review), creating PRs (use create-pr), PR status (use pr-summary).

Licence
MIT
Last repository change
08.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 08.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/pr-comment.js

What it does and when to use it

Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review. Use when: posting code review comments, giving PR feedback, sending inline suggestions. Not for: reading existing reviews (use load-pr-review), creating PRs (use create-pr), PR status (use pr-summary).

Original author description

Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review. Use when: posting code review comments, giving PR feedback, sending inline suggestions. Not for: reading existing reviews (use load-pr-review), creating PRs (use create-pr), PR status (use pr-summary).

How it works

  1. Trigger Keywords
  2. When NOT to Use
  3. Core Principle
  4. Tone Guidelines
  5. Workflow
  6. Step-by-Step
  7. Verification Checklist
  8. References
Original SKILL.md headings · 175 lines, 876 words
SKILL.md preview
---
name: pr-comment
description: "Post friendly review comments to a GitHub PR — prepare locally, preview, then submit as atomic review. Use when: posting code review comments, giving PR feedback, sending inline suggestions. Not for: reading existing reviews (use load-pr-review), creating PRs (use create-pr), PR status (use pr-summary)."
---

# PR Comment

## Trigger Keywords

`pr comment`, `review comment`, `post comment`, `send review`, `pr feedback`, `inline comment`

## When NOT to Use

| Need | Use Instead |
|------|-------------|
| Read existing PR review comments | `/load-pr-review` |
| Create a code review (automated) | `/codex-review-fast` or `/codex-review` |
| Create a PR | `/create-pr` |
| PR status overview | `/pr-summary` |

## Core Principle

```
Discuss locally → prepare friendly comments → dry-run preview → user confirms → atomic submit
Control plane (this SKILL.md) handles conversation, tone, orchestration.
Data plane (JS script) handles validation, API calls, safety.
```

## Tone Guidelines

Claude prepares comments following these rules:

| Rule | Description | Example |
| ---- | ----------- | ------- |
| Questions over commands | Use "would it make sense to" instead of "change this to" | "Would it make sense to extract this to a shared utility?" |
| Code, not person | Subject is the code, not "you" | "This logic seems to..." not "You wrote..." |
| Explain why | Give the reason, not just the what | "If one copy gets a bug fix but the other doesn't..." |
| Assume good intent | Confirm rather than accuse | "Just want to confirm this trade-off is intentional" |
| Praise first | Acknowledge before suggesting | "This async design is great. One thought though..." |
| No emoji | Unless user explicitly requests | -- |
| Follow PR language | Match the language used in the PR | -- |

**Internal classification** (Conventional Comments, not shown in output):

| Label | Purpose | Blocking |
| ----- | ------- | -------- |
| `suggestion` | Improvement proposal | Configurable |
| `question` | Clarification | No |
| `issue` | Points out a problem | Yes |
| `nitpick` | Stylistic preference | No |
| `praise` | Positive feedback | No |

## Workflow

```mermaid
sequenceDiagram
    participant U as User
    participant C as Claude (Conversation)
    participant SK as SKILL.md (Orchestration)
    participant JS as pr-comment.js (Data Plane)
    participant GH as GitHub API

    Note over U,C: Phase 1: Natural conversation
    U->>C: Discuss PR diff, observations
    C->>U: Draft N friendly comments
    U->>C: Adjust tone / content / count

    Note over U,GH: Phase 2: Skill invoked
    U->>SK: /pr-comment [PR#]
    SK->>SK: Collect comments from conversation

    SK->>JS: prepare --pr N --repo owner/repo --input comments.json
    JS->>GH: gh pr view (metadata)
    JS->>GH: gh api pulls/N/files (changed files)
    JS->>GH: gh api pulls/N (head SHA)
    JS-->>SK: Validated payload + validation summary

    SK->>U: Dry-run preview (default)

    alt User confirms
        SK->>U: AskUserQuestion gate
        U->>SK: Approved
        SK->>JS: submit --pr N --repo owner/repo --input payload.json
        JS->>JS: Re-fetch head SHA, drift check
        JS->>GH: POST /repos/{owner}/{repo}/pulls/{N}/reviews
        GH-->>JS: 200/201 Success
        JS-->>SK: Success + review URL
        SK->>U: Review posted successfully
    end
```

## Step-by-Step

### Step 0: Collect Comments

From the conversation context, gather the user's review comments. Each comment needs:

| Field | Required | Default | Description |
| ----- | -------- | ------- | ----------- |
| `path` | Yes | -- | File path (repo-relative) |
| `line` | Yes | -- | Line number (positive integer) |
| `side` | No | `RIGHT` | `RIGHT` (new) or `LEFT` (deleted) |
| `body` | Yes | -- | Comment content |

### Step 1: Prepare (Dry-run)

Write the comments to a temp JSON file, then run:

```bash
bash scripts/run-skill.sh pr-comment pr-comment.js \
  prepare --pr <N> --repo <owner/repo> --input <comments.json>
```

Parse the JSON output. Display to user:

```markdown
## PR #<N>: <title>
**Target**: <owner/repo> | **Head**: <branch> | **State**: <state>

### Comments to Post (<valid>/<total> valid)

| # | File | Line | Side | Preview |
|---|------|------|------|---------|
| 1 | path/to/file.go | 136 | RIGHT | First 80 chars of body... |

### Validation
- Valid: N | Invalid: M (excluded) | Warnings: K
```

If invalid comments exist, show them with reasons.
If warnings exist, note them but include in payload.

### Step 2: Confirm

Use AskUserQuestion to get user approval before submitting.

### Step 3: Submit

Save the prepare output (including payload) to a temp file, then run:

```bash
bash scripts/run-skill.sh pr-comment pr-comment.js \
  submit --pr <N> --repo <owner/repo> --input <payload.json>
```

### Step 4: Handle Results

| Exit Code | Meaning | Action |
|-----------|---------|--------|
| 0 | Success | Report review URL |
| 2 | Error (including 422) | Report error details |
| 3 | SHA drift | Warn user, offer to re-prepare |

### SHA Drift Handling

If submit returns exit 3:

1. Inform user: "PR head has changed since prepare"
2. Re-run prepare with new SHA
3. Show updated dry-run preview
4. AskUserQuestion for re-confirmation
5. Re-submit

## Verification Checklist

- [ ] Comments collected from conversation context
- [ ] prepare validates paths against changed files
- [ ] prepare validates line numbers (positive integer)
- [ ] prepare validates body (non-empty)
- [ ] Dry-run preview shown to user before submit
- [ ] AskUserQuestion gate before submit
- [ ] SHA drift detected and handled
- [ ] Review URL reported on success
- [ ] jq + temp file pattern used (no shell interpolation)

## References

- `references/api-and-guardrails.md` -- API contract + safety rules + exit codes
Files in this package (3)
  • SKILL.md 6 KB
  • references/api-and-guardrails.md 3 KB
  • scripts/pr-comment.js 15 KB

Versions

The database has no other skills named pr-comment.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version b3402508a36d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100pr-review-comments
    Guide for submitting/posting inline PR review comments to GitHub. Use this when you need to post code review comments on specific lines of a Pull Request.
  • 100pr-review-post
    Post a GitHub PR review (verdict + inline comments) in one API call. Use when posting, submitting, or publishing a "PR review", "code review", "review with inline comments", "approve the PR", "request changes", or any payload bound for `gh api repos/*/pulls/*/reviews`. Triggers…
  • 100github-pr-comments
    Resolve inline code review comments on a GitHub PR. Use when asked to "resolve review comments", "address PR feedback", "fix PR comments", or "work through review comments". Fetches every inline comment with its surrounding code context, then applies each change systematically.
  • 100review-pr
    Use when reviewing a pull request, posting PR review comments, or when user says /review-pr. Reviews code with parallel agents and posts a pending GitHub review with inline comments.
  • 95pr-comment-resolver
    Automate PR comment review, fix, and resolution workflow with atomic commits. Use when the user asks to "handle PR comments", "resolve PR review comments", "fix PR feedback", "process review comments", "address PR suggestions", "deal with review comments", or provides a GitHub…
  • 100pr-review-comments
    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line. Use when you have a list/JSON of review findings (each with a file path, line number, and a message such as summary/failure_scenario) and want them…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.