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.
npx skills add magarcia/skills --skill regrouping-git-historygit clone --depth 1 https://github.com/magarcia/skillsWrote 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.
[](https://agentmods.dev/skills/magarcia/skills/regrouping-git-history)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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!orsquash!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: originalHEAD;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.
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.
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.
- 11d ago First seen · 181 lines · 108 tokens per session scan A 49a191386651
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.
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.
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…
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…
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"…
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.
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.