conductor-revert
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRevert Track
Revert Track
Revert changes by logical work unit with full git awareness. Supports reverting entire tracks, specific phases, or individual tasks.
通过具备完整Git感知能力的逻辑工作单元撤销更改。支持撤销整个跟踪项、特定阶段或单个任务。
Use this skill when
适用场景
- Working on revert track tasks or workflows
- Needing guidance, best practices, or checklists for revert track
- 处理撤销跟踪项的任务或工作流时
- 需要撤销跟踪项的指导、最佳实践或检查清单时
Do not use this skill when
不适用场景
- The task is unrelated to revert track
- You need a different domain or tool outside this scope
- 任务与撤销跟踪项无关时
- 需要使用此范围外的其他领域或工具时
Instructions
操作说明
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open .
resources/implementation-playbook.md
- 明确目标、约束条件和所需输入。
- 应用相关最佳实践并验证结果。
- 提供可执行步骤和验证方式。
- 如果需要详细示例,请打开。
resources/implementation-playbook.md
Pre-flight Checks
前置检查
-
Verify Conductor is initialized:
- Check exists
conductor/tracks.md - If missing: Display error and suggest running first
/conductor:setup
- Check
-
Verify git repository:
-
Runto confirm git repo
git status -
Check for uncommitted changes
-
If uncommitted changes exist:
WARNING: Uncommitted changes detected Files with changes: {list of files} Options: 1. Stash changes and continue 2. Commit changes first 3. Cancel revert
-
-
Verify git is clean enough to revert:
- No merge in progress
- No rebase in progress
- If issues found: Halt and explain resolution steps
-
验证Conductor已初始化:
- 检查是否存在
conductor/tracks.md - 如果缺失:显示错误并建议先运行
/conductor:setup
- 检查
-
验证Git仓库:
-
运行确认Git仓库状态
git status -
检查是否存在未提交的更改
-
如果存在未提交更改:
WARNING: Uncommitted changes detected Files with changes: {list of files} Options: 1. Stash changes and continue 2. Commit changes first 3. Cancel revert
-
-
验证Git状态是否适合执行撤销:
- 无合并操作正在进行
- 无变基操作正在进行
- 如果发现问题:终止操作并说明解决步骤
Target Selection
目标选择
If argument provided:
若提供参数:
Parse the argument format:
Full track:
{trackId}- Example:
auth_20250115 - Reverts all commits for the entire track
Specific phase:
{trackId}:phase{N}- Example:
auth_20250115:phase2 - Reverts commits for phase N and all subsequent phases
Specific task:
{trackId}:task{X.Y}- Example:
auth_20250115:task2.3 - Reverts commits for task X.Y only
解析参数格式:
完整跟踪项:
{trackId}- 示例:
auth_20250115 - 撤销该跟踪项的所有提交
特定阶段:
{trackId}:phase{N}- 示例:
auth_20250115:phase2 - 撤销第N阶段及所有后续阶段的提交
特定任务:
{trackId}:task{X.Y}- 示例:
auth_20250115:task2.3 - 仅撤销任务X.Y的提交
If no argument:
若未提供参数:
Display guided selection menu:
What would you like to revert?
Currently In Progress:
1. [~] Task 2.3 in dashboard_20250112 (most recent)
Recently Completed:
2. [x] Task 2.2 in dashboard_20250112 (1 hour ago)
3. [x] Phase 1 in dashboard_20250112 (3 hours ago)
4. [x] Full track: auth_20250115 (yesterday)
Options:
5. Enter specific reference (track:phase or track:task)
6. Cancel
Select option:显示引导式选择菜单:
What would you like to revert?
Currently In Progress:
1. [~] Task 2.3 in dashboard_20250112 (most recent)
Recently Completed:
2. [x] Task 2.2 in dashboard_20250112 (1 hour ago)
3. [x] Phase 1 in dashboard_20250112 (3 hours ago)
4. [x] Full track: auth_20250115 (yesterday)
Options:
5. Enter specific reference (track:phase or track:task)
6. Cancel
Select option:Commit Discovery
提交记录查找
For Task Revert
任务撤销
-
Search git log for task-specific commits:bash
git log --oneline --grep="{trackId}" --grep="Task {X.Y}" --all-match -
Also find the plan.md update commit:bash
git log --oneline --grep="mark task {X.Y} complete" --grep="{trackId}" --all-match -
Collect all matching commit SHAs
-
在Git日志中搜索任务特定的提交:bash
git log --oneline --grep="{trackId}" --grep="Task {X.Y}" --all-match -
同时查找更新plan.md的提交:bash
git log --oneline --grep="mark task {X.Y} complete" --grep="{trackId}" --all-match -
收集所有匹配的提交SHA值
For Phase Revert
阶段撤销
-
Determine task range for the phase by reading plan.md
-
Search for all task commits in that phase:bash
git log --oneline --grep="{trackId}" | grep -E "Task {N}\.[0-9]" -
Find phase verification commit if exists
-
Find all plan.md update commits for phase tasks
-
Collect all matching commit SHAs in chronological order
-
通过读取plan.md确定该阶段的任务范围
-
搜索该阶段内的所有任务提交:bash
git log --oneline --grep="{trackId}" | grep -E "Task {N}\.[0-9]" -
查找阶段验证提交(如果存在)
-
查找该阶段所有任务对应的plan.md更新提交
-
按时间顺序收集所有匹配的提交SHA值
For Full Track Revert
完整跟踪项撤销
-
Find ALL commits mentioning the track:bash
git log --oneline --grep="{trackId}" -
Find track creation commits:bash
git log --oneline -- "conductor/tracks/{trackId}/" -
Collect all matching commit SHAs in chronological order
-
查找所有提及该跟踪项的提交:bash
git log --oneline --grep="{trackId}" -
查找跟踪项创建的提交:bash
git log --oneline -- "conductor/tracks/{trackId}/" -
按时间顺序收集所有匹配的提交SHA值
Execution Plan Display
执行计划展示
Before any revert operations, display full plan:
================================================================================
REVERT EXECUTION PLAN
================================================================================
Target: {description of what's being reverted}
Commits to revert (in reverse chronological order):
1. abc1234 - feat: add chart rendering (dashboard_20250112)
2. def5678 - chore: mark task 2.3 complete (dashboard_20250112)
3. ghi9012 - feat: add data hooks (dashboard_20250112)
4. jkl3456 - chore: mark task 2.2 complete (dashboard_20250112)
Files that will be affected:
- src/components/Dashboard.tsx (modified)
- src/hooks/useData.ts (will be deleted - was created in these commits)
- conductor/tracks/dashboard_20250112/plan.md (modified)
Plan updates:
- Task 2.2: [x] -> [ ]
- Task 2.3: [~] -> [ ]
================================================================================
!! WARNING !!
================================================================================
This operation will:
- Create {N} revert commits
- Modify {M} files
- Reset {P} tasks to pending status
This CANNOT be easily undone without manual intervention.
================================================================================
Type 'YES' to proceed, or anything else to cancel:CRITICAL: Require explicit 'YES' confirmation. Do not proceed on 'y', 'yes', or enter.
在执行任何撤销操作前,显示完整计划:
================================================================================
REVERT EXECUTION PLAN
================================================================================
Target: {description of what's being reverted}
Commits to revert (in reverse chronological order):
1. abc1234 - feat: add chart rendering (dashboard_20250112)
2. def5678 - chore: mark task 2.3 complete (dashboard_20250112)
3. ghi9012 - feat: add data hooks (dashboard_20250112)
4. jkl3456 - chore: mark task 2.2 complete (dashboard_20250112)
Files that will be affected:
- src/components/Dashboard.tsx (modified)
- src/hooks/useData.ts (will be deleted - was created in these commits)
- conductor/tracks/dashboard_20250112/plan.md (modified)
Plan updates:
- Task 2.2: [x] -> [ ]
- Task 2.3: [~] -> [ ]
================================================================================
!! WARNING !!
================================================================================
This operation will:
- Create {N} revert commits
- Modify {M} files
- Reset {P} tasks to pending status
This CANNOT be easily undone without manual intervention.
================================================================================
Type 'YES' to proceed, or anything else to cancel:重要:必须要求用户输入明确的'YES'才能继续。不接受'y'、'yes'或直接回车。
Revert Execution
撤销执行
Execute reverts in reverse chronological order (newest first):
Executing revert plan...
[1/4] Reverting abc1234...
git revert --no-edit abc1234
✓ Success
[2/4] Reverting def5678...
git revert --no-edit def5678
✓ Success
[3/4] Reverting ghi9012...
git revert --no-edit ghi9012
✓ Success
[4/4] Reverting jkl3456...
git revert --no-edit jkl3456
✓ Success按逆时间顺序执行撤销操作(从最新提交开始):
Executing revert plan...
[1/4] Reverting abc1234...
git revert --no-edit abc1234
✓ Success
[2/4] Reverting def5678...
git revert --no-edit def5678
✓ Success
[3/4] Reverting ghi9012...
git revert --no-edit ghi9012
✓ Success
[4/4] Reverting jkl3456...
git revert --no-edit jkl3456
✓ SuccessOn Merge Conflict
合并冲突处理
If any revert produces a merge conflict:
================================================================================
MERGE CONFLICT DETECTED
================================================================================
Conflict occurred while reverting: {sha} - {message}
Conflicted files:
- src/components/Dashboard.tsx
Options:
1. Show conflict details
2. Abort revert sequence (keeps completed reverts)
3. Open manual resolution guide
IMPORTANT: Reverts 1-{N} have been completed. You may need to manually
resolve this conflict before continuing or fully undo the revert sequence.
Select option:HALT immediately on any conflict. Do not attempt automatic resolution.
如果任何撤销操作产生合并冲突:
================================================================================
MERGE CONFLICT DETECTED
================================================================================
Conflict occurred while reverting: {sha} - {message}
Conflicted files:
- src/components/Dashboard.tsx
Options:
1. Show conflict details
2. Abort revert sequence (keeps completed reverts)
3. Open manual resolution guide
IMPORTANT: Reverts 1-{N} have been completed. You may need to manually
resolve this conflict before continuing or fully undo the revert sequence.
Select option:一旦发现冲突立即终止操作。不要尝试自动解决冲突。
Plan.md Updates
Plan.md 更新
After successful git reverts, update plan.md:
- Read current plan.md
- For each reverted task, change marker:
- ->
[x][ ] - ->
[~][ ]
- Write updated plan.md
- Update metadata.json:
- Decrement
tasks.completed - Update if needed
status - Update timestamp
updated
- Decrement
Do NOT commit plan.md changes - they are part of the revert operation
Git撤销操作成功后,更新plan.md:
- 读取当前的plan.md
- 对每个已撤销的任务,修改标记:
- ->
[x][ ] - ->
[~][ ]
- 写入更新后的plan.md
- 更新metadata.json:
- 减少的数值
tasks.completed - 必要时更新
status - 更新时间戳
updated
- 减少
请勿提交plan.md的更改 - 这些更改属于撤销操作的一部分
Track Status Updates
跟踪项状态更新
If reverting entire track:
若撤销整个跟踪项:
- In tracks.md: Change or
[x]to[~][ ] - Consider offering to delete the track directory entirely
- 在tracks.md中:将或
[x]改为[~][ ] - 可选择是否删除跟踪项目录
If reverting to incomplete state:
若撤销至未完成状态:
- In tracks.md: Ensure marked as if partially complete,
[~]if fully reverted[ ]
- 在tracks.md中:如果是部分完成则标记为,如果完全撤销则标记为
[~][ ]
Verification
验证
After revert completion:
================================================================================
REVERT COMPLETE
================================================================================
Summary:
- Reverted {N} commits
- Reset {P} tasks to pending
- {M} files affected
Git log now shows:
{recent commit history}
Plan.md status:
- Task 2.2: [ ] Pending
- Task 2.3: [ ] Pending
================================================================================
Verify the revert was successful:
1. Run tests: {test command}
2. Check application: {relevant check}
If issues are found, you may need to:
- Fix conflicts manually
- Re-implement the reverted tasks
- Use 'git revert HEAD~{N}..HEAD' to undo the reverts
================================================================================撤销完成后:
================================================================================
REVERT COMPLETE
================================================================================
Summary:
- Reverted {N} commits
- Reset {P} tasks to pending
- {M} files affected
Git log now shows:
{recent commit history}
Plan.md status:
- Task 2.2: [ ] Pending
- Task 2.3: [ ] Pending
================================================================================
Verify the revert was successful:
1. Run tests: {test command}
2. Check application: {relevant check}
If issues are found, you may need to:
- Fix conflicts manually
- Re-implement the reverted tasks
- Use 'git revert HEAD~{N}..HEAD' to undo the reverts
================================================================================Safety Rules
安全规则
- NEVER use - Only use
git reset --hardgit revert - NEVER use - Only safe push operations
git push --force - NEVER auto-resolve conflicts - Always halt for human intervention
- ALWAYS show full plan - User must see exactly what will happen
- REQUIRE explicit 'YES' - Not 'y', not enter, only 'YES'
- HALT on ANY error - Do not attempt to continue past failures
- PRESERVE history - Revert commits are preferred over history rewriting
- 切勿使用- 仅使用
git reset --hardgit revert - 切勿使用- 仅使用安全的推送操作
git push --force - 切勿自动解决冲突 - 始终等待人工介入
- 始终显示完整计划 - 用户必须清楚了解即将执行的操作
- 要求明确的'YES'确认 - 不接受'y'、回车,仅接受'YES'
- 遇到任何错误立即终止 - 不要尝试跳过错误继续执行
- 保留历史记录 - 优先使用撤销提交,而非重写历史
Edge Cases
边缘情况处理
Track Never Committed
跟踪项从未提交
No commits found for track: {trackId}
The track exists but has no associated commits. This may mean:
- Implementation never started
- Commits used different format
Options:
1. Delete track directory only
2. CancelNo commits found for track: {trackId}
The track exists but has no associated commits. This may mean:
- Implementation never started
- Commits used different format
Options:
1. Delete track directory only
2. CancelCommits Already Reverted
提交已被撤销
Some commits appear to already be reverted:
- abc1234 was reverted by xyz9876
Options:
1. Skip already-reverted commits
2. Cancel and investigateSome commits appear to already be reverted:
- abc1234 was reverted by xyz9876
Options:
1. Skip already-reverted commits
2. Cancel and investigateRemote Already Pushed
提交已推送到远程仓库
WARNING: Some commits have been pushed to remote
Commits on remote:
- abc1234 (origin/main)
- def5678 (origin/main)
Reverting will create new revert commits that you'll need to push.
This is the safe approach (no force push required).
Continue with revert? (YES/no):WARNING: Some commits have been pushed to remote
Commits on remote:
- abc1234 (origin/main)
- def5678 (origin/main)
Reverting will create new revert commits that you'll need to push.
This is the safe approach (no force push required).
Continue with revert? (YES/no):Undo the Revert
撤销已执行的撤销操作
If user needs to undo the revert itself:
To undo this revert operation:
git revert HEAD~{N}..HEAD
This will create new commits that restore the reverted changes.
Alternatively, if not yet pushed:
git reset --soft HEAD~{N}
git checkout -- .
(Use with caution - this discards the revert commits)如果用户需要撤销本次撤销操作本身:
To undo this revert operation:
git revert HEAD~{N}..HEAD
This will create new commits that restore the reverted changes.
Alternatively, if not yet pushed:
git reset --soft HEAD~{N}
git checkout -- .
(Use with caution - this discards the revert commits)