Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

create-fix-pr

БесплатноБез исполняемых скриптовНе проверен

Use when opening or updating a GitHub pull request after Phase 5 of `/compliance:analyze-cve` has applied and verified a CVE fix locally.

openshift-engот openshift-eng★ 123 звезды на GitHub

Об этом скилле

Create Fix PR

Opens a GitHub pull request for the CVE fix already applied in REPO_DIR (Phase 5). Never commits, pushes, or opens a PR without explicit approval — interactive, or AUTO_APPROVE=yes recorded once upfront (see Autonomous Mode). Direct CVE mode (no --jira=/--jql=) still creates the PR; it just omits Jira Fixes: links and the Jira follow-up comment.

Called from Phase 6 of the analyze-cve skill after Phase 5 verification succeeds.


When to Use This Skill

Use this skill when:

  • Phase 5 applied a fix in REPO_DIR and verification passed
  • The user approved creating a GitHub PR
  • embargo_status is not True

Do not use this skill to apply the fix itself (that is Phase 5) or to post the analysis report (that is report-to-jira in Phase 4).


Required Inputs

From the parent command:

Input Source Required
REPO_DIR Phase 0.7 Yes
GIT_BRANCH Phase 0.7 (mapped release branch, e.g. release-4.17) Yes
REPO_URL Phase 0.7 Yes
CVE_ID Phase 0.5 / direct CVE mode Yes
SOURCE_TICKET --jira= / --jql= No
AUTO_APPROVE Phase 0 (--auto-approve, default no) Yes
FORK_ORG Caller environment (e.g. CI/RWS runner) No — enables Fork Mode when set
PHASE5_FILES Phase 5 allowlist (incl. untracked) Yes
Module path, old version, new version Phase 4 / 5 Yes if a dependency bump
Short CVE description Phase 1 Recommended
Phase 5 change summary Phase 5 "Document Changes" Yes

Prerequisites

Hard requirements for this skill. Phase 0 does not treat gh as required (warn-only). This skill must not assume either tool is present — re-check both, then fail if either is missing. Do not create a PR another way.

which git 2>/dev/null || echo "MISSING: git"
which gh 2>/dev/null || echo "MISSING: gh"
gh auth status 2>/dev/null || echo "MISSING: gh auth"
  • IF git is missing → print install instructions and return status: failed (git_missing). Stop. Do not commit or push.
  • IF gh is missing → print install instructions (https://cli.github.com/) and return status: failed (gh_missing). Stop. Do not commit or push.
  • IF gh auth status fails → print gh auth login instructions and return status: failed (gh_unauthenticated). Stop. Do not commit or push.
  • Do not print token or login output that contains credentials.

Credential rule: Never print, echo, or log tokens, PATs, or gh auth output that contains credentials. Reference credentials only via environment variable names.


Fork Mode (FORK_ORG set)

By default (no FORK_ORG) this skill pushes the fix branch directly to the cloned repo's own origin and opens a same-repo branch→base PR. That requires the authenticated gh/git identity to have direct write access to every upstream repo image-repo-mapping might resolve to (e.g. openshift/cert-manager-operator, openshift/cert-manager, openshift/secrets-store-csi-driver-operator, ...). In an unattended CI/RWS runner that isn't a collaborator on all of those repos, that's the wrong default.

IF the environment variable FORK_ORG is set (e.g. a bot-owned org), push to a fork under that org instead and open a cross-repo PR — mirrors the fork/upstream model used elsewhere for automated OpenShift PRs. This section only changes where the branch is pushed and how the PR's --head is specified; Step 0 (safety gates), Step 1 (org/repo/base-branch resolution from origin), Step 2 (conflicting-PR detection), and Step 3b (commit, allowlist validation) are unchanged and still operate against REPO_DIR/ORG/REPO/BASE_BRANCH resolved from origin.

Resolve the fork repo

FORK_REPO="${FORK_ORG}/${REPO}"   # REPO = repo name parsed from origin in Step 1, e.g. "cert-manager-operator"

Ensure the fork exists and is actually a fork of this repo

Never assume a repo at ${FORK_REPO} is the right push target just because the name matches — verify its fork lineage first. Reusing an unrelated (or unexpectedly renamed/transferred) repo that happens to occupy that name would push the fix branch and open a PR from somewhere unintended.

if FORK_JSON=$(gh repo view "${FORK_REPO}" --json isFork,parent 2>/dev/null); then
  IS_FORK=$(echo "$FORK_JSON" | jq -r '.isFork')
  PARENT_FULL_NAME=$(echo "$FORK_JSON" | jq -r '.parent.fullName // empty')
else
  IS_FORK=""
  PARENT_FULL_NAME=""
fi
  • IF ${FORK_REPO} exists (the gh repo view above succeeded) and (IS_FORK is not exactly true or PARENT_FULL_NAME is not exactly ${ORG}/${REPO}) → stop immediately, do not add the fork remote or push anything, and return status: failed (fork_wrong_lineage).
  • IF ${FORK_REPO} exists and lineage matches → skip fork cr
Полный SKILL.md на GitHub

Установить create-fix-pr в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл create-fix-pr?

Use when opening or updating a GitHub pull request after Phase 5 of `/compliance:analyze-cve` has applied and verified a CVE fix locally.

Как установить скилл create-fix-pr?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл create-fix-pr запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить create-fix-pr с