cross-reference-discipline
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.
What this skill does
# Cross-reference Discipline (bookwright)
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.
## Header comment block (every section)
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.
## Label naming conventions
- `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.
## When to use \Cref vs prose-only
- Use `\Cref{...}` when the target label EXISTS at build time.
- Use prose-only (e.g., "chapter 17 covers this") when:
- The target chapter is not yet drafted (Plan 0 stubs aside).
- The reference is informal ("the next chapter," "the appendix").
- The reference is to an external paper (use `\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.
## Forward-reference documentation
When you write a forward ref, EITHER:
1. The target label exists in a Plan 0 stub file (chapter-level forward refs to undrafted chapters resolve to the stub's label).
2. The target is documented as "resolves in plan N" in the header comment block of THIS section AND in the plan file for the section that will define the label.
A forward ref undocumented in either place is a bug.
## Integration-check baseline
When `/bookwright:integrate` runs, it greps `book.log` for `Reference undefined`. 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.
## Cross-ref auditor
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.
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.