agentleFS
YangsonHungYangsonHung/awesome-agent-skills/skills/en/frontend-quality-guardrails/SKILL.md

frontend-quality-guardrails

Skill18 starsChanged 8 days agoMITView on GitHub

Use when building, modifying, or reviewing frontend UI where text overflow, layout, responsiveness, accessibility, and visual polish must be verified.

The file

Show its rules and text

We split this skill into the rules it gives an agent

116 rules. About 0 are common, 90 are distinctive, and 26 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈90

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 26

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill as a frontend quality gate for UI implementation and review.

    line 10
  2. Distinctive:

    Treat every UI as hostile to perfect content.

    line 12
  3. Distinctive:

    Prefer small, local CSS/layout fixes over broad rewrites.

    line 14
  4. Distinctive:

    Use this skill when building, modifying, or reviewing frontend UI where layout quality matters, especially:

    line 18
  5. Distinctive:

    Do not use this skill as the primary guide for:

    line 26
  6. Distinctive:

    Do not introduce a new design system for a localized fix.

    line 42
  7. Very specific:

    Add missing min-width: 0 or min-height: 0 in flex/grid children.

    line 58
  8. Very specific:

    Add explicit max-width, overflow-wrap, text-overflow, line-clamp, or scroll behavior where needed.

    line 59
  9. Distinctive:

    Avoid changing parent layout unless the parent is the source of the overflow.

    line 60
  10. Distinctive:

    Verify with adversarial content and viewports:

    line 62
  11. Distinctive:

    Test narrow mobile, tablet, desktop, and wide desktop.

    line 63
  12. Distinctive:

    Test long unbroken strings, long natural language, CJK text, mixed CJK/English, URLs, empty values, and dense lists.

    line 64
  13. Distinctive:

    Use browser screenshots or DOM inspection for visual changes when feasible.

    line 65
  14. Distinctive:

    Use wrapping when users must read the content inline:

    line 77
  15. Distinctive:

    Use truncation only when space is intentionally compact and the full value is still accessible:

    line 87
  16. Distinctive:

    Use multi-line clamping for cards, summaries, and search results:

    line 100
  17. Distinctive:

    Use scroll for logs, code, long tables, and raw technical values:

    line 111
  18. Very specific:

    Do not rely on overflow: hidden alone.

    line 123
  19. Very specific:

    Do not apply white-space: nowrap to containers that may receive translated text.

    line 124
  20. Very specific:

    Do not use word-break: break-all as the default for readable prose.

    line 125
  21. Distinctive:

    Do not truncate form errors, critical warnings, prices, dates, or destructive action labels.

    line 126
  22. Very specific:

    Do not place ellipsis on inline elements without a constrained width and block/inline-block/flex behavior.

    line 127
  23. Distinctive:

    Do not clamp text without considering keyboard focus, screen readers, and access to full content.

    line 128
  24. Very specific:

    Always check min-width: 0 for flex/grid children that contain text:

    line 132
  25. Very specific:

    Use minmax(0, 1fr) in CSS Grid when columns contain long content:

    line 145
  26. Very specific:

    Use flex: none for icons and fixed controls next to flexible text.

    line 157
  27. Very specific:

    Use gap rather than margin hacks for repeated horizontal/vertical rhythm.

    line 158
  28. Distinctive:

    Avoid percentage widths that combine with padding and cause overflow.

    line 159
  29. Very specific:

    Use min-height: 0 on nested flex/grid panels that need internal scrolling.

    line 161
  30. Distinctive:

    Keep icon-only buttons square and centered.

    line 169
  31. Distinctive:

    Keep mixed icon/text controls baseline-balanced.

    line 170
  32. Distinctive:

    Use the project spacing scale.

    line 171
  33. Distinctive:

    Do not center-align long paragraphs, tables, form labels, or dense operational UI.

    line 173
  34. Distinctive:

    Use right alignment only for numeric values that users compare in columns.

    line 174
  35. Distinctive:

    Use tabular numbers for metrics, prices, timers, and aligned numeric columns when available.

    line 175
  36. Distinctive:

    Keep type readable and stable:

    line 190
  37. Distinctive:

    Do not scale font size directly with viewport width.

    line 192
  38. Distinctive:

    Avoid negative letter spacing unless the existing design system explicitly uses it.

    line 193
  39. Distinctive:

    Use sufficient line-height for CJK and mixed-language text.

    line 194
  40. Distinctive:

    Avoid oversized headings inside compact cards, sidebars, toolbars, tables, and modals.

    line 195
  41. Distinctive:

    Keep button labels short but do not make them cryptic.

    line 196
  42. Distinctive:

    Use semantic heading order even when visual size differs.

    line 197
  43. Distinctive:

    Use font weights sparingly.

    line 198
  44. Distinctive:

    Test text expansion from localization.

    line 199
  45. Very specific:

    Check 320px, 375px, 768px, 1024px, 1280px, and one wide desktop size when feasible.

    line 211
  46. Distinctive:

    Avoid fixed widths that exceed small screens.

    line 212
  47. Very specific:

    Use max-width: 100% for media and text containers.

    line 213
  48. Distinctive:

    Ensure sticky headers, sidebars, bottom bars, and floating controls do not cover content.

    line 214
  49. Distinctive:

    Use horizontal scrolling only for content that naturally needs it, such as large tables, timelines, code, or comparison matrices.

    line 215
  50. Very specific:

    Keep tap targets at least roughly 44px high/wide on mobile unless the app's dense UI standard intentionally differs.

    line 216
  51. Very specific:

    Ensure viewport units account for mobile browser chrome.

    line 217
  52. Distinctive:

    Keep loading states the same size as idle states.

    line 231
  53. Distinctive:

    Keep destructive, disabled, focus, hover, pressed, and selected states visually distinct.

    line 232
  54. Distinctive:

    Do not hide focus outlines unless replacing them with accessible focus styles.

    line 233
  55. Distinctive:

    Use icons for familiar tool actions when an icon library exists, with accessible labels or tooltips.

    line 234
  56. Distinctive:

    Keep labels visible when possible.

    line 238
  57. Distinctive:

    Avoid layout jump when errors appear.

    line 240
  58. Distinctive:

    Ensure long option labels in selects, radio groups, checkboxes, and comboboxes wrap or truncate intentionally.

    line 241
  59. Distinctive:

    Do not make input text smaller than surrounding UI in a way that harms readability.

    line 243
  60. Distinctive:

    Keep important identifiers readable.

    line 248
  61. Distinctive:

    Use sticky headers/columns only when they do not create clipping or z-index issues.

    line 250
  62. Distinctive:

    Test empty, one-row, many-row, loading, error, and filtered states.

    line 251
  63. Distinctive:

    Avoid putting complex cards inside every table cell unless the product pattern already does it.

    line 252
  64. Distinctive:

    Keep badges from pushing primary content out of view.

    line 258
  65. Distinctive:

    Ensure hover/focus styles do not resize cards.

    line 259
  66. Distinctive:

    Avoid nested cards unless the design system explicitly uses them.

    line 260
  67. Distinctive:

    Test long route names and translated labels.

    line 264
  68. Distinctive:

    Use overflow menus, scrollable tab lists, wrapping breadcrumbs, or truncation intentionally.

    line 265
  69. Distinctive:

    Keep the active state visible when labels truncate.

    line 266
  70. Distinctive:

    Ensure keyboard navigation remains usable.

    line 267
  71. Distinctive:

    Keep headers and footers stable while body content scrolls.

    line 271
  72. Distinctive:

    Do not put critical content only in hover tooltips.

    line 273
  73. Distinctive:

    Ensure escape, outside click, focus trap, and return focus behavior match the library pattern.

    line 275
  74. Distinctive:

    Test missing, slow, broken, and very large images.

    line 282
  75. Very specific:

    Do not crop product/person/content images so aggressively that users cannot inspect them.

    line 283
  76. Very specific:

    Do not fix overflow by adding random z-index, position: absolute, or negative margins.

    line 289
  77. Very specific:

    Do not use height: 100vh for app shells without accounting for mobile viewport behavior.

    line 290
  78. Very specific:

    Do not set overflow: hidden on high-level layout containers unless clipping is intentional.

    line 291
  79. Distinctive:

    Do not use global selectors that alter unrelated components.

    line 292
  80. Distinctive:

    Do not introduce color, radius, shadow, or spacing values outside existing tokens without reason.

    line 293
  81. Distinctive:

    Do not make text unreadable by relying on low contrast placeholder, muted, disabled, or secondary colors.

    line 294
  82. Distinctive:

    Do not put important content behind transparent overlays or decorative layers.

    line 295
  83. Distinctive:

    Do not let hover borders change element size.

    line 296
  84. Distinctive:

    Do not animate layout properties when transform/opacity can achieve the same effect.

    line 297
  85. Distinctive:

    Prefer robust CSS primitives:

    line 299
  86. Distinctive:

    Use Tailwind utilities intentionally:

    line 311
  87. Very specific:

    Add min-w-0 to flex/grid text children.

    line 313
  88. Very specific:

    Use truncate only with a constrained width.

    line 314
  89. Very specific:

    Use break-words for readable wrapping and break-all only for technical tokens when acceptable.

    line 315
  90. Very specific:

    Use line-clamp-* for summaries when the plugin/support exists.

    line 316
  91. Very specific:

    Use overflow-x-auto around wide tables, not on the whole page.

    line 317
  92. Very specific:

    Use shrink-0 for icons/avatars and flex-1 min-w-0 for text.

    line 318
  93. Distinctive:

    Avoid long arbitrary-value chains when a token or existing component class exists.

    line 319
  94. Distinctive:

    When using a component library:

    line 339
  95. Distinctive:

    Read the local wrapper component before changing usage.

    line 341
  96. Distinctive:

    Prefer library-supported props for size, status, disabled, placement, overflow, and accessibility.

    line 342
  97. Distinctive:

    Do not override internals with brittle selectors unless there is no public API.

    line 343
  98. Distinctive:

    Keep UI usable beyond the happy path:

    line 350
  99. Distinctive:

    Use semantic elements for buttons, links, headings, lists, tables, forms, and landmarks.

    line 353
  100. Distinctive:

    Do not rely on color alone for errors, warnings, active states, or status.

    line 355
  101. Distinctive:

    Ensure truncated content has an accessible path to the full value when the full value matters.

    line 356
  102. Distinctive:

    Ensure tooltips are reachable or nonessential.

    line 357
  103. Distinctive:

    Keep contrast sufficient for normal, muted, disabled, hover, selected, and error text.

    line 359
  104. Distinctive:

    Avoid hard-coded pixel heights for text containers that may translate.

    line 365
  105. Distinctive:

    Do not concatenate translated fragments when grammar may differ.

    line 366
  106. Distinctive:

    Check pluralization and variable interpolation.

    line 367
  107. Distinctive:

    Avoid layout assumptions based on English word boundaries.

    line 368
  108. Distinctive:

    Ensure CJK text, RTL text, diacritics, emoji, and long numbers do not break the layout.

    line 369
  109. Very specific:

    Use dir, logical CSS properties, or library RTL support when the app supports RTL.

    line 370
  110. Distinctive:

    Before finishing a UI change, scan for:

    line 374
  111. Distinctive:

    When practical, verify with these strings:

    line 390
  112. Distinctive:

    Do not mark the task complete until these are true for the changed surface:

    line 413
  113. Distinctive:

    No horizontal page overflow unless intentionally required.

    line 415
  114. Distinctive:

    No text overlaps adjacent UI.

    line 416
  115. Distinctive:

    When reporting work done with this skill:

    line 427
  116. Distinctive:

    Call out any remaining UI risk, untested viewport, or state that could not be checked.

    line 431

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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.

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

Frontend Quality Guardrails

Overview

Use this skill as a frontend quality gate for UI implementation and review. It covers long text, overflow, wrapping, truncation, alignment, spacing, responsive behavior, component states, accessibility, internationalization, visual polish, project-level code review, browser screenshot verification, and common UI style pitfalls.

Treat every UI as hostile to perfect content. Assume labels, names, URLs, IDs, prices, translated strings, user input, errors, table cells, badges, breadcrumbs, tabs, and button text can be longer than the mockup.

Prefer small, local CSS/layout fixes over broad rewrites. Preserve the existing design system, component API, tokens, spacing scale, and framework conventions unless the user asks for a redesign.

When to Use

Use this skill when building, modifying, or reviewing frontend UI where layout quality matters, especially:

  • Long text, URLs, IDs, translated strings, form errors, labels, table cells, cards, tabs, breadcrumbs, or badges may overflow.
  • The task touches HTML, CSS, React, Vue, Svelte, Next.js, Tailwind, shadcn/ui, Ant Design, forms, tables, dashboards, modals, drawers, navigation, or responsive layouts.
  • The user asks to polish UI, fix overflow, improve alignment, review frontend code, validate browser screenshots, or avoid frontend style pitfalls.

Do not use

Do not use this skill as the primary guide for:

  • Backend-only, CLI-only, database-only, or infrastructure tasks with no visible UI.
  • Full brand identity creation, illustration, logo design, or image generation.
  • Pixel-perfect implementation from a provided screenshot when a dedicated image-to-code or design reproduction skill is available.
  • Accessibility audits that require formal WCAG scoring beyond implementation-level guardrails.

Instructions

Apply the workflow below as a guardrail layer on top of the project's existing frontend conventions. For simple changes, use the core checklist only. For deeper work, load the relevant reference file from the Deep References section.

Workflow

  1. Inspect the existing UI conventions before editing:
    • Identify the framework, styling system, component library, breakpoints, typography scale, spacing tokens, and icon library.
    • Reuse existing components and utility classes.
    • Do not introduce a new design system for a localized fix.
  2. Identify text risk surfaces:
    • User names, organization names, file names, paths, slugs, UUIDs, hashes, tokens, URLs, emails, phone numbers.
    • Headings, card titles, table cells, nav items, tabs, breadcrumbs, filters, chips, badges, tooltips, toasts, dialogs.
    • Form labels, placeholders, help text, validation errors, empty states, loading text.
    • Translated strings and CJK/Latin mixed content.
  3. Define the intended behavior for each text container:
    • Wrap: content can take multiple lines without breaking layout.
    • Clamp: content is visually limited but full value is available elsewhere.
    • Truncate: content is shortened with ellipsis for compact repeated UI.
    • Scroll: content is intentionally scrollable, usually code, logs, tables, or panels.
    • Resize: layout adapts to content, but within stable min/max bounds.
  4. Implement the smallest robust fix:
    • Add missing min-width: 0 or min-height: 0 in flex/grid children.
    • Add explicit max-width, overflow-wrap, text-overflow, line-clamp, or scroll behavior where needed.
    • Avoid changing parent layout unless the parent is the source of the overflow.
  5. Verify with adversarial content and viewports:
    • Test narrow mobile, tablet, desktop, and wide desktop.
    • Test long unbroken strings, long natural language, CJK text, mixed CJK/English, URLs, empty values, and dense lists.
    • Use browser screenshots or DOM inspection for visual changes when feasible.

Deep References

Load these reference files when the task needs deeper coverage:

  • code-review-checklist.md: use before editing or reviewing React, Vue, Svelte, HTML/CSS, component-library usage, stateful UI, forms, tables, or existing project code.
  • visual-standards.md: use when creating, redesigning, polishing, or critiquing visual style, density, hierarchy, color, radius, shadow, typography, and interaction states.
  • browser-verification.md: use after visible UI changes, before final response, or when debugging layout/overflow/responsive issues with browser automation, screenshots, console logs, and viewport checks.

Text Overflow Rules

Use wrapping when users must read the content inline:

.wrap-text {
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

Use truncation only when space is intentionally compact and the full value is still accessible:

.truncate-one-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

For compact names or titles in repeated UI, prefer one-line ellipsis with full text available on hover and keyboard focus through the project's Tooltip/title pattern. Do not only "protect layout" by clipping text; the user must still be able to inspect the complete value.

Use multi-line clamping for cards, summaries, and search results:

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

Use scroll for logs, code, long tables, and raw technical values:

.scroll-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

Avoid these traps:

  • Do not rely on overflow: hidden alone; it hides bugs and can make content inaccessible.
  • Do not apply white-space: nowrap to containers that may receive translated text.
  • Do not use word-break: break-all as the default for readable prose; use overflow-wrap: anywhere for long unbroken tokens.
  • Do not truncate form errors, critical warnings, prices, dates, or destructive action labels.
  • Do not place ellipsis on inline elements without a constrained width and block/inline-block/flex behavior.
  • Do not clamp text without considering keyboard focus, screen readers, and access to full content.

Flex And Grid Pitfalls

Always check min-width: 0 for flex/grid children that contain text:

.row {
  display: flex;
}

.row__content {
  min-width: 0;
  flex: 1;
}

Use minmax(0, 1fr) in CSS Grid when columns contain long content:

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

Guard against layout shifts:

  • Give avatars, icons, buttons, table columns, and thumbnails stable dimensions.
  • Use flex: none for icons and fixed controls next to flexible text.
  • Use gap rather than margin hacks for repeated horizontal/vertical rhythm.
  • Avoid percentage widths that combine with padding and cause overflow.
  • Set box-sizing: border-box if the project does not already do it globally.
  • Use min-height: 0 on nested flex/grid panels that need internal scrolling.

Alignment And Spacing

Align by visual role, not by accidental DOM order:

  • Align labels and values consistently within forms, detail panels, tables, and cards.
  • Align icons with text using inline-flex, align-items: center, and a stable gap.
  • Keep icon-only buttons square and centered.
  • Keep mixed icon/text controls baseline-balanced; avoid icons floating above text.
  • Use the project spacing scale; do not invent one-off margins unless necessary.
  • Preserve vertical rhythm between headings, body text, controls, and section boundaries.
  • Do not center-align long paragraphs, tables, form labels, or dense operational UI.
  • Use right alignment only for numeric values that users compare in columns.
  • Use tabular numbers for metrics, prices, timers, and aligned numeric columns when available.

Prefer:

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

Typography

Keep type readable and stable:

  • Do not scale font size directly with viewport width.
  • Avoid negative letter spacing unless the existing design system explicitly uses it.
  • Use sufficient line-height for CJK and mixed-language text.
  • Avoid oversized headings inside compact cards, sidebars, toolbars, tables, and modals.
  • Keep button labels short but do not make them cryptic.
  • Use semantic heading order even when visual size differs.
  • Use font weights sparingly; hierarchy should also come from size, spacing, color, and layout.
  • Test text expansion from localization; English to German, Russian, Vietnamese, Chinese, Japanese, and Korean can stress width/height differently.

Recommended starting points:

  • Body text: line-height around 1.45 to 1.7, depending on density.
  • UI labels: line-height around 1.2 to 1.4.
  • Dense tables: maintain legibility before optimizing for row count.

Responsive Layout

Design for real breakpoints, not only one desktop width:

  • Check 320px, 375px, 768px, 1024px, 1280px, and one wide desktop size when feasible.
  • Avoid fixed widths that exceed small screens.
  • Use max-width: 100% for media and text containers.
  • Ensure sticky headers, sidebars, bottom bars, and floating controls do not cover content.
  • Use horizontal scrolling only for content that naturally needs it, such as large tables, timelines, code, or comparison matrices.
  • Keep tap targets at least roughly 44px high/wide on mobile unless the app's dense UI standard intentionally differs.
  • Ensure viewport units account for mobile browser chrome; prefer modern units like svh, dvh, or project-supported fallbacks when relevant.

For mobile:

  • Stack forms and filter bars when horizontal density becomes brittle.
  • Let primary actions remain reachable without covering inputs.
  • Make modals fit within viewport height with internal scrolling.
  • Avoid hover-only affordances.

Component-Specific Checks

Buttons And Controls

  • Prevent label overflow with min-width: 0 on text spans inside flexible buttons.
  • Keep loading states the same size as idle states.
  • Keep destructive, disabled, focus, hover, pressed, and selected states visually distinct.
  • Do not hide focus outlines unless replacing them with accessible focus styles.
  • Use icons for familiar tool actions when an icon library exists, with accessible labels or tooltips.

Forms

  • Keep labels visible when possible; placeholders are not labels.
  • Let validation errors wrap and remain close to the field.
  • Avoid layout jump when errors appear; reserve space only if the project pattern supports it.
  • Ensure long option labels in selects, radio groups, checkboxes, and comboboxes wrap or truncate intentionally.
  • Support autofill, disabled, readonly, required, invalid, loading, and success states.
  • Do not make input text smaller than surrounding UI in a way that harms readability.

Tables And Data Grids

  • Decide per column: fixed width, flexible width, wrap, truncate, or horizontal scroll.
  • Keep important identifiers readable; if truncated, provide copy or full-value access.
  • Align numbers right and text left.
  • Use sticky headers/columns only when they do not create clipping or z-index issues.
  • Test empty, one-row, many-row, loading, error, and filtered states.
  • Avoid putting complex cards inside every table cell unless the product pattern already does it.

Cards And Lists

  • Give repeated items stable structure and consistent action placement.
  • Clamp summaries, not critical titles, unless full titles are available on hover/focus/detail.
  • Keep badges from pushing primary content out of view.
  • Ensure hover/focus styles do not resize cards.
  • Avoid nested cards unless the design system explicitly uses them.

Navigation, Tabs, And Breadcrumbs

  • Test long route names and translated labels.
  • Use overflow menus, scrollable tab lists, wrapping breadcrumbs, or truncation intentionally.
  • Keep the active state visible when labels truncate.
  • Ensure keyboard navigation remains usable.

Modals, Drawers, Popovers, Tooltips

  • Keep headers and footers stable while body content scrolls.
  • Prevent popovers from clipping against viewport edges.
  • Do not put critical content only in hover tooltips.
  • Let dialogs handle long titles, long errors, and dense forms.
  • Ensure escape, outside click, focus trap, and return focus behavior match the library pattern.

Images, Avatars, And Media

  • Set explicit aspect ratios or dimensions to prevent layout shifts.
  • Use object-fit deliberately.
  • Provide alt text for meaningful images and empty alt for decorative images.
  • Test missing, slow, broken, and very large images.
  • Do not crop product/person/content images so aggressively that users cannot inspect them.

CSS And Styling Pitfalls

Avoid fragile CSS:

  • Do not fix overflow by adding random z-index, position: absolute, or negative margins.
  • Do not use height: 100vh for app shells without accounting for mobile viewport behavior.
  • Do not set overflow: hidden on high-level layout containers unless clipping is intentional.
  • Do not use global selectors that alter unrelated components.
  • Do not introduce color, radius, shadow, or spacing values outside existing tokens without reason.
  • Do not make text unreadable by relying on low contrast placeholder, muted, disabled, or secondary colors.
  • Do not put important content behind transparent overlays or decorative layers.
  • Do not let hover borders change element size; use transparent borders or shadows.
  • Do not animate layout properties when transform/opacity can achieve the same effect.

Prefer robust CSS primitives:

  • box-sizing: border-box
  • min-width: 0
  • min-height: 0
  • max-width: 100%
  • overflow-wrap: anywhere
  • text-wrap: balance only for headings where supported and not required for correctness
  • contain, content-visibility, or virtualization only when performance need is real

Tailwind Notes

Use Tailwind utilities intentionally:

  • Add min-w-0 to flex/grid text children.
  • Use truncate only with a constrained width.
  • Use break-words for readable wrapping and break-all only for technical tokens when acceptable.
  • Use line-clamp-* for summaries when the plugin/support exists.
  • Use overflow-x-auto around wide tables, not on the whole page.
  • Use shrink-0 for icons/avatars and flex-1 min-w-0 for text.
  • Avoid long arbitrary-value chains when a token or existing component class exists.

Common patterns:

<div className="flex min-w-0 items-center gap-2">
  <Icon className="size-4 shrink-0" aria-hidden="true" />
  <span className="min-w-0 truncate">Very long label</span>
</div>
<div className="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-3">
  <p className="min-w-0 break-words">Long readable content</p>
  <button className="shrink-0">Action</button>
</div>

Component Library Notes

When using a component library:

  • Read the local wrapper component before changing usage.
  • Prefer library-supported props for size, status, disabled, placement, overflow, and accessibility.
  • Do not override internals with brittle selectors unless there is no public API.
  • For Ant Design, check Table column width, ellipsis, scroll.x, Tooltip, Form.Item help text, Select option rendering, and Typography.Text ellipsis behavior.
  • For shadcn/ui, preserve Radix accessibility behavior and component composition; fix layout with wrapper classes before rewriting primitives.
  • For MUI/Chakra/Headless UI, prefer documented slot props, style props, or composition points.

Accessibility And Semantics

Keep UI usable beyond the happy path:

  • Preserve visible focus and logical tab order.
  • Use semantic elements for buttons, links, headings, lists, tables, forms, and landmarks.
  • Provide accessible names for icon-only controls.
  • Do not rely on color alone for errors, warnings, active states, or status.
  • Ensure truncated content has an accessible path to the full value when the full value matters.
  • Ensure tooltips are reachable or nonessential.
  • Respect reduced motion for large or repeated animations.
  • Keep contrast sufficient for normal, muted, disabled, hover, selected, and error text.

Internationalization And Content Variability

Plan for text expansion and writing differences:

  • Avoid hard-coded pixel heights for text containers that may translate.
  • Do not concatenate translated fragments when grammar may differ.
  • Check pluralization and variable interpolation.
  • Avoid layout assumptions based on English word boundaries.
  • Ensure CJK text, RTL text, diacritics, emoji, and long numbers do not break the layout.
  • Use dir, logical CSS properties, or library RTL support when the app supports RTL.

Visual Polish Checks

Before finishing a UI change, scan for:

  • Text overlapping icons, badges, images, inputs, or adjacent sections.
  • Content clipped by rounded corners, sticky bars, drawers, or hidden overflow.
  • Cards or rows changing size on hover.
  • Inconsistent icon sizes or stroke weights.
  • Mismatched border radius within the same component group.
  • Shadows or borders that make nested surfaces look accidental.
  • Uneven spacing between repeated items.
  • Empty states that look like broken loading states.
  • Loading skeletons that do not match final layout dimensions.
  • Disabled states with insufficient contrast or unclear affordance.
  • Toasts, dropdowns, menus, and popovers hidden behind headers or modals.

Required Test Content

When practical, verify with these strings:

This is a normal sentence that should wrap naturally without breaking the layout.
SuperLongUnbrokenOrganizationNameWithNoSpacesAndManyCharacters1234567890
https://example.com/a/very/long/path/with/query?search=frontend-layout-overflow-and-wrapping
UserLocaleLongTextWithoutSpacesMixedWithAsciiABCDEFGHIJKLMN1234567890
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Also test:

  • Empty string
  • Single character
  • Very long translated label
  • Long number or currency value
  • Long validation error
  • Multiple badges or tags
  • Missing image/avatar
  • Loading and error states

Verification Checklist

Do not mark the task complete until these are true for the changed surface:

  • No horizontal page overflow unless intentionally required.
  • No text overlaps adjacent UI.
  • Long text wraps, clamps, truncates, or scrolls according to the intended behavior.
  • Full critical content remains accessible.
  • Flex/grid children with text have appropriate min-width: 0 or min-height: 0.
  • Mobile and desktop layouts remain usable.
  • Loading, empty, error, disabled, hover, focus, selected, and dense-data states are covered when relevant.
  • The change follows existing design tokens and component patterns.
  • The UI is verified visually when a browser or screenshot workflow is available.

Response Pattern

When reporting work done with this skill:

  • Mention the specific overflow/layout risks addressed.
  • Mention the verification performed.
  • Call out any remaining UI risk, untested viewport, or state that could not be checked.

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.