Skip to content

docs(cli): describe page templates by structure so build can find them - #5615

Merged
ernestt merged 3 commits into
mainfrom
feat/template-descriptions
Aug 28, 2026
Merged

ernestt merged 3 commits into
mainfrom
feat/template-descriptions

Conversation

@ernestt

@ernestt ernestt commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Rewrites all 46 page template description fields so they describe what makes a template structurally unlike its siblings, rather than the sample data it happens to ship with.

description is the field that carries retrieval. A 36-query field ablation put top-1 at 15/36 with descriptions and 9/36 without — the largest contribution of any field, larger than name and category combined. Removing auto-extracted keywords or category actually improved precision. Most descriptions weren't doing that work: the mean was 17 words, seven were under eight, and table shipped 'Data table with actions'.

Describe the shape, not the fixture

The first pass leaned on content-type nouns, and review feedback correctly killed it: data is interchangeable, so it can't be the differentiator.

- 'Order detail page with timeline and line items'
-
- # first pass — still describing the fixture
- 'Single order record detail for fulfilling a purchase: customer and address
-  summary, line items with quantities, totals with discount, shipping and tax…'
+
+ 'Single-record detail in two columns: a summary header with status and actions,
+  a repeating line-item list, a totals block that sums it, and a chronological
+  activity timeline in the rail. The shape for any record holding children plus
+  a history — a customer order with shipping, an invoice, a transaction, or a job.'

Someone building an invoice, a shipment or a job record needs exactly that layout, and would never have matched the first two. Descriptions now differentiate on four structural lenses:

lens vocabulary
layout split, centered, two-column, rail, stacked, masonry, asymmetric
container modal, panel, card, drawer, inline, full-bleed
data shape flat rows, grouped, hierarchical, time series, single record
behaviour drag, resize, collapse, filter, drill down, step through

Domain nouns are demoted to interchangeable examples rather than identity — listing several signals that none is definitional. Siblings now state what separates them: mixed-gallery is "variable-height tiles that pack against each other instead of cropping to a shared ratio, unlike the uniform gallery"; table-page "sits between the bare table and the filtered one".

Written against the scorer

Descriptions match on a stemmed whole word for 50 points, which forces five things:

  1. Spell out synonyms. The SYNONYMS map discounts to 43, under the 50-point floor a token needs to count in a multi-word query, so relying on it scores nothing.
  2. Base forms — the stemmer only strips s|es|ing|ed|ies.
  3. -able and verb forms are disjoint. resizable and resize never match each other, nor collapsible/collapse or draggable/drag. Where a behaviour is load-bearing, both forms appear.
  4. Don't spend words on stopwords — page, view, app, screen, side, big are discarded before scoring.
  5. Leave component names out. They're already in the keyword pool, which measures net-negative.

Measurements

36-query battery, same template set:

top-1 top-3 MRR false-confident
main today 15/36 23/36 0.509 8/36
#5614 alone (scoring fix) 17/36 26/36 0.574 6/36
noun-led descriptions 21/36 32/36 0.704 9/36
this PR alone 22/36 32/36 0.727 10/36
this PR + #5614 32/36 32/36 0.889 2/36

Two things worth reading off that table.

Descriptions alone make false-confidence worse (8 → 10). Richer text pushes more candidates over the confidence gate, including the wrong ones. #5614 is what converts the extra signal into precision, taking it to 2/36. These two want to land together; this one alone is a partial win.

Structural descriptions are worth far more than noun-led ones once the scorer is fixed — 32/36 versus 23/36 top-1. That isn't a coincidence. Structural vocabulary is what a builder types when they don't know the template name, and the fixed aggregation rewards matching many query terms, which is exactly what a description of layout and behaviour does.

Test plan

  • All 46 template.doc.mjs files load and typecheck
  • astryx template --list / template <name> render the new text
  • Full pre-commit gate green
  • Retrieval battery re-run in all five configurations above

Caveats

Read 32/36 as optimistic. The battery is one author's 36 queries, so absolute rates describe the battery rather than a population — and after the first structural pass I revised 8 of the 46 entries having looked at which queries failed, which is fitting to the test set. The unbiased structural number is nearer 29/36. What I'd defend is the ordering and the mechanism: structure-led beats noun-led, both beat what's on main, and the ablation is what establishes that descriptions carry the load in the first place.

theme-showcase still has no category, which the naming convention now asks for. Left alone to keep this PR to descriptions.

The convention is written up on the Contributing Templates wiki page, and rubric §5b scores against it.

`description` is the only template metadata field that carries retrieval
weight it hasn't already earned elsewhere. A 36-query field ablation put
top-1 at 15/36 with descriptions and 9/36 without — the largest single
contribution of any field, and larger than name and category combined.
Most descriptions weren't doing that work: the mean was 17 words, seven
were under eight, and `table` shipped "Data table with actions", which
is three content words for the most-requested archetype in the catalog.

Every page description now follows the same four slots:

  archetype     what kind of surface, in a builder's words
  job           the verb — what someone is actually doing here
  distinctive   the 3-5 nouns that separate it from its siblings
  synonyms      the other words people literally type

Written against the scorer rather than for prose. Descriptions match on
a stemmed whole word for 50 points, so: synonyms are spelled out (the
SYNONYM map discounts to 43, under the 50-point floor that lets a token
count in a multi-word query, so relying on it scores nothing); words are
in base form; stopwords like "page", "view" and "app" are not spent; and
component names are left out, since those are already in the keyword
pool. The long entries were cut, not extended — `dashboard-project-status`
went from 79 words to 34, because a description that mentions everything
matches everything.

Measured over the same 36-query battery: top-1 15->21, top-3 23->32,
MRR 0.509->0.704. Mean length 17.4 -> 27.3 words, none under eight.

Co-authored-by: Cursor <[email protected]>
@vercel

vercel Bot commented Aug 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 27, 2026 10:26pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 27, 2026
@github-actions

github-actions Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

Review feedback on the first pass: the differentiator slot was leaning on
content-type nouns, and data is interchangeable. "Customer and address
summary, line items with quantities, totals with discount, shipping and
tax" describes the fixture `detail-page` happens to ship, not the
template. Someone building an invoice, a shipment or a job record needs
exactly that layout and would never match it, while the words carry no
information about what makes it unlike its siblings.

Descriptions now differentiate on four structural lenses:

  layout      split, centered, two-column, rail, stacked, masonry
  container   modal, panel, card, drawer, inline, full-bleed
  data shape  flat rows, grouped, hierarchical, time series, one record
  behaviour   drag, resize, collapse, filter, drill down, step through

Domain nouns are demoted to interchangeable examples rather than the
identity: `detail-page` is now "the shape for any record holding
children plus a history — a customer order with shipping, an invoice, a
transaction, or a job". The noun is illustration, the structure is the
claim, and listing several signals that none is definitional.

This also matches how the retrieval actually behaves. Structural
vocabulary is what a builder types when they don't know the template
name ("collapsible sections with an inspector", "a collapsible left
rail"), and stacked with the scoring fix it is worth far more than
domain nouns were: 32/36 top-1 against 23/36 for the noun-led pass.

Measured over the 36-query battery:

  main today                       top-1 15  top-3 23  MRR 0.509  false-conf 8
  noun-led descriptions            top-1 21  top-3 32  MRR 0.704  false-conf 9
  structural descriptions          top-1 22  top-3 32  MRR 0.727  false-conf 10
  structural + scoring fix (#5614) top-1 32  top-3 32  MRR 0.889  false-conf 2

Descriptions alone raise false-confident results, because richer text
pushes more candidates over the gate; #5614 is what converts that into
precision. The two want to land together.

Co-authored-by: Cursor <[email protected]>
@ernestt ernestt changed the title docs(cli): rewrite page template descriptions so build can find them docs(cli): describe page templates by structure so build can find them Aug 27, 2026
github-actions Bot added a commit that referenced this pull request Aug 27, 2026
@ernestt
ernestt merged commit 8e2751b into main Aug 28, 2026
24 of 25 checks passed
@github-actions
github-actions Bot deleted the feat/template-descriptions branch August 29, 2026 06:19

This branch was successfully deployed

1 active deployment
Preview — 76f64c22 Deployed Aug 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant