validate-bug
БесплатноБез исполняемых скриптовНе проверенDiagnose and fix jira/invalid-bug on PRs by running the same 7 checks as the jira-lifecycle-plugin
от openshift-eng★ 123 звезды на GitHubОб этом скилле
JIRA Bug Validator — Implementation Guide
IMPORTANT FOR AI: This is a procedural skill. Execute each phase in order. Do not skip steps. Do not invent field IDs — use only the documented custom field IDs below.
This skill replicates the validation logic of the jira-lifecycle-plugin (Prow external plugin) that applies the jira/invalid-bug label to PRs in OpenShift repositories.
Custom Field Reference
| Field | Custom Field ID | JQL Name |
|---|---|---|
| Target Version | customfield_10855 |
"Target Version" |
| Release Note Text | customfield_10783 |
— |
| Release Note Type | customfield_10785 |
— |
| Severity | customfield_10840 |
— |
The 7 Validation Checks
The jira-lifecycle-plugin runs these checks in order. A bug must pass ALL checks to get jira/valid-bug.
| # | Check | What it validates |
|---|---|---|
| 1 | Bug is open | Status is not "Closed" |
| 2 | Target version matches branch | Bug's Target Version matches the expected version for the PR's base branch |
| 3 | Bug in valid state | Status is one of: NEW, ASSIGNED, POST |
| 4 | Release notes set | Release note text is non-empty and doesn't match the default template, OR release note type is "Release Note Not Required" |
| 5 | Dependent bug states | Each dependent (linked via "Blocks") is in an allowed state |
| 6 | Dependent bug target versions | Each dependent targets an allowed version |
| 7 | Dependents exist | At least one "Blocks" link exists to a bug in the same project |
Checks 5-7 only apply to release branches (release-4.X), not main/master.
Branch-to-Version Mapping
The plugin config follows a mechanical pattern:
Target version (what the bug on the PR's branch must target):
release-4.X→4.X.z(prefix match —4.X.0also accepted)main/master→5.0.0(prefix match —5.0also accepted). Update whenmaintargets a new major version — checkopenshift/release/core-services/jira-lifecycle-plugin/config.yamlfor the current value.
Dependent target version (what the "Blocks" linked bug must target):
release-4.X→4.(X+1).0or4.(X+1).z
Valid states for the bug itself (all branches):
NEW,ASSIGNED,POST
Valid states for dependent bugs (varies by branch — check openshift/release/core-services/jira-lifecycle-plugin/config.yaml for current boundaries):
release-4.22and newer:MODIFIED,ON_QA,VERIFIEDrelease-4.6throughrelease-4.21:VERIFIED,RELEASE PENDING,CLOSED (ERRATA),CLOSED (CURRENT RELEASE),CLOSED (DONE),CLOSED (DONE-ERRATA)
Dependent bug checks (checks 5-7):
- Required for
release-4.Xbranches - NOT required for
main/master(config setsexclude_defaults: true)
Release notes:
- Required by default (
require_release_notes: true) - Default template text (must NOT match this):
"Cause: What actions or circumstances cause this bug to present.\r\nConsequence: What happens when the bug presents.\r\nFix: What was done to fix the bug.\r\nResult: Bug doesn't present anymore."
Prerequisites
ghCLI authenticated with GitHub- Jira MCP server configured (Atlassian Rovo MCP)
cloudId: useredhat.atlassian.net
Detailed Implementation Steps
Phase 1: Resolve Input
Parse the argument to determine input type:
PR URL — matches
https://github.com/{org}/{repo}/pull/{number}- Extract org, repo, and PR number from the URL
- Run:
gh pr view {number} --repo {org}/{repo} --json title,baseRefName,state - Extract JIRA key from PR title using regex: first match of
[A-Z]+-[0-9]+(e.g.,OCPBUGS-85778) - Extract base branch from
baseRefName(e.g.,release-4.20,main)
PR number — plain integer
- Determine repo from current git remote:
gh repo view --json nameWithOwner -q .nameWithOwner - Then same as PR URL flow above
- Determine repo from current git remote:
JIRA key — matches
[A-Z]+-[0-9]+- Require
--branchargument (no PR context to infer branch) - If
--branchnot provided, error: "JIRA key input requires --branch (e.g., --branch release-4.20)"
- Require
Validate the JIRA key project:
- Must be a bug project:
OCPBUGS,DFBUGS, orPROJQUAY - If not, warn: "Project {PROJECT} is not a bug project. The jira-lifecycle-plugin only validates bugs in OCPBUGS, DFBUGS, and PROJQUAY."
Compute expected values from branch:
- Parse branch name to extract version number
- Compute
expected_target_version,expected_dependent_versions,valid_states,dependent_valid_states,dependents_requiredusing the mapping above
Phase 2: Gather Data
Fetch the primary bug:
Call executeRead with name: "getJiraIssue", cloudId, and the rest in inputs — the primary getJiraIssue tool's schema omits view, so schema-validating clients drop it silently and return no issuelinks:
cloudId:redhat.atlassian.netinputs.issueIdOrKey: the JIRA key- `in
Установить validate-bug в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл validate-bug?
Diagnose and fix jira/invalid-bug on PRs by running the same 7 checks as the jira-lifecycle-plugin
Как установить скилл validate-bug?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл validate-bug запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic