bookwright/skills/cross-reference-discipline/SKILL.md
Use when writing cross-referenced sections in a bookwright project. Covers the header comment block template, label-naming conventions, when to use prose-only vs Cref, forward-reference documentation, and the integration-check baseline.
npx skillsauth add queelius/claude-anvil cross-reference-disciplineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
LaTeX cross-references are mechanical. The trouble with them is that LaTeX silently emits "Reference undefined" warnings without erroring out, and over a long manuscript a single typo can cascade into chapters of broken refs that nobody notices. This skill encodes the discipline that prevents that.
Every section file starts with a comment block. Template:
% §X.Y Section Title
%
% Cross-reference resolution status:
%
% DEFINED here: labels this section creates.
% \label{sec:foo}
% \label{def:bar}
% \label{thm:baz}
%
% RESOLVED (chapter X):
% \Cref{sec:foo-prior} -- file: book/chapters/chXX/foo.tex
% \Cref{def:bar-prior} -- file: book/chapters/chXX/bar.tex
%
% FORWARD REFS (resolve in later sections/chapters):
% \Cref{sec:foo-future} -- target: ch. Y §Y.Z (this plan's Task N)
% \Cref{ch:future-chapter} -- target: ch. Z (drafted in a future plan)
Why: the cross-ref-auditor and the integration check both read these blocks. The comment is the section's contract with the rest of the book.
sec:foo-bar: section labels (kebab-case after the type prefix).def:foo-bar: definitions.prop:foo-bar: propositions.thm:foo-bar: theorems.cor:foo-bar: corollaries.lem:foo-bar: lemmas.eq:foo-bar: display equations.tab:foo-bar: tables.fig:foo-bar: figures.alg:foo-bar: algorithms.ex:chN-M: exercises (chapter N, exercise number M).ch:foo-bar: chapters.Label names should be the section/concept name in kebab-case. Avoid generic names like sec:intro or def:1 that collide across chapters.
\Cref{...} when the target label EXISTS at build time.\cite{} instead).The Bernoulli baseline of "expected unresolved refs" includes ch:composition (chapter 4 forward into Part II; chapter 6's label is ch:set-composition; never renamed) and ch:sketches (chapter 9 prose; chapter 10's label is ch:sketches-estimators). These are documented in the integration-pass record so they pass the audit.
When you write a forward ref, EITHER:
A forward ref undocumented in either place is a bug.
When /bookwright:integrate runs, it greps book.log with grep "undefined" book/book.log | grep -iE "reference|citation" (the literal string "Reference undefined" never appears in LaTeX logs). It expects the set of unresolved refs to match the documented baseline. Any UNEXPECTED unresolved ref is a FAIL.
When you add a new section, EITHER its labels resolve immediately (the section file defines them) OR you add the labels to the documented baseline as expected forward refs in the integration-pass record.
The cross-ref-auditor agent reads section header comment blocks and verifies them against actual \label{} declarations and \Cref{} invocations. Run it after drafting if you want to catch issues per-section.
tools
This skill should be used when the user asks about research directions, open problems, future work, or follow-up research from the academic literature. Trigger phrases include "open problems in X", "what's next for Y", "future work for paper Z", "research directions on T", "salient follow-up research", "what should I work on next in", "find me follow-up research unrelated to my prior work", "broad survey of W", "neglected directions in V". Routes the request to the right Vista MCP tool, reads back the structured paper sections, and synthesizes research directions in the conversation.
testing
Discover latent themes in the metafunctor corpus. Use when the user wants to find implicit through-lines across their blog posts, surface recurring ideas they have not consciously framed as a series, or get candidate themes for a synthesis post. Reads titles, descriptions, and tags; proposes 3 themes that connect 4+ posts each, each with a single-sentence through-line. Output is a proposal, not a draft. Trigger phrases include "find themes in my posts", "what threads connect my writing", "latent themes in my corpus", "scribe".
development
Use when drafting prose sections for a bookwright (technical non-fiction) project. Encodes the Bernoulli-textbook workflow: atom-outward design, deferral discipline, running threads, page budgets, Path A subagent pattern, header comment block convention.
testing
Use when drafting or executing a paired notebook for a bookwright chapter. Covers when notebooks are required vs optional, numerical-sanity-target convention, exec-from-fresh-kernel requirement, and stack-specific execution commands (Jupyter/R Markdown/Quarto).