Skip to content
gh-pr-issue logo

Gh PR Issue

gh-pr-issue

Keep pull requests and issues healthy using gh CLI (list, view, comment, close).

SKILL.md

Full skill instructions

When to Use

Invoke this skill when triaging review queues, summarizing checks, or updating GitHub issues. It wraps gh pr and gh issue commands so you can stay on top of reviews without leaving Opencode.

Prerequisites

  1. gh CLI authenticated (gh auth login --scopes repo,workflow).
  2. jq installed for JSON parsing.
  3. Environment variables (ask for them if absent):
    • GITHUB_REPOSITORY
    • DEFAULT_BRANCH

Pull Request Procedures

List Pull Requests (/​pr-list)

  1. Command template:
    gh pr list --repo "$GITHUB_REPOSITORY" \
      --state ${STATE:-open} \
      ${LABEL:+--label "$LABEL"} \
      ${SEARCH:+--search "$SEARCH"} \
      --limit ${LIMIT:-20} \
      --json number,title,author,reviewDecision,updatedAt,url
    
  2. Pipe to jq '.'.
  3. Highlight numbers, titles, reviewDecision, and last updated timestamps.

View Pull Request (/​pr-checks, /​pr-open)

  1. Fetch metadata + checks:
    gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" \
      --json number,title,author,baseRefName,headRefName,isDraft,mergeable,reviewDecision,checks
    
  2. Summarize failing checks with names, status, and URLs.
  3. To open in browser, run gh pr view "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --web (gh will launch the default browser; echo the URL when possible).

Comment on Pull Request (/​pr-comment)

  1. Ensure a comment body exists; request it if missing.
  2. Run gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY".
  3. Share the resulting comment URL from gh output.

Close / Reopen Pull Request (/​pr-close)

  1. Optional: leave a note explaining why the PR is closing.
  2. If deleting the branch, append --delete-branch.
  3. Command:
    [ -n "$BODY" ] && gh pr comment "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY"
    gh pr close "$PR_NUMBER" --repo "$GITHUB_REPOSITORY" ${DELETE_BRANCH:+--delete-branch}
    
  4. Report final state.

Issue Procedures

List Issues (/​issue-list)

  1. Command template:
    gh issue list --repo "$GITHUB_REPOSITORY" \
      --state ${STATE:-open} \
      ${LABEL:+--label "$LABEL"} \
      ${SEARCH:+--search "$SEARCH"} \
      --limit ${LIMIT:-20} \
      --json number,title,author,assignees,updatedAt,url
    
  2. Use jq '.' and summarize.

View Issue (/​issue-view)

  1. Fetch metadata:
    gh issue view "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" \
      --json number,title,state,body,labels,assignees,url
    
  2. Surface body excerpt, labels, assignees, and share the URL.

Comment on Issue (/​issue-comment)

  1. Confirm comment body.
  2. Run gh issue comment "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY" --body "$BODY".
  3. Return confirmation output.

Close or Reopen Issue (/​issue-close, /​issue-reopen)

  1. For closing:
    • Optionally comment with context first.
    • Run gh issue close "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY".
  2. For reopening:
    • Optionally state the reason.
    • Run gh issue reopen "$ISSUE_NUMBER" --repo "$GITHUB_REPOSITORY".
  3. Confirm the resulting state.

Safety Checks

  • Never mutate PRs/​issues outside GITHUB_REPOSITORY.
  • Validate required arguments (PR/​issue numbers, comment bodies) before running gh commands.
  • When summarizing checks, focus on failing or pending contexts to avoid noisy output.

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
Any Summary logo
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View