Agent skill

PR

by opsmill in opsmill/infrahub

Opens a pull request, publishing the current branch as a PR.

Apache-2.0Auto-check passedDevelopment

Install PR

skills CLI
$ npx skills add opsmill/infrahub --skill pr -a claude-code

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

GitHub CLI
$ gh skill install opsmill/infrahub pr --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/opsmill/infrahub.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pr .claude/skills/pr && 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
pr
GitHub stars
529
Token cost
~3.7k tokens
SKILL.md length
1,783 words
Files
1
Skills in repo
32
Repo updated
First seen
Licence
Apache-2.0

At a glance

Opens a pull request, publishing the current branch as a PR.

  • Works in 7 steps: Safety Checks & Branch State → Commit Changes (only when commit… → Analyze All Branch Changes → …
  • : the user wants to open a pull request
  • SKILL.md covers Introduction, Arguments, Main Tasks and Notes, plus 1 more section
  • Calls git and gh; reaches claude.ai

What it does

PR is an agent skill from opsmill/infrahub. Opens a pull request, publishing the current branch as a PR. TRIGGER when: the user wants to open a pull request, publish the current branch as a PR, or take the current work through to an open PR. DO NOT TRIGGER when: only committing changes → commit; babysitting CI after the PR is already open → monitoring-pull-requests.

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Requires a Git working tree and GitHub access (gh CLI authenticated, GitHub MCP server, or equivalent). Works best alongside the commit and…

It sits in Development, covering Pull requests. It works with Git. The repository describes itself as: Infrahub is a graph-based data management platform with built-in version control, CI workflows, peer review, and API access. It’s purpose-built to power reliable infrastructure… The licence is Apache-2.0.

When your agent uses it

  • : the user wants to open a pull request
  • Publish the current branch as a PR
  • Take the current work through to an open PR
  • : only committing changes → commit

Example prompts

  • “Use the pr skill to open a pull request, publishing the current branch as a PR”
  • “/pr”

Requirements

  • Compatibility (from SKILL.md): Requires a Git working tree and GitHub access (gh CLI authenticated, GitHub MCP server, or equivalent). Works best alongside the `commit` and `monitoring-pull-requests` skills from this plugin.

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Safety Checks & Branch State
  2. Commit Changes (only when commit argument is provided)
  3. Analyze All Branch Changes
  4. Documentation Review
  5. Draft PR Description
  6. User Validation & PR Creation
  7. Hand Off to monitoring-pull-requests as a Background Agent

What it can do on your machine

Read from SKILL.md and the folder at commit af1c6c8. 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:

    • git
    • gh

    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:

    • claude.ai

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

  • Compatibility

    Requires a Git working tree and GitHub access (gh CLI authenticated, GitHub MCP server, or equivalent). Works best alongside the `commit` and `monitoring-pull-requests` skills from this plugin.

    From compatibility in the SKILL.md frontmatter.

Context cost

PR loads about 3.7k tokens when it runs. Until then it costs about 82 tokens; SKILL.md has 1,783 words of instructions outside code blocks.

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

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 opsmill/infrahub at commit af1c6c8, republished under its Apache-2.0 licence (© opsmill). 1,783 words, ~3,666 tokens.

Download SKILL.mdSave it as .claude/skills/pr/SKILL.md (or your agent's skills folder).
name
pr
description
Opens a pull request, publishing the current branch as a PR. TRIGGER when: the user wants to open a pull request, publish the current branch as a PR, or take the current work through to an open PR. DO NOT TRIGGER when: only committing changes → commit; babysitting CI after the PR is already open → monitoring-pull-requests.
compatibility
Requires a Git working tree and GitHub access (gh CLI authenticated, GitHub MCP server, or equivalent). Works best alongside the `commit` and `monitoring-pull-requests` skills from this plugin.
argument-hint
Optional `commit` to stage, commit, and push uncommitted changes before opening the PR
metadata.version
0.1.0
metadata.author
OpsMill

Open Pull Request

Introduction

Handle the full workflow from current branch state to an open, CI-monitored pull request. This skill enforces branch discipline, analyzes all branch changes for a business-value-focused description, ensures documentation is current, and requires user approval at every step.

It is project-agnostic: base branch, validation commands, documentation layout, and labels are all discovered from the repository itself rather than assumed.

Arguments

<arguments> $ARGUMENTS </arguments>

Supported arguments:

  • commit — Stage, commit, and push uncommitted changes before proceeding. Without this argument, no commits are made — the skill works only with what is already committed on the branch.

Main Tasks

1. Safety Checks & Branch State

First, verify the agent is on a safe branch and understand the current git state. Branch creation and commit logic are owned by the commit skill — this phase only inspects state and decides what to do next.

  1. Run git status to see uncommitted/staged/untracked files.
  2. Run git branch --show-current to identify the current branch.
  3. Determine the base branch the PR should target:
    • Prefer the repository's default branch: git symbolic-ref --short refs/remotes/origin/HEAD (the name after origin/).
    • If the current branch was clearly forked from a different long-lived branch (e.g. a release branch), use that instead.
    • When ambiguous, ask the user.
  4. If on an unsafe branch — the default branch, a long-standing integration branch, a release branch, or a placeholder/scratch branch (the commit skill's step 2 holds the canonical rules; don't re-derive the list here):
    • If commit was passed: proceed to Phase 2; the commit skill will refuse the unsafe branch, propose a properly named feature branch, and ask the user for approval before creating it. Do not pre-create the branch here — let the commit skill own that conversation so the rules stay in one place.
    • If commit was NOT passed: STOP. There's no feature branch to open a PR from. Tell the user they need to either invoke /pr commit (so the commit skill creates a branch and captures the changes), or switch to a feature branch first.
  5. If already on a feature branch, continue to the next phase.
2. Commit Changes (only when commit argument is provided)

Skip this phase entirely if commit was NOT passed as an argument. If there are uncommitted changes and commit was not provided, warn the user that uncommitted changes exist but will not be included in the PR.

When commit IS provided, run any project-specific prep first, then delegate the actual commit + push to the commit skill so branch discipline, secret hygiene, and message conventions stay in one place:

  1. If the project defines fast validation commands (formatters, linters), run them first. Discover them from the project's own context — AGENTS.md/CLAUDE.md/CONTRIBUTING.md, a Makefile/Taskfile/justfile, package.json scripts, pyproject.toml/tox.ini, or a pre-commit config. If the project defines none, skip this step.

  2. If the project checks in generated artefacts (GraphQL schemas, OpenAPI clients, generated SDK types, protobufs) and their sources were modified, regenerate them using the project's documented commands and include the regenerated files — CI commonly fails on stale generated artefacts.

  3. Invoke the commit skill with the push argument: /commit push. The skill will:

    • Refuse to commit on protected or placeholder branches and, if needed, propose a conventional feature branch name (feat/…, fix/…, etc.) for user approval before creating it.
    • Stage changes safely (explicit paths, secret-pattern warnings).
    • Draft a conventional-commit message and confirm it with the user.
    • Run pre-commit hooks (no --no-verify); fix violations and create a new commit on hook failure.
    • Push the branch upstream (git push -u origin <branch> on first push).

    Do not duplicate any of that logic inline here. If the user has additional commit-message guidance specific to this PR (e.g., spec or issue reference, conventional-commit scope), pass it along when invoking the skill.

  4. After /commit push returns, confirm the working tree is clean and the branch is published before continuing to Phase 3.

3. Analyze All Branch Changes

Understand the FULL scope of changes in this branch — not just the latest commit, but everything since it diverged from the base branch. If there's a related spec or issue, use it to understand the business context.

  1. Use the base branch determined in Phase 1 (referred to as <base> below).

  2. View all commits in the branch:

    bash
    git log origin/<base>..HEAD --oneline
  3. View the full diff of all changes:

    bash
    git diff origin/<base>...HEAD --stat
    git diff origin/<base>...HEAD
  4. Check for related planning context. If the repository keeps specs, PRDs, or ADRs (e.g. a specs/ directory, docs/adr/, or locations referenced from AGENTS.md/CONTEXT.md), look for one matching this branch — by branch name, by files touched, or by a linked issue. When one exists, read it to understand user scenarios, requirements, and success criteria; it is the primary source for framing the PR's business value. If the repo keeps no such context, skip this step.

  5. Categorize changes by area (e.g. application code, tests, documentation, CI/CD, configuration) using the repository's own layout.

4. Documentation Review

Before opening the PR, ensure that the project's documentation reflects the changes being introduced. Stale docs are worse than no docs.

  1. Discover where this project keeps developer documentation. Probe in this order, and use what actually exists:

    • Locations referenced from AGENTS.md/CLAUDE.md/CONTEXT.md/CONTRIBUTING.md (these often map code areas to docs).
    • Conventional directories: dev/, docs/, doc/, ADR directories (docs/adr/, dev/adr/).
    • The README.md for user-facing behaviour changes.

    If the project keeps no developer documentation, note that and skip to Phase 5 — do not invent a documentation structure.

  2. Based on the changes identified in Phase 3, check the docs covering the touched areas:

    • Read each relevant doc and compare against the actual changes.
    • If a doc is outdated or missing coverage of new functionality, propose updates.
    • Present proposed doc changes to the user for approval.
  3. Commit any approved doc updates to the branch (with a docs: conventional commit, following the repo's commit style).

  4. Push if new commits were added.

5. Draft PR Description

Focus on business value — what problem does this solve, what capability does it add? The reviewer should understand WHY before they look at HOW. Reference the spec or issue if one exists.

PR Title: Short, conventional format (under 70 chars), mirroring the repo's existing PR/commit style. Examples:

  • feat: add environment backup and restore operations
  • fix: resolve config drift during reconciliation
  • refactor: migrate inline queries to dedicated files

PR Body Template (adapt to the repository's PR template in .github/PULL_REQUEST_TEMPLATE.md if one exists — the repo template wins):

markdown
## Summary
[1-3 sentences: what business problem this solves or what capability it adds.
Frame as outcomes for users/operators, not as code changes.]

## Key Changes
[Bulleted list of the most important changes, framed as outcomes:
- "Operators can now back up and restore environments" NOT "Added backup_service.py"
- "Queries are validated against the schema in CI" NOT "Moved queries to .graphql files"]

## Related Context
[If tied to a spec, PRD, ADR, or issue: link it and highlight the key
requirements addressed. Omit this section if none exists.]

## Documentation Updates
[List any docs that were added or updated as part of this PR.
Omit this section if no docs were changed.]

## Test Plan
[How to verify — test commands to run, manual verification steps, or CI checks to watch]

No session-link footer — strip it if the harness added one. Some harnesses append a trailer pointing at the private agent session after your body, typically a bare https://claude.ai/code/session_… URL (or a link wrapping one). Never include it: that URL is internal and usually unshareable, it lands in the project's permanent — often public — PR history, and it references session state no reviewer can open. If the harness inserts such a line, remove it before creating the PR, and never author one yourself. This mirrors the commit skill's step 4 rule for commit messages; legitimate attribution (e.g. a Co-Authored-By trailer or a generic "Generated with" credit) is unaffected.

Labels: Discover the repository's labels with gh label list and pick the ones that fit the change. Don't invent labels; if none fit, omit them.

Show full SKILL.md (692 more words)Show less
6. User Validation & PR Creation

IMPORTANT: Always present the full PR draft to the user for review BEFORE creating it. Never create a PR without explicit user approval.

  1. Present to the user:

    • PR title
    • PR body (rendered)
    • Target base branch
    • Labels
  2. Wait for the user's explicit approval or requested changes.

  3. After approval, create the PR using the GitHub interface available to the agent. First strip any harness-appended session-link footer from the body (see step 5). Examples:

    bash
    gh pr create --title "[TITLE]" --body "[BODY]" --base <base> --label "[LABELS]"

    Or, when using the GitHub MCP server, the equivalent create_pull_request call.

  4. Return the PR URL to the user.

7. Hand Off to monitoring-pull-requests as a Background Agent

Don't just open the PR and walk away — but don't re-implement the CI babysitting loop here either, and don't sit blocked in the foreground waiting 30+ minutes for CI to finish. The monitoring-pull-requests skill owns the CI workflow (poll, classify, reproduce narrowly, fix, retry up to 5 times, revert on exhaustion), and CI watching is the textbook "long-running, independent of what the user does next" background task. Spawn it as a background agent so the parent conversation can return control to the user immediately.

  1. Confirm the PR was created and you have the PR number / URL / branch name.

  2. Spawn monitoring-pull-requests as a background agent. Use the runtime's agent-launching mechanism (Claude Code: the Agent tool with run_in_background: true; other runtimes: equivalent background-task primitive). The agent must run with a clean context — give it everything it needs in the prompt rather than relying on parent-conversation state.

    Recommended invocation (Claude Code, general-purpose subagent):

    text
    Agent(
      description: "Monitor PR #<N> CI",
      subagent_type: "general-purpose",
      run_in_background: true,
      prompt: "Invoke the monitoring-pull-requests skill and run its workflow against
               PR #<N> on branch <branch>. The PR was just opened by
               the /pr skill at commit <sha>; pass that commit as the
               expected baseline — monitoring-pull-requests re-captures and verifies
               the baseline_commit itself in its Phase 0. Follow every
               phase of the skill verbatim, including the narrow-
               reproduction-first discipline and the 5-iteration cap.
               Produce the skill's final report when you finish."
    )

    Adjust the prompt to match your runtime's agent contract, but always (a) name the monitoring-pull-requests skill as the source of truth, (b) pass the PR number, branch, and baseline commit, and (c) require the skill's final report on completion.

  3. Tell the user what just happened, then return control:

    • PR URL.
    • That monitoring-pull-requests is now running in the background.
    • That CI feedback / fix attempts / a final report will arrive asynchronously when the agent completes.

    Do not poll or re-summarize CI here. The agent's final report is the closing status; surface it to the user when it lands.

If the runtime cannot spawn background agents, fall back to invoking /monitoring-pull-requests <pr-number> synchronously, or — as a last resort — poll gh run list --branch <branch-name> every 30–60 seconds and follow the same narrow-reproduction-first discipline monitoring-pull-requests enforces. Do not push speculative fixes when local reproduction is possible.

Notes

Branch Safety:

  • This skill will NEVER commit to the default branch, a long-standing integration branch, or a release branch — the canonical rules live in the commit skill's step 2.
  • If uncommitted changes exist and commit was not passed, warn but do not commit.

Business Value Focus:

  • PR descriptions should answer "why does this matter?" before "what changed?".
  • When a spec, PRD, or issue exists, it is the primary framing device — reference user scenarios and success criteria.
  • Technical implementation details belong in the diff, not the PR description.

Documentation Discipline:

  • Stale docs are worse than no docs — always check before opening a PR.
  • New features or changed behavior should be reflected wherever the project keeps its developer documentation.
  • If the project keeps no developer documentation, don't invent a structure — note it and move on.

Expected Outcome

A pull request that:

  • Lives on a properly named feature branch (never a protected or long-lived branch).
  • Has a business-value-focused description referencing specs or issues when available.
  • Includes up-to-date documentation where the project keeps any.
  • Has been reviewed and approved by the user before creation.
  • Has been handed off to a backgrounded monitoring-pull-requests agent, which owns post-creation CI watching and fix-on-failure asynchronously.

© opsmill, 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 .agents/skills/pr of opsmill/infrahub.

Open the folder on GitHubat commit af1c6c8

Compare with similar skills

PR 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.

PR compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR this skillopsmill/infrahub529—~3.7kAutomated safety check: PassApache-2.0
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Understand Diff AnalysisEgonex-AI/Understand-Anything85k1 repos~1.4kAutomated safety check: PassMIT
Contributor-First PR MergeHKUDS/OpenHarness16k1 repos~847Automated safety check: PassMIT
Open Code Review CLIalibaba/open-code-review44k—~3.1kAutomated safety check: PassApache-2.0
Create Pull Requestcline/cline70k1 repos~1.6kAutomated safety check: PassApache-2.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Understand Diff Analysis

    Egonex-AI/Understand-Anything

    Reads your git changes or a pull request against a prebuilt knowledge graph of the project to explain what changed, which components are affected and what is risky.

    85k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Merges external GitHub pull requests while keeping the original author credited, and fixes conflicts after the merge instead of rewriting the contribution.

    16k GitHub starsUsed in 1 repo~847 tokens
    DevelopmentAuto-check passed
  • Open Code Review CLI

    alibaba/open-code-review

    Runs the ocr command-line tool to review Git changes, a commit or a branch comparison with an AI model, returning line-level comments and optionally applying fixes.

    44k GitHub stars~3.1k tokensUpdated 2 days ago
    DevelopmentAuto-check passed
  • Opens a GitHub pull request from your current branch with the gh CLI, after reviewing the commits and diff and gathering the details the PR needs.

    70k GitHub starsUsed in 1 repo~1.6k tokens
    DevelopmentAuto-check passed
  • Pull Request Title and Body Writer

    openinterpreter/openinterpreter

    Rewrites the title and body of one or more pull requests with gh, leading with why the change was made, then what changed, and describing only the net result.

    69k GitHub starsUsed in 2 repos~1.1k tokens
    DevelopmentAuto-check passed

More from opsmill/infrahub

All 32 skills in this repo
  • Analyzing CI Flakiness

    opsmill/infrahub

    Analyzes recent CI failures on pull requests to identify flaky tests, using retry outcomes (failed attempt → green re-run) and cross-PR recurrence as evidence, and maintains a local longitudinal…

    529 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Audit Docs

    opsmill/infrahub

    Audits internal (dev/) and external (docs/) documentation completeness for a feature, subject, or set of existing docs, maps changes indicated by the user, across Infrahub's documentation layers…

    529 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Commit

    opsmill/infrahub

    Stages and commits the current changes onto a safe working branch, enforcing branch discipline and optionally pushing upstream.

    529 GitHub stars~2.8k tokensUpdated today
    Auto-check: notes
  • A skill your agent uses when you've fixed a bug, added a feature, or made any user-facing change in a project that uses Towncrier and need to record it for the changelog — before committing or…

    529 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Creating Issues

    opsmill/infrahub

    Turns a single feature idea, improvement, or bug into ONE well-structured GitHub issue.

    529 GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Creating Prd

    opsmill/infrahub

    Synthesises the current conversation context into a Product Requirements Document and publishes it to GitHub (as a comment on a referenced issue, or a new issue).

    529 GitHub stars~4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about PR

What does PR do?

Opens a pull request, publishing the current branch as a PR. PR is an agent skill from opsmill/infrahub. Opens a pull request, publishing the current branch as a PR.

When should I use PR?

PR fits situations like: : the user wants to open a pull request; publish the current branch as a PR; take the current work through to an open PR; : only committing changes → commit.

How do I install PR in Claude Code?

Run `npx skills add opsmill/infrahub --skill pr -a claude-code`. Or copy the skill folder (.agents/skills/pr in opsmill/infrahub) into .claude/skills/pr in your project. Claude Code loads it when a task matches its description.

How do I install PR in Codex?

Run `npx skills add opsmill/infrahub --skill pr -a codex`. Or copy the skill folder (.agents/skills/pr in opsmill/infrahub) into .agents/skills/pr in your project. Codex loads it when a task matches its description.

Can I use PR 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 opsmill/infrahub --skill pr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr, .gemini/skills/pr, .github/skills/pr and .opencode/skills/pr in your project.

What does PR need to run?

Going by SKILL.md and its folder, PR needs the command-line tools its instructions call (git and gh). Compatibility (from SKILL.md): Requires a Git working tree and GitHub access (gh CLI authenticated, GitHub MCP server, or equivalent). Works best alongside the `commit` and `monitoring-pull-requests` skills from this plugin..

Does PR access the network?

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

Is PR 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 PR use?

PR 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 PR use?

About 3.7k tokens (SKILL.md is roughly 15k 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 PR?

Skills that share tags, products or a category with PR: Finishing a Development Branch (obra/superpowers, 296k stars), Understand Diff Analysis (Egonex-AI/Understand-Anything, 85k stars), Contributor-First PR Merge (HKUDS/OpenHarness, 16k stars) and Open Code Review CLI (alibaba/open-code-review, 44k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR?

opsmill (a GitHub organization) maintains it in opsmill/infrahub, which has 529 GitHub stars. The repository holds 32 skills in this directory. The repository was last updated on October 7, 2026.

Source: opsmill/infrahub on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.