← ClaudeAtlas

fix-pr-commit-titleslisted

Bulk-rewrite commit titles on a PR branch to match [LKPR-N] format using filter-branch — avoids per-commit hook re-runs.
Jessinra/Lorekeeper · ★ 2 · Code & Development · score 72
Install: claude install-skill Jessinra/Lorekeeper
# Fix PR Commit Titles Use when a PR has commits with the wrong title format (e.g. `feat(lkpr-38):` instead of `[LKPR-38] feat:`). --- ## When to use - Commits on a PR branch don't match `[LKPR-N] type: description` - Interactive rebase (`git rebase -i --reword`) is impractical because the pre-commit hook fires on every commit and may abort on pre-existing lint violations --- ## Approach: `filter-branch --msg-filter` Rewrites all commit messages in a range in one pass. Does NOT trigger pre-commit or commit-msg hooks — avoids the hook-per-commit problem that breaks interactive rebase. **Trade-off**: every SHA in the range changes, even commits whose messages weren't touched. Force-push to the PR branch is required. --- ## Steps ### 1. Identify bad commits ```bash cd ~/.hermes/profiles/diana/projects/lorekeeper # Get PR head branch + commits gh pr view <N> --json headRefName,commits \ | python3 -c "import sys,json; d=json.load(sys.stdin); print('Branch:', d['headRefName']); [print(f\"{c['oid'][:8]} {c['messageHeadline']}\") for c in d['commits']]" ``` Or just inspect the local log: ```bash git log --oneline -15 ``` Look for commits with `feat(lkpr-N):`, `fix(lkpr-N):`, etc. instead of `[LKPR-N] feat:`. ### 2. Check out the PR branch ```bash git checkout feat/lkpr-N-branch-name # or, if not yet local: git checkout -b feat/lkpr-N-branch-name origin/feat/lkpr-N-branch-name ``` ### 3. Run filter-branch Replace each wrong pattern with the correct `[LKPR-N] type