Git-aware undo by logical work unit (track, phase, or task)
Add this skill
npx mdskills install sickn33/conductor-revertComprehensive git revert workflow with strong safety checks, explicit confirmations, and excellent edge case handling
1---2name: conductor-revert3description: Git-aware undo by logical work unit (track, phase, or task)4metadata:5 argument-hint: "[track-id | track-id:phase | track-id:task]"6---78# Revert Track910Revert changes by logical work unit with full git awareness. Supports reverting entire tracks, specific phases, or individual tasks.1112## Use this skill when1314- Working on revert track tasks or workflows15- Needing guidance, best practices, or checklists for revert track1617## Do not use this skill when1819- The task is unrelated to revert track20- You need a different domain or tool outside this scope2122## Instructions2324- Clarify goals, constraints, and required inputs.25- Apply relevant best practices and validate outcomes.26- Provide actionable steps and verification.27- If detailed examples are required, open `resources/implementation-playbook.md`.2829## Pre-flight Checks30311. Verify Conductor is initialized:32 - Check `conductor/tracks.md` exists33 - If missing: Display error and suggest running `/conductor:setup` first34352. Verify git repository:36 - Run `git status` to confirm git repo37 - Check for uncommitted changes38 - If uncommitted changes exist:3940 ```41 WARNING: Uncommitted changes detected4243 Files with changes:44 {list of files}4546 Options:47 1. Stash changes and continue48 2. Commit changes first49 3. Cancel revert50 ```51523. Verify git is clean enough to revert:53 - No merge in progress54 - No rebase in progress55 - If issues found: Halt and explain resolution steps5657## Target Selection5859### If argument provided:6061Parse the argument format:6263**Full track:** `{trackId}`6465- Example: `auth_20250115`66- Reverts all commits for the entire track6768**Specific phase:** `{trackId}:phase{N}`6970- Example: `auth_20250115:phase2`71- Reverts commits for phase N and all subsequent phases7273**Specific task:** `{trackId}:task{X.Y}`7475- Example: `auth_20250115:task2.3`76- Reverts commits for task X.Y only7778### If no argument:7980Display guided selection menu:8182```83What would you like to revert?8485Currently In Progress:861. [~] Task 2.3 in dashboard_20250112 (most recent)8788Recently Completed:892. [x] Task 2.2 in dashboard_20250112 (1 hour ago)903. [x] Phase 1 in dashboard_20250112 (3 hours ago)914. [x] Full track: auth_20250115 (yesterday)9293Options:945. Enter specific reference (track:phase or track:task)956. Cancel9697Select option:98```99100## Commit Discovery101102### For Task Revert1031041. Search git log for task-specific commits:105106 ```bash107 git log --oneline --grep="{trackId}" --grep="Task {X.Y}" --all-match108 ```1091102. Also find the plan.md update commit:111112 ```bash113 git log --oneline --grep="mark task {X.Y} complete" --grep="{trackId}" --all-match114 ```1151163. Collect all matching commit SHAs117118### For Phase Revert1191201. Determine task range for the phase by reading plan.md1212. Search for all task commits in that phase:122123 ```bash124 git log --oneline --grep="{trackId}" | grep -E "Task {N}\.[0-9]"125 ```1261273. Find phase verification commit if exists1284. Find all plan.md update commits for phase tasks1295. Collect all matching commit SHAs in chronological order130131### For Full Track Revert1321331. Find ALL commits mentioning the track:134135 ```bash136 git log --oneline --grep="{trackId}"137 ```1381392. Find track creation commits:140141 ```bash142 git log --oneline -- "conductor/tracks/{trackId}/"143 ```1441453. Collect all matching commit SHAs in chronological order146147## Execution Plan Display148149Before any revert operations, display full plan:150151```152================================================================================153 REVERT EXECUTION PLAN154================================================================================155156Target: {description of what's being reverted}157158Commits to revert (in reverse chronological order):159 1. abc1234 - feat: add chart rendering (dashboard_20250112)160 2. def5678 - chore: mark task 2.3 complete (dashboard_20250112)161 3. ghi9012 - feat: add data hooks (dashboard_20250112)162 4. jkl3456 - chore: mark task 2.2 complete (dashboard_20250112)163164Files that will be affected:165 - src/components/Dashboard.tsx (modified)166 - src/hooks/useData.ts (will be deleted - was created in these commits)167 - conductor/tracks/dashboard_20250112/plan.md (modified)168169Plan updates:170 - Task 2.2: [x] -> [ ]171 - Task 2.3: [~] -> [ ]172173================================================================================174 !! WARNING !!175================================================================================176177This operation will:178- Create {N} revert commits179- Modify {M} files180- Reset {P} tasks to pending status181182This CANNOT be easily undone without manual intervention.183184================================================================================185186Type 'YES' to proceed, or anything else to cancel:187```188189**CRITICAL: Require explicit 'YES' confirmation. Do not proceed on 'y', 'yes', or enter.**190191## Revert Execution192193Execute reverts in reverse chronological order (newest first):194195```196Executing revert plan...197198[1/4] Reverting abc1234...199 git revert --no-edit abc1234200 ✓ Success201202[2/4] Reverting def5678...203 git revert --no-edit def5678204 ✓ Success205206[3/4] Reverting ghi9012...207 git revert --no-edit ghi9012208 ✓ Success209210[4/4] Reverting jkl3456...211 git revert --no-edit jkl3456212 ✓ Success213```214215### On Merge Conflict216217If any revert produces a merge conflict:218219```220================================================================================221 MERGE CONFLICT DETECTED222================================================================================223224Conflict occurred while reverting: {sha} - {message}225226Conflicted files:227 - src/components/Dashboard.tsx228229Options:2301. Show conflict details2312. Abort revert sequence (keeps completed reverts)2323. Open manual resolution guide233234IMPORTANT: Reverts 1-{N} have been completed. You may need to manually235resolve this conflict before continuing or fully undo the revert sequence.236237Select option:238```239240**HALT immediately on any conflict. Do not attempt automatic resolution.**241242## Plan.md Updates243244After successful git reverts, update plan.md:2452461. Read current plan.md2472. For each reverted task, change marker:248 - `[x]` -> `[ ]`249 - `[~]` -> `[ ]`2503. Write updated plan.md2514. Update metadata.json:252 - Decrement `tasks.completed`253 - Update `status` if needed254 - Update `updated` timestamp255256**Do NOT commit plan.md changes** - they are part of the revert operation257258## Track Status Updates259260### If reverting entire track:261262- In tracks.md: Change `[x]` or `[~]` to `[ ]`263- Consider offering to delete the track directory entirely264265### If reverting to incomplete state:266267- In tracks.md: Ensure marked as `[~]` if partially complete, `[ ]` if fully reverted268269## Verification270271After revert completion:272273```274================================================================================275 REVERT COMPLETE276================================================================================277278Summary:279 - Reverted {N} commits280 - Reset {P} tasks to pending281 - {M} files affected282283Git log now shows:284 {recent commit history}285286Plan.md status:287 - Task 2.2: [ ] Pending288 - Task 2.3: [ ] Pending289290================================================================================291292Verify the revert was successful:293 1. Run tests: {test command}294 2. Check application: {relevant check}295296If issues are found, you may need to:297 - Fix conflicts manually298 - Re-implement the reverted tasks299 - Use 'git revert HEAD~{N}..HEAD' to undo the reverts300301================================================================================302```303304## Safety Rules3053061. **NEVER use `git reset --hard`** - Only use `git revert`3072. **NEVER use `git push --force`** - Only safe push operations3083. **NEVER auto-resolve conflicts** - Always halt for human intervention3094. **ALWAYS show full plan** - User must see exactly what will happen3105. **REQUIRE explicit 'YES'** - Not 'y', not enter, only 'YES'3116. **HALT on ANY error** - Do not attempt to continue past failures3127. **PRESERVE history** - Revert commits are preferred over history rewriting313314## Edge Cases315316### Track Never Committed317318```319No commits found for track: {trackId}320321The track exists but has no associated commits. This may mean:322- Implementation never started323- Commits used different format324325Options:3261. Delete track directory only3272. Cancel328```329330### Commits Already Reverted331332```333Some commits appear to already be reverted:334 - abc1234 was reverted by xyz9876335336Options:3371. Skip already-reverted commits3382. Cancel and investigate339```340341### Remote Already Pushed342343```344WARNING: Some commits have been pushed to remote345346Commits on remote:347 - abc1234 (origin/main)348 - def5678 (origin/main)349350Reverting will create new revert commits that you'll need to push.351This is the safe approach (no force push required).352353Continue with revert? (YES/no):354```355356## Undo the Revert357358If user needs to undo the revert itself:359360```361To undo this revert operation:362363 git revert HEAD~{N}..HEAD364365This will create new commits that restore the reverted changes.366367Alternatively, if not yet pushed:368 git reset --soft HEAD~{N}369 git checkout -- .370371(Use with caution - this discards the revert commits)372```373
Full transparency — inspect the skill content before installing.