templates/global/skills/ralph-discard/SKILL.md
Abandon RALPH worktree without merging changes
npx skillsauth add doravidan/supreme-ralph ralph-discardInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Discard a RALPH worktree and all its changes without merging.
| Command | Description |
|---------|-------------|
| /ralph-discard | Discard current/only worktree |
| /ralph-discard {spec-name} | Discard specific worktree |
| /ralph-discard --force | Skip confirmation prompt |
| /ralph-discard --all | Discard all RALPH worktrees |
/ralph-discardIf multiple worktrees exist:
? Which worktree do you want to discard?
○ ralph/user-authentication (4 commits, 12 files)
○ ralph/payment-integration (2 commits, 5 files)
○ All worktrees
╔════════════════════════════════════════════════════════════════╗
║ Discard Warning ║
╚════════════════════════════════════════════════════════════════╝
⚠ You are about to discard:
Worktree: .worktrees/user-authentication
Branch: ralph/user-authentication
This will permanently delete:
- 4 commits
- 12 files of work
- +342 lines of code
PRD progress will NOT be affected:
- prd.json will remain unchanged
- You can re-run /ralph-run to start fresh
This action CANNOT be undone.
? Are you sure you want to discard this worktree?
○ Yes, discard all changes
○ No, keep the worktree
○ No, let me review first (/ralph-review)
# Remove worktree (force to handle uncommitted changes)
git worktree remove .worktrees/{spec-name} --force
# Delete the branch
git branch -D ralph/{spec-name}
╔════════════════════════════════════════════════════════════════╗
║ Worktree Discarded ║
╚════════════════════════════════════════════════════════════════╝
✓ Removed worktree: .worktrees/user-authentication
✓ Deleted branch: ralph/user-authentication
The following changes were discarded:
- 4 commits
- 12 files
- +342 lines
Your main branch is unchanged.
Next steps:
- Run /ralph-run to start fresh implementation
- Run /ralph to check PRD status
With /ralph-discard --all:
╔════════════════════════════════════════════════════════════════╗
║ Discard All Worktrees ║
╚════════════════════════════════════════════════════════════════╝
⚠ You are about to discard ALL RALPH worktrees:
1. ralph/user-authentication
- 4 commits, 12 files
2. ralph/payment-integration
- 2 commits, 5 files
Total: 6 commits, 17 files will be lost.
? Proceed with discarding all worktrees?
○ Yes, discard everything
○ No, let me choose specific worktrees
○ Cancel
With --force, skip confirmation:
# Used for automated cleanup or when you're certain
/ralph-discard --force
# Or for specific worktree
/ralph-discard user-authentication --force
Output:
✓ Force discarded: ralph/user-authentication
If the worktree has uncommitted changes:
╔════════════════════════════════════════════════════════════════╗
║ Uncommitted Changes ║
╚════════════════════════════════════════════════════════════════╝
⚠ This worktree has uncommitted changes:
Modified:
~ src/services/user.service.ts
~ tests/services/user.service.test.ts
Untracked:
+ src/utils/temp.ts
? How do you want to proceed?
○ Discard everything (including uncommitted)
○ Commit changes first, then discard
○ Cancel and review changes
╔════════════════════════════════════════════════════════════════╗
║ Recovery Information ║
╚════════════════════════════════════════════════════════════════╝
If you accidentally discarded a worktree, you may be able to recover
commits using git reflog (within 30 days):
git reflog
git checkout -b recovered {commit-hash}
However, uncommitted changes CANNOT be recovered.
| Error | Action | |-------|--------| | No worktrees | Inform user, nothing to discard | | Worktree not found | List available worktrees | | Permission denied | Suggest --force flag | | Branch in use | Checkout different branch first |
Before discarding:
development
Run RALPH autonomous development loop. Converts PRD markdown to prd.json and runs autonomous implementation.
development
Run RALPH autonomous development loop to implement features from the PRD.
documentation
Generate detailed Product Requirements Documents (PRDs) through interactive conversation.
development
Initialize any project with Claude Code best practices and RALPH autonomous development