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

# Spell — Adopt Docs

## At a glance

| Field | Value |
| --- | --- |
| Invoke as | `/spell-adopt-docs` |
| Argument | Optional path to the tree to adopt (defaults to the repository root). Add `--apply` only after reviewing a dry run. |
| Agent | agent |
| When to use | Use PROACTIVELY when bringing an existing, ungoverned doc tree under Arcane governance. |

## Executive Summary

- This spell adopts a folder of documents that already exists, rather than
  scaffolding a new one.
- It **never moves, renames, or deletes anything until you approve a specific
  written mapping** — the default run is read-only.
- It works with `subject_root: "."`, so a tree that already lives at the
  repository root is adopted where it is. Restructuring is offered, never
  required.
- Every mutating phase states its rollback before it runs.
- In a repository marked `content_sensitivity: sensitive`, the inventory records
  paths and shapes, never document contents.

---

## Preconditions

Stop and report, without changing anything, if any of these fail:

1. **`.arcane.json` exists.** If not: "Run `spell init` first — adoption needs a
   profile and a subject root to map into."
2. **The working tree is clean** (`git status --porcelain` is empty). Adoption's
   rollback story is "revert the commit"; that only works from a clean baseline.
   Report the dirty paths and stop.
3. **The target path exists and is inside the repository.** Reject absolute
   paths and anything resolving outside the repo root.

Read, in order: `.arcane.json` (for `subject_root`, `content_sensitivity`,
`profile`), then `.arcane/governance/records-conventions.md`, then
`.arcane/governance/naming-conventions.md` if installed.

## Phase 1 — Inventory (always read-only)

Walk the target tree and build a picture of what is actually there. Do not open
a document to summarize its subject matter; classify from path, name, extension,
and size.

Report:

- **Total counts** by extension, and total size.
- **Depth and shape** — how deep the tree goes, which directories hold the bulk.
- **Naming patterns observed** — dated (`2024-03-01-...`), numbered, free-form,
  or mixed. Report what you see; do not judge it yet.
- **Collisions with Arcane's own layout** — anything already at `TODO.md`,
  `DECISIONS.md`, `IDEAS.md`, `README.md`, `journal/`, `.arcane/`, `.github/`,
  `.claude/`. These are the only paths where adoption could overwrite something.
- **Files Git will treat as binary** under the installed `.gitattributes`, and
  any that are large enough to be worth an explicit LFS decision later.
- **Anything unreadable** — permission errors, broken symlinks, zero-byte files.
  Report them; never silently skip.

**If `content_sensitivity` is `"sensitive"`:** the inventory is paths, counts,
extensions and sizes only. Do not quote filenames that are themselves revealing
in the session summary — say "12 files under `clients/`", not the list — and do
not open documents to characterize their contents.

## Phase 2 — Propose a mapping

Produce a written proposal. This is the artifact the operator approves, and it
must be specific enough that they can predict every effect.

For each group of files, state one of:

| Disposition | Meaning |
|---|---|
| **Leave in place** | No move. The default, and the right answer for most trees. |
| **Move** | Old path → new path, explicitly, per file or per directory. |
| **Rename** | Old name → new name, with the rule that produced it. |
| **Ignore** | Added to `.gitignore` rather than governed. |
| **Flag** | Needs an operator decision this spell will not make (see below). |

Always also state:

- **What `subject_root` will be** afterwards, and whether adoption changes it.
  If the tree is already at the repository root, propose `"."` and say plainly
  that this means no restructuring.
- **Which collisions from Phase 1 you propose to resolve, and how.** Never
  propose overwriting an existing `TODO.md`/`DECISIONS.md`/`README.md`; propose
  merging or leaving the operator's file untouched.
- **What will NOT be touched** — an explicit list is part of the proposal, not
  an omission from it.

Flag rather than decide:

- Anything that looks like credentials, keys, or personal data.
- Anything suggesting a retention obligation (contracts, filings, tax records)
  — see `records-conventions.md`; deletion and relocation of those is an
  operator decision.
- Superseded-looking duplicates (`final-v2-FINAL.docx`). Propose the tombstone
  convention from `records-conventions.md`; do not pick a winner.

End with: **"Approve this mapping? (yes / edit / cancel)"** and stop. A dry run
ends here, always.

## Phase 3 — Apply (only after explicit approval, and only with `--apply`)

Apply in the order below. Each step states its rollback *before* it runs, and
each step is a separate commit. Revert them in reverse order — reverting an
earlier phase while a later one still stands will conflict, because the later
phase built on the paths the earlier one created.

1. **Write `subject_root` to `.arcane.json`** (if it changes).
   *Rollback: revert the commit; no files moved yet.*
2. **Add ignore entries** for anything dispositioned "Ignore".
   *Rollback: revert the commit; files are untouched on disk either way.*
3. **Renames**, using `git mv` so history follows the file.
   *Rollback: revert the commit. If a rename collides with an existing path,
   stop the whole phase — do not overwrite, do not continue to step 4.*
4. **Moves**, using `git mv`, deepest paths first so parent directories are
   never removed out from under a pending move.
   *Rollback: revert the commit.*
5. **Tombstones** for anything the operator confirmed as superseded, per
   `records-conventions.md`.
   *Rollback: revert the commit; original content was never deleted.*

Hard rules for this phase:

- **Never delete a document.** Adoption moves, renames, and marks. Deletion is a
  separate, explicit operator decision (`records-conventions.md`).
- **Never overwrite an existing file.** On any collision, stop and report.
- **Stop at the first failure.** Do not attempt partial recovery mid-phase —
  report what completed, what did not, and the exact `git revert` command for
  each commit already made.
- If the repository is `content_sensitivity: sensitive`, commit messages name
  paths and counts only, never contents.

## Phase 4 — Report

**Action required — what only the operator can do.** When this run leaves an action that only the operator can take, report it in one block at the very top of the final report, before every other section and before any optional next step. The block exists because these are the operator's decisions to make, not because the agent is stuck: write it as a hand-off of authority, never as a plea for help. Frame it with a horizontal rule above and below, so it stands apart in a terminal as well as on a rendered page:

```markdown
---

## 🚧 Action required

**Now**

- <exactly what to do: the command, the link, or the question> — <why only the operator can do it>

**When you're at your desk**

- <exactly what to do> — <why only the operator can do it>

---
```

- **What belongs in it:** an action only the operator can take — approving or merging a pull request, accepting a decision record, answering a question the work is waiting on, confirming a `guarded` push, running an interactive command such as `spell unblock-push`, or a step on an external platform the agent cannot reach. An optional suggestion, a next spell to run, or anything the agent could do itself is not a required action and stays out of the block.
- **Two tiers, one block.** **Now** holds what the work is not correct or complete without. **When you're at your desk** holds what only the operator can do but that can wait: a permission rule, a leftover remote branch, a credential to set up. Leave out a tier that has nothing in it; never split the tiers into two blocks.
- **One line per action.** Say exactly what to do, then, after the dash, why only the operator can do it. Write the command, link or question out in full; never point elsewhere with "see above".
- **Never only among optional steps.** An action required for correctness is never listed only under next steps, suggestions, `Carry Forward` or `What's Next?`. It may be repeated there, but it always appears in this block.
- **Done items stay, struck through.** Within one session, once an item has been listed, keep it in every later report of the block; when the operator has done it, strike it through (`~~<the line>~~`) rather than dropping it, so progress shows and nothing disappears silently. The session's close carries only the open items forward.
- **Omit it when empty.** When nothing is left for the operator and nothing was struck through this session, leave the block out entirely: no heading, no rules and no "None" line.
- **Every final report.** The block belongs in whatever report ends the run, including a report written when the spell stops early.
- **Report the Now tier to the presence channel.** When the **Now** tier has open items, also run `spell presence report --status waiting --required-action "<line 1>" --required-action "<line 2>"`, one flag per open line of that tier; the other tier is not blocking and is not reported. With no presence channel configured on this machine the command prints nothing and exits 0, so the block itself and the rest of the run are unchanged.
- Enforcement: explicitly advisory prose ([ARC-023](https://github.com/codemagicianhq/arcane/blob/v1.24.1/DECISIONS.md#arc-023--normative-controls-require-inline-enforcement-contracts)) — no check reads a spell's actual output for this block; it holds by these instructions alone.

Output:

```
Adopted <N> files under {SUBJECT_ROOT}

Moved      <n>   (commit <sha>)
Renamed    <n>   (commit <sha>)
Tombstoned <n>   (commit <sha>)
Left as-is <n>
Ignored    <n>
Flagged    <n>   — needs your decision, listed below
```

Then list every flagged item with the decision it needs. Finish with the
suggested next step: `spell-todo` to capture the flagged decisions, or
`spell-commit-work` if anything remains uncommitted.

## Related

- [Records Conventions](/docs/reference/records-conventions) — supersession and retention
- [Git Conventions](/docs/reference/git-conventions) — branch and merge discipline
- [Universal Agent Rules](/docs/reference/universal-agent-rules) — sensitive-repository behaviour
