retcon

Reset a pull request branch and regroup commits by package with byte-identical net diff.

3|2|Updated May 12, 2026
One-click install
npx skills add https://github.com/kriscendobot/garden --skill retcon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: retcon
Source: https://github.com/kriscendobot/garden/tree/main/skills/retcon
Command: npx skills add https://github.com/kriscendobot/garden --skill retcon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill resolves the issue of sprawling, messy commit histories in pull requests that occur during iterative development, ensuring the final history is clean and reviewable without altering the proposed changes.

Core Features & Use Cases

  • Commit Regrouping: Automatically reorganizes commits by package and separates lockfile updates to maintain a logical, readable history.
  • Invariant Verification: Ensures the PR's net diff remains byte-identical before and after the operation, guaranteeing no functional changes are introduced.
  • Use Case: When a PR has accumulated numerous work-in-progress commits, fixups, and interleaved lockfile changes, use this skill to consolidate the history into a professional, package-scoped sequence before merging.

Quick Start

Ask the gardener to retcon the current pull request to clean up the commit history while preserving the net diff.

Frequently Asked Questions about retcon

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?

To clean up a messy pull request commit history, you can reset the branch to its base and restage the existing net diff into a linear, logically grouped sequence. This regroups commits by package and separates lockfile updates for better readability.

Does restructuring commit history alter the final code changes in a pull request?

Restructuring commit history does not alter the final code changes when invariant verification is enforced. The process verifies that the final tree state remains byte-identical to the pre-retcon state, guaranteeing no functional changes are introduced.

What is the best way to separate lockfile updates from source code commits in git?

The best way to separate lockfile updates from source code commits is to use an automated refactoring script that restages the net diff. This enforces per-package commit structures and isolates lockfile changes into their own dedicated commits.

Can I reorganize git commits by package without losing any work-in-progress changes?

You can reorganize git commits by package without losing work-in-progress changes by resetting the pull request branch to its base and restaging the existing net diff. The operation preserves all accumulated fixups and interleaved changes.

Do I need active project worktrees to reorganize commits by package?

Yes, you need active project worktrees to reorganize commits by package. The restaging process operates on these worktrees to enforce per-package commit structures and verify that the final tree state remains byte-identical to the original state.