migrate-docs

A command for moving an older research documentation layout into a newer thread registry. The older layout keeps plans in plans/ and experiments in exp/, while the registry organizes them into linked research threads.

In plain words
What is it for?
Use it to scan for unregistered plans, experiments, broken references, or other documentation problems. It creates a dry-run proposal and asks the user to confirm mappings before applying changes.
Why use it?
Projects with older folders may lack the records and links needed by newer research tools. The command detects mismatches and prepares a migration without guessing the project’s history.

Command

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 commands/zhyx12/projtool/migrate-docs
Clone the repo
git clone --depth 1 https://github.com/zhyx12/projtool
Per session 43 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 709 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.00043 $0.00709
Opus 5 $0.00022 $0.00354
Sonnet 5 $0.00009 $0.00142
Haiku 4.5 $0.00004 $0.00071

Measured yesterday against content hash 86e97895c6d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate-docs 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 yesterday.

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.

src/projtool/assets/project_templates/claude/commands/migrate-docs.md · 51 lines

How it starts

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

/migrate-docs — adopt an old docs layout into the registry

This project's docs may predate the registry: standing plans under plans/ and experiment scratch under exp/. This command adopts them into docs/registry/ so lineage tooling (thread_tree, edges, freezes) works. The tool never guesses history — the human confirms every decision.

Steps

  1. Scan. mcp__projtool__reconcile_docs (read-only, never raises) reports drift as findings. Present them grouped by kind, one line each: unregistered_experiment_dir, unregistered_thread_dir, unregistered_plan, invalid_record, broken_doc_ref, graph_violation, runs_index_corrupt. If it comes back clean and there are no plans/ or exp/ directories, the project is already migrated (or has nothing to adopt) — say so and stop.

  2. Dry-run. mcp__projtool__migrate_docs_layout() (no args) returns a proposal. Show it as a table:

    • threads_to_create — proposed threads, each with its source from_plan;
    • experiments — each with suggested_thread, suggestion_reason, runs_found, and suggested_status;
    • already_registered — what's left alone. The dry-run always works — dirty plan files are checked at apply time, not here.
  3. Confirm the mapping WITH THE USER. The suggested_* fields are suggestions, not decisions. Build a mapping that decides every proposed experiment — the tool refuses a partial mapping. For each <exp_slug>, the value is {"thread": <existing/proposed thread slug | thr_ id | "_scratch" | "skip">} with an optional "status" override (planned | running | finalized | abandoned). "_scratch" routes it under the built-in scratch thread; "skip" leaves it unadopted (and still counts as a decision). Walk the user through it; do not fill it in yourself.

  4. Apply. mcp__projtool__migrate_docs_layout(apply=True, mapping={...}). If it refuses because plan files have uncommitted changes, it names them — commit those first (narrow git add) and re-apply. Report the summary: created threads, imported experiments (stamped imported, with no edges and an empty frozen block — the tool never reconstructs history), runs backfilled, and plan files git-mv'd into threads/<slug>/plan.md. Then run reconcile_docs again and show it comes back clean (or exactly what remains).

Read the full file on GitHub · 51 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. yesterday First seen · 51 lines · 43 tokens per session scan A 86e97895c6d9

Subscribe to this mod's changes

migrate-docs is a command published in the GitHub repository zhyx12/projtool (1 stars, last pushed 18d ago), licensed MIT. It adds 43 tokens to every session and 709 once invoked, about $0.0002 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-31.