Preface

Code Review before Pull Request merging is often the most mentally draining part of the development workflow. Reviewers leave inline comments on the diff, add explanations in the Conversation tab, and send a Request changes notification—comments scattered across different sections of the GitHub webpage. Developers need to switch back and forth between their browser and IDE, checking line by line to confirm “who said what, which line to modify, and whether it has been resolved”. After making changes, they also have to manually verify that no comment thread was missed.

If you are already using AI programming Agents to write code and run tests, but PR comment processing is still done manually, the cost of context switching becomes even higher. gh-address-comments is a curated Skill maintained by OpenAI in the skills/.curated/ directory of the openai/skills repository. It specifically standardizes the workflow of “pull PR comments → manually filter → Agent modifies code”. It does not automatically swallow all reviews with one click, but retains human judgment while handing over the mechanical parts to the Agent and the gh CLI.

What is gh-address-comments

gh-address-comments is an Agent Skill based on the universal SKILL.md format, maintained by OpenAI and categorized as a Codex curated skill. Its official description is:

Help address review/issue comments on the open GitHub PR for the current branch using gh CLI; verify gh auth first and prompt the user to authenticate if not logged in.

One-sentence positioning: On the open PR associated with the current Git branch, use the GitHub CLI (gh) to pull all review and issue comments, and modify the code one by one after user confirmation.

The core pain points it solves are: PR comments come from multiple sources (Conversation comments, Review submissions, inline review threads), manual summarization is time-consuming and prone to omissions; if the Agent lacks a fixed workflow, it may mistakenly modify feedback that requires human judgment. This Skill uses scripts to uniformly crawl comments, presents them in a numbered list, and lets users check the items before acting—a typical human-in-the-loop workflow design.

Note: The openai/skills repository README marks that the repository has been deprecated, and subsequent Codex plugin examples have been moved to openai/plugins. However, gh-address-comments can still be obtained from the original repository, and the installation method and SKILL.md content shall be subject to the files in the repository.

Core Functions and Workflow

The official SKILL.md divides the execution process into three steps, and comes with a Python auxiliary script.

Step 1: Check Pending Comments

The Agent runs scripts/fetch_comments.py in the Skill directory to pull all comment data from the PR associated with the current branch. The script initiates a GraphQL query via gh api graphql, and paginates and crawls three types of content:

  1. Conversation comments: Top-level issue-style discussion comments on the PR
  2. Reviews: Review submissions and their main text, such as Approve / Request changes / Comment
  3. Review threads: Inline line-level comment threads, including metadata such as isResolved, isOutdated, file path, line number, etc.

The script first calls gh auth status to confirm that the CLI is logged in, then parses the PR corresponding to the current branch via gh pr view --json number,headRepositoryOwner,headRepository (supports cross-repository PRs). The output is JSON, which can be saved via redirection:

python scripts/fetch_comments.py > pr_comments.json

Step 2: Number and Summarize, Let User Choose

The Agent numbers each review thread and comment one by one, and adds a summary of “what needs to be done to fix it” for each item, then asks the user: Which numbers need to be processed?

This step is the design highlight: the Agent does not decide what to modify on its own. Comments that require human decision-making, such as architectural trade-offs, product semantics, and whether to accept suggestions, can be left unchecked in the list; clear technical corrections (naming, boundary checks, test additions, etc.) can be checked and handed over to the Agent.

Step 3: Modify Code According to Selection

After the user confirms the numbers, the Agent understands the diff location and intent based on the comment context, and applies corresponding modifications to the local repository. The specific modification method depends on the Agent’s code understanding ability, and the Skill itself does not hard-code repair logic—it standardizes the workflow, not a fixed patch template.

Prerequisites for Authentication and Permissions

The Skill requires completing gh authentication before use, and recommends running gh auth status with elevated permissions (including scopes such as workflow / repo) to ensure that subsequent gh api graphql calls are not blocked by sandboxes or insufficient permissions. If you encounter auth or rate limit issues during operation, you should prompt the user to re-execute gh auth login and try again. In the Codex environment, the official note that all gh commands require elevated network access.

Directory Structure

From the official repository directory, this Skill includes:

Path Description
SKILL.md Skill definition and three-step workflow
scripts/fetch_comments.py Auxiliary script that pulls PR comments via gh api graphql
agents/ Agent-related configuration directory
assets/ Additional resources
LICENSE.txt License file

fetch_comments.py is the technical core of the entire Skill: it does not depend on additional Python packages, only calls gh via subprocess. The GraphQL query covers three types of nodes: comment, review, reviewThread, and supports cursor pagination, making it suitable for large PRs with many comments.

Installation and Activation

Install in OpenAI Codex

According to the openai/skills README and Codex Skills Documentation, curated skills can be pulled in one click via the Codex built-in installer:

$skill-installer gh-address-comments

You can also specify the GitHub directory URL for installation:

$skill-installer install https://github.com/openai/skills/tree/main/skills/.curated/gh-address-comments

If it does not appear in the skill list after installation, restart Codex. You can also enter /skills in the CLI to browse and manually select the installed skills. Codex’s global skill directory is ~/.agents/skills/, and the repository-level directory is .agents/skills/.

Use in Cursor

Cursor supports the general Agent Skills format. Place the gh-address-comments folder (including SKILL.md and scripts/) into any of the following directories to be automatically discovered:

  • Project-level: .cursor/skills/gh-address-comments/ or .agents/skills/gh-address-comments/
  • Global: ~/.cursor/skills/gh-address-comments/ or ~/.agents/skills/gh-address-comments/

The common practice is to copy the corresponding directory from the official repository, or use sparse checkout to only pull this Skill subpath. Cursor will scan the above paths when starting; you can also enter /gh-address-comments in the Agent conversation to call it explicitly.

Environment Prerequisite: GitHub CLI

No matter which AI programming tool you use, you need to install and log in to GitHub CLI first:

# One-time login
gh auth login

# Confirm status (required to run before Skill)
gh auth status

The current branch must have an associated open PR; if the branch has no PR or the PR has been merged and closed, the script cannot parse the target PR.

Typical Usage Examples

Scenario: PR Received Multiple Inline Comments

Suppose you are developing on the feature branch feat/oauth-refresh, and your colleague left 8 inline comments and 2 Conversation explanations on the PR. You can trigger it in the Codex or Cursor Agent conversation like this:

Please use the gh-address-comments skill to handle the review comments on the current branch's PR.
First pull all comments and number them for summary, then I will tell you which ones to modify.

After the Agent executes according to the Skill workflow, it may return a summary similar to the following (for illustration):

1. [inline] src/auth/token.go:42  Suggest adding a null check for the refresh token
2. [inline] src/auth/token.go:78  Internal IDs should not be exposed in error messages
3. [review] @reviewer  Request changes: Add unit tests to cover the expiration scenario
...
Please select the numbers that need to be processed (e.g. 1,2,3).

After you reply with 1,2,3, the Agent will modify the corresponding files locally, and can continue to assist with running tests and submitting commits.

Run the Crawling Script Separately

Even without using an Agent, you can manually view the full picture of PR comments under the Skill directory:

cd skills/.curated/gh-address-comments
python scripts/fetch_comments.py | jq '.pull_request, (.review_threads | length)'

This is very useful when debugging whether the Agent missed a certain thread—the JSON contains fields such as isResolved, path, and line, making it easy to compare with the GitHub webpage.

Applicable Scenarios and Notes

Applicable scenarios:

  • The current branch has an open PR, and review comments are distributed across multiple threads, requiring systematic summarization
  • You want the Agent to assist in modifying code, but want to retain the right to choose which comments to modify
  • The team uniformly uses the gh CLI, and local authentication and repository permission configurations are mature
  • Combine with other Codex GitHub skills (such as gh-fix-ci, yeet) to form an automated workflow of “fix comments → fix CI → submit PR”

Restrictions to note:

  1. Not fully automatic: The Skill clearly requires the user to select numbers, and will not silently modify all review opinions
  2. Depends on open PR: The script parses the current branch PR via gh pr view, and cannot work without a PR or if the PR is closed
  3. Fix quality depends on the Agent: The Skill standardizes the workflow, and whether the specific patch is correct still requires manual review or CI verification
  4. Network and permissions: gh may require elevated permissions in the Codex sandbox; insufficient auth scope will cause GraphQL query failures
  5. Repository migration: openai/skills has been marked as deprecated, and long-term distribution may shift to plugin form, but the Skill content and installation commands shall prevail based on the official repository

Among the OpenAI curated series of Skills, gh-fix-ci focuses on fixing failed GitHub Actions checks, and yeet focuses on one-click stage/commit/push/open PR; gh-address-comments focuses on review comment digestion, and the three complement each other, covering different stages of the PR lifecycle.

Summary

The difficulty of PR Code Review is never just “modifying a few lines of code”, but finding all comments, understanding the context, and deciding whether to modify them. gh-address-comments uses fetch_comments.py + gh GraphQL to standardize comment crawling, uses a numbered list to leave decision-making power to developers, and then lets the Agent perform the selected modifications—striking a balance between automation and controllability.

If you use Codex, you can directly install it with $skill-installer gh-address-comments; if you use Cursor, put the Skill directory into .cursor/skills/. Official resources: