---
name: undocmap
description: DESTRUCTIVE teardown of the guidance map /docmap generated for the current codebase — deletes every per-folder CLAUDE.md, the root CLAUDE.md, all path-scoped .claude/rules/ files docmap created, and the .claude/docmap.json manifest. Runs without a confirmation prompt; the deletion is irreversible. Fully sub-agent driven via a Workflow. Use when the user asks to "remove the docmap", "undo docmap", "delete the generated CLAUDE.md files", "tear down agent guidance", or "clean up .claude/rules".
---

# undocmap

The inverse of `/docmap`. This skill is a **dispatcher** — all work runs inside a deterministic
Workflow whose steps are sub-agents on pinned models.

## ⚠️ Override / destructive tool — warn the user first

`undocmap` **deletes** files with no confirmation gate: the root `CLAUDE.md`, every per-folder
`CLAUDE.md` docmap owns, docmap's `.claude/rules/` files, and the `.claude/docmap.json` manifest.
Deletion is irreversible (files aren't backed up).

**Before launching the workflow, tell the user plainly what will be deleted and that it can't be
undone**, in the same turn. You don't need a formal yes/no gate, but the warning must be visible —
`undocmap` is a teardown tool and treats these CLAUDE.md files as docmap-owned. If the user only
wants *some* of it gone, do that manually instead of running this.

## What to do

State the warning, then launch:

```
Workflow({ scriptPath: "<home>/.claude/skills/undocmap/undocmap.workflow.js" })
```

(Expand `~` to the current user's home, or use `<repo>/.claude/skills/undocmap/...` for a
project-level install.) The user invoking this skill is the opt-in for the `Workflow` tool. Relay
the returned summary (what was deleted, any warnings) afterward.

## What the workflow does

1. **Inventory (Sonnet 5, read-only)** — lists every artifact `/docmap` created, preferring
   `.claude/docmap.json` (the root + every unit `CLAUDE.md`, rule files, rule dirs). With no manifest
   it falls back to scanning docmap's known shape and flags inferred items in `warnings`.
2. **Remove (Sonnet 5)** — deletes every listed `CLAUDE.md` and rule file, `rmdir`s rule dirs left
   empty, and deletes the manifest. It never touches `.claude/` itself, settings, or `CLAUDE.local.md`.

If no artifacts are found it reports "nothing to remove" and exits.

## Companion: docmap is also an override tool

`/docmap` **owns** every `CLAUDE.md` it writes — it reads a pre-existing `CLAUDE.md` only as a
dispensable hint, then overwrites it. So the pair is symmetric: docmap overwrites, undocmap deletes.
Neither preserves arbitrary hand-written `CLAUDE.md` content; keep anything you can't lose elsewhere
(e.g. `CLAUDE.local.md`, which neither tool touches).

## If the Workflow tool is unavailable

Fall back to the `Agent` tool with the same contract: a read-only Sonnet 5 inventory (manifest-first,
filesystem fallback), then a Sonnet 5 remove pass that deletes exactly the inventoried artifacts.
Warn the user before deleting.
