ui-primitives
Skill104 starsChanged 3 days agoApache-2.0View on GitHub
UI primitive components for this project (BlockStack, InlineStack, Text, Heading, Paragraph, Button, Icon). Use when writing JSX, creating components, or working with layout and typography.
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Always prefer UI primitives over raw HTML elements.
- Very specific: line 12
Use BlockStack and InlineStack from @/components/ui/layout instead of <div className="flex ...">:
- Very specific: line 17
Use as prop for semantic elements: <BlockStack as="ul">, <InlineStack as="li">
- Very specific: line 21
All typography components are exported from @/components/ui/typography.
- Very specific: line 23
Use
Headingfor headings: instead of raw <h1-h6> or Text as="h*": - Very specific: line 29
Use
Paragraphfor paragraph text: instead of raw <p> or Text as="p": - Very specific: line 40
Use Button from @/components/ui/button
- Very specific: line 44
Use Icon from @/components/ui/icon instead of importing from lucide-react directly:
- Very specific: line 65
Use shadcn/ui components from @/components/ui/ for all UI primitives
- Distinctive: line 66
Use TailwindCSS v4 for styling (not CSS modules or styled-components)
- Very specific: line 68
Use cn() utility for conditional classes (from @/lib/utils)
- Distinctive: line 69
Prefer composition over prop drilling for complex components
- Distinctive: line 73
When you see similar Tailwind class combinations used multiple times, suggest creating reusable components or utility classes:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
UI Primitives
Always prefer UI primitives over raw HTML elements.
Layout
Use BlockStack and InlineStack from @/components/ui/layout instead of <div className="flex ...">:
BlockStack= vertical flex (flex-col)InlineStack= horizontal flex (flex-row)- Both support
gap,align,blockAlignprops - Use
asprop for semantic elements:<BlockStack as="ul">,<InlineStack as="li">
Typography
All typography components are exported from @/components/ui/typography.
Use Heading for headings instead of raw <h1-h6> or Text as="h*":
<Heading level={2}>Title</Heading>— renders<h2>withrole="heading"andaria-level- Automatically sets
size="md"+weight="semibold"for level 1,size="sm"for others - Supports
tone,size,weight,fontoverrides
Use Paragraph for paragraph text instead of raw <p> or Text as="p":
<Paragraph size="sm" tone="subdued">instead of<p className="text-sm text-muted">
Use Text for inline text (<span>, <dt>, <dd>, etc.):
<Text as="dt" weight="semibold">instead of<dt className="font-semibold">- Supports:
as,size,weight,tone,fontprops
Buttons
Use Button from @/components/ui/button
Icons
Use Icon from @/components/ui/icon instead of importing from lucide-react directly:
<Icon name="ChevronRight" size="lg" />instead of<ChevronRight className="size-5" />nameis any Lucide icon name;sizeisxssmmdlgxlfill(12/14/16/20/24/100%, defaultmd)- Size comes from the
sizeprop, not aclassName. The variant emits!w-* !h-*, so a width or height class onclassNameloses to it —<Icon name="X" className="size-5" />renders at 16px, not 20px. ReserveclassNamefor colour, margin, and transforms.
Icons Lucide does not have — brand and language logos (Python, Ruby, Bash, JavaScript, Google
Drive, …) — come from react-icons and are used directly, because Icon only accepts Lucide names:
<FaPython />fromreact-icons/fa— correct, not a deviation to migrate- Match the surrounding icons' rendered size by hand (
size={n}or a Tailwind size class); these do not get theIconsize scale
Draw a raw <svg> only for something that is not an icon from a set — SVG <defs>/<marker>
definitions, or a bespoke glyph with no library equivalent.
Styling
- Use shadcn/ui components from
@/components/ui/for all UI primitives - Use TailwindCSS v4 for styling (not CSS modules or styled-components)
- Only use inline styling (
style={...}) for dynamic/variable CSS values (e.g.,style={{height: h}}). Never use inline styles for static values — use Tailwind classes instead - Use
cn()utility for conditional classes (from@/lib/utils) - Prefer composition over prop drilling for complex components
Suggest Abstractions for Repeated Patterns
When you see similar Tailwind class combinations used multiple times, suggest creating reusable components or utility classes:
- Multiple buttons with similar styling -> Create a Button variant or new component
- Repeated container/card patterns -> Abstract into reusable Card component
- Common spacing/layout patterns -> Suggest utility classes or component abstractions
- Similar form field styling -> Create form field components
When Raw HTML is Acceptable
- Semantic elements not supported by primitives (e.g.,
<dl>,<ul>,<ol>,<table>) - Complex layouts where primitives don't fit
- Performance-critical sections where abstraction overhead matters
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- massCodeIO/massCode★ 7.1ksame name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- address-pr-commentsSkill
- analytics-trackingSkill
- audit-ticketsSkill
- docs-updateSkill
- e2e-testingSkill
- gardeningSkill
- list-skillsSkill
- open-sourceSkill
- project-conventionsSkill
- react-patternsSkill
- reviewSkill
- tangle-domainSkill
- tanstack-querySkill
- tanstack-routerSkill
- typescript-standardsSkill
- validateSkill
- vitest-testingSkill
- playwright-testingSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

