Agent skill

Extract PRs

by openshift-eng in openshift-eng/ai-helpers

Recursively extract GitHub Pull Request links from Jira issues

Apache-2.0Auto-check passedDevelopment

Install Extract PRs

skills CLI
$ npx skills add openshift-eng/ai-helpers --skill extract-prs -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install openshift-eng/ai-helpers extract-prs --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/openshift-eng/ai-helpers.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/jira/skills/extract-prs .claude/skills/extract-prs && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
extract-prs
GitHub stars
120
Token cost
~2.1k tokens
SKILL.md length
910 words
Files
1
Skills in repo
118
Repo updated
First seen
Licence
Apache-2.0

At a glance

Recursively extract GitHub Pull Request links from Jira issues

  • Works in 3 steps: Fetch issue metadata via getJiraIssue… → Search for descendant issues using BFS… → Fetch full data for each issue…
  • Development work in your project
  • SKILL.md covers When to Use This Skill, Prerequisites, Output Format and Implementation, plus 2 more sections
  • Calls gh and jq; reaches github.com; needs JIRA_API_TOKEN

What it does

Extract PRs is an agent skill from openshift-eng/ai-helpers. Recursively extract GitHub Pull Request links from Jira issues

Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development. It works with GitHub and Jira. The repository describes itself as: Developer productivity tools for Claude Code & other AI assistants. The licence is Apache-2.0.

When your agent uses it

  • Development work in your project

Example prompts

  • “/extract-prs”

Requirements

  • A credential in JIRA_API_TOKEN

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Fetch issue metadata via getJiraIssue with the issue key, requesting fields summary, description, issuetype, status, comment, and expand…
  2. Search for descendant issues using BFS via searchJiraIssuesUsingJql with jql: "parent = ", fields: ["key"], and maxResults: 100…
  3. Fetch full data for each issue (including root + all descendants) via getJiraIssue with fields summary, description, issuetype, status…

What it can do on your machine

Read from SKILL.md and the folder at commit a627176. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • gh
    • jq

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • github.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • JIRA_API_TOKEN

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Extract PRs loads about 2.1k tokens when it runs. Until then it costs about 19 tokens; SKILL.md has 910 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~19
When it runs · the whole SKILL.md, loaded when a task matches
~2.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from openshift-eng/ai-helpers at commit a627176, republished under its Apache-2.0 licence (© openshift-eng). 910 words, ~2,088 tokens.

Download SKILL.mdSave it as .claude/skills/extract-prs/SKILL.md (or your agent's skills folder).
name
extract-prs
description
Recursively extract GitHub Pull Request links from Jira issues

Jira Pull Request Extractor

This skill recursively discovers Jira issues and extracts all associated GitHub Pull Request links.

IMPORTANT FOR AI: This is a procedural skill - when invoked, you should directly execute the implementation steps defined in this document. Do NOT look for or execute external scripts (like extract_prs.py). Follow the step-by-step instructions in the "Implementation" section below.

When to Use This Skill

Use this skill when you need to:

  • Discover all GitHub PRs associated with a Jira feature and its subtasks
  • Extract PR metadata without analyzing PR content
  • Build a complete map of PRs for documentation or release notes

Key characteristics:

  • ✅ Always recursive: Automatically discovers all descendant issues via parent = KEY BFS
  • ✅ PR-only: Extracts only Pull Request URLs (ignores Issue and Commit URLs)
  • ✅ Dual-source: Extracts from both changelog remote links and text content (description/comments)
  • ✅ Structured output: Returns JSON with PR metadata and deduplication across sources

Prerequisites

  • MCP Jira server configured and running (required - see plugins/jira/README.md for setup)
  • jq installed for JSON parsing
  • GitHub CLI (gh) installed and authenticated for fetching PR metadata
  • User has read permissions for target Jira issues (including private issues via MCP authentication)
  • User has read access to linked GitHub repositories

Output Format

Purpose: This skill returns structured JSON that serves as an interface contract for consuming skills and commands.

Delivery Method:

  • Primary: Output JSON directly to the response (no file writes, no user prompts)
  • Secondary: Only save to .work/extract-prs/{issue-key}/output.json if user explicitly requests to save results

Schema Version: 1.0

Structure
json
{
  "schema_version": "1.0",
  "metadata": {
    "generated_at": "2025-11-24T10:30:00Z",
    "command": "extract_prs",
    "input_issue": "OCPSTRAT-1612"
  },
  "pull_requests": [
    {
      "url": "https://github.com/openshift/hypershift/pull/6444",
      "state": "MERGED",
      "title": "Add support for custom OVN subnets",
      "isDraft": false,
      "sources": ["comment", "description", "remote_link"],
      "found_in_issues": ["CNTRLPLANE-1201", "OCPSTRAT-1612"]
    }
  ]
}

Fields:

  • schema_version: Format version ("1.0")
  • metadata: Generation timestamp, command name, and input issue
  • pull_requests: Array of PR objects with url, state, title, isDraft, sources, and found_in_issues

Implementation

The skill operates in three main phases:

Phase 1: Descendant Issue Discovery

Discovers all descendant issues using parent = KEY JQL with BFS recursion.

Implementation:

  1. Fetch issue metadata via getJiraIssue with the issue key, requesting fields summary, description, issuetype, status, comment, and expand: "changelog".

    • Extract fields.description -- for text-based PR URL extraction
    • Extract fields.comment.comments -- for PR URLs mentioned in comments
    • Extract changelog.histories -- for remote link PR URLs from RemoteIssueLink field changes
  2. Search for descendant issues using BFS via searchJiraIssuesUsingJql with jql: "parent = <issue-key>", fields: ["key"], and maxResults: 100. Recursively search parent = <child-key> for each result until no more children. Only fetch the key field here -- full data (including changelog) is fetched per-issue in Phase 2.

  3. Fetch full data for each issue (including root + all descendants) via getJiraIssue with fields summary, description, issuetype, status, comment, and expand: "changelog". This fetches description, comments, and changelog (which includes remote links). Excludes issue links (relates to, blocks, etc.) -- only parent-child relationships.

🔗 Phase 2: GitHub PR Extraction

Extracts PR URLs from two sources:

  • Extract remote links from issue changelog (using MCP with authenticated access):
    1. Fetch the issue via getJiraIssue with issueIdOrKey and expand: "changelog"
    2. From the response, extract changelog.histories[].items[] entries where field == "RemoteIssueLink"
    3. Parse the toString (or to_string) value of each entry for GitHub PR URLs matching https://github.com/{owner}/{repo}/pull/{number}
    4. Deduplicate the extracted URLs
  • Important:
    • Remote links appear in changelog as RemoteIssueLink field changes
    • Changelog contains link creation events with GitHub PR URLs in toString or to_string field
    • Store results in variables, not temporary files
    • Uses MCP authentication (no separate curl needed)
  • Filters for GitHub PR URLs matching /pull/ or /pulls/ pattern
Show full SKILL.md (397 more words)Show less
Source 2: Text Content (backup)
  • Searches both fields.description and fields.comment.comments[] (already fetched in Phase 1)
  • Description: Extract from fields.description (plain text or Jira wiki format)
  • Comments: Iterate through fields.comment.comments[] array and search each comment.body
  • Uses regex: https?://github\.com/([\w-]+)/([\w-]+)/pulls?/(\d+)
  • Example extraction (using variables):
    bash
    # From description (stored in variable from MCP response)
    description_prs=$(echo "$description" | \
      grep -oE 'https?://github\.com/[^/]+/[^/]+/pulls?/[0-9]+')
    
    # From comments (parse JSON in memory)
    comment_prs=$(echo "$issue_json" | \
      jq -r '.fields.comment.comments[]?.body // empty' | \
      grep -oE 'https?://github\.com/[^/]+/[^/]+/pulls?/[0-9]+')
    
    # Combine all PRs
    all_prs=$(echo -e "${description_prs}\n${comment_prs}" | sort -u)

Deduplication:

  • Merges URLs found in multiple sources/issues
  • Tracks sources array: ["comment", "description", "remote_link"] (alphabetically sorted)
    • "comment": Found in issue comments
    • "description": Found in issue description
    • "remote_link": Found via Jira Remote Links API
  • Tracks found_in_issues array: ["OCPSTRAT-1612", "CNTRLPLANE-1201"] (alphabetically sorted)
  • Important: If same PR URL found in multiple sources or issues, merge into single entry with combined arrays
📊 Phase 3: Data Structuring and Output

PR Metadata: Fetch via gh pr view {url} --json state,title,isDraft. CRITICAL: When building the output JSON, you MUST use the exact values returned by gh pr view - do NOT manually type or guess PR states/titles.

Output: Build JSON in memory using jq -n, output to console. Only save to .work/extract-prs/{issue-key}/output.json if user explicitly requests.

Important: Use bash variables for all data - no temporary files to avoid user confirmation prompts.

Error Handling

  • MCP server not available: Display error message directing user to configure MCP server (see Prerequisites)
  • Issue not found: Log warning and continue with remaining issues
  • Permission denied:
    • If MCP returns 403 for private issues, verify JIRA_API_TOKEN and JIRA_USERNAME are set and match a valid Jira account
    • MCP authentication handles all Jira access (including changelog and remote links)
  • Changelog expansion fails: If expand="changelog" returns error, continue with text-based extraction only (graceful degradation)
  • No PRs found: Return empty pull_requests array (valid result)
  • Too many descendants: If hierarchy has >100 issues, increase maxResults parameter in searchJiraIssuesUsingJql
  • GitHub rate limit: If gh pr view fails due to rate limiting, display error with reset time
  • PR metadata fetch fails: If gh pr view returns error (PR deleted/private), exclude that PR from output

Performance Considerations

API calls: BFS searchJiraIssuesUsingJql calls + N getJiraIssue (with changelog) + M gh pr view

  • Example: 11 issues = BFS discovery calls + 11 MCP detail calls + M PR fetches
  • Changelog expansion includes remote links (no extra calls needed)
  • Can parallelize: issue fetching and PR metadata fetching

File I/O: Save PR metadata to .work/extract-prs/{issue-key}/pr-*-metadata.json, build final JSON by reading files

© openshift-eng, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/jira/skills/extract-prs of openshift-eng/ai-helpers.

Open the folder on GitHubat commit a627176

Compare with similar skills

Extract PRs next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Extract PRs compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Extract PRs this skillopenshift-eng/ai-helpers120—~2.1kAutomated safety check: PassApache-2.0
YugabyteDB Issue Creatoryugabyte/yugabyte-db11k—~2kAutomated safety check: PassCustom licence
Link Ticket To SessionJayantDevkar/claude-code-karma329—~1.8kAutomated safety check: NotesApache-2.0
Issue Triage Loopcobusgreyling/loop-engineering11k—~522Automated safety check: PassMIT
Leanspeccodervisor/leanspec296—~1.8kAutomated safety check: PassMIT
Create Epic RecapDataDog/datadog-agent3.8k—~5kAutomated safety check: NotesApache-2.0

Similar skills

  • YugabyteDB Issue Creator

    yugabyte/yugabyte-db

    Creates a GitHub issue or JIRA ticket for a YugabyteDB change or bug, after scrubbing customer data, secrets and unreleased details from anything public.

    11k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Link Ticket To Session

    JayantDevkar/claude-code-karma

    Link the current Claude Code session to a ticket (Linear, Jira, GitHub Issues, or GitHub Pull Requests) and cache its title/status in karma.

    329 GitHub stars~1.8k tokensUpdated 10 days ago
    DevelopmentAuto-check: notes
  • Issue Triage Loop

    cobusgreyling/loop-engineering

    Scans open GitHub issues and discussions, flags duplicates, scores priority and proposes labels into issue-triage-state.md without ever labeling or closing.

    11k GitHub stars~522 tokensUpdated today
    DevelopmentAuto-check passed
  • Leanspec

    codervisor/leanspec

    The spec-coding methodology for AI-assisted development. An agent skill from codervisor/leanspec.

    296 GitHub stars~1.8k tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Create Epic Recap

    DataDog/datadog-agent

    Official

    A skill your agent uses when an engineer or manager asks to recap, summarize, or post an update on a Jira Epic — a progress update for an in-progress Epic (how far along it is, what's shipped so…

    3.8k GitHub stars~5k tokensUpdated today
    DevelopmentAuto-check: notes
  • Dynamo PR Description

    DynamoDS/Dynamo

    Generate PR descriptions for Dynamo that align with the team template section names and order.

    2k GitHub stars~880 tokensUpdated today
    DevelopmentAuto-check passed

More from openshift-eng/ai-helpers

All 118 skills in this repo
  • Investigate CI Reliability

    openshift-eng/ai-helpers

    Find and independently validate actionable reliability defects across OpenShift release jobs and presubmits, then export portable issue handoffs.

    120 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Address Review PR

    openshift-eng/ai-helpers

    Fetch and address all PR review comments — categorize by priority, make code changes, post replies, and push.

    120 GitHub stars~2.9k tokensUpdated yesterday
    Auto-check passed
  • Categorize Activity Types

    openshift-eng/ai-helpers

    Categorize Jira issues into Red Hat Sankey Activity Type categories using MCP Jira tools.

    120 GitHub stars~2.4k tokensUpdated yesterday
    Auto-check passed
  • Has Review Work

    openshift-eng/ai-helpers

    Decide whether a GitHub PR has unanswered authorized review comments or new required CI failures worth a follow-up agent.

    120 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Must Gather Analyzer

    openshift-eng/ai-helpers

    Analyze OpenShift must-gather diagnostic data including cluster operators, pods, nodes, and network components.

    120 GitHub stars~2.3k tokensUpdated yesterday
    Auto-check passed
  • Payload Autodl JSON

    openshift-eng/ai-helpers

    Schema for the autodl JSON data file produced by payload-analysis for database ingestion — you must use this skill whenever generating the autodl JSON file

    120 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Extract PRs

What does Extract PRs do?

Recursively extract GitHub Pull Request links from Jira issues. Extract PRs is an agent skill from openshift-eng/ai-helpers.

When should I use Extract PRs?

Extract PRs fits situations like: development work in your project.

How do I install Extract PRs in Claude Code?

Run `npx skills add openshift-eng/ai-helpers --skill extract-prs -a claude-code`. Or copy the skill folder (plugins/jira/skills/extract-prs in openshift-eng/ai-helpers) into .claude/skills/extract-prs in your project. Claude Code loads it when a task matches its description.

How do I install Extract PRs in Codex?

Run `npx skills add openshift-eng/ai-helpers --skill extract-prs -a codex`. Or copy the skill folder (plugins/jira/skills/extract-prs in openshift-eng/ai-helpers) into .agents/skills/extract-prs in your project. Codex loads it when a task matches its description.

Can I use Extract PRs in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add openshift-eng/ai-helpers --skill extract-prs -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/extract-prs, .gemini/skills/extract-prs, .github/skills/extract-prs and .opencode/skills/extract-prs in your project.

What does Extract PRs need to run?

Going by SKILL.md and its folder, Extract PRs needs the command-line tools its instructions call (gh and jq) and credentials named JIRA_API_TOKEN. Our summary lists: A credential in JIRA_API_TOKEN.

Does Extract PRs access the network?

SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Extract PRs safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Extract PRs use?

Extract PRs is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Extract PRs use?

About 2.1k tokens (SKILL.md is roughly 8.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Extract PRs?

Skills that share tags, products or a category with Extract PRs: YugabyteDB Issue Creator (yugabyte/yugabyte-db, 11k stars), Link Ticket To Session (JayantDevkar/claude-code-karma, 329 stars), Issue Triage Loop (cobusgreyling/loop-engineering, 11k stars) and Leanspec (codervisor/leanspec, 296 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Extract PRs?

openshift-eng (a GitHub organization) maintains it in openshift-eng/ai-helpers, which has 120 GitHub stars. The repository holds 118 skills in this directory. The repository was last updated on October 6, 2026.

Source: openshift-eng/ai-helpers on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.