tooling: Generate the screen (route) and shared-component reference from the code
Back to our planType
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.mdhas one, with 172 screenshots, frozen at commite887427of 2026-10-21; routes have changed since (the events category pages, the paged lists). docs/ui/component-set.mddescribes 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.
docs/reference/routes.md: everypage.tsxandroute.tsundersrc/app/(frontend)/, with its URL pattern, the module entry points it imports (@/modules/<name>/serverand the like), whether it is static or dynamic and its revalidate setting, and where its metadata comes from.docs/reference/components/: one page per group ofsrc/platform/ui/(and the shared parts ofsrc/platform/richtext/): each exported component, its props with types, its variants, and the modules and routes that use it.docs/ui/component-set.mdkeeps 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.mdand the element files are marked as a dated snapshot.- 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.mdlists every route insrc/app/(frontend)/, and adding apage.tsxwithout regenerating failsnpm run docs:check. - Not done: Every component exported from
src/platform/ui/appears with its props, and changing a prop without regenerating failsnpm run docs:check. - Not done: Each component's page lists where it is used.
- Not done:
docs/ui/component-set.mdno 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