/blueprint-plugin:blueprint-sync-ids --dry-run to preview changes, --link-issues to create GitHub issues for orphansfrom blueprint-plugin
Scans blueprint docs (PRDs, ADRs, PRPs, work-orders) and assigns missing IDs. Supports --dry-run preview and --link-issues for orphan docs.
Ships in blueprint-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Scan all PRDs, ADRs, PRPs, and work-orders, assign IDs to documents missing them, and update the manifest registry.
| Use this skill when... | Use blueprint-sync instead when... |
|---|---|
| You're assigning PRD-NNN / ADR-NNNN / PRP-NNN / WO-NNN to docs missing them | You want to detect modified or stale generated content (not IDs) |
You're previewing ID assignments with --dry-run | You're reconciling drift between .claude/rules/ and the manifest |
You want to create GitHub issues for orphan docs via --link-issues | Use document-linking instead for runtime cross-doc traceability |
| Flag | Description |
|---|---|
--dry-run | Preview changes without modifying files |
--link-issues | Also create GitHub issues for orphan documents |
Before any closing AskUserQuestion menu, resolve the automation config:
bash "${CLAUDE_SKILL_DIR}/../../scripts/get-automation-config.sh"
When EFFECTIVE_INTERACTION_MODE=quiet and this invocation was
automation-initiated (autopilot, session bookend, drift-nudge follow-up — not
a slash command the user typed), skip closing navigation menus ("what next?" /
"create another?" style): apply the safe default and end with a one-line
receipt instead. Quiet mode never skips confirmation gates that guard writes —
only navigation menus. A direct user invocation always behaves fully
interactively (explicit intent overrides quiet; see ADR-0020).
docs/blueprint/manifest.json exists)docs/prds/, docs/adrs/, docs/prps/, or docs/blueprint/work-orders/Check if id_registry exists in manifest:
jq -e '.id_registry' docs/blueprint/manifest.json >/dev/null 2>&1
If not, initialize it:
{
"id_registry": {
"last_prd": 0,
"last_prp": 0,
"documents": {},
"github_issues": {}
}
}
Run the helper. It owns the read-only scan: frontmatter id: extraction across
PRDs/ADRs/PRPs/work-orders, deriving the expected ADR / WO-NNN id from each
filename, flagging NEEDS_ID (no id) and id_mismatch (frontmatter id disagrees
with the filename-derived expectation), checking ids against the manifest
id_registry, and building the reverse github_issues index from it. ADRs come
from docs/adrs/, else docs/adr/, named NNNN-title.md or ADR-NNN-title.md
(else the frontmatter id: alone):
bash "${CLAUDE_SKILL_DIR}/scripts/blueprint-sync-ids.sh" --home-dir "$HOME"
Parse STATUS= and ISSUES: from the output:
PRD_NEEDS_ID / ADR_NEEDS_ID / PRP_NEEDS_ID / WO_NEEDS_ID and the
needs_id issues are the documents to assign IDs to in Step 7 (each carries
DOC= and, for ADRs/WOs, the EXPECTED= filename-derived ID).ADR_MISMATCH / WO_MISMATCH and the id_mismatch issues (HAS= vs
EXPECTED=) are documents whose frontmatter id disagrees with their filename
— reconcile these in Step 7, never silently. STATUS=ERROR indicates at least
one mismatch, duplicate, or registry conflict.ADR_DIR is the ADR directory scanned (none if absent);
ADR_FRONTMATTER_ONLY counts ADRs numbered only in frontmatter.DUPLICATE_IDS / duplicate_id (ERROR, KIND= ID= DOCS=): two documents
of one kind share a frontmatter id. Renumber one before assigning anything.REGISTRY_PRESENT is true only when the manifest has id_registry with a
documents map; when false, every registry check is skipped (counts 0).
Documents under docs/{prds,adrs,prps,trps}/ and docs/blueprint/work-orders/
are compared by the id-registry engine
(blueprint-autorun.sh --registry-reconcile --check, which writes nothing);
the rows are what the engine would change on its next reconcile:
REGISTRY_ID_ABSENT / registry_id_absent (ERROR): the entry's path exists
but its frontmatter does not carry the id (HAS= is what it carries) — a
junk entry or the old key of a re-id'd document. The engine prunes it.REGISTRY_UNREGISTERED / unregistered (WARN): the id is not in
documents. Add it in Step 7.REGISTRY_ID_PATH_MISMATCH / id_path_mismatch (ERROR): the id is
registered under another path (REGISTRY_PATH=); outside the engine's scan
set, also the path registered under another id (REGISTRY=). A swapped
pair is two rows.REGISTRY_FIELD_DRIFT / registry_field_drift (INFO): derived fields
(FIELDS=) differ from frontmatter; the engine refreshes them.REGISTRY_PATH_MISSING / registry_path_missing (ERROR): a documents
path not on disk. Step 7a removes the entry once git confirms the deletion.REGISTRY_PATH_IGNORED / registry_path_ignored (INFO): the missing path
is git-ignored (work orders) or outside a sparse checkout. Keep the entry.ADR_NUMBER_RESERVED / adr_number_reserved (INFO): a deleted ADR's entry.
Keep it: it is the only thing reserving the number
(/blueprint:adr-validate's registry check; there is no ADR counter).COUNTER_STALE / counter_stale (WARN): a last_* counter is below the
highest id of its kind on disk (MAX_ON_DISK=). Raise it before Step 7.GH_ISSUE_MAPPINGS and MANIFEST_PRESENT summarise the reverse-index build
(Step 9 detail below).REASON= names the first finding as <type>: <detail>.The audit is read-only; it makes no edits. Surface its counts as the Step 6 report and proceed to the mutating steps.
--dry-run)For each document needing an ID:
PRD and PRP ids come from the shared helper, which prints max(id_registry.last_<kind>,
highest id of that kind on disk) + 1. The counter alone can repeat an id that a
pulled or merged document already carries (#3554). Call the helper once per
document, after the previous document's id: is written, so each call sees it:
bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind PRD
bash "${CLAUDE_SKILL_DIR}/../../scripts/blueprint-next-id.sh" --kind PRP
PRDs:
blueprint-next-id.sh --kind PRD (prints PRD-NNN)---:
id: PRD-001
last_prd to the assigned number, add to documentsADRs:
0003-title.md → ADR-0003, ADR-003-title.md → ADR-003documentsPRPs:
blueprint-next-id.sh --kind PRP (prints PRP-NNN)last_prp to the assigned number, add to documentsWork-Orders:
003-task.md → WO-003documents--dry-run)The engine never removes an entry whose path is missing, because the path may
exist in another clone. For each registry_path_missing row (ID=, PATH=),
ask with AskUserQuestion whether to remove the entry, listing every row in
one question. Run this for each confirmed row, with ID, REG_PATH and
MANIFEST set:
# registry-removal:begin
# Removes the entry only when git records REG_PATH as deleted; never an ADR
# entry (it reserves the number); never touches last_* counters.
if [ -n "$(git log -1 --diff-filter=D --format=%h -- "$REG_PATH" 2>/dev/null)" ]; then
jq --arg id "$ID" '
if ($id | ascii_upcase | startswith("ADR-")) then
error("ADR entries reserve their number; keep \($id)")
else
del(.id_registry.documents[$id])
| .id_registry.github_issues |= ((. // {})
| map_values(if type == "array" then map(select(. != $id)) else . end)
| with_entries(select(.value != [])))
end' "$MANIFEST" > "$MANIFEST.removal" \
&& mv "$MANIFEST.removal" "$MANIFEST" \
|| { rm -f "$MANIFEST.removal"; echo "KEPT: $ID"; }
else
echo "KEPT: $ID — git records no deletion of $REG_PATH"
fi
# registry-removal:end
Report each KEPT: line in Step 11.
For each document, also extract:
# heading or frontmatter name/title fieldrelates-to, implements, github-issues from frontmatterStore in manifest registry:
{
"documents": {
"PRD-001": {
"path": "docs/prds/user-auth.md",
"title": "User Authentication",
"status": "Active",
"relates_to": ["ADR-0003"],
"github_issues": [42],
"created": "2026-01-15"
}
}
}
The Step 2 audit already groups the manifest's per-document github_issues
arrays into the reverse index (GH_ISSUE_MAPPINGS= reports how many distinct
issue numbers map to documents). Write that reverse index into the manifest:
{
"github_issues": {
"42": ["PRD-001", "PRP-002"],
"45": ["WO-003"]
}
}
--link-issues)For each document without github-issues:
question: "Create GitHub issue for {ID}: {title}?"
options:
- label: "Yes, create issue"
description: "Creates [{ID}] {title} issue"
- label: "Skip this one"
description: "Leave unlinked for now"
- label: "Skip all remaining"
description: "Don't prompt for more orphans"
If yes:
gh issue create \
--title "[{ID}] {title}" \
--body "## {Document Type}
**ID**: {ID}
**Document**: \`{path}\`
{Brief description from document}
---
*Auto-generated by /blueprint:sync-ids*" \
--label "{type-label}"
Update document frontmatter and manifest with new issue number.
sync-ids is a deterministic task and keeps no run state in the tracked
manifest (ADR-0027, #3548): do not write task_registry["sync-ids"]
last_completed_at, last_result or stats. The only manifest changes are
the id_registry edits made in Steps 1–10.
ID Sync Complete
Assigned IDs:
- PRD-003: docs/prds/payment-flow.md
- PRD-004: docs/prds/notifications.md
- PRP-005: docs/prps/stripe-integration.md
Updated Manifest:
- last_prd: 4
- last_prp: 5
- documents: 22 entries
- github_issues: 18 mappings
{If --link-issues:}
Created GitHub Issues:
- #52: [PRD-003] Payment Flow
- #53: [PRP-005] Stripe Integration
Still orphaned (no GitHub issues):
- ADR-0004: Database Migration Strategy
- WO-008: Add error handling
Run `/blueprint:status` to see full traceability report.
| Condition | Action |
|---|---|
| No manifest | Error: Run /blueprint:init first |
| No documents found | Warning: No documents to scan |
| Frontmatter parse error | Warning: Skip file, report for manual fix |
gh not available | Skip issue creation, warn user |
| Write permission denied | Error: Check file permissions |
After sync, manifest includes:
{
"id_registry": {
"last_prd": 4,
"last_prp": 5,
"documents": {
"PRD-001": {
"path": "docs/prds/user-auth.md",
"title": "User Authentication",
"status": "Active",
"relates_to": ["ADR-0003"],
"implements": [],
"github_issues": [42],
"created": "2026-01-10"
},
"ADR-0003": {
"path": "docs/adrs/0003-session-storage.md",
"title": "Session Storage Strategy",
"status": "Accepted",
"domain": "authentication",
"relates_to": ["PRD-001"],
"github_issues": [],
"created": "2026-01-12"
}
},
"github_issues": {
"42": ["PRD-001", "PRP-002"],
"45": ["WO-003"]
}
}
}
What SKILL.md sets; muted values are Claude Code's defaults
sonnetThree short reads, in order
35 skills in this plugin
/adr-relationshipsDomain analysis, conflict detection, and relationship validation for Architecture Decision Records. Use when creating or validating ADRs to ensure consistency./blueprint-adr-listList ADRs as a markdown table with title, status, date, domain. Use when generating an ADR index, auditing ADR status, or reviewing all architecture decisions./blueprint-adr-validateValidate ADR relationships, domain consistency, and duplicate ADR numbers. Use when auditing ADRs before release, finding broken supersedes/extends links, cycles, or number collisions./blueprint-autonomy-level3Install blueprint autonomy level 3 (ADR-0020): scheduled-autorun + approved-work-order-execution GitHub workflows. Use when enabling out-of-band blueprint automation in a repo./blueprint-autopilotRun due blueprint maintenance ambiently at autonomy level 2+. Use when a drift nudge reports blueprint tasks due or suggests /blueprint:autopilot./blueprint-claude-mdCLAUDE.md and CLAUDE.local.md from blueprint artifacts. Use when editing CLAUDE.md team instructions, converting inline content to @imports, or setting up CLAUDE.local.md.npx claudepluginhub laurigates/claude-plugins --plugin blueprint-pluginOther plugins' skills for the same job