revert

A Git-based undo tool that understands Draft tracks, phases, and tasks. Git is the version-control system that records changes to a codebase.

In plain words
What is it for?
Use it to roll back a task, phase, or entire Draft track after reviewing the related commits and confirming the action.
Why use it?
It helps undo exactly the requested unit of work while checking for uncommitted changes and showing a preview before anything is reverted.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/drafthq/draft/revert
Any agent
npx skills add drafthq/draft --skill revert
Clone the repo
git clone --depth 1 https://github.com/drafthq/draft

Made for: Claude Code, Codex.

Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,494 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00066 $0.01494
Opus 5 $0.00033 $0.00747
Sonnet 5 $0.00013 $0.00299
Haiku 4.5 $0.00007 $0.00149

Measured 2d ago against content hash 6c425808c301, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

revert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/revert/SKILL.md · 185 lines

How it starts

The opening of the file, as written. The whole thing — 185 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Draft Revert

Perform intelligent git revert that understands Draft's logical units of work.

Red Flags - STOP if you're

  • Reverting without showing preview first
  • Skipping user confirmation
  • Not checking for uncommitted changes first
  • Reverting more than requested
  • Not updating Draft state after git revert
  • Assuming you know which commits to revert without checking

Preview and confirm before any destructive action.


Step 0: Pre-flight Check

  1. 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."

  2. 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.


Step 1: Analyze What to Revert

Ask user what level to revert:

  1. Task - Revert a single task's commits
  2. Phase - Revert all commits in a phase
  3. Track - Revert entire track's commits

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.

Read the full file on GitHub · 185 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 185 lines · 66 tokens per session scan A 6c425808c301

Subscribe to this mod's changes

revert is a skill published in the GitHub repository drafthq/draft (40 stars, last pushed 14d ago), licensed MIT. It adds 66 tokens to every session and 1,494 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.