Repair git history
Personal Codex and agent skills collection
npx -y skills add forchain/skills --skill repair-git-historyAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Repair Git history across repositories. Use for incorrect commit identities, non-English commit messages, evidence-backed tags or Releases, wrong GitHub accounts, and repository professionalism audits.
SKILL.md
2.9 KB, 599 tokens by cl100k_base, as published. Nobody here has run it
Repair Git History
Use one Repair Plan through four gates: Audit, Apply, Verify, and Publish. A gate is complete only when its criterion is met.
Audit
- Run:
python3 <skill-dir>/scripts/git_history_repair.py audit --repo . > /tmp/git-history-audit.json - Read references/repair-policy.md, then create a Repair Plan outside the target repository. Each identity mapping is an exact
(name, email)pair; each message mapping is a complete replacement keyed by old SHA. Preserve identifiers, trailers, and issue references. - When versions, tags, Releases, or public presentation matter, read references/professional-audit.md and collect evidence before proposing action.
Completion criterion: the user has reviewed the Repair Plan, including its ref boundary and every proposed public mutation.
Apply
- Compute the reviewed plan's digest:
python3 -c 'from pathlib import Path; import hashlib; print(hashlib.sha256(Path("/tmp/repair-plan.json").read_bytes()).hexdigest())' - Run Apply into a new mirror:
python3 <skill-dir>/scripts/git_history_repair.py apply \ --repo . --plan /tmp/repair-plan.json --approval <digest> \ --output /tmp/rewritten-repository.git
Completion criterion: the mirror and its before-rewrite.bundle exist; the source repository is unchanged.
Verify
Run:
python3 <skill-dir>/scripts/git_history_repair.py verify \
--source . --mirror /tmp/rewritten-repository.git --plan /tmp/repair-plan.json
Run the target repository's documented tests from a temporary worktree when available.
Completion criterion: verify accepts the complete commit map, unchanged trees, parent topology, dates, approved identities, and approved messages.
Publish
- Obtain a second explicit approval after Verify.
- Derive a login hint only from an explicit
remote.origin.urlusername. Before every GitHub mutation, verify it withgh auth status, switch withgh auth switch -h github.com -u <login>, and restore the prior account afterwards. Treat GitHub login and commit identity as separate values. - Snapshot Releases. Push each approved ref using the exact old OID in
repair-result.jsonwith--force-with-lease; create a missing Release only after its annotated tag exists, usinggh release create --verify-tag. - Recheck remote refs, tags, Releases, and the active GitHub account. Set local
user.name,user.email, anduser.useConfigOnly=trueto the canonical identity.
Completion criterion: every approved remote mutation is visible, and collaborators have the old-to-new SHA map.
What ships with it: 5 files
29.4 KB alongside SKILL.md, 2 of them executable
agents/
- openai.yaml216 B
references/
- professional-audit.md882 B
- repair-policy.md1.7 KB
scripts/
- git_history_repair.pyruns13.7 KB
tests/
- test_git_history_repair.pyruns13.0 KB