Summary\n- Integrate our new doc hygiene scripts into the existing docs githook/CI (pending PR on the githook branch).\n\nWhy\n- Keep the guide/spec consistent automatically: chapter links, SPEC/TECH-SPEC § anchors, and per-file ToCs.\n\nTasks\n- In githook branch:\n - Add pre-commit (or pre-push) hook to run:\n - python scripts/linkify_chapters.py --write --paths docs/guide\n - python scripts/linkify_refs.py --write --paths docs\n - python scripts/anchors_and_toc.py --write --paths docs\n - Re-stage modified files in the hook or fail with guidance if diffs are produced.\n- In CI (docs lint job):\n - Run the same scripts in --check mode to fail on drift.\n\nNotes\n- Scripts live under scripts/:\n - linkify_chapters.py — auto-link "Chapter N" mentions\n - linkify_refs.py — linkify SPEC/TECH-SPEC § references\n - anchors_and_toc.py — add anchors after H1–H5 and insert/update ToC\n- Scripts skip code fences, try to be conservative, and are idempotent.\n\nAcceptance\n- Hooks regenerate links/anchors/ToCs locally with no manual steps.\n- CI blocks when a contributor forgets to run hooks, with actionable output.
Summary\n- Integrate our new doc hygiene scripts into the existing docs githook/CI (pending PR on the githook branch).\n\nWhy\n- Keep the guide/spec consistent automatically: chapter links, SPEC/TECH-SPEC § anchors, and per-file ToCs.\n\nTasks\n- In githook branch:\n - Add pre-commit (or pre-push) hook to run:\n - python scripts/linkify_chapters.py --write --paths docs/guide\n - python scripts/linkify_refs.py --write --paths docs\n - python scripts/anchors_and_toc.py --write --paths docs\n - Re-stage modified files in the hook or fail with guidance if diffs are produced.\n- In CI (docs lint job):\n - Run the same scripts in --check mode to fail on drift.\n\nNotes\n- Scripts live under scripts/:\n - linkify_chapters.py — auto-link "Chapter N" mentions\n - linkify_refs.py — linkify SPEC/TECH-SPEC § references\n - anchors_and_toc.py — add anchors after H1–H5 and insert/update ToC\n- Scripts skip code fences, try to be conservative, and are idempotent.\n\nAcceptance\n- Hooks regenerate links/anchors/ToCs locally with no manual steps.\n- CI blocks when a contributor forgets to run hooks, with actionable output.