agentleFS
roerohanroerohan/skills/frontend-design/SKILL.md

frontend-design

Skill29 starsChanged 7 months agoMITView on GitHub

React-oriented UI/UX design principles for frontend development. Covers React patterns, component architecture, hooks, layout, typography, color, accessibility, and responsive design. Use when building React UI, reviewing frontend code, designing components, or making visual/interaction decisions. Assumes React with a meta-framework (TanStack Start, Next.js, Remix, etc.).

189 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use file-reading, arrange and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SeifBenayedSkill

    file-reading

    Use this skill when a file has been uploaded but its content is NOT in your context — only its path at /mnt/user-data/uploads/ is listed in an uploaded_files block. This skill is a router: it tells you which tool to use for each file type (pdf, docx, xlsx, csv, json, images, archives, ebooks) so you read the right amount the right way instead of blindly running cat on a binary. Triggers: any mention of /mnt/user-data/uploads/, an uploaded_files section, a file_path tag, or a user asking about an uploaded file you have not yet read. Do NOT use this skill if the file content is already visible in your context inside a documents block — you already have it.

    Also in 7 projects that use this

  • nikafastovets-langSkill

    arrange

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy to create intentional compositions.

    Also in 6 projects that use this

  • mm-mazharSkill

    cache-components

    Expert guidance for Next.js Cache Components and Partial Prerendering (PPR).

    Also in 6 projects that use this

  • SeifBenayedSkill

    pdf-reading

    Use this skill when you need to read, inspect, or extract content from PDF files — especially when file content is NOT in your context and you need to read it from disk. Covers content inventory, text extraction, page rasterization for visual inspection, embedded image/attachment/table/form-field extraction, and choosing the right reading strategy for different document types (text-heavy, scanned, slide-decks, forms, data-heavy). Do NOT use this skill for PDF creation, form filling, merging, splitting, watermarking, or encryption — use the pdf skill instead.

    Also in 6 projects that use this

  • JokerRunSkill

    compound-engineering

    Compound Engineering workflow for AI-assisted development. Use when planning features, executing work, reviewing code, or codifying learnings. Follows the Plan → Work → Review → Compound loop where each unit of engineering makes subsequent work easier. Triggers on: plan this feature, implement this, review this code, compound learnings, create implementation plan, systematic development.

    Also in 5 projects that use this

  • mtctSkill

    teach-impeccable

    One-time setup that gathers design context for your project and saves it to your AI config file. Run once to establish persistent design guidelines.

    Also in 10 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 180 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use a consistent base unit (4px or 8px).

    line 47
  2. Distinctive:

    When reviewing frontend code or designs:

    line 68

“Common” is measured: kept by at least 6 in 10 of the 180 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Frontend Design

UI/UX principles for building well-designed, accessible, maintainable React interfaces.

Context: This skill assumes React as the UI layer, typically with a meta-framework (TanStack Start, Next.js, Remix, etc.) and a styling approach (Tailwind, CSS Modules, etc.). Raw HTML/CSS guidance is provided only where it underpins React patterns.

Core Principles

  1. Clarity over cleverness — Users should understand the interface immediately
  2. Consistency over novelty — Reuse established patterns; deviate only with reason
  3. Accessibility is not optional — Design for all users from the start
  4. Content drives layout — Structure follows information hierarchy, not decoration
  5. Composition over configuration — Prefer children and compound components over prop sprawl
  6. Server-first data, client-first interaction — Load data on the server; keep interactivity on the client

Decision Tree

What are you working on?
├─ React component design / hooks / state  → See react.md
├─ Reusable UI component patterns          → See components.md
├─ Page layout / spacing                   → See layout.md
├─ Text styling / hierarchy                → See typography.md
├─ Colors / theming / contrast             → See color.md
├─ Keyboard / screen reader / a11y         → See accessibility.md
├─ Multi-device / breakpoints              → See responsive.md
└─ Multiple concerns                       → Start with react.md, layer in others

Quick Reference

Visual Hierarchy Checklist

LevelPurposeTechniques
PrimarySingle main action/contentSize, weight, color, position
SecondarySupporting actions/contentReduced size/weight, muted color
TertiaryContextual/metadataSmallest size, lightest weight

Spacing System

Use a consistent base unit (4px or 8px). Apply multiples:

TokenValue (8px base)Use
xs4pxInline elements, icon gaps
sm8pxTight grouping
md16pxDefault element spacing
lg24pxSection padding
xl32pxMajor section separation
2xl48pxPage-level separation

The 60-30-10 Rule

ProportionRoleExample
60%Dominant / backgroundPage background, card surfaces
30%Secondary / supportingSection backgrounds, borders
10%Accent / emphasisCTAs, active states, highlights

Design Review Checklist

When reviewing frontend code or designs:

  • Hierarchy: Is the most important content/action visually dominant?
  • Consistency: Do similar elements look and behave the same?
  • Spacing: Is spacing systematic (not arbitrary pixel values)?
  • Color contrast: Do text/background combos meet WCAG AA (4.5:1)?
  • Interactive states: Do clickable elements have hover, focus, active, disabled states?
  • Responsive: Does the layout work at mobile, tablet, and desktop widths?
  • Keyboard: Can all interactive elements be reached and operated via keyboard?
  • Loading states: Are empty/loading/error states designed, not just happy path?
  • Touch targets: Are tap targets at least 44x44px on mobile?
  • Content overflow: Does the layout handle long text, missing images, edge cases?

Common Anti-Patterns

Anti-PatternProblemFix
Magic numbersmargin: 13px breaks systemUse spacing tokens
Color hardcoding#3b82f6 everywhereUse semantic color tokens
Hover-only affordanceHidden from keyboard/touch usersAlways show affordance; enhance on hover
Fixed dimensionsBreaks on different content/screensUse min/max + fluid sizing
Z-index warsEscalating z-index: 9999Use a layering system (base, dropdown, modal, toast)
Truncation without accesstext-overflow: ellipsis hides contentAdd tooltip or expand mechanism

Interaction Principles

  1. Feedback is immediate — Every user action gets a visible response within 100ms
  2. State is visible — Users can always tell what state the system is in
  3. Actions are reversible — Destructive actions require confirmation; prefer undo over "are you sure?"
  4. Errors are recoverable — Show what went wrong and how to fix it
  5. Transitions are meaningful — Animation communicates change, not decoration

React Review Checklist (Addendum)

On top of the design review checklist above, verify for React code:

  • Component boundaries: Is each component focused on one concern?
  • Props: Are props minimal and well-typed? No boolean prop sprawl?
  • Composition: Using children/render props instead of mega-config objects?
  • Effects: Are effects necessary, or can derived state / event handlers replace them?
  • Keys: Are list keys stable and meaningful (not array index)?
  • Memoization: Is useMemo/useCallback used only where measured necessary?
  • Server vs client: Is data fetching on the server? Is client JS minimal?
  • Error boundaries: Do async/fallible sections have error boundaries?
  • Suspense: Are loading states handled with Suspense where appropriate?

Reading Order

TaskFiles to Read
React component architecturereact.md
Building a page layoutlayout.md
Designing a reusable UI componentreact.md + components.md
Styling text contenttypography.md
Choosing / applying colorscolor.md
Making UI accessibleaccessibility.md
Supporting multiple screen sizesresponsive.md
Full design reviewThis file + all references

In This Reference

FilePurpose
react.mdReact patterns, hooks, composition, state, meta-frameworks
components.mdCommon UI component design patterns
layout.mdSpatial organization, grid, flexbox, spacing
typography.mdType scale, font selection, readability
color.mdColor systems, contrast, theming, dark mode
accessibility.mdWCAG compliance, keyboard, screen readers
responsive.mdBreakpoints, mobile-first, fluid design

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.