rhdh-jira-link
Skill20 starsChanged 22 days agoApache-2.0View on GitHub
Ties a GitHub pull request or GitLab merge request to an RHDH Jira issue in RHIDP, RHDHPLAN, RHDHBUGS, or RHDHSUPP: attach the Jira Web link titled `repo #N: <title>`, post or update the structured comment, fill empty issue fields, move an RHDHPLAN Epic, Story, or Task to RHIDP, and mark a Web link merged or closed. Raises the PR or MR first when one does not exist yet. Use for "link this PR to RHIDP-1234", "attach the MR to the Jira issue", "mark the Web links merged", "mark closed PRs", replacing a hand-rolled remotelink or comment step, or a PR outside the rhdh-plugins and community-plugins monorepo flow. The full monorepo flow — build, changeset, recordings — is rhdh-pr-create.
- 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-pr-mrSkill
- rhdh-prow-jobsSkill
- rhdh-prow-release-branchSkill
- rhdh-prow-triggerSkill
- rhdh-yarn-bumpSkill
- rhdh-feature-docsSkill
- rhdh-jira-createSkill
- 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
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
After the feature branch is committed:
- Distinctive: line 89
When a PR/MR already exists:
- Distinctive: line 102
If a comment already mentions the PR/MR URL, it is updated in place (comments are paginated).
- Very specific: line 107
If the linked issue is an Epic, Story, or Task in RHDHPLAN, link moves it to RHIDP (same issue type) via the Jira bulk-move API, then …
- Very specific: line 127
When no title is known, the line falls back to PR: <url> / MR: <url>.
- Very specific: line 154
Prefer glab default host: gitlab.cee.redhat.com in ~/.config/glab-cli/config.yml for day-to-day CEE work.
- Very specific: line 157
When summarizing to the user, use markdown links (<title>).
- Very specific: line 221
Commit on a feature branch.
- Very specific: line 225
Run create-pr-mr.js once. Report url: / diffs: / browserOpened: / jiraLink: from its stdout (browserOpened: true or --no-open means the …
≈ “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
Jira PR / MR links
Zero-token Node scripts for GitHub and GitLab: create the PR/MR, attach a Jira remote Web link, post or update a structured comment, and optionally fill empty issue fields.
Scripts live under this skill's scripts/ directory. Resolve that path from the
installed skill root (agents already have it when reading this file):
SKILL="$(cd "$(dirname "$0")" && pwd)" # or the absolute path to this skill root
node "$SKILL/scripts/create-pr-mr.js" …
node "$SKILL/scripts/link-pr-mr.js" …Another skill that needs the link step invokes /rhdh-jira-link by name and
lets this skill run its own scripts; it never calls into this directory by path.
Preferred: one-shot create (create-pr-mr.js)
After the feature branch is committed:
Compose the reviewer-facing PR or MR title and body, then invoke
/prose-editing once on both in the flavored register. Preserve Jira keys,
closing syntax, headings, checklists, links, and the required Assisted-By
line. Pass the edited strings to create-pr-mr.js; it is a transport layer and
must not edit them. The structured Jira link comment created later is a protocol
payload and does not receive this prose pass.
node "$SKILL/scripts/create-pr-mr.js" \
--issue RHIDP-12345 \
--title 'fix: short summary' \
--target main \
--body "$(cat <<'EOF'
## Summary
- …
## Test plan
- [ ] …
EOF
)"git push -u origin HEAD(unless--no-push)- Detects GitHub vs GitLab from
origin - Runs
gh pr createorglab mr create - Runs
link-pr-mr.js link(unless--no-link). Missing Jira auth is an error; pass--no-linkto skip linking. - Opens the diffs page (unless
--no-open)
Flags: --draft, --no-push, --no-link, --no-open, --no-defaults,
--no-comment, --no-jira-ref, --host github|gitlab.
Auth
Either works (same token either way):
JIRA_API_TOKEN+login/serverin~/.config/.jira/.config.yml, or.jira-token(email:token) next toacli— the same credential/rhdh-jira-apiuses. Invoke/rhdh-jira-apiby name for the authoritative auth setup instead of duplicating it here.
create-pr-mr.js appends Ref: https://redhat.atlassian.net/browse/KEY and an
attribution trailer to the PR/MR body when missing — Assisted-By: pi
(<model>, thinking: <level>) when PI_MODEL / PI_REASONING_LEVEL identify the
harness, and nothing at all when they do not (never a guessed tool). It adds
nothing when the body already carries an Assisted-By:/Generated-by: line. It
skips the Jira Ref: line for community-plugins remotes (or when --no-jira-ref is set) so
that repo stays free of Jira browse URLs in git history / PR text.
Link-only: link-pr-mr.js
When a PR/MR already exists:
node "$SKILL/scripts/link-pr-mr.js" link \
--issue RHIDP-12345 \
--url 'https://gitlab.cee.redhat.com/rhidp/example/-/merge_requests/817' \
--title 'example #817: fix: short summary' \
--host gitlab--hostoptional; inferred from URL when omitted.--no-defaultsskips In Progress + metadata fills (Web link + comment still run).--no-commentskips the Jira comment.- If a comment already mentions the PR/MR URL, it is updated in place (comments are paginated).
RHDHPLAN → RHIDP auto-move
If the linked issue is an Epic, Story, or Task in RHDHPLAN,
link moves it to RHIDP (same issue type) via the Jira bulk-move API, then
continues Web link / defaults / comment on the new key. Features and other
RHDHPLAN types are left alone.
Stdout includes move: … and the post-move issue: key.
Comment shape (only newly set fields; omit kept values) — the first
line is the PR/MR title (the same string as the Web link) linking to the URL:
[org/repo #123: fix: widget [main]](https://github.com/org/repo/pull/123)or, for GitLab:
[rhdh-plugin-catalog #1003: fix: … [release-2.1]](https://gitlab.cee.redhat.com/rhidp/rhdh-plugin-catalog/-/merge_requests/1003)When no title is known, the line falls back to PR: <url> / MR: <url>.
Then, when any defaults were newly set:
Adjusted fields:
* Priority: Normal
* Status: In ProgressThe Web link title remains repo #N: <title> (unchanged).
Mark merged / closed
node "$SKILL/scripts/link-pr-mr.js" mark-merged --issue RHIDP-12345Prefixes Web link titles with [x] merged: when the PR/MR is merged, or
[!] closed: when it is closed without merging. Does not re-apply
defaults/comment. Stdout lists each title and its PR/MR URL (indented under
the title). Open PRs/MRs stay in leftOpen with no prefix.
mark-merged checks status via gh / glab. Failed checks print a
warn: line and leave the link in leftOpen (do not treat a failed check as
closed). For GitLab remotelinks it passes --hostname from the URL
(e.g. gitlab.cee.redhat.com), so CEE MRs resolve against the right host.
Prefer glab default host: gitlab.cee.redhat.com in
~/.config/glab-cli/config.yml for day-to-day CEE work.
When summarizing to the user, use markdown links ([<title>](<url>)).
Title format (for link --title)
<repo-short-name> #<id>: <full PR/MR title>Merged: [x] merged: <repo-short-name> #<id>: <full PR/MR title>
Closed (not merged): [!] closed: <repo-short-name> #<id>: <full PR/MR title>
Defaults link applies (only if empty)
No built-in team/assignee values. First run with defaults enabled requires a
config file (or env/CLI). Missing keys error when applying defaults; the Web
link and comment still succeed with --no-defaults.
mkdir -p ~/.config/rhdh-jira-link
cp "$SKILL/config.example.json" ~/.config/rhdh-jira-link/config.json
# edit assigneeEmail, teamId, teamName, boardId, …Also accepted: $JIRA_PR_MR_CONFIG or $SKILL/config.local.json
(keep personal email out of the repo).
Precedence: CLI > env > config file > Jira CLI hints (login / board.id
from ~/.config/.jira/.config.yml may fill assignee/board only).
| Field | Required when applying defaults |
assigneeEmail | yes (or Jira login email) |
teamId / teamName | yes, or set either to NONE to skip team and sprint |
boardId | yes (or jira CLI board.id), unless team/sprint skipped via NONE |
storyPoints | yes |
priorityName | yes (only fills when priority is empty) |
storyPointsField | yes |
teamField / sprintField | yes, unless team/sprint skipped via NONE |
| Status | → In Progress unless already In Progress / Review / Closed |
Skip all defaults: --no-defaults or JIRA_PR_MR_APPLY_DEFAULTS=0.
Skip only team + sprint (still set points / assignee / priority / In Progress):
"teamName": "NONE",
"teamId": "NONE"Relationship to /rhdh-pr-create
/rhdh-pr-create owns the rhdh-plugins / community-plugins monorepo PR
flow (build, changesets, recordings). This skill owns the Jira Web link +
comment (and optional defaults) for any repo. Invoke it by name; do not read or
run its files.
Once /rhdh-pr-create has created a PR, it hands the URL and title back and
this skill runs the link step with --no-defaults, leaving /rhdh-pr-create
free to transition the issue to Review (see
references/raise-pr-integration.md).
Agent checklist
- Resolve Jira key. Ask if missing (unless user skipped Jira).
- Commit on a feature branch. Put the Jira browse URL and an attribution trailer
(
Assisted-By: <tool> (<model>, thinking: <level>), dropping the parts you do not know) in the PR/MR body (create-pr-mr.jsappends them when missing; skipsRef:for community-plugins). - Run
create-pr-mr.jsonce. Reporturl:/diffs:/browserOpened:/jiraLink:from its stdout (browserOpened: trueor--no-openmeans the open step is already done). - Fallback: raw create → run
link-pr-mr.js, then open diffs yourself once. - For mark-merged:
link-pr-mr.js mark-merged --issue KEY. Report merged, closed, and still-open Web links. - In user-facing summaries, link PR/MRs as
[<title>](<url>).
Every run here is an external write
Creating a PR/MR, writing a Jira Web link, posting a comment, moving an issue to
another project, and filling default fields all change something outside the
session. Invoke /mutation-gate and follow it before the first command:
one script invocation can perform several of these at once, so state them as one
set — push, create, link, comment, defaults — and get a single approval covering
all of them.
Completion
Complete when the answer names the PR/MR URL and diffs link, the Jira key it was
linked to — including the post-move key when an RHDHPLAN Epic, Story, or Task
moved to RHIDP — the Web link title, whether the comment was posted or updated,
which default fields were newly set, and every warn: line the scripts printed.
Report the fields the script left alone as kept, never as set. A Web link that
succeeded followed by a defaults update that errored is a partial link, so say
which half landed.
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.

