---
title: "Spell — Todo"
type: reference
kind: reference
documentedFor: "1.24.1"
updated: "2026-11-19"
canonical: "https://arcaneai.net/docs/reference/spell-todo"
---

# Spell — Todo

## At a glance

| Field | Value |
| --- | --- |
| Invoke as | `/spell-todo` |
| Argument | The raw idea to elaborate (e.g., "add spending limits doc", "automate ADR numbering", "build a dashboard for {AGENT_NAME}"), optionally "for <venture>" (hub only). `{AGENT_NAME}` resolves from `.arcane.json` / frontmatter; ask if unset. Use `--sweep` instead to report open-item counts across every book. |
| Agent | agent |
| When to use | Use PROACTIVELY whenever a raw idea needs to become one or more well-scoped TODO items, even if the user just says 'add a todo'. |

## Executive Summary

- This prompt turns a vague idea into a concrete, well-scoped TODO item placed in the correct file and section.
- It reads the current TODO landscape and repo structure to avoid duplicates and pick the right home.
- Use this any time you have an idea mid-session and don't want to lose it or park it in the wrong place.
- If the idea is ADR-worthy or journal-worthy, it flags that and routes accordingly.
- `--prune` removes checked items from a TODO book and moves them word for word to an append-only done book (`DONE.md` by default; `todo_done_book: false` in `.arcane.json` deletes instead) — report first, outcome recorded or migrated before anything is removed, one fingerprinted batch approval, and unchecked items are never touched.
- **In a hub repo:** "add a todo for &lt;venture&gt;" targets that venture's own `TODO.md` book instead of the hub root. `--sweep` skips elaboration entirely and reports new/open counts across every book (hub root + every venture).

---

Resolve `{BUSINESS_ROOT}` from `.arcane.json`'s `business_root` field (default `ventures/` if unset) before any mode below.

## Sweep Mode (`--sweep`)

If the argument is (or starts with) `--sweep`, skip every other step in this spell entirely and run this instead:

- **In a hub repo:** report `status: new` counts and oldest-entry age for the hub root `TODO.md` plus every `{BUSINESS_ROOT}/<slug>/TODO.md` that exists. Group by book, point at `spell-manifest` for entries ready to promote. Report-only — no edits (the one exception is the opt-in `--validate` below).
- **In a consumer repo:** report the same, for the repo-root `TODO.md` only (no venture books exist there).
- **Idea books too:** report the same `status: new` counts for the idea books that sit beside those TODO books — the hub root `IDEAS.md` and each venture's own `IDEAS.md` in a hub, the repo-root `IDEAS.md` in a consumer repo. Still report-only.

**Sweep scope is hub-local (PRD D-08).** The sweep reads only books and journals inside this repository: in a hub, the hub's TODO books, the hub's IDEAS books, and the hub's own `journal/`. **It never reads a consumer repo's clone — not even a registered clone on this machine.** In a consumer repo it reads only that repo's own root books and `journal/`. Reaching into other repositories would widen what this spell touches, a privacy and scope change nobody asked for.

Output format:

```
Todo sweep — N books, M open items

hub TODO.md               12 open, oldest 2026-07-14
ventures/ordovica/TODO.md  3 open, oldest 2026-08-10
hub IDEAS.md               5 new, oldest 2026-08-02
```

### Unrouted lessons (part of every `--sweep`)

The sweep also lists lessons from this repository's own journal that nothing has picked up yet. This pass is report-only, like the rest of the sweep: no writes, no moves, no filing, and no network calls.

- **Where:** the hub's own `journal/` only — or, in a consumer repo, that repo's own `journal/` — within the hub-local scope above. Never a consumer clone's journal.
- **Window:** journal entries dated on or after `--since YYYY-MM-DD`. Without `--since`, the last 30 days. The sweep is report-only, so it keeps no marker of when it last ran: to cover "since the last sweep", pass that sweep's date as `--since`. The output header states the window used.
- **What counts as a lesson:** each heading directly under a `### Lessons Learned` section — one level deeper, e.g. `#### <lesson>` — because `spell-close-session` writes one heading per lesson. The pass reads headings only. **Bold sentences and bullet items are not read as lessons.** A `### Lessons Learned` section with no per-lesson headings (the older bullet style) is reported as one line — `<path>: Lessons Learned has no per-lesson headings — not harvested` — so it is never silently skipped.
- **Routed or unrouted:** a lesson is routed when something references it:
  - a `FEEDBACK.md` item;
  - an idea-book entry or a TODO item within the sweep's scope — a reference is the lesson's heading text, or a link to its journal file with the lesson's heading anchor;
  - an issue link in the lesson's own body (`#123`, `AB#123`, a Jira key, or an issue URL).

  Everything else is unrouted. A lesson that `spell-close-session`'s Lessons Learned routing step (#274) already sent to `FEEDBACK.md` or an idea book is referenced there, so it drops out here.

```
Lessons since 2026-08-28 (hub journal) — 2 unrouted
  journal/2026-09-11-cache-rollout.md
    - The stated risk was work that did not exist
    - Building the state first beat reading the plan
  journal/2026-09-02-release-prep.md: Lessons Learned has no per-lesson headings — not harvested
Promote with spell-feedback (framework), spell-save-idea (product idea), or spell-todo (task).
```

### Idea validation (`--sweep --validate`, opt-in)

Without `--validate`, the sweep never edits anything. With it, the sweep also asks two or three quick yes/no questions per idea entry, so that `spell-manifest` can later see which ideas are worth promoting. Capture itself (`spell-save-idea`) stays unchanged.

1. **Candidates:** idea-book entries, within the hub-local scope above, whose status comment is `status: new` and does not yet carry a `value:` field. TODO-book items have no status comment and are not validated.
2. **Ask, per entry** — show the entry's text and book, then ask:
   - `value` — Is this valuable to the people who use what this repo builds? (`y` / `n` / `?`)
   - `fit` — Does it belong here, rather than in another venture, another repo, or a consumer's own product? (`y` / `n` / `?`)
   - `dup` — Does it duplicate an existing idea entry, TODO item or tracker issue? (`none`, or a short reference such as `#123` or `IDEAS.md 2026-08-02 14:10`; never containing `;` or `--`)

   `skip` leaves the entry unanswered; `stop` ends the questions and goes on to the confirmation with what has been answered so far. **Nothing is written while the questions are being asked** — the answers are held until step 3.
3. **One batch confirmation.** Print every change as `file:line`, the old comment, and the new one. Then ask once: `Write N status comments? (write / cancel)`. Only the operator's own literal `write` writes. A timeout, a cancellation, a host-generated fallback or ordinary conversational assent is not confirmation, and nothing is written. If a book changed since it was read, re-read it and confirm again. **Enforcement: structured spell gate ([ARC-023](https://github.com/codemagicianhq/arcane/blob/v1.24.1/DECISIONS.md#arc-023--normative-controls-require-inline-enforcement-contracts)) — answers are written only after the operator's single batch `write`; the check is agent-administered, not tool-verified.**
4. **Write only the status comment.** The entry text, timestamp and tag stay untouched, and the books stay append-only. The answers are added as fields after the status. The grammar is `spell-manifest`'s Step 1 "Status-comment grammar", which reads both forms:

   ```
   <!-- status: new -->                                  before
   <!-- status: new; value: y; fit: y; dup: none -->     after
   ```

   Update `last_updated` in the frontmatter of every touched book. Do not commit; hand off to `spell-commit-work`.

## Prune Mode (`--prune`)

If the argument is (or starts with) `--prune`, skip every other step in this spell entirely and run this instead. It moves resolved items out of a TODO book into a done book, only after proving each one's outcome is recorded somewhere durable. (Not to be confused with `spell update --prune`, which removes orphaned managed files.)

**Target book:** this repo's root `TODO.md`. In a hub, `--prune --venture <slug>` targets that venture's own `TODO.md` instead, resolved through the registry's aliases exactly as Step 0 below does. One book per run.

**Done book:** read `.arcane.json`'s optional `todo_done_book` field.

- **Absent:** the done book is `DONE.md`, in the same directory as the target book.
- **A path, for example `"DONE.md"` or `"docs/DONE.md"`:** the done book is that path, relative to the target book's directory.
- **`false`:** there is no done book. Approved items are deleted, not moved, as `--prune` did before the done book existed.

The done book is the home `governance/records-conventions.md` ("Completed TODO items") names for completed TODO items. **It is append-only: this mode adds lines to it and never edits, reorders or removes a line already in it.**

1. **Collect checked items only.** A candidate is a checked item — `- [x]` or `- [X]` — together with its indented continuation lines, and only when every item it is nested under is checked too: a checked sub-item under an unchecked parent belongs to that open item and is never a candidate. **An unchecked item (`- [ ]`) is never a candidate: it is never deleted, moved or edited by this mode.** A checked item with any unchecked sub-item is kept whole and reported as `has open sub-items — kept`. A checked sub-item whose checked parent is itself a candidate is one of that parent's continuation lines: it moves with the parent and is never a separate candidate, so nothing reaches the done book twice.
2. **Check each outcome is recorded durably.** For each candidate, look for the record of what happened, in this order:
   - the item's own reference — a file link, a PR or issue link, an ADR id, a tracker-id suffix — followed and confirmed to exist and to describe the outcome;
   - otherwise, a search of `journal/`, `DECISIONS.md`, `CHANGELOG.md`, and the repo's audit log and playbooks where they exist, for the item's key terms.

   Classify each candidate as `recorded → <where>` (path, plus heading or line) or `unrecorded`. A merged PR or closed issue counts as durable only when the item links it; an unlinked guess ("probably PR #40") is `unrecorded`. The done book does not count as the outcome record: it keeps the item, not the evidence of what the item produced.
3. **Report first — no edits yet.** Print every candidate with its classification, and the done book it will move to. For each `unrecorded` one, print the outcome migration you propose: a short outcome note (what was done, when, where it can be seen) appended to today's journal entry, `journal/YYYY-MM-DD-<topic-slug>.md`, under a `### Pruned TODO outcomes` heading. If you cannot tell what the outcome was, say so and leave that item out of the batch — never invent an outcome.

   ```
   Todo prune — TODO.md, 5 checked items → DONE.md

     1. [x] Add export button              recorded → CHANGELOG.md (1.4.0)
     2. [x] Decide on ADR numbering         recorded → DECISIONS.md (numbering entry)
     3. [x] Document the retrofit path      unrecorded → migrate to journal/2026-09-27-todo-prune.md
     4. [x] Wire the push hook              has open sub-items — kept
     5. [x] Try the new cache               outcome unknown — kept (tell me what happened, or leave it)

   Move 3 items to DONE.md (1 after migration). Fingerprint: 3f9c1a…
   ```

   With `todo_done_book: false`, the header names no done book and the last line reads `Delete 3 items (1 after migration).`
4. **One batch approval, fingerprinted.** This is the same gate `spell-commit-work` step 8 uses for a commit. Compute an approval fingerprint from the exact deletion list (book path, line, full item text for every item to delete) plus the exact migration text, plus the done-book path and its current content (or its absence) when items move. Present the list, the migration text and the fingerprint through a structured approval control, and wait for an authenticated operator response tied to that fingerprint. One approval covers the whole batch, the move to the done book included; there are no per-item prompts. A timeout, a cancellation, a host-generated fallback, a delegated response, or ordinary conversational assent is not approval: halt with nothing written. Recompute the fingerprint immediately before writing. If the book, the migration text or the done book changed, the approval is void; ask again. **Enforcement: structured spell gate ([ARC-023](https://github.com/codemagicianhq/arcane/blob/v1.24.1/DECISIONS.md#arc-023--normative-controls-require-inline-enforcement-contracts)) — nothing is written until the operator approves the fingerprinted batch; the fingerprint comparison is agent-administered, not tool-verified.**
5. **Migrate, move, then delete.** Write every migration first and confirm each one landed. Then, unless `todo_done_book` is `false`, copy each approved item into the done book:
   - **Word for word.** The item line and its continuation lines exactly as they stand in the TODO book, checkbox and indentation included; nothing reworded, dated or summarised.
   - **Under the same heading.** The item's heading path is the nearest heading above it in the TODO book plus every heading that encloses that one (each next heading above it at a higher level), excluding the book's level-1 title. Match the path in the done book heading by heading, by exact text and level, top level first; where a level has two matches, use the first. The item goes directly under the nearest heading, after the items already there and before that heading's first subheading or the next heading, so items keep their order and never read as part of a subsection. A heading missing from the path is added word for word at the end of its parent's section in the done book (before the next heading of the parent's level or higher), or at the end of the file when the parent is the title; the item goes under it. An item with no heading but the title above it goes directly under the done book's `# Done` title, before its first heading.
   - **Never through a link.** If the done book, or a directory on its path, is a symbolic link, stop and report it; write nothing.
   - **Creating the file when missing.** A new done book starts with a `# Done` title and the line `<!-- Append-only: spell-todo --prune adds items here and never edits or removes them. -->`, and has no frontmatter, so no later run has a reason to edit a line already in it.

   Confirm every copied item is in the done book word for word. Then delete exactly the approved lines from the TODO book, and nothing else. An item whose migration or copy failed stays in the TODO book. Update `last_updated` in the frontmatter of every touched file that has one, except the done book: its existing lines are never edited, frontmatter included, whoever created it.
6. **Record the move; do not commit.** `governance/records-conventions.md` ("Retention and deletion") requires an approved deletion to be recorded. Propose a commit message whose body lists each item removed from the TODO book, where its outcome is recorded, and the done book it moved to (or that it was deleted, under `todo_done_book: false`), and hand off to `spell-commit-work`. The done book, the commit body and the migrated journal notes are the record.

**Speed rule:** a book with no checked items reports `Nothing to prune — 0 checked items` and stops.

## Step 0 — Venture Targeting (Hub Only)

If the input names a venture ("add a todo for ordo", `--venture <slug>`), resolve it through `{BUSINESS_ROOT}/registry.json`'s aliases first (exact slug → alias → closest match offered — never guessed). Unknown slug:

```
No venture "<slug>" under {BUSINESS_ROOT}/ (closest: ordovica, tidewright).
1) use <closest>  2) add to hub root TODO.md  3) cancel (create the venture first: spell-summon-venture)
```

If `role` in `.arcane.json` is not `"hub"`, venture-targeting phrasing is refused:

> Venture targeting works only in the hub repo (`role: "hub"` in `.arcane.json`). This repo has no venture books.
> 1) add to this repo's TODO.md (venture reference removed)
> 2) skip — capture it in the hub: `spell-todo --venture <slug> "<idea>"`

If option 1 is chosen and the named venture is a *different* venture than this repo's own, strip that name from the item text before writing it — a sibling venture's name must never land in a consumer repo's `TODO.md`. If it's this repo's own venture, keep the text as given.

An idea that only *mentions* a venture, without targeting phrasing, is not redirected — proceed with the hub root as normal (speed rule: don't block on a maybe).

Elaborate the idea given by the user and add it to the right document(s) — the hub root `TODO.md` by default, or the resolved venture's own `TODO.md` when targeted.

The raw idea from the user is in the prompt argument. If no argument was provided, ask the user to describe the idea before proceeding.

Use these files first:

- TODO.md — section structure and existing items (avoid duplicates); or the targeted venture's own `TODO.md`
- DECISIONS.md — ADR registry (check if the idea is decision-worthy)
- README.md — repo structure (find the right canonical doc to reference)
- project.md — active priorities (calibrate urgency)

## Step 1 — Understand the Idea

Read the raw input. Ask one clarifying question only if the idea is fundamentally ambiguous (e.g., "which business?"). Do not ask for information you can infer.

Classify the idea along two axes:

**Type:**
- `todo` — a discrete action item with a clear done state
- `bug` — a defect to fix
- `tech-debt` — deferred cleanup/refactor cost to track
- `adr-candidate` — a significant architectural or policy decision that needs a formal ADR
- `journal-seed` — context-heavy exploration that belongs in a journal entry, not a task list
- `idea-capture` — a speculative or long-horizon idea with no immediate action (goes in TODO under the relevant section with a `[ ]`)

**Domain** (pick primary):
- `security` — threat model, hardening, access control
- `agents` — agent config, channels, policies, installation
- `infrastructure` — hardware, OS, cloud, networking, provisioning
- `governance` — git conventions, agent autonomy, spending controls, work management
- `ci-cd` — repos, pipelines, build/release automation
- `business` — a specific business under `{BUSINESS_ROOT}/` — name which one
- `product-ideas` — new product concepts or packaging ideas
- `legal` — LLC, ToS, contracts
- `playbooks` — runbooks, setup guides, automation scripts
- `prompts` — new or updated `.arcane/spells/` canonical spell files (the client shims are generated from them)

**Scope** (optional, additive — does not replace Domain):
- `repo` — repo-wide change touching the project broadly
- `feature` — scoped to a specific feature or slug
- `file` — scoped to a specific file or area

## Step 2 — Elaborate

Expand the idea into one or more concrete TODO items. Each item must:

- Be phrased as an imperative action (e.g., "Define...", "Create...", "Implement...", "Document...")
- Have a clear done state (reviewable by a human in 10 seconds)
- Include a file reference if a canonical home doc already exists (e.g., `— see [[DECISIONS]]`)
- Be specific enough to act on without further clarification

**Tracker-id suffix (`tracking_mode: external` only):** when `.arcane.json`'s tracking mode is `external` and an item corresponds to a work item that already exists (the operator gave its id, or the idea names it), end the item with that id's suffix in the provider's format — defined once in [governance/development-methodology.md](/docs/reference/development-methodology) under "Tracker-ID Suffix on Captured Items" (e.g. `[#123]` GitHub, `[AB#123]` Azure DevOps, the issue key for Jira). Never guess an id or file a work item just to get one. In `tracking_mode: internal`, items are written without a suffix, exactly as before.

If the idea naturally decomposes into multiple sub-items (e.g., "build dashboard" → design, implement, deploy, document), list them individually — do not bundle vague compound items.

If the idea is an `adr-candidate`, also draft a one-sentence ADR title suggestion (e.g., `ADR-NNN: Use GitHub Actions for CI instead of Azure Pipelines`).

## Step 3 — Route to the Right Document

Determine the target file(s) for each item:

| Situation                                             | Target                                                                             |
| ----------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Discrete action item with a domain section in TODO.md | `TODO.md` under the matching section                                               |
| New domain not yet in TODO.md                         | `TODO.md` — add a new section heading                                              |
| Speculative idea or future-facing concept             | `TODO.md` under `## Product Ideas` or the best matching section                    |
| ADR candidate                                         | `DECISIONS.md` — flag it as pending, do not write the full ADR yet                 |
| Journal-worthy context                                | `journal/` — propose a filename with today's date slug, do not create the file yet |
| Finding sourced from a research report                | `TODO.md` under the matching section — cross-reference the report path (e.g., `— see docs/research/<slug>.md`) |
| Business-specific execution item                      | Both `TODO.md` AND the relevant `{BUSINESS_ROOT}/<name>/overview.md` reference section  |

## Step 4 — Show Proposal

Output the elaborated items in this format before making any edits:

## Proposed TODO Addition

**Idea understood as:** [one-sentence restatement]
**Type:** [type from Step 1]
**Domain:** [domain from Step 1]
**Scope:** [scope from Step 1, if applicable — repo / feature / file]

**Elaborated items:**

- [ ] [First item — phrased as imperative, with file ref if applicable]
- [ ] [Second item if applicable]
- ...

**Target document(s):**
- `[file path]` → section `## [Section Name]`

**If ADR-candidate:** Suggested ADR title: `ADR-NNN: [title]`

**Placement note (if any):** [e.g., "No matching section exists — will add ## [New Section]"]

**Approve?** (yes / edit / skip)

## Step 5 — Apply (After Approval)

When the user approves:

1. Insert the item(s) at the bottom of the correct section in the target file(s).
2. Update the `last_updated` frontmatter on every file touched (date: today as YYYY-MM-DD).
3. Do NOT commit — leave that to `spell-commit-work`.
4. Confirm what was added and where.

Output after applying:

## Added

- `[file]` → `## [Section]`: [item text]

**Next:** Run `spell-commit-work` to checkpoint, or continue the session.
