Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

update-doc-references

FreeNo executable scriptsNot checked

Analyze source-file changes referenced by documentation, update affected docs when needed, and report documentation reference updates for a PR.

AztecProtocolby AztecProtocol★ 458 GitHub stars

About this skill

Update Documentation References

When source files referenced by documentation change, analyze the changes and update the affected documentation if needed.

The docs live in this repository's docs/, in two lines that each have their own copy of every developer and operator page (docs/CLAUDE.md, "Two dev lines: change both"). Most of the code they document is aztec-node's: main's pages describe aztec-node main at the commit docs/aztec-node.json pins, read through a checkout of it (docs/.aztec-node/tree, or $AZTEC_NODE_DIR), and the v6 line's pages (docs/lines/v6/) describe aztec-node v6 at the commit docs/lines/v6/aztec-node.json pins, read through docs/lines/v6/.aztec-node/tree. node docs/scripts/aztec_node.mts fetch keeps both. A page's frontmatter references names paths from this repository's root: labs/<path in aztec-node> for Labs code, where the labs/ prefix names the checkout of the page's line and never the labs/ submodule, and plain paths for this repository's own files (docs/examples/..., docs/lines/v6/examples/...). A reference ending in /* covers every file under that directory.

Workflow

Step 1: Parse the Prompt

The dispatcher is offline, so the skill runs by hand: it needs only the PR number and its repository, and Step 3 finds the pages the PR's files reach. A dispatch prompt gives:

  • the PR number and its repository: aztec-labs-eng/aztec-node for Labs code (the usual case), AztecProtocol/aztec-packages for this repository's own files
  • the PR title
  • the changed references (format: source_file -> doc1, doc2; ...)
  • the reply thread link, if the dispatch gives one (Step 7)

Step 2: Get the Changes

For a PR:

gh pr view <PR_NUMBER> --repo <REPO> --json title,body,baseRefName,files,url
gh pr diff <PR_NUMBER> --repo <REPO>

An aztec-node PR names paths from aztec-node's root: prefix them with labs/ to compare them with references.

Each line's pages describe the code at that line's pin. The PR's base branch (baseRefName: main or v6) says which line to start with, not which lines it reaches: test its merge commit against every pin (an unmerged PR is in none):

cd "$(git rev-parse --show-toplevel)"
merge=$(gh pr view <PR_NUMBER> --repo aztec-labs-eng/aztec-node --json mergeCommit -q .mergeCommit.oid)
for pinfile in docs/aztec-node.json docs/lines/*/aztec-node.json; do
  echo "$pinfile: $(gh api "repos/aztec-labs-eng/aztec-node/compare/$merge...$(node -p "require('./$pinfile').commit")" --jq .status)"
done

ahead or identical means that line's pin has the change, so its pages may need it. A line whose pin lacks it gets no edit that quotes the new code: report what its pages will need when its pin moves. Then compare the symbol or behaviour the pages document in both checkouts, and edit each copy whose checkout has it (Step 5): a main PR can fix behaviour v6 shares, and a page that is wrong about code both lines have is wrong in both copies.

When the change is a move of a pin rather than a PR (node docs/scripts/aztec_node.mts [--line <line>] pin <tag>), the pages it reaches come from the line's two pin commits. Run this once per line whose pin moved, after check passes:

cd "$(git rev-parse --show-toplevel)"
docs/scripts/pin_doc_references.sh   # the v6 line's: docs/scripts/pin_doc_references.sh --line v6

It prints <reference> -> <page>, <page> for each labs/ reference whose files differ between the line's pin at git merge-base origin/next HEAD and its pin now. Pass the old commit as an argument when the base is another (a release cut does). That list is Step 3's mapping. stderr names both commits and the checkout, so read one reference's change with:

git -C "$AZTEC_NODE_DIR" diff <old> <new> -- <reference without labs/ and /*>

AZTEC_NODE_DIR is the line's checkout: eval "$(node docs/scripts/aztec_node.mts [--line v6] env)" exports it. The pin file also names the toolchain: when bb, noir or l1Artifacts moved, say so in the report, since the examples and the Solidity snippets follow them.

Step 3: Identify Affected Documentation

The prompt lists which source files changed and which docs reference them. Confirm the mapping from the docs' frontmatter, from the repository root, once per line (the library scans a line's docs-developers, docs-operate, docs-participate and docs, never the versioned snapshots):

cd "$(git rev-parse --show-toplevel)"
source docs/scripts/lib/extract_doc_references.sh
map=$(mktemp) changed=$(mktemp)
gh pr view <PR_NUMBER> --repo aztec-labs-eng/aztec-node --json files -q '.files[].path' |
  sed 's|^|labs/|' >"$changed"
for root in docs docs/lines/*; do
  extract_references_mapping "$root" "$map"
  changed_references "$map" "$changed"
done

Each line is <reference> -> <page>, <page>, as pin_doc_references.sh prints for a pin move, which needs no other mapping. For a PR of this repository drop the sed. R

Full SKILL.md on GitHub

Install update-doc-references in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

FAQ

What does the update-doc-references skill do?

Analyze source-file changes referenced by documentation, update affected docs when needed, and report documentation reference updates for a PR.

How do I install the update-doc-references skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the update-doc-references skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare update-doc-references with