better-layout
できること
ページのセクション、コントロール、余白を整えて、どの画面でも読みやすい構造にする手順を、AIに案内します。Webのレイアウトを作るデザイナーと開発者向けです。
使う場面
- ✓新しいページやコンポーネントの構成を決め、レイアウトを読みやすくしたいとき。
- ✓コントロールの余白や整列が乱れて見えるとき。
- ✓小さい画面で何を折りたたむか、隠すかを決める必要があるとき。
スキルのリンク
https://github.com/trycompai/crm/blob/release/.agents/skills/better-layout/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“この設定ページは、スマートフォンで窮屈で整列が乱れて見えます。レイアウトを直してもらえますか。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは関連する項目をまとめ、共通の端にそろえ、プロジェクトの余白の体系を使い、いくつかの幅でレイアウトを確認します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Layout that communicates structure
Layout communicates before a single word is read: position, spacing, and alignment carry hierarchy on their own, and generous space beats decoration. A good layout also survives stress: resize it, translate it, mirror it for RTL, and it should still hold together. Apply these principles when building or reviewing UI code, and express every change in the project's existing styling system (Tailwind, plain CSS, CSS-in-JS); never introduce a second styling approach.
Hit-area sizes and focus behavior are covered by the better-accessibility skill; visual polish (radius, shadows, animation) by the better-ui skill; line length and text spacing by the better-typography skill.
Treat the numeric values below as starting points for interfaces without an established density or spacing system. Preserve deliberate platform chrome, compact professional tools, and project tokens when they remain usable under hit-area, zoom, localization, and viewport stress tests.
Quick Reference
| Category | When to Use |
|---|---|
| Grouping & Alignment | Space vs separators, alignment edges, logical properties, importance ordering |
| Spacing & Adaptivity | Spacing between targets, layout margins, progressive disclosure, full-bleed content, breakpoints, i18n growth |
Core Principles
1. Group with Space, Not Lines
Negative space is the primary grouping tool; background shapes second; separator lines last, only where space alone can't carry the structure. The gap between groups must be at least 2× the gap within a group (8px intra-group → 16px+ inter-group), or the grouping reads as noise.
2. Keep Controls Distinct from Content
Interactive elements must look interactive: a background shape, a border, or a consistent placement zone. Never style a control identically to adjacent static text.
3. Align to Shared Edges
Pick alignment edges and stick to them; every stray edge reads as noise. Use one project spacing step for each level of subordination (16px is a useful default). Use logical properties (padding-inline-start, margin-inline-end) for direction-dependent layout; reserve physical left/right for genuinely physical geometry.
4. Order by Importance
The most important content sits near the top and the leading edge; reading order flows top-to-bottom, leading-to-trailing. Think in leading/trailing, not left/right.
5. Hint at Hidden Content
Progressive disclosure needs a visible affordance. Use the project's established cue; without one, let the next item peek 16–32px past the scroll edge or show a disclosure control. Content hidden with zero cue may as well not exist.
6. Breathing Room Between Targets
Without an established density system, start with 12px between adjacent bordered or filled controls and 24px of clearance around borderless text- and icon-only controls. Compact layouts may use less when better-accessibility hit areas do not overlap and the controls remain visually distinct.
7. Inset Buttons from the Edges
In content layouts, keep full-width buttons inside the layout margins (start near 16px inline on mobile) with a visible radius. Edge-to-edge actions are acceptable when they intentionally follow established platform or application chrome, account for safe areas, and remain distinguishable from system UI.
8. Content Bleeds, Controls Float
Backgrounds and media extend to the viewport edges; controls and text stay inside the layout margins and safe areas (env(safe-area-inset-*)). Sticky chrome floats above the content layer, it doesn't dam it.
9. Hold Structure Until It Breaks
Breakpoints come from the content, not device presets. Keep the expanded layout as long as it genuinely fits and collapse late; prefer container queries for component-level adaptation. Test the smallest and largest sizes first.
10. Plan for Growth and Clipping
Plan for substantial and language-dependent string growth rather than relying on a universal percentage: no fixed widths or heights on text containers, and let rows wrap. Never park critical actions where resizing or scrolling clips them; keep them reachable in the normal flow or stable chrome appropriate to the product.
Common Mistakes
| Mistake | Fix |
|---|---|
| Separator line where spacing would do | Remove the line, double the gap between groups |
margin-left / padding-right in a localizable l |
よくある質問
プロジェクトのスタイルの仕組みを置き換えますか?
いいえ。変更は、TailwindやプレーンなCSSなど、プロジェクトの既存の仕組みで表すよう定めています。
右から左に読む言語にも対応していますか?
はい。RTLのレイアウトの方向と論理的なCSSのプロパティに対応しています。
アニメーションも扱いますか?
いいえ。見た目の仕上げと動きはbetter-uiのスキルが担当します。
詳細
作者による元の説明
Layout structure for web interfaces, from grouping and alignment to reading order, progressive disclosure, and adaptive breakpoints. Use when structuring a page or component, spacing or aligning controls, deciding what collapses at small sizes, handling RTL layout direction, or reviewing frontend code for layout. Triggers on layout, spacing, alignment, grouping, negative space, whitespace, visual hierarchy, reading order, progressive disclosure, breakpoints, responsive layout, container queries, safe area, full-bleed, edge-to-edge, layout margins, RTL layout, logical properties.
repo: trycompai/crm
人気
- GitHubのスター
- 12k
- ランキング
- #11512
- ライセンス
- MIT
- 更新日
- 2026/11/1
コメント
- …
このリポジトリの他のスキル
ai-elements
12kエージェントが、会話、メッセージ、ツールの表示、プロンプト入力のための既成のコンポーネントを使って、AIチャットの画面を作れるよう支援します。
ai-sdk
12kエージェントが、テキスト生成、ストリーミング、ツール呼び出し、エージェントを含め、Vercel AI SDKでAI機能を作れるよう支援します。
better-accessibility
12kエージェントが、フォーカス、ラベル、ARIA、フォームを含め、キーボードとスクリーンリーダーで使えるインターフェースを作れるよう支援します。
better-auth-best-practices
12kエージェントが、Better Authの文書の手順に従い、TypeScriptのアプリでログイン、セッション、OAuth、プラグインのための設定を行えるよう支援します。
似ているスキル
canvas
394k接続されたMacのパネルにホスト型のビジュアルウィジェットを表示し、そのパネルを隠したり別のページに移動したりするようエージェントを支援します。
control-ui
394kセッション、ダッシュボード、接続されたGatewayを含め、OpenClaw Control UIを整理し、問題を解決するようエージェントを支援します。
diagram-maker
394kプロセス、システムのアーキテクチャ、ホワイトボードのスケッチのために、SVG、HTML、または編集可能なExcalidrawとして、分かりやすい図を作るようエージェントを支援します。