Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Handle Pr Comment

ASecurity

Reply to a comment on a GitHub pull request, implementing changes if appropriate, using the codebase and comment history as context.

10 stars
0 votes
0 copies
0 views
Added 10/6/2026
toolsbashgit

Works with

cli

Security Analysis

A100/100

Scanned 10/6/2026

$npx -y skills add tomzx/agents --skill handle-pr-comment --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handle Pr Comment?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Handle Pr Comment
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tomzx-handle-pr-comment/badge)](https://www.skillsdirectory.com/skills/tomzx-handle-pr-comment)

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

Download with Pro
Files
SKILL.md
---
name: handle-pr-comment
description: Reply to a comment on a GitHub pull request, implementing changes if appropriate, using the codebase and comment history as context.
allowed-tools: Bash(gh:*, ghx:*, git:*, ~/.agents/scripts/should-post-to-github:*), Read, Edit, Glob, Grep
argument-hint: "<pr-url>"
---

# Handle PR Comment

Evaluates a comment on a GitHub pull request and responds appropriately, either implementing the requested change or drafting a reply explaining why the change will not be made. On user approval it commits and pushes code changes; whether the reply comment is posted to GitHub is decided by `should-post-to-github` (based on `~/.sdlc/config.yaml`), otherwise the drafted reply is shown without posting.

## Prerequisites

- `gh` CLI authenticated with write access to the target repository
- PR URL (`$1`) pointing to an open pull request
- Git push access to the PR branch

### Skill attribution (GitHub)

Before posting any PR comment with `gh`, read [`github-post-attribution/SKILL.md`](../github-post-attribution/SKILL.md) and append the **Posted with** footer for `SKILL_DIR` = `handle-pr-comment`.

### Communication guidelines (outbound text)

Before composing any text posted or drafted on the user's behalf, apply [`communication-guidelines/SKILL.md`](../communication-guidelines/SKILL.md).

## Workflow

```
Fetch PR metadata + comment history
            |
            v
      Clone repository
            |
            v
   Is the comment actionable?
         /          \
       Yes            No
        |              |
        v              v
  Implement       Draft rejection
  changes         explanation
        |              |
        +------+--------+
               |
               v
   Present to user for approval
       /          \
   Approved      Rejected
      |              |
      v              v
  Commit +       Skip
  push
  (always on approval);
  post reply only if
  should-post-to-github allows
```

## Steps

1. Fetch PR details and full comment history:
   ```
   gh pr view $1 --comments
   ```
2. Clone the repository locally:
   ```
   gh repo clone <owner>/<repo>
   ```
3. Display the target comment's content.
4. Evaluate whether the feedback is appropriate and actionable.
5. If actionable: implement the changes in the codebase.
6. If not actionable: draft a reply explaining the rejection.
7. Present reasoning to the user for approval.
8. On approval:
   - For code changes: commit and push to the PR branch (push is not gated).
   - For posting a reply comment: get the PR author (`gh pr view $1 --json author --jq .author.login`), then run `~/.agents/scripts/should-post-to-github --repo "<owner>/<repo>" --author "<PR_AUTHOR>"`. If it exits 0, post the reply via `gh` with the **Skill attribution** footer on the comment body. If it exits 1, present the drafted reply to the user without posting.

## Example Usage

**Scenario 1: Valid refactor request**
```
/handle-pr-comment https://github.com/owner/repo/pull/55
```
Comment: "Extract this logic into a helper function."
Action: Implement refactor, commit to PR branch, push.

**Scenario 2: Out-of-scope request**
```
/handle-pr-comment https://github.com/owner/repo/pull/88
```
Comment: "Can you also fix the unrelated bug in `utils.py`?"
Action: Post reply: "That's out of scope for this PR. I'll open a separate issue."

**Scenario 3: Incorrect suggestion**
```
/handle-pr-comment https://github.com/owner/repo/pull/33
```
Comment: "Use a `global` variable here instead of passing it as a parameter."
Action: Draft rejection with technical reasoning; present to user before posting.

## Useful Commands Reference

| Command | Description |
|---|---|
| `gh pr view <pr-url> --comments` | Fetch PR details and all comments (fresh) |
| `gh repo clone <owner>/<repo>` | Clone the repository locally |
| `gh pr comment <pr-url> --body "..."` | Post a reply to the PR |
| `git commit -m "..."` | Commit code changes |
| `git push` | Push changes to the PR branch |

Attribution

tomzxtomzx
View sourceSee grades on GitHubMore from tomzx →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

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 (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

ucoz-landing-skill

Create and edit uCoz homepage landing pages via MCP: custom templates, hero sections, lead forms, navigation menus, SEO, and responsive layout. Includes a visual design system (style selection, layout/grid, section recipes, typography/spacing, color tokens, component states, icons, modern CSS/JS, motion, imagery, social proof, copy/voice, accessibility). Uses ucoz-mcp tools for templates, site file uploads, and site modules.

107 votes

Paperclip

Interact with the Paperclip control plane API for task coordination and governance. Use when checking assignments, updating issue status, posting comments, delegating work, managing routines, or calling Paperclip API endpoints.

953191 votes

Pptx

Presentation toolkit (.pptx). Create/edit slides, layouts, content, speaker notes, comments, for programmatic presentation creation and modification.

471861 votes

Daw Music

Digital Audio Workstation usage, music composition, interactive music systems, and game audio implementation for immersive soundscapes.

761 votes

Instantly Rdsthomas Mission Control

Instantly.ai cold email outreach API - manage campaigns, leads, accounts, and analytics. Use for cold email automation, lead management, campaign creation/monitoring, and email account warmup.

761 votes
View all in tools →