restructure-commits

A procedure for reorganizing a HyperShift feature branch into logical commits grouped by parts of the system.

In plain words
What is it for?
Use it when redoing, squashing, or organizing commits by areas such as the API, vendor files, command-line tools, operators, and control-plane components.
Why use it?
It turns scattered work-in-progress commits into a clearer history that is easier to review in a pull request.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/openshift/hypershift/restructure-commits
Any agent
npx skills add openshift/hypershift --skill restructure-commits
Clone the repo
git clone --depth 1 https://github.com/openshift/hypershift

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,919 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.01919
Opus 5 $0.00010 $0.00959
Sonnet 5 $0.00004 $0.00384
Haiku 4.5 $0.00002 $0.00192

Measured 2d ago against content hash 7f63668bc12a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

restructure-commits scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/restructure-commits/SKILL.md · 128 lines

How it starts

The opening of the file, as written. The whole thing — 128 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Restructure Commits by Component

Reorganize all commits on a feature branch into logical, component-based commits that match HyperShift's architecture.

When to Use

  • User asks to "redo commits", "restructure commits", "squash by component", or "organize commits"
  • Preparing a branch for PR review with clean commit history
  • Branch has many small/WIP commits that should be consolidated

Component Categories and File Mapping

Commits are created in this order. Each commit groups files by architectural boundary.

Order Component Scope File Patterns
1 API api api/ (types, deepcopy, CRD manifests, go.mod) — excluding *_test.go
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/, shared-ingress/, sharedingress-config-generator/
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/, sync-fg-configmap/, sync-global-pullsecret/, token-minter/
6 E2E e2e test/, api/**/*_test.go
7 Docs docs docs/, examples/

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.

Procedure

1. Identify merge base and changed files

BASE_BRANCH=$(gh pr view --json baseRefName -q .baseRefName 2>/dev/null || echo "main")
MERGE_BASE=$(git merge-base ${BASE_BRANCH} HEAD)
git log --oneline ${MERGE_BASE}..HEAD          # review existing commits
git diff ${MERGE_BASE}..HEAD --name-only | sort # all changed files

Read the full file on GitHub · 128 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 128 lines · 20 tokens per session scan A 7f63668bc12a

Subscribe to this mod's changes

restructure-commits is a skill published in the GitHub repository openshift/hypershift (538 stars, last pushed 2d ago), licensed Apache-2.0. It adds 20 tokens to every session and 1,919 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.