用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/joris887/exosuit --skill undo-work命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | undo-work |
| version | 3.0.1 |
| description | Safely discard or revert failed implementation attempts and restore a clean working state. |
| trigger | manual |
| depends-on | [] |
| references | [] |
| disable-model-invocation | true |
| user-invocable | true |
| allowed-tools | Bash, Read, Glob, Grep |
| argument-hint | [--soft | --hard | --story] |
Safely undo work when an implementation attempt has gone wrong. Provides structured rollback with safeguards against accidental data loss.
Arguments: $ARGUMENTS
git status
git log --oneline -10
git stash list
Determine the situation:
Present findings to the user before proceeding.
Show the user:
Ask the user to confirm one of these rollback levels:
| Level | What it does | When to use |
|---|---|---|
| Soft | Stash uncommitted changes (recoverable via git stash pop) | "Let me save this aside and try a different approach" |
| Hard | Discard all uncommitted changes | "This attempt is wrong, start fresh from last commit" |
| Story | Reset branch to before the story's commits | "The whole story implementation needs to restart" |
git stash push -m "undo-work: <user-provided reason or auto-description>"
Report: "Changes stashed. Use git stash pop to recover if needed."
git diff --stat # Show what will be lost — confirm with user
git stash push --include-untracked -m "undo-work: <user-provided reason>"
git stash drop # Discard the stash (changes intentionally discarded)
This captures both tracked changes AND untracked files into a stash, achieving a clean working directory. If the user changes their mind before the drop, recovers everything.
git stash popgit tag -l 'story-checkpoint-*'
If a checkpoint tag exists, prefer it as the rollback target — it was set by story-cycle Phase 3.pre at the exact point before implementation began.
git log --oneline main..HEAD
Show the user exactly which commits will be removed (or that a checkpoint tag was found).
After confirmation:
If checkpoint tag exists:
git stash push --include-untracked -m "undo-work: story rollback backup"
git reset --soft <checkpoint-tag>
git restore .
git tag -d <checkpoint-tag>
If no checkpoint tag (fall back to commit-based):
git reset --soft <commit-before-story> # Keep changes staged (safest)
User wants a clean slate (not just unstaged)
git stash push --include-untracked -m "undo-work: story rollback backup"
git reset --soft <commit-before-story>
git restore .
git status
git log --oneline -5
Confirm the working directory is in the expected state.
The failed attempt has useful learnings
Suggest the user note what went wrong in the current session context so the next attempt avoids the same pitfalls. Do NOT auto-create documentation files.
git stash --include-untracked (recoverable) over destructive alternatives. Use git restore . for discarding tracked file changes, git reset --soft for undoing commits while keeping changes stagedmain branch, REFUSE to reset — only feature/sprint branches