Scrivener: Edit & Restructure
You help the writer change a Scrivener project's content and structure: add and remove binder items, move and reorder them, rename them, and edit a document's body text, synopsis, and notes — without losing the rich data Scrivener hides inside the RTF (comments, footnotes, links, styles, images).
Scrivener authoring is non-linear: restructuring the binder is the normal creative loop, not a rare event. Treat "move this scene," "reorder these chapters," and "split this draft" as routine. But a .scriv is a structured package, so every write goes through the shared toolkit, which backs up and snapshots first.
Safety (read before any write)
- Close the project in Scrivener first, and let cloud sync (Dropbox/iCloud) finish. Editing a
.scriv while it is open or mid-sync can corrupt or create conflicted copies — even when the app appears idle.
- Every mutating command auto-backs-up (timestamped zip of the whole project) and, for content edits, auto-snapshots the document before overwriting its
content.rtf. These are on by default; --no-backup / --no-snapshot only when you are certain.
- Titles are not unique. The reference project has two items titled "Dont Stop To Early." For any mutating op where a title could be ambiguous, resolve to a UUID first (run
find or outline) and address the item by UUID. An ambiguous title makes the toolkit refuse the write and list all matches.
- Never regenerate a rich document from plain text. Comments/footnotes (
scrivcmt:// anchors), applied styles (<$Scr_H::n> markers), embedded images (\pict), tables, and internal links all live inside the RTF byte stream. The default edit model is token-preserving — it edits in place and leaves those constructs byte-for-byte. To change a rich doc's body either --append, or take a snapshot and pass --allow-destructive for a full rewrite. set-text refuses to regenerate a rich doc otherwise.
docs.checksum mismatches are advisory, not corruption — real projects routinely carry stale entries. Never block an edit on a checksum mismatch.
- Deletions go to Trash, never hard-delete. The Draft (a.k.a. Manuscript) folder may contain only Text and Folder items — no media — and the toolkit enforces this on add/move.
Use --dry-run to preview any mutating command before committing.
CLI commands this skill uses
Entry point (JSON by default; --format text for humans):
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py <command> --project "<path.scriv>" [args]
| Command |
What it does |
outline |
Binder tree — read this first to get UUIDs, parents, and order |
find <query> |
Resolve a title/type to its UUID before a mutating op |
add <parent-id> --type text|folder [--title ...] [--text ...|--text-file ...] |
Create a new binder item |
rename <id> <title> |
Rename a document or folder |
move <id> --to <parent-id> [--index N] |
Re-parent and/or reorder (--index is the 0-based slot among siblings) |
delete <id> |
Move an item (and its subtree) to Trash |
set-synopsis <id> --text ...|--text-file ... |
Set the corkboard synopsis |
set-notes <id> --text ...|--text-file ... |
Set document notes |
set-text <id> (--text ...|--text-file ...) [--append] [--allow-destructive] |
Edit body; token-preserving; refuses to regenerate a rich doc |
snapshot <id> [--title ...] |
Capture a version of content.rtf before a risky change |
All mutating commands accept --no-backup, --no-snapshot, and --dry-run.
How to approach a request
- Inspect first. Run
outline (and find for a named item) to get UUIDs, current parent, and sibling order. Never act on a guessed UUID.
- Disambiguate. If a title resolves to more than one item, show the matches and ask, or pick by type — then use the UUID.
- Pick the right verb. Add vs. move vs. rename vs. delete vs. edit-text. Keep structural and content edits separate steps so each is independently revertible.
- Protect rich content. For an existing body, prefer
--append. Only do a destructive rewrite after a snapshot and with --allow-destructive, and tell the user why.
- Confirm and verify. Re-run
outline (or read) to confirm the new shape. After significant restructuring, suggest scrivener-integrity's verify.
Worked example: move a section, then rename it
Goal: move the scene "The Reveal" so it becomes the second child of the chapter folder "Act Two," then rename it to "The Turn."
SCRIV="/path/My Novel.scriv"
# 1. Find the items and their UUIDs (titles are not unique — confirm one match each).
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py find "The Reveal" --project "$SCRIV" --format text
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py find "Act Two" --project "$SCRIV" --format text
# → scene = 8F1C... (Text)
# → chapter = 2A9D... (Folder)
# 2. Preview the move into slot index 1 (the second position) under Act Two.
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py move 8F1C... --to 2A9D... --index 1 \
--project "$SCRIV" --dry-run
# 3. Commit the move (auto-backup runs).
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py move 8F1C... --to 2A9D... --index 1 \
--project "$SCRIV"
# 4. Rename it by UUID.
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py rename 8F1C... "The Turn" --project "$SCRIV"
# 5. Confirm the new structure.
python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py outline --project "$SCRIV" --format text
To set a synopsis or notes on the moved scene, follow with set-synopsis 8F1C... --text "..." or set-notes 8F1C... --text "...".
This same move + rename, then assigning a section type and compiling, is a multi-skill flow: scrivener-edit (move + rename) → scrivener-metadata (set section type) → scrivener-compile (compile to Markdown).
Editing text without losing rich data
- Append (safe for any doc):
set-text <id> --append --text "new paragraph" adds to the end and preserves everything already there.
- Replace a plain doc: for a document with no comments/styles/images/tables/links,
set-text <id> --text "..." rewrites it cleanly.
- Replace a rich doc:
set-text refuses unless you --allow-destructive. First snapshot <id> --title "before rewrite", then rewrite. Warn the user that comments, footnotes, styles, embedded images, and internal links anchored in that doc will be lost.
- For inserting comments or footnotes rather than overwriting, see scrivener-annotations. For applying named styles, see scrivener-styles.
Toolkit support
✅ Available now: add, rename, move (re-parent + reorder via --to/--index), delete (to Trash), set-synopsis, set-notes, set-text (--append, --allow-destructive; token-preserving with the rich-doc guard), snapshot.
🔜 Planned (v0.1.0 roadmap — not yet in the CLI): split a document at an offset or by separator, merge several documents, promote/demote (shift outline level), duplicate (optionally with subtree), convert folder↔text (lossless), auto-fill titles/synopses, and set-title --from-selection. When asked for one of these, describe the workflow and suggest the closest available command — e.g. for a manual "split," add a new sibling and move text via set-text/--append; for a manual "merge," append each source's text into one doc, then delete the emptied originals. See references/restructuring.md.
Related skills
- scrivener-metadata — labels, status, keywords, custom metadata, and section types (assign "Part"/"Chapter"/"Scene" after restructuring).
- scrivener-snapshots — take/list/read/diff/restore versions; always snapshot before a destructive rewrite.
- scrivener-annotations — add/edit comments and footnotes (linked and inline) instead of overwriting body text.
- scrivener-formatting — direct formatting (fonts, color, alignment, lists, tables) on the text you edit here.
- scrivener-inspect —
outline/read/find to gather UUIDs and current structure before editing.
- scrivener-integrity —
verify/backup/repair after risky restructuring.
For the move/reorder mechanics, Draft containment rules, the token-preserving edit model, the rich-doc guard, and planned split/merge/promote/demote, see references/restructuring.md.
1---2name: scrivener-edit3description: When the user wants to edit a document's text or restructure the binder of a Scrivener project — adding, renaming, moving, reordering, re-parenting, or deleting documents and folders, appending to a document, or setting its synopsis or notes. Use when the user says "add a chapter," "add a scene," "move this section," "reorder chapters," "rename this document," "delete this," "append to this doc," "set the synopsis," "set the notes," "split this scene," or "merge these." For labels, status, keywords, and section types, see scrivener-metadata. For versioning before a rewrite, see scrivener-snapshots.4---56# Scrivener: Edit & Restructure78You help the writer change a Scrivener project's content and structure: add and remove binder items, move and reorder them, rename them, and edit a document's body text, synopsis, and notes — without losing the rich data Scrivener hides inside the RTF (comments, footnotes, links, styles, images).910Scrivener authoring is non-linear: restructuring the binder is the normal creative loop, not a rare event. Treat "move this scene," "reorder these chapters," and "split this draft" as routine. But a `.scriv` is a structured package, so every write goes through the shared toolkit, which backs up and snapshots first.1112## Safety (read before any write)1314- **Close the project in Scrivener first**, and **let cloud sync (Dropbox/iCloud) finish**. Editing a `.scriv` while it is open or mid-sync can corrupt or create conflicted copies — even when the app appears idle.15- Every mutating command **auto-backs-up** (timestamped zip of the whole project) and, for content edits, **auto-snapshots** the document before overwriting its `content.rtf`. These are on by default; `--no-backup` / `--no-snapshot` only when you are certain.16- **Titles are not unique.** The reference project has two items titled "Dont Stop To Early." For any mutating op where a title could be ambiguous, **resolve to a UUID first** (run `find` or `outline`) and address the item by UUID. An ambiguous title makes the toolkit refuse the write and list all matches.17- **Never regenerate a rich document from plain text.** Comments/footnotes (`scrivcmt://` anchors), applied styles (`<$Scr_H::n>` markers), embedded images (`\pict`), tables, and internal links all live *inside* the RTF byte stream. The default edit model is **token-preserving** — it edits in place and leaves those constructs byte-for-byte. To change a rich doc's body either `--append`, or take a snapshot and pass `--allow-destructive` for a full rewrite. `set-text` **refuses** to regenerate a rich doc otherwise.18- **`docs.checksum` mismatches are advisory**, not corruption — real projects routinely carry stale entries. Never block an edit on a checksum mismatch.19- **Deletions go to Trash**, never hard-delete. The Draft (a.k.a. Manuscript) folder may contain **only Text and Folder items** — no media — and the toolkit enforces this on add/move.2021Use `--dry-run` to preview any mutating command before committing.2223## CLI commands this skill uses2425Entry point (JSON by default; `--format text` for humans):2627```bash28python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py <command> --project "<path.scriv>" [args]29```3031| Command | What it does |32|---|---|33| `outline` | Binder tree — read this first to get UUIDs, parents, and order |34| `find <query>` | Resolve a title/type to its UUID before a mutating op |35| `add <parent-id> --type text\|folder [--title ...] [--text ...\|--text-file ...]` | Create a new binder item |36| `rename <id> <title>` | Rename a document or folder |37| `move <id> --to <parent-id> [--index N]` | Re-parent and/or reorder (`--index` is the 0-based slot among siblings) |38| `delete <id>` | Move an item (and its subtree) to Trash |39| `set-synopsis <id> --text ...\|--text-file ...` | Set the corkboard synopsis |40| `set-notes <id> --text ...\|--text-file ...` | Set document notes |41| `set-text <id> (--text ...\|--text-file ...) [--append] [--allow-destructive]` | Edit body; token-preserving; refuses to regenerate a rich doc |42| `snapshot <id> [--title ...]` | Capture a version of `content.rtf` before a risky change |4344All mutating commands accept `--no-backup`, `--no-snapshot`, and `--dry-run`.4546## How to approach a request47481. **Inspect first.** Run `outline` (and `find` for a named item) to get UUIDs, current parent, and sibling order. Never act on a guessed UUID.492. **Disambiguate.** If a title resolves to more than one item, show the matches and ask, or pick by type — then use the UUID.503. **Pick the right verb.** Add vs. move vs. rename vs. delete vs. edit-text. Keep structural and content edits separate steps so each is independently revertible.514. **Protect rich content.** For an existing body, prefer `--append`. Only do a destructive rewrite after a snapshot and with `--allow-destructive`, and tell the user why.525. **Confirm and verify.** Re-run `outline` (or `read`) to confirm the new shape. After significant restructuring, suggest `scrivener-integrity`'s `verify`.5354## Worked example: move a section, then rename it5556Goal: move the scene "The Reveal" so it becomes the second child of the chapter folder "Act Two," then rename it to "The Turn."5758```bash59SCRIV="/path/My Novel.scriv"6061# 1. Find the items and their UUIDs (titles are not unique — confirm one match each).62python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py find "The Reveal" --project "$SCRIV" --format text63python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py find "Act Two" --project "$SCRIV" --format text64# → scene = 8F1C... (Text)65# → chapter = 2A9D... (Folder)6667# 2. Preview the move into slot index 1 (the second position) under Act Two.68python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py move 8F1C... --to 2A9D... --index 1 \69 --project "$SCRIV" --dry-run7071# 3. Commit the move (auto-backup runs).72python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py move 8F1C... --to 2A9D... --index 1 \73 --project "$SCRIV"7475# 4. Rename it by UUID.76python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py rename 8F1C... "The Turn" --project "$SCRIV"7778# 5. Confirm the new structure.79python3 ${CLAUDE_PLUGIN_ROOT}/tools/scrivener/cli.py outline --project "$SCRIV" --format text80```8182To set a synopsis or notes on the moved scene, follow with `set-synopsis 8F1C... --text "..."` or `set-notes 8F1C... --text "..."`.8384This same move + rename, then assigning a section type and compiling, is a multi-skill flow: `scrivener-edit` (move + rename) → `scrivener-metadata` (set section type) → `scrivener-compile` (compile to Markdown).8586## Editing text without losing rich data8788- **Append (safe for any doc):** `set-text <id> --append --text "new paragraph"` adds to the end and preserves everything already there.89- **Replace a plain doc:** for a document with no comments/styles/images/tables/links, `set-text <id> --text "..."` rewrites it cleanly.90- **Replace a rich doc:** `set-text` refuses unless you `--allow-destructive`. First `snapshot <id> --title "before rewrite"`, then rewrite. Warn the user that comments, footnotes, styles, embedded images, and internal links anchored in that doc will be lost.91- For inserting comments or footnotes rather than overwriting, see **scrivener-annotations**. For applying named styles, see **scrivener-styles**.9293## Toolkit support9495✅ **Available now:** `add`, `rename`, `move` (re-parent + reorder via `--to`/`--index`), `delete` (to Trash), `set-synopsis`, `set-notes`, `set-text` (`--append`, `--allow-destructive`; token-preserving with the rich-doc guard), `snapshot`.9697🔜 **Planned (v0.1.0 roadmap — not yet in the CLI):** `split` a document at an offset or by separator, `merge` several documents, `promote`/`demote` (shift outline level), `duplicate` (optionally with subtree), `convert` folder↔text (lossless), `auto-fill` titles/synopses, and `set-title --from-selection`. When asked for one of these, describe the workflow and suggest the closest available command — e.g. for a manual "split," `add` a new sibling and move text via `set-text`/`--append`; for a manual "merge," append each source's text into one doc, then `delete` the emptied originals. See `references/restructuring.md`.9899## Related skills100101- **scrivener-metadata** — labels, status, keywords, custom metadata, and **section types** (assign "Part"/"Chapter"/"Scene" after restructuring).102- **scrivener-snapshots** — take/list/read/diff/restore versions; always snapshot before a destructive rewrite.103- **scrivener-annotations** — add/edit comments and footnotes (linked and inline) instead of overwriting body text.104- **scrivener-formatting** — direct formatting (fonts, color, alignment, lists, tables) on the text you edit here.105- **scrivener-inspect** — `outline`/`read`/`find` to gather UUIDs and current structure before editing.106- **scrivener-integrity** — `verify`/`backup`/`repair` after risky restructuring.107108For the move/reorder mechanics, Draft containment rules, the token-preserving edit model, the rich-doc guard, and planned split/merge/promote/demote, see [references/restructuring.md](references/restructuring.md).