undolisted
Install: claude install-skill thettwe/nyann
# undo
Wraps `bin/undo.sh`. History-mutating operation — treat as destructive.
## 1. Always preview first
Before any mutation, run `bin/undo.sh --dry-run` and show the user
which commits will be undone. The preview JSON lists them newest-
first with SHA and subject. Read it back and ask the user to
confirm — even for a single-commit undo.
Exception: the user's request explicitly included "don't ask" / "just
do it" AND `--count` is 1 AND `--strategy` is `soft` (the safest
default). For anything multi-commit or non-soft, always confirm.
## 2. Decide strategy
Default is `soft` (safest — all changes stay staged). When the user's
intent is unclear, **you MUST call the `AskUserQuestion` tool** (not
plain text):
```json
{
"questions": [
{
"question": "How should the commit be undone?",
"header": "Strategy",
"multiSelect": false,
"options": [
{ "label": "Soft (Recommended)", "description": "Undo commit, keep changes staged" },
{ "label": "Mixed", "description": "Undo commit, keep changes in working tree (unstaged)" },
{ "label": "Hard", "description": "Undo commit AND discard all changes permanently" }
]
}
]
}
```
For `hard`, warn the user twice: the work is gone after hard reset.
Confirm before executing even after the picker selection.
## 3. Decide scope
- **`last-commit`** (default) — one commit.
- **`last-N-commits` with `--count <N>`** — multiple commits. Use
when the user says "undo the last 3 commits