rebase-flow

Enforces a gated approval, backup, and verification workflow for safe git rebase operations.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/Hakkadaikon/hymme --skill rebase-flow-hakkadaikon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rebase-flow
Source: https://github.com/Hakkadaikon/hymme/tree/main/skills/rebase-flow
Command: npx skills add https://github.com/Hakkadaikon/hymme --skill rebase-flow-hakkadaikon

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Git rebase rewrites committed history and can cause unrecoverable accidents when run without state checks or recovery options. This Skill turns rebase into a fixed five-stage gate (context collection, plan presentation, user approval, backup plus execution, machine verification) so history rewriting never happens blindly. ## Core Features & Use Cases - Guardrail detection: A context script reports BLOCKER/WARNING conditions such as protected branches, dirty trees, in-progress operations, pushed commits, child branches, and conflict predictions before any rebase starts. - Backup-gated execution: A backup branch script creates a recovery point and unlocks a git-guard hook for 30 minutes, so rebase without a backup is mechanically blocked. - Machine verification: A verify script checks tree identity and range-diff after the rebase, and force-push is restricted to explicit --force-with-lease=<branch>:<sha> with separate approval. - Use Case: When asked to squash the last four commits and follow up with origin/main, the Skill splits this into two approved rebases, verifies tree identity after the squash, then rebases onto origin/main with conflict prediction. ## Quick Start Ask the assistant to rebase the current branch onto origin/main or squash recent commits, and it will run the context check, present a plan for approval, create a backup, execute, and verify the result.

Frequently Asked Questions about rebase-flow

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

FAQPage Schema
How do I safely rebase a branch onto main in git?

Run the context script with the base ref to detect blockers, present a plan for explicit user approval, create a backup branch, then execute the approved command verbatim. Afterward, verify with tree identity and range-diff checks before any push.

How to squash commits with interactive rebase without opening an editor?

Write the todo list to a file using pick and fixup lines, then run git rebase -i with GIT_SEQUENCE_EDITOR set to copy that file. Change messages with exec git commit --amend -m so no editor ever opens.

Can I force-push after rebasing a branch with an open PR?

Yes, but only with an explicit --force-with-lease=<branch>:<sha> using a verified remote tip, after separate user approval. Raw git push --force is blocked by the git-guard hook, and protected branches can never be force-pushed.

What happens if a rebase hits an unexpected conflict?

The workflow requires an immediate git rebase --abort for any conflict not predicted in the approved plan, followed by a status report. Predicted conflicts are resolved with an approved fix, git add, and GIT_EDITOR=true git rebase --continue.

How do I undo a rebase after it completed?

Use the backup branch created before execution by running git reset --hard through the reset-flow skill workflow. If no backup exists, locate the pre-rebase HEAD in the reflog and reset to that SHA.

Why is git rebase blocked even though I want to run it directly?

The bundled git-guard PreToolUse hook denies any git rebase unless the backup script has placed a valid unlock marker within the last 30 minutes. Only git rebase --abort is always permitted as an escape path.