Skip to content
SprecherEast
Issue 718

tooling: Generate the screen (route) and shared-component reference from the code

Back to our plan
Done
enhancementfrontendtoolingpriority: medium

Type

enhancement

Summary

Extend the generated reference from content types to the two other things agents keep working out again: the list of screens (routes) with what each one is built from, and the shared components with their props and where they are used. Like the content-type pages, these are produced by a script and checked on every pull request.

Problem

  • There is no current list of the site's screens. docs/ui/inventory.md has one, with 172 screenshots, frozen at commit e887427 of 2026-10-21; routes have changed since (the events category pages, the paged lists).
  • docs/ui/component-set.md describes every shared component's variants and props by hand. It is the largest hand-kept document in the repo, and it drifts (#495, #517).
  • An agent that needs "which screens use this component" or "which module feeds this page" greps the code each time.

Proposed fix

Follow the decision record from the design sub-issue, and reuse the generator, the two commands and the CI job from the content-type sub-issue.

  1. docs/reference/routes.md: every page.tsx and route.ts under src/app/(frontend)/, with its URL pattern, the module entry points it imports (@/modules/<name>/server and the like), whether it is static or dynamic and its revalidate setting, and where its metadata comes from.
  2. docs/reference/components/: one page per group of src/platform/ui/ (and the shared parts of src/platform/richtext/): each exported component, its props with types, its variants, and the modules and routes that use it.
  3. docs/ui/component-set.md keeps what a script can't know (the rules every component follows, the decided choices, what to build first) and links to the generated pages in place of its props tables. docs/ui/inventory.md and the element files are marked as a dated snapshot.
  4. Tests first for the functions that render a route row and a component's props.

Go down the native-first ladder before writing an extractor (the TypeScript compiler API and an established props extractor are the first candidates) and record the findings on this issue.

Acceptance criteria

  • Not done: docs/reference/routes.md lists every route in src/app/(frontend)/, and adding a page.tsx without regenerating fails npm run docs:check.
  • Not done: Every component exported from src/platform/ui/ appears with its props, and changing a prop without regenerating fails npm run docs:check.
  • Not done: Each component's page lists where it is used.
  • Not done: docs/ui/component-set.md no longer repeats props tables, and the inventory files say when they were taken.
  • Not done: #495 and #517 are closed by this work or updated with what is left.
  • Not done: The ladder findings are recorded on this issue.

Files likely touched

scripts/ (generator and tests), docs/reference/routes.md and docs/reference/components/ (new, generated), docs/ui/component-set.md, docs/ui/inventory.md, docs/knowledge/index.md.

Must not touch

Behavior under src/, .github/ (the CI job already exists), process files.

Open questions

None for the owner.

Area

frontend, tooling

Priority

medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab