Prompt file imported from mazipan/html-tools (
.claude/commands/sync-umbrella-issue.md). Fill in{{arguments}}before use. Copyright stays with the author.
Sync the umbrella issue #{{arguments}} in mazipan/html-tools so its markers and links match reality. Umbrellas drift fast โ child issues close, PRs merge, files land โ and AGENTS.md "Tracking issues" is strict that they stay honest. This command is the reconciliation pass.
If {{arguments}} is empty, ask the user which umbrella to sync. Don't guess.
-
Read the umbrella.
mcp__github__issue_readonmazipan/html-tools#{{arguments}}. Bail out early if:- The issue is closed (umbrellas should stay open while tracking work โ surface this and stop).
- The body doesn't contain the
โฌ/๐/โmarker vocabulary (it's probably not an umbrella โ confirm with the user before continuing).
-
Parse the body into a checklist. Walk every bullet that starts with one of the three markers. For each, capture:
- The raw line (for surgical replacement later).
- The item name (the text after the marker, before any parenthetical).
- The current marker (
โฌ/๐/โ). - Any linked issue / PR number (
#NN) and any file path (src/<slug>.html). - The section heading it sits under (so a missing-link search can be scoped).
Keep an in-memory list โ do not rewrite the body yet.
-
Plan with TodoWrite. One todo per bullet, plus a final "rewrite umbrella body" task. Visibility matters because the reconciliation can take a while.
-
Resolve each bullet against GitHub. For every item, run the matching probe:
- Has a linked
#NN: read it withmcp__github__issue_read(ormcp__github__pull_request_readif it's a PR โ try issue first, fall back to PR on 404). Determine state:- PR merged โ target marker is
โ. Find the canonical artifact path (for new tools,src/<slug>.html; for SEO/docs, the touched file). If the bullet doesn't already cite a path, add it. - PR open or issue open โ target marker is
๐ spec'd (issue or PR open). Keep the(#NN)link. - Issue closed as completed with no PR linked โ search
mcp__github__search_pull_requestsforrepo:mazipan/html-tools is:pr closes:#NN(or scan recent merged PRs). If a merged PR is found, treat as โ with the path; if not, flag the bullet in the report so the user can decide (don't silently flip to โ ). - Issue closed as not planned / duplicate โ target marker is
โฌ, append a short note (โ closed as not planned, #NN). AGENTS.md: "Don't leave dangling๐markers."
- PR merged โ target marker is
- No linked
#NN, marker isโฌ: searchmcp__github__search_issuesfor open issues whose title contains the item name / slug, scoped torepo:mazipan/html-tools is:open. Also searchmcp__github__search_pull_requestsfor open PRs. If exactly one strong match exists, propose flipping to๐and linking it; if multiple or ambiguous, list them in the report and leave the bullet alone. - No linked
#NN, marker isโ: trust the existing path/citation. Only re-check if the user passes a flag like--deep(skip otherwise โ these are settled).
Batch the reads where possible (multiple
issue_readcalls in a single message) to keep this fast. - Has a linked
-
Compute the diff. Build a list of
(old line โ new line)replacements. Skip bullets where nothing changed. If the diff is empty, report "umbrella already in sync" and stop โ don't write a no-op edit. -
Rewrite the body surgically. Fetch the umbrella body fresh (state may have drifted during step 4), then for each
(old, new)pair do an exact string replace โ don't reflow sections, don't normalize whitespace, don't touch bullets that didn't change. If anyoldstring no longer matches (someone edited the umbrella mid-run), abort that single replacement and flag it in the report. Usemcp__github__issue_write(update) once with the rewritten body. -
Report in a compact table or bullet list:
<section> ยท <item>:<old marker> โ <new marker>(+#NN/+path/note: โฆ).- Items that need human judgement (ambiguous matches, closed-completed without a merged PR found, mid-run conflicts).
- End with the umbrella URL and a 1-line summary (
flipped 3, linked 2, flagged 1, untouched 14).
Rules:
- One umbrella per run. If the user wants multiple umbrellas synced, call
/sync-umbrella-issueonce per umbrella โ keeps each diff scrutable. - Never invent links. If the search doesn't return a confident match, leave the bullet alone and flag it.
- Never flip
๐โโwithout a merged PR. A closed-completed issue alone isn't enough โ work only counts as shipped when code landed. - Never rewrite untouched bullets. Surgical edits only. The umbrella's history matters; don't churn it.
- No branching, no
src/edits, no commits. This command only touches the umbrella issue body on GitHub. - If the user is mid-
/plan-new-toolsor/ship, those already flip the relevant marker. This command is the periodic reconciliation pass, not a substitute for in-flow updates.
