regrouping-git-history

regrouping-git-history is a skill for Codex from magarcia/skills. It costs 108 tokens per session (2,091 once invoked), scanned A, original, MIT.

A workflow for reorganising a tangled Git branch into a small set of logical commits while keeping the final files exactly unchanged. Git commits are saved versions of a project, and a branch is a line of development.

In plain words
What is it for?
Use it to tidy a substantial feature branch before review or later debugging. It checks the repository and branch base, groups related changes, preserves a recovery reference, and validates the final tree.
Why use it?
Interleaved feature, fix, formatting, and review commits are difficult to review and troubleshoot. The workflow makes the commit history clearer while preserving the branch’s final result.

Skill for Codex

Written for Codex: agents/openai.yaml present.

Good fit Use it to tidy a substantial feature branch before review or later debugging. It checks the repository and branch base, groups related changes, preserves a recovery reference, and validates the final tree.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/magarcia/skills/regrouping-git-history
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add magarcia/skills --skill regrouping-git-history
Clone the repo
git clone --depth 1 https://github.com/magarcia/skills

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for regrouping-git-history

README.md
[![agentmods](https://agentmods.dev/badge/skills/magarcia/skills/regrouping-git-history/github.svg)](https://agentmods.dev/skills/magarcia/skills/regrouping-git-history)
Your own site
<a href="https://agentmods.dev/skills/magarcia/skills/regrouping-git-history"><img src="https://agentmods.dev/badge/skills/magarcia/skills/regrouping-git-history/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for regrouping-git-history

Your own site · 80×15
<a href="https://agentmods.dev/skills/magarcia/skills/regrouping-git-history"><img src="https://agentmods.dev/badge/skills/magarcia/skills/regrouping-git-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.02091
Opus 5 $0.00054 $0.01045
Sonnet 5 $0.00022 $0.00418
Haiku 4.5 $0.00011 $0.00209

Measured 11d ago against content hash 49a191386651, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

regrouping-git-history scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/regrouping-git-history/SKILL.md · 181 lines

How it starts

The opening of the file, as written. The whole thing — 181 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Regroup a branch safely

Announce that this skill is reorganizing history into logical commits. The invariant is strict: the rebuilt branch's final tree must have the same Git tree ID as the original branch. This workflow changes commit grouping only.

History rewriting and force-pushing are destructive operations. Follow every gate below. Never use git reset --hard, never rebuild directly in the user's worktree, and never delete the recovery ref automatically.

Decide whether regrouping is justified

Use a lighter method when appropriate:

  • Use autosquash for clean fixup! or squash! commits.
  • Use a small interactive rebase for a handful of commits with one concern.
  • Let squash-merge flatten history when the team does not need a narrative branch history.
  • Stop if others are actively committing to the branch.

Use this workflow for a substantial branch with multiple tangled concerns where readable commits materially improve review or later bisection.

Verify repository state and resolve the base

Inspect the exact repository, current branch, status, remotes, upstream, and PR before acting. Require a named local branch; stop on detached HEAD.

Do not infer the base from @{upstream}. That normally points to the remote feature branch. Resolve the PR base through the installed github:github skill or a bounded gh pr view --json baseRefName,headRefName,isCrossRepository query. If there is no PR, ask the user to name the intended base.

Fetch only the required remote refs. Set:

  • REGROUP_BRANCH: verified current branch;
  • REGROUP_REMOTE: verified remote that owns the feature branch;
  • REGROUP_BASE_REF: verified remote base ref;
  • REGROUP_MERGE_BASE: git merge-base HEAD "$REGROUP_BASE_REF";
  • REGROUP_ORIGINAL_OID: original HEAD;
  • REGROUP_ORIGINAL_TREE: git rev-parse "$REGROUP_ORIGINAL_OID^{tree}".

List the bounded range REGROUP_MERGE_BASE..REGROUP_ORIGINAL_OID. Confirm that every commit intended for rewriting is in the range.

Do not stash user changes. Require a clean tracked and untracked worktree before later synchronizing the local branch. If the worktree is dirty, stop and ask the user to commit, stash, or remove their own changes.

Read the full file on GitHub · 181 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 181 lines · 108 tokens per session scan A 49a191386651

Subscribe to this mod's changes

regrouping-git-history is a skill published in the GitHub repository magarcia/skills (4 stars, last pushed 17d ago), licensed MIT. It adds 108 tokens to every session and 2,091 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

chinese-commit-conventions

A Chinese-language guide to Conventional Commits, a format for writing consistent Git commit messages, plus related changelog, commit-checking, and commit-helper configuration.

jnMetaCode/superpowers-zh · 65 tokens

azure-repos

Expert knowledge for Azure Repos development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, and integrations & coding patterns. Use when managing Git/TFVC repos, branch/PR policies, CLI/IDE integrations, CodeQL/scanning, or…

MicrosoftDocs/Agent-Skills · 115 tokens

dependabot

Comprehensive guide for configuring and managing GitHub Dependabot. Use this skill when users ask about creating or optimizing dependabot.yml files, managing Dependabot pull requests, configuring dependency update strategies, setting up grouped updates, monorepo patterns, multi-ecosystem groups, security update…

boshi-xixixi/TraeSkill · 136 tokens

commit-message-storyteller

Analyzes git diffs or staged changes and generates narrative commit messages that explain WHY a change was made, not just what changed — following Conventional Commits format. Use when asked to "write a commit message", "generate a commit", "describe my changes", "what should I commit this as", "commit this"…

boshi-xixixi/TraeSkill · 98 tokens

conventional-commit

Prompt and workflow for generating conventional commit messages using a structured XML format. Guides users to create standardized, descriptive commit messages in line with the Conventional Commits specification, including instructions, examples, and validation.

boshi-xixixi/TraeSkill · 45 tokens

chinese-commit

A guide for writing Git commit messages in a shared format: an English change type followed by a short Chinese summary. Git commits are saved descriptions of changes to a codebase.

Wade-DevCode/awesome-coding-skills-cn · 28 tokens