NO-JIRA: chore(claude): add restructure-commits plugin command#7927
Conversation
Add a .claude-plugin structure and a /restructure-commits command that reorganizes branch commits into logical, component-based commits matching HyperShift's architecture. - Add .claude-plugin/plugin.json for plugin metadata - Add .claude/commands/restructure-commits.md as user-invocable command - Update .claude/SKILLS.md with documentation Signed-off-by: Bryan Cox <brcox@redhat.com> Commit-Message-Assisted-by: Claude (via Claude Code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
WalkthroughAdds a Claude plugin manifest and documentation for a HyperShift development workflow skill, including a new "Restructure Commits" command guide with component-to-file mappings, step-by-step commit reorganization instructions, commit message conventions, edge-case rules, and verification steps. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Comment |
|
@bryan-cox: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
.claude-plugin/plugin.json (1)
5-7: Consider using an organization name for the author field.The
author.namefield currently uses a GitHub repository path. While valid, plugin author fields typically contain a person or organization name (e.g., "OpenShift Team" or "Red Hat"). Using "github.com/openshift/hypershift" is unconventional for an author name.♻️ Suggested alternative
"author": { - "name": "github.com/openshift/hypershift" + "name": "OpenShift HyperShift Team" }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude-plugin/plugin.json around lines 5 - 7, Change the author.name value in the plugin.json to a conventional person or organization label instead of the GitHub repo path; locate the "author" object and update the "name" field (author.name) to something like "OpenShift Team" or "Red Hat" to reflect an author identity rather than a URL..claude/commands/restructure-commits.md (1)
30-30: Clarify the meaning of "excluded from restructuring."The phrase "Excluded from restructuring" followed by "include them in the most relevant commit" is potentially ambiguous. The intent appears to be that these directories don't have automatic mappings but should still be included when changed. Consider rephrasing for clarity.
✍️ Suggested rewording
-**Excluded from restructuring:** `bin/` (build output), `hack/`, `contrib/`, `hypershift-ci-python/`, `self-managed-azure-ci-setup/`, and `.claude*/` are build tooling, CI helpers, or dev config. If changed, include them in the most relevant commit based on their purpose. When ambiguous, prefer HO. +**No default mapping:** `bin/` (build output), `hack/`, `contrib/`, `hypershift-ci-python/`, `self-managed-azure-ci-setup/`, and `.claude*/` are build tooling, CI helpers, or dev config. If changed, include them in the most relevant commit based on their purpose. When ambiguous, prefer HO.Or alternatively:
-**Excluded from restructuring:** `bin/` (build output), `hack/`, `contrib/`, `hypershift-ci-python/`, `self-managed-azure-ci-setup/`, and `.claude*/` are build tooling, CI helpers, or dev config. If changed, include them in the most relevant commit based on their purpose. When ambiguous, prefer HO. +**Manual categorization required:** `bin/` (build output), `hack/`, `contrib/`, `hypershift-ci-python/`, `self-managed-azure-ci-setup/`, and `.claude*/` are build tooling, CI helpers, or dev config without automatic component mappings. If changed, include them in the most relevant commit based on their purpose. When ambiguous, prefer HO.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/SKILLS.md:
- Line 110: The SKILLS.md entry references a non-existent skill directory
`.claude/skills/restructure-hypershift-commits/` while the actual implementation
lives at `.claude/commands/restructure-commits.md`; fix this by either updating
the SKILLS.md line that mentions
`.claude/skills/restructure-hypershift-commits/` (around line 110) to point to
`.claude/commands/restructure-commits.md`, or create the missing skill directory
`.claude/skills/restructure-hypershift-commits/` and add a `SKILL.md` there that
mirrors the command content so the repository follows the established
skill/`SKILL.md` pattern.
---
Nitpick comments:
In @.claude-plugin/plugin.json:
- Around line 5-7: Change the author.name value in the plugin.json to a
conventional person or organization label instead of the GitHub repo path;
locate the "author" object and update the "name" field (author.name) to
something like "OpenShift Team" or "Red Hat" to reflect an author identity
rather than a URL.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2222af4d-1d25-4b41-b158-92ccd59ba78b
📒 Files selected for processing (3)
.claude-plugin/plugin.json.claude/SKILLS.md.claude/commands/restructure-commits.md
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bryan-cox The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
3f199a1 to
83029a4
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.claude/commands/restructure-commits.md:
- Around line 53-57: The example that shows "git add api/" incorrectly stages
API test files; update that example to stage API sources but exclude files
matching the API test pattern (api/**/*_test.go) so tests remain in the E2E
commit. Edit the snippet that currently contains the "git add api/" line in the
restructure-commits example to use an add command or explicit file globs that
exclude api/**/*_test.go, and ensure the accompanying comment/instruction
mentions that API tests are excluded and belong in the E2E commit.
- Around line 34-40: The snippet hard-codes "main" when computing MERGE_BASE and
running git log/diff; change this to require an explicit base branch variable
(e.g. TARGET_BASE or BASE_BRANCH) and use that variable in the git merge-base,
git log and git diff commands instead of "main"; update the documentation text
to instruct the user to set or pass TARGET_BASE (with a sensible default note)
and apply the same change for the other occurrences referenced (the commands
around git merge-base/git log/git diff on lines 68-70) so all comparisons use
the explicit base variable.
In @.claude/SKILLS.md:
- Around line 108-130: The "### Restructure Commits" entry is currently under
the wrong section; move that entire block (the header "Restructure Commits", its
Description, Invoked with: `/restructure-commits`, Use when:, Covers:,
Benefits:) out of the "Available Skills" area and place it under the "Available
Commands" section, updating any surrounding headings or table-of-contents
references so the command is discoverable alongside other manual commands and
its classification text reflects it is a manually-invoked command rather than an
automatic skill.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d29e2729-ffa8-4e50-abfc-98fd65373746
📒 Files selected for processing (2)
.claude/SKILLS.md.claude/commands/restructure-commits.md
| | 2 | Vendor | `api` | `vendor/`, `client/`, `cmd/install/assets/hypershift-operator/zz_generated.crd-manifests/` | | ||
| | 3 | CLI | `cli` | `cmd/cluster/`, `cmd/install/`, `cmd/nodepool/`, `product-cli/` (source, tests, testdata) | | ||
| | 4 | HO | `hypershift-operator` | `hypershift-operator/`, `support/`, `karpenter-operator/`, `kubevirtexternalinfra/`, `pkg/`, `manifests/` | | ||
| | 5 | CPO | `control-plane-operator` | `control-plane-operator/`, `control-plane-pki-operator/`, `availability-prober/`, `dnsresolver/`, `etcd-backup/`, `etcd-defrag/`, `etcd-recovery/`, `ignition-server/`, `kas-bootstrap/`, `konnectivity-https-proxy/`, `konnectivity-socks5-proxy/`, `kubernetes-default-proxy/`, `shared-ingress/`, `sharedingress-config-generator/`, `sync-fg-configmap/`, `sync-global-pullsecret/`, `token-minter/` | |
There was a problem hiding this comment.
shared-ingress is part of the HO.
Also support/ contains shared code used by the CPO as well as the HO
There was a problem hiding this comment.
Done. Moved shared-ingress/ and sharedingress-config-generator/ from CPO to HO in the component table and edge cases section. Also noted that support/ is shared code used by both.
AI-assisted response via Claude Code
Address CodeRabbit review feedback by mapping all top-level directories to their appropriate component categories: - CPO: control-plane-pki-operator, availability-prober, dnsresolver, etcd-backup/defrag/recovery, ignition-server, kas-bootstrap, konnectivity-*, kubernetes-default-proxy, shared-ingress, sharedingress-config-generator, sync-fg-configmap, sync-global-pullsecret, token-minter - HO: karpenter-operator, kubevirtexternalinfra, pkg, manifests - Docs: examples - Excluded: bin, hack, contrib, hypershift-ci-python, self-managed-azure-ci-setup, .claude* Signed-off-by: Bryan Cox <brcox@redhat.com> Commit-Message-Assisted-by: Claude (via Claude Code) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
83029a4 to
e7abb46
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.claude/SKILLS.md (1)
120-141: Consider adding a safety note for this destructive operation.The command involves git history rewriting (
git reset, rebasing), which is potentially destructive. While the "Fix HyperShift Repo Robot PR" command includes a "Safety features" section for similar operations, this entry lacks any mention of prerequisites or safety considerations.Consider adding a brief note such as:
**Prerequisites:** - Clean working tree (no uncommitted changes) - Feature branch that can be force-pushedor
**Note:** This command rewrites git history. Ensure you have a clean working tree and are on a branch that can be force-pushed.The detailed safety procedures are likely in
.claude/commands/restructure-commits.md, but a brief mention here would help users understand the implications before invoking the command.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.claude/SKILLS.md around lines 120 - 141, Add a short safety note to the "Restructure Commits" entry (the "/restructure-commits" command) stating that the command rewrites git history and listing minimal prerequisites—e.g., a clean working tree (no uncommitted changes) and that the feature branch can be force-pushed—and/or a one-line "Note:" warning; also add a pointer that detailed safety procedures live in the full "restructure-commits" command doc so users know where to find the full precautions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.claude/SKILLS.md:
- Around line 120-141: Add a short safety note to the "Restructure Commits"
entry (the "/restructure-commits" command) stating that the command rewrites git
history and listing minimal prerequisites—e.g., a clean working tree (no
uncommitted changes) and that the feature branch can be force-pushed—and/or a
one-line "Note:" warning; also add a pointer that detailed safety procedures
live in the full "restructure-commits" command doc so users know where to find
the full precautions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 47238e13-7f01-430e-a8ed-a07b28d07f99
📒 Files selected for processing (2)
.claude/SKILLS.md.claude/commands/restructure-commits.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .claude/commands/restructure-commits.md
|
/retest |
|
Scheduling required tests: Scheduling tests matching the |
|
/verified bypass |
|
@bryan-cox: The DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
/override "ci/prow/e2e-aws" |
|
@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/e2e-aws DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/override "ci/prow/e2e-aws" |
|
@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/e2e-aws DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/override "ci/prow/e2e-azure-self-managed" |
|
@bryan-cox: Overrode contexts on behalf of bryan-cox: ci/prow/e2e-azure-self-managed DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@bryan-cox: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Summary
.claude-plugin/plugin.jsonto make the hypershift repo a Claude Code plugin/restructure-commitsas a user-invocable command that reorganizes branch commits into logical, component-based commits (API, Vendor, CLI, HO, CPO, E2E, Docs).claude/SKILLS.mdwith documentation for the new commandTest plan
.claude-plugin/plugin.jsonis present with valid metadata.claude/commands/restructure-commits.mdis present and correctly formatted/restructure-commitsin Claude Code on a branch with multiple commits🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation