pr-restructure

Analyze the final diff to propose atomic commits for a clean PR history.

1|Updated Oct 18, 2025
One-click install
npx skills add https://github.com/furiosa-ai/agent_skills --skill pr-restructure
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pr-restructure
Source: https://github.com/furiosa-ai/agent_skills/tree/main/pr-restructure
Command: npx skills add https://github.com/furiosa-ai/agent_skills --skill pr-restructure

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Clean up messy commit history into atomic commits before merge. Use when user wants to restructure PR commit history based on final diff. Triggers include:

  • Korean: "PR 히스토리 정리해줘", "커밋 히스토리 정리", "커밋 깔끔하게"
  • English: "clean up commit history", "restructure commits", "organize commits"
  • Context: User has messy commits (WIP, typo fixes) and wants atomic commit structure

Core Features & Use Cases

  • Analyze final diff to propose atomic commit groupings for cleaner PR history.
  • Provide safe, backup-first guidance and clear steps for executing rebase.
  • Support step-by-step reconstruction strategy for common branching scenarios

Quick Start

Describe the atomic-commit plan and steps to apply it to the current branch.

Frequently Asked Questions about pr-restructure

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

FAQPage Schema
How do I restructure commits into atomic units before merging a PR?

Restructuring commits into atomic units involves analyzing the final diff between your base branch and HEAD to propose logical commit groupings. This cleans up messy feature branch history containing WIP changes and typo fixes by replacing it with a structured commit sequence.

What is an atomic commit in git history?

An atomic commit in git history is a single, self-contained change that addresses one specific feature or fix. Restructuring your PR into atomic commits ensures each commit is logically grouped, making the diff easier to review and revert if necessary.

How do I clean up a git branch with WIP commits and typo fixes?

You can clean up a git branch with WIP commits by analyzing the final diff against the base branch and proposing a new atomic commit structure. This involves grouping related changes together and executing a safe rebase with backup steps to rewrite the history.

Can I safely rewrite git commit history on a feature branch?

You can safely rewrite git commit history on a feature branch by following backup-first guidance before executing a rebase. The process identifies the base branch, analyzes the diff, and provides safe execution steps to restructure commits without losing data.

When should I reorganize my PR commit history?

You should reorganize your PR commit history when your feature branch contains multiple small commits, WIP changes, or typo fixes. Restructuring these into atomic commits based on the final diff ensures a clean, logical history before merging into the main branch.

What is the best way to group git diffs into logical commits for a PR?

The best way to group git diffs into logical commits is to analyze the complete final diff between base and HEAD, then categorize changes by logical function. This atomic-commit strategy reconstructs the branch history step by step for a cleaner PR.