restory

Reconstruct a PR's commit history into a coherent narrative with a restory plan.

Updated Feb 20, 2026
One-click install
npx skills add https://github.com/ChrisSteinbach/claude-skills --skill restory
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: restory
Source: https://github.com/ChrisSteinbach/claude-skills/tree/main/restory
Command: npx skills add https://github.com/ChrisSteinbach/claude-skills --skill restory

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Restructure a PR's commit history into a clean narrative — refactors first, then the feature with tests, unrelated changes isolated.

Core Features & Use Cases

  • Phase-driven reconstruction of PR history by reclassifying and sequencing commits to tell a coherent story.
  • Handles interleaved refactors, features, and fixes by grouping hunks into unrelated, refactor, and feature commits.
  • Enforces safety through a temporary safety branch and a target state tag, with explicit user confirmation before risky operations, and preserves the original history in reflog.
  • Outputs a detailed .restory plan for review and reconstruction steps.

Quick Start

Run restory to reconstruct the current branch's history against the base branch (default: main).

Frequently Asked Questions about restory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clean up a messy pull request commit history before merging?

Restructuring a pull request commit history involves reclassifying commits to separate refactors, features, and unrelated changes. This creates a clean narrative sequence while ensuring the final tree exactly matches the original HEAD state.

What is the best way to separate refactoring commits from feature commits in git?

Separating refactoring commits from feature commits is done by grouping hunks into distinct categories. The workflow sequences refactors first, followed by the feature with its tests, and isolates unrelated changes to produce a coherent commit narrative.

How do I restructure a git branch history without losing my original commits?

You can restructure a git branch history safely by using a temporary safety branch and a target state tag. The original history is preserved in the reflog, and explicit confirmation is required before any risky operations are executed.

Can I isolate unrelated code changes when cleaning up a PR for review?

Yes, you can isolate unrelated code changes when cleaning up a PR. The restructuring workflow identifies and groups unrelated hunks into isolated commits, separating them from the primary refactors and feature additions to clarify the review process.

Does restructuring commit history change the final code in my branch?

Restructuring commit history does not change the final code in your branch. The workflow enforces a target state tag to guarantee the final tree exactly matches HEAD, altering only the commit sequence and messages, not the resulting codebase.

How do I generate a plan for reordering commits in a complex git workflow?

You generate a plan for reordering commits by analyzing the branch history and outputting a detailed .restory file. This plan guides users through safety checks and reconstruction steps to produce a coherent sequence of commits.