Docs Restructuring
Why
Volume hurts only as much as structure fails. A reader who can jump straight
to the answer never meets the other 250 lines; a reader whose heading tree
lies to them must read linearly, and then every line costs. Structural failure
has recognizable shapes: a large subtree filed under an unrelated parent, one
bullet list interleaving concepts, invariants, procedures, and vendor
constraints, the same fact maintained in three places drifting apart.
The fix is placement, not prose. Developer documentation answers four
questions — understand (concepts, why it is designed this way), not break
(invariants, contracts), do (procedures), look up (reference data) — and a
reader arrives with exactly one of them. Structure serves the reader when each
section answers one question and the heading names it. See
references/intent-model.md for the model, the
defect catalog, and target patterns.
Two invariants protect the operation: every passage of the old document is
accounted for (moved, pointer-ized, or explicitly retired — never silently
dropped), and content moves verbatim — reshaping sentences is the
comment-pruning skill's job, kept out of this diff so review can verify
moves instead of re-reading everything.
Scope — and the boundary with comment-pruning
In scope: developer docs — README, docs/, contributing/architecture/setup
notes — their heading trees, section placement, splits and merges, and where
each fact canonically lives.
Out of scope:
- Per-unit tightening — shortening blocks, fixing drifted references,
deleting history narration: that is
comment-pruning. The boundary rule:
if it can be fixed inside the existing structure, prune; if the structure
itself must change, restructure. For a full overhaul run this skill first,
then prune.
- Code comments (pruning's territory), end-user content, and
generated documentation.
Execution model
Two phases separated by an approval gate. Never merge them.
Phase 1 ANALYZE (read-only) → target tree + move map → ⛔ USER APPROVAL
Phase 2 EXECUTE (move verbatim) → VERIFY move map + links → report
Phase 1 — Inventory and design
- Map the current structure. Heading tree with per-section line counts.
Oversized subtrees, mis-leveled parents, and monoliths show up here.
- Classify every passage by the question it answers (understand / not
break / do / look up). Passages answering several at once are split points.
- Decide each fact's canonical home. Precedence: the code itself → an
enforced check (test, schema, lint rule) → exactly one doc section.
Everything else becomes a one-line pointer to the home. A fact a test
already enforces is stated only at the test; the doc says what is
forbidden and which check enforces it.
- Design the target tree against the patterns and budgets in
references/intent-model.md (intent-pure
sections, heading depth ≤ 3, sibling budgets, entry-point README).
Present the plan in this fixed format, then stop for approval:
CURRENT TREE (with line counts) TARGET TREE
MOVE MAP
<old section / passage> → <destination | pointer to <home> | RETIRE (reason, where the information survives)>
...
Handed to comment-pruning afterwards: <sections needing per-unit tightening>
Phase 2 — Execute and verify
- Move verbatim. Cut and paste passages; write new glue only for heading
lines and one-sentence pointers. Resist every temptation to "improve"
sentences in passing — flag them for the pruning pass instead.
- Verify the move map ⛔ completion gate: every heading and passage of
the old document has a destination that matches the approved map. Nothing
is dropped that the map did not explicitly retire.
- Verify inbound links. Search the whole repo — docs, code comments,
templates, config — for the old paths and anchors and update them.
- Run the project's checks (formatter, markdown lint, link checkers if
present) per its task manifest.
- Commit, with the move map in the message body — it is the durable
record of where everything went.
Report
- Before/after heading trees and per-section line counts.
- The executed move map, including retirements and their justification.
- Inbound links updated (count and locations).
- What was handed to
comment-pruning for per-unit tightening.
- Out-of-scope observations — content errors, suspected bugs, candidates for
deletion. Reported, never acted on here.
Timing — when to run
Rarely — this is structural surgery, not routine grooming:
- A reader (or agent) failed to find something that was written down.
- A document's heading tree stopped predicting its content, or one section
answers several reader questions at once.
- A doc has grown monolithic and needs splitting, or duplicated facts have
started to drift.
Routine tidying after a settled change is comment-pruning, not this.
Never
- Drop a passage the approved move map did not explicitly retire.
- Rewrite prose while moving it — moves stay verbatim; tightening belongs to
comment-pruning.
- Mix code changes, or content rewrites, into a restructuring commit.
- Leave an inbound link pointing at a heading or file that no longer exists.
- Restructure end-user content or generated docs.
- Skip the approval gate between Phase 1 and Phase 2.
1---2name: docs-restructuring3description: Restructure developer documentation whose structure has failed — the heading tree no longer predicts content, one list mixes concepts with invariants and procedures, half a document sits under an unrelated parent, or the same fact is maintained in several places. Rebuild the document around the four reader questions (understand / not break / do / look up), give every fact exactly one canonical home with pointers elsewhere, and verify with a move map that no passage is lost and no inbound link breaks. Structure only — per-unit tightening of comments and sentences is the comment-pruning skill's job; run it after this one. Use when a README or docs set has grown past navigability, when readers can't find things they know are written down, or when asked to reorganize, restructure, or split documentation.4license: CC-BY-4.05---67# Docs Restructuring89## Why1011Volume hurts only as much as structure fails. A reader who can jump straight12to the answer never meets the other 250 lines; a reader whose heading tree13lies to them must read linearly, and then every line costs. Structural failure14has recognizable shapes: a large subtree filed under an unrelated parent, one15bullet list interleaving concepts, invariants, procedures, and vendor16constraints, the same fact maintained in three places drifting apart.1718The fix is placement, not prose. Developer documentation answers four19questions — *understand* (concepts, why it is designed this way), *not break*20(invariants, contracts), *do* (procedures), *look up* (reference data) — and a21reader arrives with exactly one of them. Structure serves the reader when each22section answers one question and the heading names it. See23[references/intent-model.md](references/intent-model.md) for the model, the24defect catalog, and target patterns.2526Two invariants protect the operation: **every passage of the old document is27accounted for** (moved, pointer-ized, or explicitly retired — never silently28dropped), and **content moves verbatim** — reshaping sentences is the29`comment-pruning` skill's job, kept out of this diff so review can verify30moves instead of re-reading everything.3132## Scope — and the boundary with comment-pruning3334In scope: developer docs — README, `docs/`, contributing/architecture/setup35notes — their heading trees, section placement, splits and merges, and where36each fact canonically lives.3738Out of scope:3940- **Per-unit tightening** — shortening blocks, fixing drifted references,41 deleting history narration: that is `comment-pruning`. The boundary rule:42 *if it can be fixed inside the existing structure, prune; if the structure43 itself must change, restructure.* For a full overhaul run this skill first,44 then prune.45- **Code comments** (pruning's territory), **end-user content**, and46 generated documentation.4748## Execution model4950Two phases separated by an approval gate. Never merge them.5152```53Phase 1 ANALYZE (read-only) → target tree + move map → ⛔ USER APPROVAL54Phase 2 EXECUTE (move verbatim) → VERIFY move map + links → report55```5657## Phase 1 — Inventory and design58591. **Map the current structure.** Heading tree with per-section line counts.60 Oversized subtrees, mis-leveled parents, and monoliths show up here.612. **Classify every passage** by the question it answers (understand / not62 break / do / look up). Passages answering several at once are split points.633. **Decide each fact's canonical home.** Precedence: the code itself → an64 enforced check (test, schema, lint rule) → exactly one doc section.65 Everything else becomes a one-line pointer to the home. A fact a test66 already enforces is *stated* only at the test; the doc says what is67 forbidden and which check enforces it.684. **Design the target tree** against the patterns and budgets in69 [references/intent-model.md](references/intent-model.md) (intent-pure70 sections, heading depth ≤ 3, sibling budgets, entry-point README).7172Present the plan in this fixed format, then **stop for approval**:7374```75CURRENT TREE (with line counts) TARGET TREE7677MOVE MAP78<old section / passage> → <destination | pointer to <home> | RETIRE (reason, where the information survives)>79...8081Handed to comment-pruning afterwards: <sections needing per-unit tightening>82```8384## Phase 2 — Execute and verify85861. **Move verbatim.** Cut and paste passages; write new glue only for heading87 lines and one-sentence pointers. Resist every temptation to "improve"88 sentences in passing — flag them for the pruning pass instead.892. **Verify the move map** ⛔ completion gate: every heading and passage of90 the old document has a destination that matches the approved map. Nothing91 is dropped that the map did not explicitly retire.923. **Verify inbound links.** Search the whole repo — docs, code comments,93 templates, config — for the old paths and anchors and update them.944. **Run the project's checks** (formatter, markdown lint, link checkers if95 present) per its task manifest.965. **Commit**, with the move map in the message body — it is the durable97 record of where everything went.9899## Report100101- Before/after heading trees and per-section line counts.102- The executed move map, including retirements and their justification.103- Inbound links updated (count and locations).104- What was handed to `comment-pruning` for per-unit tightening.105- Out-of-scope observations — content errors, suspected bugs, candidates for106 deletion. Reported, never acted on here.107108## Timing — when to run109110Rarely — this is structural surgery, not routine grooming:111112- A reader (or agent) failed to find something that was written down.113- A document's heading tree stopped predicting its content, or one section114 answers several reader questions at once.115- A doc has grown monolithic and needs splitting, or duplicated facts have116 started to drift.117118Routine tidying after a settled change is `comment-pruning`, not this.119120## Never121122- Drop a passage the approved move map did not explicitly retire.123- Rewrite prose while moving it — moves stay verbatim; tightening belongs to124 `comment-pruning`.125- Mix code changes, or content rewrites, into a restructuring commit.126- Leave an inbound link pointing at a heading or file that no longer exists.127- Restructure end-user content or generated docs.128- Skip the approval gate between Phase 1 and Phase 2.