migrate-documentation

Reorganize an existing documentation tree with resumable, verified, git-history-preserving migrations.

2|Updated Jul 18, 2026
One-click install
npx skills add https://github.com/Arasz/ai-badger --skill migrate-documentation-arasz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: migrate-documentation
Source: https://github.com/Arasz/ai-badger/tree/main/features/common/skills/documentation/references/migrate-documentation
Command: npx skills add https://github.com/Arasz/ai-badger --skill migrate-documentation-arasz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Large documentation trees decay into hundreds of unstructured, overlapping, and contradictory files that nobody can navigate or trust. Reorganizing them wholesale is risky: moves break links, rewrites destroy git history, unverified legacy claims get carried forward as fresh truth, and multi-day work is lost when a session is compacted. This Skill runs a phased, resumable migration whose terminal deliverable is documentation someone can trust, not merely a tidy tree. ## Core Features & Use Cases - Resumable state machine: All migration state lives in a committed state file (never the todo list), so any session can resume by reading the current phase, the n/total count, and the single in-progress item. - History-preserving moves: Files move via git mv in rename-only commits with recorded old-to-new edges, keeping git log --follow intact and answering for referrers nobody can edit. - Evidence and drain gates: Claims carried forward require verified evidence=<path>:<line> citations, and a legacy file is deleted only when its drain report shows residual == 0 and every processedto target resolves. - Optional tool extension: A config-gated ledger extension binds each gate to a <docs.tool> subcommand (link-check, freeze, trust, drain, record) when the project configures docs.tool. - Use Case: A repository has 300 files under docs/ with no structure and unknown accuracy. The skill inventories and classifies every path, freezes build-pinned files, moves documents in reviewable batches, extracts content one section per commit, and only deletes legacy files after a verifiable drain report. ## Quick Start Ask the agent to migrate the docs directory into the canonical documentation tree, resuming from the migration state file if one exists.

Frequently Asked Questions about migrate-documentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I migrate a large documentation tree without breaking links?

Run a link check and derive a freeze list before any file moves, then move files with git mv in rename-only commits of roughly 15 files per PR. Record each old-to-new edge so referrers you cannot edit still resolve, and re-run the link check after every batch.

How do I resume a documentation migration after a session ends?

Read the migration state file committed in the docs tree's meta area before anything else. It records the current phase, the n/total count, and the single in-progress item, which is all the context a resumed session needs.

When should I use migrate-documentation versus scaffold-documentation?

Use migrate-documentation when a documentation tree already exists and must be reorganized, verified, and drained. Use scaffold-documentation only to create a tree that does not exist yet, and update-documentation for a single documentation change.

Why does the migration forbid deleting a legacy file in the same PR as its replacement?

Separating deletion from replacement keeps the content transfer reviewable as a readable diff. A legacy file is deleted only after a drain report shows residual == 0 and every processedto target exists and contains the expected span id.

Can I batch multiple files or sections to finish the migration faster?

No. The skill processes exactly one item at a time and one top-level section per commit, with the state file cursor updated in the same commit. Batching is how a compaction lands mid-batch and nobody can tell what transferred.

What are the limitations of automated scripts in a docs migration?

Scripts handle checkable steps like link resolution and drain counts, but must never perform Diataxis classification, fact verification, amendment reasoning, or drain decisions. Scripting judgement steps produces plausible text that passes review without being correct.