Repository navigation
docs(cli): describe page templates by structure so build can find them - #5615
Merged
Merged
Conversation
`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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
ernestt
requested review from
cixzhang,
imdreamrunner and
josephfarina
as code owners
August 27, 2026 21:55
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: 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]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rewrites all 46 page template
descriptionfields so they describe what makes a template structurally unlike its siblings, rather than the sample data it happens to ship with.descriptionis 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 orcategoryactually improved precision. Most descriptions weren't doing that work: the mean was 17 words, seven were under eight, andtableshipped'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.
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:
Domain nouns are demoted to interchangeable examples rather than identity — listing several signals that none is definitional. Siblings now state what separates them:
mixed-galleryis "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:
SYNONYMSmap discounts to 43, under the 50-point floor a token needs to count in a multi-word query, so relying on it scores nothing.s|es|ing|ed|ies.-ableand verb forms are disjoint.resizableandresizenever match each other, norcollapsible/collapseordraggable/drag. Where a behaviour is load-bearing, both forms appear.page,view,app,screen,side,bigare discarded before scoring.Measurements
36-query battery, same template set:
maintodayTwo 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
template.doc.mjsfiles load and typecheckastryx template --list/template <name>render the new textCaveats
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-showcasestill has nocategory, 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.