smart-revert
БесплатноЗапускает вложенные скриптыНе проверенGit-aware smart revert for tracks, phases, and tasks. Handles rewritten history, finds related commits, and provides safe rollback with multiple confirmation…
от oimiragieo★ 48 звёзд на GitHubОб этом скилле
Smart Revert
Git-aware intelligent revert system for reverting logical work units (tracks, phases, tasks) while handling complex Git histories.
When to Use
- Reverting completed tasks that need to be redone
- Rolling back entire phases that didn't meet requirements
- Undoing track changes after failed review
- Recovering from implementation mistakes
- Cleaning up after interrupted work
Core Concepts
Logical vs Physical Revert
| Type | Description | Example |
|---|---|---|
| Logical | Revert a track/phase/task as defined in plan.md | "Revert Task 2.1" |
| Physical | Revert specific Git commits | "Revert commit abc1234" |
This skill bridges the gap: given a logical target, it finds all physical commits.
4-Phase Protocol
Phase 1: Interactive Target Selection
- Check for explicit target: Did user specify what to revert?
- If no target: Present guided menu of candidates:
- First: In-progress items (
[~]) - Fallback: Recently completed items (
[x])
- First: In-progress items (
- Confirm intent: Verify understanding before proceeding
Menu Format:
I found the following items to potentially revert:
Track: user-auth_20250115
1) [Phase] Phase 2: Core Logic
2) [Task] Task 2.1: Implement validation
3) A different Track, Task, or Phase
Which would you like to revert?
Phase 2: Git Reconciliation
Goal: Find ALL commits related to the logical unit.
Find implementation commits:
- Extract SHAs from plan.md (
[x] Task: Description \abc1234``) - Handle "ghost commits" (rebased/squashed)
- Extract SHAs from plan.md (
Find plan-update commits:
- For each implementation SHA, find the following plan.md update
Find track creation commit (if reverting entire track):
- Search git log for when track entry was added to tracks.md
Handling Ghost Commits:
SHA abc1234 from plan.md not found in git history.
This may have been rewritten by rebase/squash.
Searching for similar commits...
Found: def5678 "feat(user): implement validation"
Is this the correct commit? (yes/no)
Phase 3: Execution Plan Confirmation
Present clear summary before any action:
## Revert Execution Plan
**Target**: Task 2.1 "Implement user validation"
**Commits to Revert**: 2
1. `abc1234` - "feat(user): implement validation"
2. `def5678` - "conductor(plan): mark task 2.1 complete"
**Action**: Run `git revert --no-edit` on each commit (newest first)
Do you want to proceed?
A) Yes - execute the revert
B) No - cancel and review
Phase 4: Execution & Verification
Execute reverts (newest to oldest):
git revert --no-edit <sha>Handle conflicts: If conflict occurs, provide guidance:
Merge conflict detected. Please resolve manually: 1. Edit conflicted files 2. Run: git add . 3. Run: git revert --continueVerify plan state: Re-read plan.md to confirm status reset
Announce completion: Confirm revert succeeded
Commit Identification Strategies
Finding Implementation Commits
# Extract SHA from plan.md
grep -oP '\[x\].*`\K[a-f0-9]{7}' plan.md
# Verify SHA exists
git cat-file -t <sha>
Finding Plan Update Commits
# Find commits that modified plan.md after implementation
git log --oneline -- path/to/plan.md | head -5
Handling Rebased History
# Search by commit message similarity
git log --oneline --all | grep -i "implement validation"
# Search by file changes
git log --oneline --all -- src/models/user.py
Finding Track Creation
# Find when track was added to registry
git log -p -- conductor/tracks.md | grep -B5 "Track: user-auth"
Safety Features
Multiple Confirmation Gates
| Gate | Purpose | When |
|---|---|---|
| Target confirmation | Verify correct item selected | After selection |
| Execution plan review | Show exactly what will happen | Before any git operation |
| Final go/no-go | Last chance to cancel | Immediately before revert |
Conflict Handling
If git revert fails:
- Do NOT force or continue automatically
- Explain what happened
- Provide manual resolution steps
- Offer to help after user resolves
Post-Revert Verification
Always verify the plan file reflects the revert:
Before: [x] Task 2.1: Implement validation `abc1234`
After: [ ] Task 2.1: Implement validation
If plan state is inconsistent, offer to fix it.
Example Scenarios
Scenario 1: Revert Single Task
User: "Revert the last task I completed"
Agent:
1. Read plan.md, find most recent [x] task
2. Extract SHA: abc1234
3. Find plan-update commit: def5678
4. Present: "R
Установить smart-revert в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadBashGlobGrepWriteEditВложенные файлы
FAQ
Что делает скилл smart-revert?
Git-aware smart revert for tracks, phases, and tasks. Handles rewritten history, finds related commits, and provides safe rollback with multiple confirmation gates.
Как установить скилл smart-revert?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл smart-revert запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic