feat(shadcn): production catalog — 32 components, 48 rules, 14 worked examples - #35
Merged
Conversation
… examples Grows the canonical shadcn/ui contract from a demonstration vocabulary (8 components, 2 intents, 8 rules, 2 examples) into the first production-quality governed catalog for the ecosystem. Vocabulary: +24 components / +67 sub-components covering the families a real product screen needs — form controls (label, textarea, checkbox, switch, radio-group, select), form structure (field, form), feedback (alert, progress, skeleton, spinner, sonner), navigation (tabs, breadcrumb, pagination), overlays (popover, tooltip, sheet), and layout/content (separator, avatar, accordion, scroll-area, aspect-ratio). 152 props, 226 constraints, accessibility blocks on 31 of 32, authored against the shadcn registry source and Radix primitives rather than recall — several entries correct facts that are easy to get wrong (Separator's shipped default is decorative=true / role=none; Popover has no Title/Description ARIA wiring unlike Dialog; Tooltip is absent on touch and can never be a control's accessible name; TooltipProvider is genuinely required). Governance: 11 intents (the 2 shipped ones verbatim, +9 covering structured input, preference settings, record detail, overlay task, panel navigation, wayfinding, supplementary detail, status feedback, loading state) and 48 rules, each carrying an authored rationale that names a concrete failure mode. 24 of 32 components are named by at least one rule; 9 of 11 intents carry scoped rules; every intent has at least one worked example. Corpus: 14 worked examples, one or more per intent, every one S1/S2/S3 clean and reachable by the constrained decoder. They are simultaneously the few-shot corpus and the proof the governance is satisfiable. Verified: node scripts/validate.mjs PASSES (schema, back-compat, governance consistency, category membership, example reference resolution); all 14 examples lint S1/S2/S3 with zero errors; a 14-mutation fail-first pass proves the green run is not vacuous. Two authored defects were caught by adversarial verification before landing: a forbidden-composition rule with no forbidden* key (schema- invalid) and nine rules scoped too narrowly to reach the intents their components serve. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Grows the canonical shadcn/ui contract from a demonstration vocabulary (8 components, 2 intents, 8 rules, 2 examples — 70 KB) into the first production-quality governed catalog for the ecosystem (32 components, 11 intents, 48 rules, 14 examples — 459 KB).
What is in it
New families: form controls (label, textarea, checkbox, switch, radio-group, select), form structure (field, form), feedback (alert, progress, skeleton, spinner, sonner), navigation (tabs, breadcrumb, pagination), overlays (popover, tooltip, sheet), layout/content (separator, avatar, accordion, scroll-area, aspect-ratio). Plus 5 new categories and the popover token pair.
Authored against the shadcn registry source and the Radix primitives, not recall. Several entries correct facts that are easy to get wrong and expensive to miss:
decorative=true, so its default isrole="none"— invisible to assistive tech.aria-labelledbymust be hand-wired.aria-describedby— so it can never be a control's accessible name.Governance
48 rules, each with an authored rationale naming a concrete failure mode. 24/32 components are named by ≥1 rule; 9/11 intents carry scoped rules; every intent has ≥1 worked example.
Scoping was treated as load-bearing, not cosmetic:
appliesTofilters enforcement, not just prompt text (rules.tsskips out-of-scope rules in S3), so a rule scoped too narrowly silently deletes governance. Three rules are deliberately universal — the naming floor true of every surface.Verification
node scripts/validate.mjsPASSES — schema, back-compat, governance consistency, category membership, example reference resolution.buildGenerationSchemafor its intent, so the few-shot corpus is reachable by a constrained decoder.Adversarial verification caught two defects before they landed: a
forbidden-compositionrule with noforbidden*key (schema-invalid as written), and nine rules scoped too narrowly to reach the intents their components serve.Known limits, recorded honestly
subComponentDescriptorhas noprops, and S2 rejects them). This makes the strongest constraints in this vocabulary inexpressible — trigger↔panel value pairing,hrefon every crumb,alton AvatarImage. Each affected rule states its enforceable floor and admits the rest as guidance, in the voice ofrule.table-carries-caption.🤖 Generated with Claude Code