Skip to content

Add project-scoped skill for restructuring PR commit history - #416

Merged
dennisdoomen merged 1 commit into
Fallout-build:mainfrom
dennisdoomen:claude/inspiring-heisenberg-1775d4
Jun 22, 2026
Merged

Add project-scoped skill for restructuring PR commit history#416
dennisdoomen merged 1 commit into
Fallout-build:mainfrom
dennisdoomen:claude/inspiring-heisenberg-1775d4

Conversation

@dennisdoomen

Copy link
Copy Markdown
Collaborator

Summary

Adds a Claude Code project skill that safely restructures an existing PR's commit history into focused, reviewable commits. The skill is invokable as /restructure-pr-commits in any session rooted in this repo.

Changes

Add restructure-pr-commits skill

There was no consistent, discoverable workflow for reshaping a PR's history after it had been published. Developers had to recall the steps from memory or quote them manually in a prompt, leading to mistakes — particularly around using git log to identify changed files (unreliable on branches that have been merge-updated from upstream) and around force-pushing without user confirmation.

The new skill codifies the correct 8-step procedure: determining the true file list via git diff, isolating branch-own commits with --first-parent --no-merges, backing up the branch before any rewrite, building a fresh history on a clean branch, verifying the result is identical to the backup, waiting for explicit confirmation, then pushing with --force-with-lease and updating the PR title/description to match.

Cross-reference in AGENTS.md

Added a single line after the GenerateTools note in the Common commands section so the skill is discoverable without browsing the .claude/skills/ directory directly.

Introduces a Claude Code skill that walks through the safe, step-by-step
process for reshaping an existing PR's commits into focused, reviewable
units. The workflow covers the subtleties that trip up naive rebases: using
git diff (not git log) as the authoritative file list, isolating branch-own
commits with --first-parent --no-merges, creating a backup branch before
touching history, verifying the result is bit-for-bit identical, and gating
the force-push behind explicit user confirmation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dennisdoomen
dennisdoomen force-pushed the claude/inspiring-heisenberg-1775d4 branch from 113f9df to 2b704e4 Compare June 22, 2026 04:44
@dennisdoomen
dennisdoomen merged commit 18baf89 into Fallout-build:main Jun 22, 2026
1 check passed
@dennisdoomen
dennisdoomen deleted the claude/inspiring-heisenberg-1775d4 branch June 22, 2026 04:45
@ChrisonSimtian ChrisonSimtian added the enhancement New feature or request label Jul 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants