rhdh-pr-mr
Skill20 starsChanged 20 days agoApache-2.0View on GitHub
Pushes a topic branch and opens a GitHub pull request or GitLab CEE merge request for CI and agent automation after validating AI/tool attribution and a linked Jira issue in its description, then links Jira via /rhdh-jira-link. Use for "open a PR", "create the merge request", "push and open PR/MR after a yarn or base-image bump", or when another CI skill needs a shared opener. Not for plugin changeset publish (/rhdh-pr-create) and not a replacement for midstream createPR.sh inside updateBaseImages.sh.
- Commits and pushes
In this repository73 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rhdh-base-imagesSkill
- rhdh-konflux-rpaSkill
- rhdh-konflux-tasksSkill
- rhdh-plugin-catalog-index-status-and-update-flowSkill
- rhdh-prow-jobsSkill
- rhdh-prow-release-branchSkill
- rhdh-prow-triggerSkill
- rhdh-yarn-bumpSkill
- rhdh-feature-docsSkill
- rhdh-jira-createSkill
- rhdh-jira-linkSkill
- rhdh-jira-refineSkill
- rhdh-jira-sprint-planSkill
- rhdh-jira-sprint-reportSkill
- rhdh-jira-updateSkill
- rhdh-prepare-refinementSkill
- agent-readinessSkill
- ask-rhdhSkill
- clean-proseSkill
- setup-rhdh-skillsSkill
- skill-authoringSkill
- rhdh-backportSkill
- rhdh-backstage-upgradeSkill
- rhdh-localSkill
- rhdh-operator-pr-testSkill
- rhdh-overlaySkill
- rhdh-playwrightSkill
- rhdh-plugin-authoringSkill
- rhdh-plugin-bug-fixSkill
- rhdh-plugin-exportSkill
- rhdh-plugin-midstream-propagateSkill
- rhdh-plugin-nfs-migrationSkill
- rhdh-plugin-wiringSkill
- rhdh-pr-createSkill
- rhdh-pr-reviewSkill
- rhdh-test-placementSkill
- backstage-api-changesSkill
- mutation-gateSkill
- openspec-journalSkill
- prose-editingSkill
- rhdh-contextSkill
- rhdh-forgeSkill
- rhdh-jira-apiSkill
- rhdh-jira-authoringSkill
- rhdh-spec-driven-schemaSkill
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-audit-changeSkill
- openspec-bulk-archive-changeSkill
- openspec-continue-changeSkill
- openspec-exploreSkill
- openspec-ff-changeSkill
- openspec-new-changeSkill
- openspec-onboardSkill
- openspec-sync-specsSkill
- openspec-verify-changeSkill
- rhdh-overlay-cve-exportSkill
- rhdh-platform-lifecycleSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Always opens rebased to the tip: Before pushing, the script fetches the remote topic branch (when it exists) and the target branch — from …
- Very specific: line 53
Default is --no-open (no browser).
- Very specific: line 75
If --attribution is omitted, the script falls back to PI_MODEL and PI_REASONING_LEVEL (pi (<model>, thinking: <level>)) before failing.
- Very specific: line 83
Before pushing, the script verifies that the latest commit carries an attribution trailer.
- Very specific: line 111
Follow /mutation-gate for push + open + Jira link.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RHDH PR / MR opener
Shared script for push + open. Caller owns the commit and /mutation-gate
approval when an agent is driving. Weekly bots may call the script unattended.
Boundaries
- Not
/rhdh-pr-create(plugin changesets, recordings, monorepo publish). - Requires a known Jira key and calls
/rhdh-jira-linkafter opening. Stop before pushing when no issue is known; never invent one. - Requires an attribution trailer on the commit and in the description. The payload is open: name the tool, then add only the agent, model, provider and thinking level that are actually known.
- Midstream
createPR.sh(distgit) stays forupdateBaseImages.shuntil a later migration. - Always opens rebased to the tip. Before pushing, the script fetches the
remote topic branch (when it exists) and the target branch — from
origin, or from anupstreamremote when origin is a fork that lacks the target — rebases onto both, and refuses to push a HEAD that is still behind the base tip. A rebase that rewrites an already-pushed topic branch is followed by a single named--force-with-leasepush; a first push stays a normalgit push -u. A conflicted rebase aborts and fails loudly rather than opening a behind-the-base PR/MR.
Script
SKILL=<this skill's directory>
"$SKILL/scripts/create-pr-mr.sh" \
--cwd /path/to/checkout \
--base main \
--head chore/my-topic \
--title 'chore: short summary' \
--body-file /tmp/body.md \
--issue RHIDP-12345 \
--attribution '<tool> (<agent> + <model> (<provider>), thinking: <level>)' \
[--label ok-to-test] \
[--dry-run]Default is --no-open (no browser). Pass --open only for interactive agent runs.
GITLAB_PIPELINE=true forces no browser.
The script appends [<base>] to --title when that suffix is missing, including
for main (chore: short summary becomes chore: short summary [main]). A
title that already ends with the base branch is left as-is.
Resolve the --attribution value from the current work, filling in whatever is
known and stopping there:
| Known | Value |
| tool + agent + model + provider + thinking | paseo (pi + DeepSeek V4.1 Flash (EnMaaS), thinking: off) |
| tool + model + thinking | pi (GLM 5.3, thinking: high) |
| tool only | pi |
- Tool is where the agent ran:
paseo,pi,cursor, a CI bot script. - Agent, provider, thinking level are optional and go in that order;
thinking:is a labelled field, not a third model word. - Never guess and never emit a placeholder. A missing model is dropped, not
filled with a stand-in string that the next agent will copy verbatim. No
Unknown AI, no invented version numbers, no borrowed IDE name. - If
--attributionis omitted, the script falls back toPI_MODELandPI_REASONING_LEVEL(pi (<model>, thinking: <level>)) before failing. - The trailer key written is
Assisted-By:;Generated-by:is accepted on read, so older callers and existing commits keep working. A value that already starts with either key is used verbatim. --assisted-byandRHDH_ASSISTED_BYremain accepted as aliases of--attributionandRHDH_ATTRIBUTION.
Before pushing, the script verifies that the latest commit carries an attribution
trailer. Any payload satisfies it — the commit trailer and the --attribution
value do not have to match, so a caller can pass less detail than the commit has.
The script adds the resolved line (when the description has none) and
Related Jira: [KEY](https://redhat.atlassian.net/browse/KEY) to the PR/MR
description.
GitLab MRs set remove_source_branch: true so merging deletes the topic branch.
Stdout includes url: …. Exit 0 if a PR/MR already exists for --head.
Jira
| Condition | Behavior |
--issue KEY or JIRA_ISSUE set + JIRA_API_TOKEN | Add the linked issue to the description, then invoke /rhdh-jira-link (link-pr-mr.js link). The Jira comment links the PR/MR title (repo #id: title [base]) to the URL (plus optional Adjusted fields). |
| Issue set but no token / missing link script | The linked description remains; warn that the Jira backlink was skipped. |
Override the link scripts directory with RHDH_JIRA_LINK_SCRIPTS when the
sibling skill is not next to this one in the pack checkout.
Agents
- Resolve the most specific available attribution from the table above — fill
in what you know, stop at the tool name — and add that
Assisted-By:trailer to the commit. - Resolve the Jira key from the conversation. Stop before pushing when none is known; never turn a plain issue key in the description into an unlinked label.
- Follow
/mutation-gatefor push + open + Jira link. - Invoke
/rhdh-pr-mrby name (or run the script path when already inside a skill clone), passing--issueand--attribution. - Report the
url:line.
Tests
bash -n "$SKILL/scripts/create-pr-mr.sh"
shellcheck --severity=warning "$SKILL/scripts/create-pr-mr.sh"
"$SKILL/scripts/create-pr-mr.sh" --help
"$SKILL/tests/smoke.sh"Completion
Done when the topic branch is pushed; the latest commit and PR/MR description carry an attribution trailer whose payload names every part that was actually known; the description contains the Markdown Jira link; a Jira Web link was updated or its missing credential was reported; and a GitLab MR is configured to delete its source branch after merge.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

