Handle Hugo docs information-architecture moves: discover old vs new URLs, add front matter aliases (Phase 1), update in-repo links (Phase 2), interactive List 2 resolution and fragment validation (Phase 3; no guessing). Supports PR-scoped mapping plus whole-content sweeps for inbound links to that mapping, or a full-site follow-up. Triggers on: "IA migration", "redirects for moved pages", "fix links after content move", "PR-scoped link/anchor pass", "aliases for old URLs". After branch work, chain the review-changes skill (main...HEAD) before a PR. Agents must run the in-file required procedure and definition of done, not the phases alone in isolation.
79
73%
Does it follow best practices?
Impact
—
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./.agents/skills/migrate-content-ia/SKILL.mdUse this skill when pages move or rename under content/ and you must
preserve old public URLs and/or fix cross-references. Work in phases;
choose PR-scoped vs full-site mode per run.
Read first: CLAUDE.md / AGENTS.md (URL rules, vendored areas, external
links, special cases) and hugo.yaml (permalinks, refLinksErrorLevel,
disablePathToLower). For prose and link text, follow STYLE.md; for
components, front matter, and link examples, follow COMPONENTS.md.
Related skills: research helps map moves and find inbound links; write commits minimal edits. Run this skill’s phases after the move is identified (or in parallel with research for large IA work).
Common mistake (wrong): use git diff main...HEAD (or the PR’s file
list) as the full set of places to fix links for a migration. That set shows
what moved; it is not the list of every page that points to a
moved page. Inbound stragglers are often in files the PR never touched. You
must still sweep the repo for every string in the old path and published-URL set
for this run, not only for “files in the diff.”
Definition of done (when the migration is finished): Both of the following (unless the user or AGENTS.md explicitly defers a List 2 item in Phase 3; document the deferral):
docker buildx bake validate passes for the branch, with no new
build/link errors from this work..md and equivalent ref forms),#fragment,link: /
url: / full-site URL strings,aliases on the new
canonical page, or redirects.yml sources you must not edit per policy.
(A hit on a source that is only an alias line on the new page is
expected—do not “fix” that away; distinguish alias rows from straggler
links in body or nav config.)Chaining (policy): when this branch’s content work is ready for handoff,
run the review-changes skill on
main...HEAD (or merge-base…HEAD for a different target branch) so
the whole branch is re-read for cross-page issues before opening a PR. Do
not treat phases 0–3 alone as the final check.
Run in order (mandatory for agents):
main: git diff --name-only main...HEAD; for another target:
BASE=$(git merge-base <target-branch> HEAD) then
git diff --name-only $BASE...HEAD, as in Phase 0.5). Include
renames; build the old → new table (source and published) per Phase
0.#) or List 2 (old path with #...) per
Phase 0.5.aliases), then Phase 2 (List 1), then
Phase 3 (List 2) with no guessing—as in the sections below.docker buildx bake validate. The Definition of done above is met or you have explicit
defers for the remainder.main…HEAD (or the correct base) before a PR.Use a repository search (e.g. rg / your IDE) so nothing in the
allowed scope is only eyeballed.
Trees to include (at minimum): all of content/, plus data/ and
layouts/ when a migration can appear in config, link:-like fields,
shortcodes, or hardcoded path strings. Follow Vendored / generated rules in
AGENTS.md; do not edit disallowed files.
What to search for (repeat per row in the old side of the mapping):
manuals/.../old-segment/... or ../old-segment/.../page.md as your tree
uses; include variants that still appear in the repo./admin/.../old-slug/ in front matter, nav
url:, or https://docs.docker.com/... in allowed files—match the
file’s established pattern, per Conventions below.#... belong on List 2 for Phase 3 unless the whole link is
a pure path-only case.scripts/scope-pr-files.sh (if present) prints
PR_SCOPE_FILES only—it does not replace this sweep. Use it to build
the old → new table, not to list where inbound links were fixed.
The procedure below stays in this file. If a run produces a very large
old → new URL table, store that table in reference.md in this skill
directory and link it from the task summary, so the agent reads the long
mapping only when needed.
PR-scoped (typical for a single PR)
git diff / base...HEAD to know which
pages and renames the branch actually moves (PR_SCOPE_FILES). The old →
new mapping and List 1 / List 2 for this migration are defined from
that work, not from unrelated areas.content/ (and config, shortcodes, layouts, per Conventions)—for inbound
links and fields whose target is an old path or URL in this PR’s
mapping. Inbound stragglers are often in files the PR never touched; finding
them is in scope for this migration.PR_SCOPE_FILES as a hard limit on
which files you may save for inbound link repairs (unless
project policy for a given PR says otherwise; then follow policy and
defer out-of-PR file fixes).content/strawberry/... should not “fix the whole site”; it should
still fix a link under mango/… that points at an old strawberry/… path
in the mapping, and should not chase mango/-only issues that do
not involve those old targets.Full-site (complete migration after the PR)
link: fields if policy allows.#anchor → new #…). If the user has not given an
explicit new target, ask, defer, or stop per AGENTS.md; never
infer, autocomplete, or substitute a plausible fragment from the target page’s
heading list. That rule applies in every phase, including after validation
in Phase 3.aliases (redirects)aliases are URLs that redirect to this page./), and
trailing / when that matches existing pages in the same area.data/redirects.yml, only add entries when
project policy requires it; avoid duplicating the same old URL in
aliases and redirects.yml unless maintainers do.../section/page.md) with
.md, following COMPONENTS.md examples, unless the file already
uses an established pattern (e.g. some link: or nav fields use published
paths without manuals or .md — match the surrounding file).content/manuals/... often use the full /manuals/... path; published
URLs omit the manuals segment—do not confuse the two when fixing links.ref /
relref, link fields in shortcode args, or hardcoded
docs.docker.com / path strings. Grep for old paths, slugs, and fragments
under layouts/shortcodes/ (and layouts/_default/ if partials build nav).#fragment values: after the user supplies a new fragment, it should
match the target page’s generated heading ID (Hugo slugification; see
CLAUDE.md / AGENTS.md). The agent still validates (see Phase 3) and
must not “pick” a different id from the page to replace a bad answer—No
guessing.[Text](#section-id).#fragment must still be checked against the
target file. Validate fragments in shortcodes the same way as in body
Markdown./latest/ aliases
rules—never leave two version files both owning /latest/.refLinksErrorLevel, disablePathToLower).disablePathToLower: true, filesystem path case appears in
URLs—directory and link casing must match (e.g. setup vs Setup).#fragment. That split feeds
List 1 and List 2 in Phase 0.5 and drives Phase 2 ordering (see
there).Set PR_SCOPE_FILES (Git scope for PR mode)
main, use the same triple-dot form as
review-changes:git diff --name-only main...HEADBASE=$(git merge-base <target-branch> HEAD)git diff --name-only "$BASE"...HEADcontent/ (and other trees per Conventions).Build checklists (see Modes for sweep vs area-of-work):
#... fragment (e.g. …/banana.md in the repo’s link style for that
file).#... fragment
(e.g. …/banana.md#anchor or the published-style equivalent in context). The
same old path string may appear on both List 1 and List 2 for
different links; duplication across the two lists is OK.../path/banana.md vs
root-anchored) per the conventions in this doc and the surrounding
file’s established pattern. Agents compare and skip List 2 links in the
List 1 pass using the same representation rules.Out of scope for the lists: only include references whose old target is in this run’s mapping. Do not build List 1/2 for unrelated mango/ (or other) problems unless those links also target an old path that this migration renames. Defer those issues separately (see Modes).
aliases (old published URLs)aliases for every real
former public URL..md paths). Do not apply the same bulk path replacement to
links that appear in List 2 (old path with #...) during this
sub-step—leave every List 2 link unchanged for now.content/ plus config) or print a clear list of
all remaining List 2 entries. Those links should still point at the
old path and old fragment until Phase 3.link: and similar so nav and grids are not left on old slugs. Apply the
List 1 / List 2 rules there too: path-only old references first; defer
fragment-bearing rewrites in line with List 2 until Phase 3.PR_SCOPE_FILES, per Modes. Log and defer (do not “fix”)
unrelated stragglers. If policy forbids out-of-PR file edits, defer per step 1
of Phase 0.5.Prerequisites: Phase 2 has updated List 1; List 2 still lists old
path + #... (unchanged) for this migration. See Modes for which files
may be edited; No guessing applies.
#anchor (in the
agreed representation), so nothing is hidden before the loop.old-path#oldAnchor (or process in the order the user
prefers, one at a time):
#newAnchor per
project conventions.#newAnchor (if any) exists as a real heading
/ generated id on that page, per CLAUDE.md / AGENTS.md (same rules
as the rest of the site). Do not replace the user’s fragment with a
“better” one from the file.#newAnchor not found on
the page): warn clearly (what failed: path vs missing fragment), then
ask again for a corrected path and/or fragment. Repeat until
validation passes or the user defers / drops the fragment (per
AGENTS.md). Never guess a new fragment to fix the problem.old-path#oldAnchor to the user-approved new-path#newAnchor
(respect each file’s link style; include shortcodes/layouts on the same
sweep surface as Phase 2).This skill includes a small scope helper so agents do not re-derive Git
recipes. See scripts/scope-pr-files.sh — it prints
paths in PR scope for a given target branch (default main).
docker buildx bake validateUse the Definition of done in Agent: required procedure (do not skip)
as the final bar: validate must pass, and the sweep must be clean for
plain and #fragment old-path references, or the remainder must be
explicitly deferred in Phase 3 per AGENTS.md / the user. Mid-run,
Phase 2 may still leave List 2 links unchanged until Phase 3; that
intermediate state is not the finished migration.
c0aa985
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.