create-cpo-override
Interactively create CPO image overrides — resolves images, verifies fixes, edits overrides.yaml, and prepares a 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 --skill fix-hypershift-repo-robot-pr --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/fix-hypershift-repo-robot-prContext preview
The summary Claude sees to decide when to auto-load this skill.
Fix robot/bot PRs in HyperShift repo by regenerating files and creating a new PR with passing verification
name: fix-hypershift-repo-robot-pr 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**
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`
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
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:**
**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.
# 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:**
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
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
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
Interactively create CPO image overrides — resolves images, verifies fixes, edits overrides.yaml, and prepares a PR
Provides systematic debugging approaches for HyperShift hosted-cluster issues. Auto-applies when debugging cluster problems, investigating stuck deletions, or…
Build and push control-plane-operator container image. Auto-applies when testing CPO changes that require deploying to a live cluster.
Build and push hypershift-operator container image. Auto-applies when testing HO changes that require deploying to a live cluster.
Create a HyperShift HostedCluster on AWS for development and testing, with optional custom CPO/HO images.
Destroy a HyperShift HostedCluster and all associated AWS infrastructure (VPC, IAM, Route53, etc.).