/draft:revertfrom draft
Safely reverts Git commits at Draft track, phase, or task levels with preview and confirmation. Prevents destructive actions.
Ships in draft. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Perform intelligent git revert that understands Draft's logical units of work.
Preview and confirm before any destructive action.
Verify Draft context exists:
ls draft/tracks.md 2>/dev/null
If draft/ does not exist: STOP — "No Draft context found. Run /draft:init first."
Check working tree:
Run git status --porcelain. If output is non-empty, warn the user about uncommitted changes and suggest stashing or committing first. Do NOT proceed until working tree is clean.
Ask user what level to revert:
If user specifies by name/description, find the matching commits.
Primary method: Read plan.md — every completed task has its commit SHA recorded inline. Use these SHAs directly.
If no commits found (all tasks are [ ] Pending with no SHAs): announce "No commits found for this scope — nothing to revert." and STOP.
Fallback method (if SHAs missing but completed tasks exist): Search git log by track ID pattern:
For Draft-managed work, commits follow pattern:
feat(<track_id>): <description>fix(<track_id>): <description>test(<track_id>): <description>refactor(<track_id>): <description># Find commits for a track
git log --oneline --grep="<track_id>"
# Find commits in date range (for phase)
git log --oneline --since="<phase_start>" --until="<phase_end>" --grep="<track_id>"
Cross-reference: Verify SHAs from plan.md match the git log results. Git log is always authoritative for commit identification. plan.md is authoritative for task-to-commit mapping. On SHA mismatch, prefer git log and warn the user.
Show user what will be reverted:
═══════════════════════════════════════════════════════════
REVERT PREVIEW
═══════════════════════════════════════════════════════════
Reverting: [Task/Phase/Track] "[name]"
Commits to revert (newest first):
abc1234 feat(add-auth): Add JWT validation
def5678 feat(add-auth): Create auth middleware
ghi9012 test(add-auth): Add auth middleware tests
Files affected:
src/auth/middleware.ts
src/auth/jwt.ts
tests/auth/middleware.test.ts
Plan.md changes:
Task 2.1: [x] (abc1234) → [ ]
Task 2.2: [x] (def5678) → [ ]
═══════════════════════════════════════════════════════════
Proceed with revert? (yes/no)
If confirmed:
Maintain a list of successfully reverted commits during execution.
Read draft/workflow.md → ## Toolchain section for VCS CLI. See core/shared/vcs-commands.md for the full command mapping.
git mode:
# Revert each commit in reverse order (newest first)
git revert --no-commit <commit1>
git revert --no-commit <commit2>
# ... continue for all commits
# Create single revert commit
git commit -m "revert(<track_id>): Revert [task/phase description]"
On conflict, report: "Successfully reverted: [list]. Conflict on: [sha]. Run git revert --abort to undo partial state."
Update plan.md:
[x] to [ ]Update metadata.json:
metadata.json only stores phases.total (int) and phases.completed (int). Decrement phases.completed if all tasks in a previously completed phase are reverted. Phase status markers ([~], [x], [ ]) are tracked in plan.md text, not in metadata.json. Update plan.md phase headings accordingly: if any task in a completed phase is reverted, mark that phase [~] In Progress in plan.md; if ALL tasks are reverted, mark it [ ] Pending in plan.md.Update draft/tracks.md if track status changed
Stale reports: After revert, existing review-report-latest.md and bughunt-report-latest.md for the track are stale. Resolve symlink targets first: readlink -f review-report-latest.md and readlink -f bughunt-report-latest.md. Add a warning header to the symlink targets (the actual timestamped files): > **WARNING: This report predates a revert operation and may be stale. Re-run the review/bughunt.** Or delete them if the revert is substantial.
Revert complete
Reverted:
- [list of tasks/commits]
Updated:
- draft/tracks/<track_id>/plan.md
- draft/tracks/<track_id>/metadata.json
Git status:
- Created revert commit: [sha]
The reverted tasks are now available to re-implement.
Run /draft:implement to continue.
If the process is interrupted between git revert and Draft state update, the recovery procedure is: check git log for the revert commit, then manually update plan.md task statuses to match the reverted state.
If user says no to preview:
Revert cancelled. No changes made.
If git revert has conflicts:
Revert conflict detected in: [files]
Options:
1. Resolve conflicts manually, then run: git revert --continue
2. Abort revert: git revert --abort
Draft state NOT updated (pending revert completion).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub drafthq/draft --plugin draft33 skills in this plugin
/adrCreate and manage Architecture Decision Records. Documents significant technical decisions with context, alternatives, and consequences. Also supports evaluate (assess proposals) and design (system design) modes./assist-reviewReviewing someone else's PR for handoff/sign-off. Isolates structural changes from trivial edits, flags HLD/LLD drift and guardrail violations, points the reviewer at what to scrutinize. Use when prepping to review another engineer's work — NOT for first-pass self-review (use review / quick-review)./bughuntPerforms an exhaustive 14-dimension bug hunt across the codebase using Draft context (architecture, tech-stack, product) for false-positive elimination. Generates a severity-ranked report with code evidence, data flow traces, and suggested fixes. Optionally writes regression tests. Use when the user asks to find bugs, audit code for defects, scan for vulnerabilities, or says 'hunt bugs', 'find bugs', or 'code audit'./changeHandle mid-track requirement changes. Analyzes impact on completed and pending tasks, proposes amendments to spec.md and plan.md before applying./coverageCompute code coverage for active track or module. Targets 95%+ coverage with report and justification for uncovered lines. Complements TDD workflow./debugStructured debugging session. Reproduce, isolate, diagnose, and fix bugs using systematic investigation. Invoked by /draft:new-track for bug tracks or directly for ad-hoc debugging.Other plugins' skills for the same job