Adapt

educlopez/ui-craft/.codex/skills/adapt

作者 educlopezceecc8e1fb0c2befda73da996435900d6dd0c1ac無授權條款375 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫5 週前更新

Responsive layout pass covering breakpoints, touch targets, safe areas, and fluid type. Use when the UI has layout or touch issues on mobile/tablet, when adding a new screen that hasn't been tested across viewports, or when the user says "make it responsive" / "fix mobile layout". Invoke when the user asks for adapt on their UI, or mentions 'adapt' alongside design / UI / frontend work.

AI 產生的概覽

指導對介面進行行動優先的響應式版面調整,涵蓋斷點、觸控目標、安全區域與流體字型。

功能
提供一份十項檢查清單,用於讓使用者介面適應手機、平板與桌面視窗,涵蓋斷點、觸控目標尺寸、安全區域內距、橫向捲動、流體排版、容器查詢、無懸停裝置、密度變化、圖片與導覽模式。它要求代理直接修改程式碼,並列印變更審查表格,同時標記因資訊不足而無法修復的響應式缺陷。它是更廣泛的 ui-craft 技能的一個視角,並引用一份響應式參考文件。
適用情境
適用於介面在手機或平板上出現版面或觸控問題、新增尚未跨視窗測試的畫面,或使用者要求讓介面響應式、修正行動版版面時。
執行需求
不附帶指令碼。需要可編輯的介面程式碼庫,並引用 ui-craft 技能與 references/responsive.md 文件,完整流程需具備這些內容。
<!-- HARNESS MIRROR — do not edit here. Canonical source: skills/ or commands/. After editing source, copy into cli/assets/<harness>/ and repo-root harness mirrors. -->

Context: this sub-skill is one lens of the broader ui-craft skill. If the ui-craft skill is also installed, read its SKILL.md first for Discovery + Anti-Slop + Craft Test, then apply the specific lens below.

Adapt the UI at $ARGUMENTS across devices. Load the ui-craft skill and read references/responsive.md.

Work mobile-first. Don't shrink desktop; grow from mobile.

Checklist:

  1. Breakpoints — use project's existing system (Tailwind: sm md lg xl; CSS: container queries preferred over media queries for components). No magic widths.
  2. Touch — tap targets ≥ 44×44px (min-h-11 min-w-11). Touch zones don't overlap. touch-action: manipulation on interactive elements.
  3. Safe areas — padding-top: env(safe-area-inset-top) etc. on fixed headers/footers/FAB. Check iOS notch and Android gesture bar.
  4. No horizontal scroll at 320px. Test with devtools device mode.
  5. Fluid type — clamp(1rem, 0.9rem + 0.5vw, 1.125rem) for body where scale matters; fixed px for small UI text (labels, captions).
  6. Container queries — prefer @container over viewport media queries for component-level responsiveness. Components that live in sidebars and main content behave differently at the same viewport width.
  7. Hover-less devices — every hover affordance has a non-hover equivalent. @media (hover: hover) to scope desktop-only effects.
  8. Density shifts with viewport — honor VISUAL_DENSITY differently per breakpoint:
    • VISUAL_DENSITY ≤ 3 → fewer columns and wider spacing even at desktop widths.
    • VISUAL_DENSITY 8+ → honor dashboard density, but still respect touch/hover distinctions (touch targets stay ≥ 44px on mobile, hover affordances gated behind @media (hover: hover)).
    • Mobile always trends toward 1 column and wider spacing regardless of the knob value.
  9. Images — aspect-ratio set; srcset + sizes for different viewports; loading="lazy" below the fold; fetchpriority="high" on hero.
  10. Nav pattern — desktop horizontal → mobile collapses (sheet, drawer, or bottom tabs). Never a hamburger on desktop unless the nav has > 7 top-level items.

Output: edit code directly. Print the Review Format table of changes. Flag any responsive bugs you can't fix without more info (missing design for a breakpoint, unclear nav pattern).

Next step: /audit — verify the responsive pass against a11y, performance and touch targets (rung 1).

來源與署名

來源:educlopez/ui-craft位於.codex/skills/adapt提交ceecc8e

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架