/fix-hypershift-repo-robot-pr
Fix robot/bot PRs in HyperShift repo by regenerating files and creating a new PR with passing verification
$ npx -y skills add openshift/hypershift --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/fix-hypershift-repo-robot-pr
Context preview
What this command does when you run it.
Fix robot/bot PRs in HyperShift repo by regenerating files and creating a new PR with passing verification
Command definition
fix-hypershift-repo-robot-pr.mddescription: Fix robot/bot PRs in HyperShift repo by regenerating files and creating a new PR with passing verification
Fix robot/bot-authored PRs in the HyperShift repository that have failing CI due to missing generated files.
[Extended thinking: This command validates a PR is from a bot, checks out the bot's branch, creates a fix branch, cherry-picks commits with conventional commit format, runs make verify to regenerate files, organizes changes into logical commits, runs validation, and if successful creates a new PR while closing/commenting on the original. If validation fails, the original PR is preserved.]
**Fix HyperShift Repo Robot PR**
Usage Examples:
1. **Fix a dependabot PR by number**: `/fix-hypershift-repo-robot-pr 7435`
2. **Fix a konflux PR by URL**: `/fix-hypershift-repo-robot-pr https://github.com/openshift/hypershift/pull/7332`
What This Command Does:
1. Validates the PR is authored by a bot (`is_bot: true`) 2. Fetches the bot's PR commits 3. Creates a new branch: `fix/<original-branch-name>` from the base branch 4. Cherry-picks commits and converts to conventional commit format 5. Runs `make verify` to regenerate all necessary files 6. Runs `UPDATE=true make test` to update test fixtures 7. Organizes changes into logical, well-structured commits 8. Runs `make verify` and `make test` for final validation 9. If successful: Creates new PR and closes/comments on original 10. If unsuccessful: Preserves original PR and reports failure
Process Flow:
Step 1: Parse Input and Validate PR
Extract the PR number from the argument (handles both number and URL formats):
PR_NUMBER=$(echo "{{args.0}}" | grep -oE '[0-9]+$')Fetch PR details and validate:
gh pr view "$PR_NUMBER" --json number,title,author,headRefName,baseRefName,body,state,url,commits
**Required validations:**
- PR must exist
- PR state must be `OPEN`
- `author.is_bot` must be `true`
- Working directory must be clean (no uncommitted changes)
**Error if not a bot:**
ERROR: PR #7435 is not authored by a bot.
Author: username (is_bot: false)
This command is specifically for fixing bot-authored PRs.
Step 2: Create Fix Branch from Base
# Save current branch
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Fetch latest from upstream
git fetch upstream
# Create fix branch from the PR's base branch
FIX_BRANCH="fix/${BOT_BRANCH_NAME}"
git checkout -b "$FIX_BRANCH" upstream/${BASE_REF_NAME}**Branch name examples:**
- `dependabot/go_modules/github-dependencies-0a2d1f925e` → `fix/dependabot/go_modules/github-dependencies-0a2d1f925e`
- `konflux-hypershift-operator-hotfix-ocpbugs-61296-0170` → `fix/konflux-hypershift-operator-hotfix-ocpbugs-61296-0170`
Step 3: Cherry-pick and Convert Commits
For each commit in the bot's PR: 1. Cherry-pick the commit 2. Amend the commit message to conventional commit format
**Converting bot commit messages to conventional format:**
| Bot | Original Format | Converted Format | |-----|-----------------|------------------| | Dependabot | `NO-JIRA: Bump the misc-dependencies group...` | `chore(deps): bump misc-dependencies group...` | | Dependabot | `build(deps): bump X from A to B` | Keep as-is (already conventional) | | Konflux | `Red Hat Konflux update hypershift-operator...` | `chore(konflux): update hypershift-operator...` |
**Note:** The conversion logic below is pseudocode. Claude should implement the conversion based on the rules in the table above, detecting the bot type from the commit message format and transforming accordingly.
# Cherry-pick each commit from the bot PR
for COMMIT in $(gh pr view $PR_NUMBER --json commits -q '.commits[].oid'); do
git cherry-pick "$COMMIT"
# Get original message and convert to conventional format
# Claude implements conversion based on the table above:
# - Strip "NO-JIRA: " prefix if present
# - Convert "Bump" to "bump" for consistency
# - Add appropriate type prefix (chore(deps):, chore(konflux):, etc.)
# - Preserve the rest of the message
ORIGINAL_MSG=$(git log -1 --format='%B')
# Amend with converted message
git commit --amend -m "$CONVERTED_MSG"
done
Step 4: Run make verify, Update Test Fixtures, and Organize Changes
Run make verify to regenerate files, run tests with UPDATE=true to update fixtures, then organize into logical commits:
# Run make verify (may generate files)
make verify 2>&1 || true
# Run make test with UPDATE=true to update test fixtures
UPDATE=true make test 2>&1 || true
# Check for changes
git status --porcelain
**Organize changes into separate commits:**
1. **go.mod/go.sum changes** (root module):
git add go.mod go.sum
git commit -m "chore(deps): update go.mod dependencies
Signed-off-by: ...
Commit-Message-Assisted-by: Claude (via Claude Code)"
2. **vendor/ changes** (root module):
git add vendor/
git commit -m "chore(deps): update vendored dependencies
Signed-off-by: ...
Commit-Message-Assisted-by: Claude (via Claude Code)"
3. **api/ module changes** (go.mod, go.sum, vendor/):
git add api/go.mod api/go.sum api/vendor/
git commit -m "chore(api): update api module dependencies
Signed-off-by: ...
Commit-Message-Assisted-by: Claude (via Claude Code)"
4. **Regenerated assets** (CRDs, manifests):
git add cmd/install/assets/
git commit -m "chore: regenerate CRD manifests
Signed-off-by: ...
Commit-Message-Assisted-by: Claude (via Claude Code)"
5. **Other code changes** (if any):
git add -A
git commit -m "chore: additional changes from make verify
Signed-off-by: ...
Commit-Message-Assisted-by: Claude (via Claude Code)"
**Important:** Check for untracked files that make verify may generate:
git status --porcelain | grep '^??'
# Add any untracked generated files
Step 5: Run Full Validation
# Run make
Read more
description: Fix robot/bot PRs in HyperShift repo by regenerating files and creating a new PR with passing verification
Fix robot/bot-authored PRs in the HyperShift repository that have failing CI due to missing generated files.
[Extended thinking: This command validates a PR is from a bot, checks out the bot's branch, creates a fix branch, cherry-picks commits with conventional commit format, runs make verify to regenerate files, organizes changes into logical commits, runs validation, and if successful creates a new PR while closing/commenting on the original. If validation fails, the original PR is preserved.]
**Fix HyperShift Repo Robot PR**
Usage Examples:
1. **Fix a dependabot PR by number**: `/fix-hypershift-repo-robot-pr 7435`
2. **Fix a konflux PR by URL**: `/fix-hypershift-repo-robot-pr https://github.com/openshift/hypershift/pull/7332`
What This Command Does:
1. Validates the PR is authored by a bot (`is_bot: true`) 2. Fetches the bot's PR commits 3. Creates a new branch: `fix/<original-branch-name>` from the base branch 4. Cherry-picks commits and converts to conventional commit format 5. Runs `make verify` to regenerate all necessary files 6. Runs `UPDATE=true make test` to update test fixtures 7. Organizes changes into logical, well-structured commits 8. Runs `make verify` and `make test` for final validation 9. If successful: Creates new PR and closes/comments on original 10. If unsuccessful: Preserves original PR and reports failure
Process Flow:
Step 1: Parse Input and Validate PR
Extract the PR number from the argument (handles both number and URL formats):
PR_NUMBER=$(echo "{{args.0}}" | grep -oE '[0-9]+$')Fetch PR details and validate:
gh pr view "$PR_NUMBER" --json number,title,author,headRefName,baseRefName,body,state,url,commits
**Required validations:**
- PR must exist
- PR state must be `OPEN`
- `author.is_bot` must be `true`
- Working directory must be clean (no uncommitted changes)
**Error if not a bot:**
ERROR: PR #7435 is not authored by a bot. Author: username (is_bot: false) This command is specifically for fixing bot-authored PRs.
Step 2: Create Fix Branch from Base
# Save current branch
ORIGINAL_BRANCH=$(git rev-parse --abbrev-ref HEAD)
# Fetch latest from upstream
git fetch upstream
# Create fix branch from the PR's base branch
FIX_BRANCH="fix/${BOT_BRANCH_NAME}"
git checkout -b "$FIX_BRANCH" upstream/${BASE_REF_NAME}**Branch name examples:**
- `dependabot/go_modules/github-dependencies-0a2d1f925e` → `fix/dependabot/go_modules/github-dependencies-0a2d1f925e`
- `konflux-hypershift-operator-hotfix-ocpbugs-61296-0170` → `fix/konflux-hypershift-operator-hotfix-ocpbugs-61296-0170`
Step 3: Cherry-pick and Convert Commits
For each commit in the bot's PR: 1. Cherry-pick the commit 2. Amend the commit message to conventional commit format
**Converting bot commit messages to conventional format:**
| Bot | Original Format | Converted Format | |-----|-----------------|------------------| | Dependabot | `NO-JIRA: Bump the misc-dependencies group...` | `chore(deps): bump misc-dependencies group...` | | Dependabot | `build(deps): bump X from A to B` | Keep as-is (already conventional) | | Konflux | `Red Hat Konflux update hypershift-operator...` | `chore(konflux): update hypershift-operator...` |
**Note:** The conversion logic below is pseudocode. Claude should implement the conversion based on the rules in the table above, detecting the bot type from the commit message format and transforming accordingly.
# Cherry-pick each commit from the bot PR for COMMIT in $(gh pr view $PR_NUMBER --json commits -q '.commits[].oid'); do git cherry-pick "$COMMIT" # Get original message and convert to conventional format # Claude implements conversion based on the table above: # - Strip "NO-JIRA: " prefix if present # - Convert "Bump" to "bump" for consistency # - Add appropriate type prefix (chore(deps):, chore(konflux):, etc.) # - Preserve the rest of the message ORIGINAL_MSG=$(git log -1 --format='%B') # Amend with converted message git commit --amend -m "$CONVERTED_MSG" done
Step 4: Run make verify, Update Test Fixtures, and Organize Changes
Run make verify to regenerate files, run tests with UPDATE=true to update fixtures, then organize into logical commits:
# Run make verify (may generate files) make verify 2>&1 || true # Run make test with UPDATE=true to update test fixtures UPDATE=true make test 2>&1 || true # Check for changes git status --porcelain
**Organize changes into separate commits:**
1. **go.mod/go.sum changes** (root module):
git add go.mod go.sum git commit -m "chore(deps): update go.mod dependencies Signed-off-by: ... Commit-Message-Assisted-by: Claude (via Claude Code)"
2. **vendor/ changes** (root module):
git add vendor/ git commit -m "chore(deps): update vendored dependencies Signed-off-by: ... Commit-Message-Assisted-by: Claude (via Claude Code)"
3. **api/ module changes** (go.mod, go.sum, vendor/):
git add api/go.mod api/go.sum api/vendor/ git commit -m "chore(api): update api module dependencies Signed-off-by: ... Commit-Message-Assisted-by: Claude (via Claude Code)"
4. **Regenerated assets** (CRDs, manifests):
git add cmd/install/assets/ git commit -m "chore: regenerate CRD manifests Signed-off-by: ... Commit-Message-Assisted-by: Claude (via Claude Code)"
5. **Other code changes** (if any):
git add -A git commit -m "chore: additional changes from make verify Signed-off-by: ... Commit-Message-Assisted-by: Claude (via Claude Code)"
**Important:** Check for untracked files that make verify may generate:
git status --porcelain | grep '^??' # Add any untracked generated files
Step 5: Run Full Validation
# Run make
HyperShift is a middleware for hosting OpenShift control planes at scale that solves for cost and time to provision, as well as portability cross cloud with strong separation of concerns between management and workloads.
Repo: openshift/hypershift
Other commands on hypershift.
- /e2e-analyze
Analyze test errors
Open command - /konflux-build
Create a manual Konflux build from a PR with configurable image expiry (default 30 days)
Open command - /pr-report
PR Report Generator
Open command - /restructure-commits
Restructure branch commits into logical component-based commits for HyperShift PRs
Open command - /test-tag-pipeline
Create a manual PipelineRun to test tag pipeline changes before merging.
Open command - /update-konflux-tasks
Automatically update outdated Konflux Tekton tasks based on enterprise contract verification logs.
Open command

