From pbr
Safely reverts recent PBR-generated git commits by phase/plan/last N/hash range using git revert. Filters git log, groups by scope, prompts selection.
How this skill is triggered — by the user, by Claude, or both
Slash command
/pbr:undoThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Begin executing Step 0 immediately.**
STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Begin executing Step 0 immediately.
Before ANY tool calls, display this banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► UNDO ║
╚══════════════════════════════════════════════════════════════╝
Then proceed to Step 1.
You are running the undo skill. Your job is to help the user safely revert recent PBR-generated commits using git revert (history-preserving), not git reset (destructive).
This skill runs inline (no Task delegation).
Run:
git log --oneline --no-merges -50
Filter lines matching the PBR commit pattern:
^[0-9a-f]+ (feat|fix|refactor|test|docs|chore|wip|revert)(\([a-zA-Z0-9._-]+\))?:
If no PBR commits found, display:
No PBR commits found in the last 50 commits.
Then exit.
Parse $ARGUMENTS for flags:
--last N: limit to N most recent PBR commits (default 20)--phase NN: filter to commits for a specific phase number (e.g. --phase 55)--plan NN-MM: filter to commits for a specific plan (e.g. --plan 55-02)--range HASH..HASH: preselect a hash range for revert — if provided, skip to Step 5 with that range pre-filledApply filters to the collected PBR commits before proceeding.
Parse the scope from each commit message (e.g., 55-02, quick-003, planning). If no scope is present, use (no scope).
Present grouped output:
Recent PBR commits (grouped by scope):
[undo]
abc1234 feat(undo): add undo skill
def5678 chore(undo): register undo command
[quick-003]
ghi9012 fix(quick-003): fix hook path resolution
[planning]
jkl3456 docs(planning): update roadmap phase 55
For descriptive scopes, show just the scope label. For phase-plan scopes (NN-MM pattern, from older commits), add a "Phase NN, Plan MM" annotation.
Use AskUserQuestion with the select-action pattern:
[{scope}] {N} commit(s), plus "Enter custom hash or range" and "Cancel")If user selects a scope label: collect all commits with that scope as the revert set. If user selects "Enter custom hash or range": use AskUserQuestion (freeform) to ask:
Display the commits that will be reverted:
The following commits will be reverted (using git revert, NOT git reset):
abc1234 feat(undo): add undo skill
def5678 chore(undo): register undo command
This creates new revert commits — your history is preserved.
Use AskUserQuestion with the yes-no pattern:
If user selects "Cancel": print "Undo cancelled." and exit.
For each commit hash in reverse chronological order (newest first):
git revert --no-commit {hash}
After all reverts are staged, determine the commit message:
undo, auth, executor)revert({scope}): undo {original description}revert({scope}): undo {N} commits from {scope}Commit with:
git commit -m "revert({scope}): undo {description}"
Conflict handling: If git revert --no-commit exits non-zero or produces conflict markers:
git revert --abort to clean upRevert failed due to merge conflicts. Manual resolution required.
Run: git revert {hashes} and resolve conflicts.
Display completion banner:
╔══════════════════════════════════════════════════════════════╗
║ PLAN-BUILD-RUN ► UNDO COMPLETE ║
╚══════════════════════════════════════════════════════════════╝
Reverted: {N} commit(s) from scope {scope}
New revert commit: {hash} — revert({scope}): undo {description}
/pbr:status — check current state
git reset — always use git revert to preserve historygit revert reports conflicts — abort and report insteadnpx claudepluginhub sienklogic/plan-build-runReverts Git changes by Conductor work units: full tracks, specific phases, or tasks. Uses git log greps for commit discovery, handles uncommitted changes, and offers selection menu.
Safely reverts Git commits at Draft task, phase, or track level with preview, confirmation, and state updates. Use for 'revert this track', 'undo phase/task', or 'roll back work'.
Undoes git-branchless operations like rebases, merges, branch changes, and checkouts. Quick undo last action, interactive history browsing, hide/unhide commits.