Dev10x-gh-context

Detect PR context from URL, number, or branch using GitHub CLI and jq.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/Brave-Labs/dev10x --skill dev10x-gh-context-brave-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Dev10x-gh-context
Source: https://github.com/Brave-Labs/dev10x/tree/main/codex-skills/dev10x-gh-context
Command: npx skills add https://github.com/Brave-Labs/dev10x --skill dev10x-gh-context-brave-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires gh, jq, and includes scripts (resource) components.

What problem does it solve?

Manages and guarantees accurate PR context (PR_NUMBER, REPO, PR_URL, BRANCH) for automation, even when working across multiple worktrees or repositories.

Core Features & Use Cases

  • gh-pr-detect.sh and gh-context wrappers provide consistent PR metadata extraction from a URL, explicit PR number, or the current branch.
  • gh-issue-get.sh and gh-issue-comments.sh fetch issue details and comments for review, auditing, or decision making.
  • BRANCH is always resolved from GitHub (not from local git state) to prevent mismatches in multi-worktree workflows.

Quick Start

Invoke the gh-context tool to detect PR_NUMBER, REPO, PR_URL, and BRANCH from a PR URL, a bare PR number, or the current branch.

Frequently Asked Questions about Dev10x-gh-context

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

FAQPage Schema
How do I fetch PR context metadata from a branch or URL for shell scripts?

To fetch PR context metadata for shell scripts, you extract PR_NUMBER, REPO, PR_URL, and BRANCH from a PR URL, bare PR number, or current branch. This process uses GitHub CLI and jq to output KEY=VALUE pairs for downstream automation steps.

Why does my git automation derive the wrong branch in multi-worktree workflows?

Git automation derives the wrong branch in multi-worktree workflows when relying on local git state. Resolving BRANCH directly from GitHub canonical data prevents mismatches, ensuring your automation scripts operate on the correct PR context.

Do I need jq and gh cli installed to detect PR context from a URL?

Yes, you need both the GitHub CLI (gh) and jq installed to detect PR context from a URL. These dependencies are required to query GitHub for canonical PR data and parse JSON responses into KEY=VALUE pairs for your scripts.

Can I fetch GitHub issue details and comments for automated code review?

Yes, you can fetch GitHub issue details and comments for automated code review using dedicated shell scripts. These scripts retrieve issue metadata and comment threads, providing necessary context for auditing, reviewing, or decision-making workflows.

What is the best way to extract PR_NUMBER and REPO for CI pipelines?

The best way to extract PR_NUMBER and REPO for CI pipelines is using a detection script that queries GitHub directly. This guarantees canonical metadata extraction from a PR URL or branch, outputting consistent KEY=VALUE pairs for pipeline steps.