custom-gh-pr-fetching-context

Fetches GitHub pull request context for the current branch using the gh CLI.

1|Updated Apr 3, 2021
One-click install
npx skills add https://github.com/NaoyaMiyagawa/dotfiles --skill custom-gh-pr-fetching-context-naoyamiyagawa
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: custom-gh-pr-fetching-context
Source: https://github.com/NaoyaMiyagawa/dotfiles/tree/main/.ai/skills/custom-gh-pr-fetching-context
Command: npx skills add https://github.com/NaoyaMiyagawa/dotfiles --skill custom-gh-pr-fetching-context-naoyamiyagawa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When working on a branch tied to a GitHub pull request, you often need the PR title, body, and comments to understand task requirements. This Skill retrieves that context automatically so implementation work stays aligned with the open PR. ## Core Features & Use Cases - PR Context Retrieval: Runs gh pr view --json title,body,comments to pull the PR title, description, and discussion for the current branch. - Graceful Fallback: Reports when no PR exists for the branch and continues with non-PR task context instead of blocking work. - Scoped Activation: Runs only for PR-related requests, avoiding unnecessary command execution on unrelated tasks. - Use Case: You ask the AI to continue implementing a feature branch; it fetches the linked PR's body and review comments first, then summarizes the key requirements before writing code. ## Quick Start Ask the AI to fetch the pull request context for the current branch and summarize the key task details.

Frequently Asked Questions about custom-gh-pr-fetching-context

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get pull request details from the command line?

Use the GitHub CLI command gh pr view --json title,body,comments to retrieve the PR title, description, and comments for the current branch in JSON format. The gh CLI must be installed and authenticated with your GitHub account.

How to fetch PR comments for the current git branch?

Run gh pr view --json title,body,comments while on the branch. The GitHub CLI automatically resolves the pull request associated with the checked-out branch and returns its comments along with the title and body.

What happens if no pull request exists for the current branch?

The skill reports that PR context is unavailable and continues with non-PR task context. It does not block implementation unless the user explicitly requires PR-based work.

Does gh pr view require authentication?

Yes, the GitHub CLI must be authenticated via gh auth login before running gh pr view. Without valid credentials, the command cannot access pull request data from the repository.

When should this PR context skill not run?

It should not run on every task, only for PR-related requests such as asking for PR context or summaries, or when implementation depends on open PR details. Running it on unrelated tasks adds unnecessary command execution.