Generated from folio-assistant-sci/skills/content/folio-paper-adapter/content-block-review.md — do not edit here.

✎ Edit this page’s source

Content Block Review

Role

Systematically audit content blocks (.ts + .md + .lean triples) against project requirements and flag everything that does not conform. This is a read-only review skill — it reports problems but does not fix them.

When to Use

  • “review blocks”, “audit content”, “check blocks”, “what’s broken”
  • Before a release or major merge
  • After bulk edits to content objects
  • Periodic health checks on the content layer

Review Checklist

Run every check below for each content block. Report violations grouped by block, with severity (error / warning / info).

1. File triple completeness

CheckSeverityRule
.ts manifest existserrorEvery block must have a manifest
.md sibling existserrorEvery block (except equation/diagram) needs narrative
.lean sibling exists for definitionerrorDefinitions require Lean formalization
.lean sibling exists for theorem/lemma/proposition/corollarywarningProvable blocks should have Lean
Sibling files share the same root nameerrorfoo.ts, foo.md, foo.lean — not mismatched names
No orphan .lean fileserrorEvery .lean file MUST have a .ts manifest sibling. A .lean file without a .ts is never valid — Lean files are always part of a content triple, never standalone.

2. Label conventions

CheckSeverityRule
Label prefix matches kinderrordefinition → def:, theorem → thm:, lemma → lem:, proposition → prop:, corollary → cor:, conjecture → conj:, example → ex:, remark → rem:
Label is unique across the papererrorNo duplicate labels
Labels in uses[] resolve to existing blockserrorDangling cross-references break the dependency graph

3. Lean declaration consistency

CheckSeverityRule
lean.ref URI in .ts matches actual declaration in .leanerrorThe manifest must name the real Lean declaration (parse with parseLeanRef())
Declaration lives under the paper’s <Paper>.* namespacewarningAll project declarations should be namespaced
Naming convention followed (hyphens → underscores, correct case)warningSee AGENTS.md naming table
Block kind matches Lean construct (definition → def/structure/class, theorem → theorem/lemma)warningA definition block should not contain a theorem in Lean

4. Sorry discipline

CheckSeverityRule
Every sorry has a preceding -- Ref: [key] commenterrorUnannotated sorry is always a violation
[key] in -- Ref: exists in content/schema/references.tserrorOrphan citation keys break the reference chain
No admit or native_decide (unless justified)warningThese bypass the kernel
No axiom declarations (unless Axiom.lean)warningAxioms should be centralized

5. Markdown content quality

CheckSeverityRule
.md is non-emptyerrorEmpty narrative blocks are placeholders, not content
Math delimiters balanced ($...$, $$...$$)warningUnbalanced delimiters break LaTeX rendering
Cross-refs use [text](#label) formatinfoEnsures \hyperref conversion works
No raw LaTeX commands outside ```tex `` fences | warning | Raw \begin{tikzcd} in markdown breaks rendering

7. Dependency graph health

CheckSeverityRule
uses[] entries all resolveerrorBare labels must exist in same paper; qualified "paper-dir:label" refs are cross-paper (resolved at folio level)
No circular dependencies in uses[]errorDAG must be acyclic (cross-paper refs are leaf nodes in the local graph)
Lean imports mirror uses[] orderinginfoLean import graph should reflect narrative dependencies
Blocks with most dependents are formalized firstinfoPriority guidance, not a hard rule

8. Chapter manifest consistency

CheckSeverityRule
Every block file in the directory is referenced in the chapter .tswarningOrphan blocks won’t appear in output
Chapter .ts references only blocks that existerrorDangling block references break the build
Section ordering in chapter .ts is consistentinfoSections should follow a logical order

10. Glossary terms (:defterm / :refterm)

CheckSeverityRule
Every slug in defines: [...] has a :defterm[…]{#slug} in the block’s .mdwarningdefterm-marked rule (validator)
Every :defterm[…] slug appears in the block’s defines: [...]errordefterm-declared rule
Every :refterm[…] resolves to some block’s defines: [...]errorrefterm-resolves rule
No slug declared by more than one blockwarningdefterm-unique rule; collapse duplicates by adding interprets: to the secondary block
Bare-text mentions of known slugs are wrapped (--strict)warningterm-mention-coverage rule; run bun run validate <paper> --strict
Defined terms are not styled as plain text or \emph{} in .mdwarningDefeats the validator’s resolution graph; rewrap with the codemod

Run bun run pipeline/build-glossary.ts <paper> --check as a CI gate to catch duplicate slugs and out-of-date glossary.json. See glossary-build skill.

Output Format

Report findings as a structured summary:

## Content Block Review: <paper-name>

### Errors (must fix)
- **<block-label>** (<file>): <description>
  - Rule: <rule-id>

### Warnings (should fix)
- **<block-label>** (<file>): <description>

### Info (consider)
- **<block-label>** (<file>): <description>

### Summary
- Blocks reviewed: N
- Errors: N | Warnings: N | Info: N
- Blocks fully compliant: N / N

How to Run

Full paper review

  1. List all content blocks: use content_list MCP tool or glob content/<paper>/**/*.ts (exclude chapter/paper manifests)
  2. For each block .ts, read the manifest and check §1–§8
  3. For blocks with .lean, read the Lean source and check §3–§4
  4. For uses[] and label uniqueness, collect all labels first (§2, §7)
  5. Cross-check against content/schema/references.ts for sorry citations (§4)

Single chapter review

Same as above but scoped to one chapter directory.

Quick check (just errors)

Skip severity=info and severity=warning. Only report errors.

9. Glossary block compliance

CheckSeverityRule
Glossary blocks use remark kinderrorGlossary entries must be remark blocks, not definition
Glossary blocks have "glossary" tagwarningTag enables filtering and discovery
Label follows rem:glossary-<term> patternwarningConsistent naming for glossary entries
.md includes “Mathlib reference” sectionwarningGlossary entries must cite the canonical Mathlib type
No Lean file exists for glossary blocksinfoGlossary blocks are terminological wrappers — Lean formalization is not expected
Glossary block does not duplicate a definition blockerrorIf the paper introduces new mathematics, it belongs as a definition, not a glossary entry
Terms used in chapter .md files that are Mathlib synonyms have glossary entriesinfoCompleteness check — missing glossary entries for standard terms

Integration

  • Runs before content-validation (which does schema + AST validation)
  • Complements lean-proof-review (which focuses on proof quality, not structural compliance)
  • Feeds into proof-triage (violations of §4–§5 indicate formalization gaps)
  • Glossary blocks are reviewed under §9 for terminology consistency

folio-assistant — code under the Apache License 2.0, documentation under CC BY 3.0. Generated schema and API references are rebuilt from source on every push to main.

deployed b08c961 · 2026-10-23T23:11:09Z