Use this skill when designing, reviewing, or generating CSS layout with display grid or flex. Apply it whenever the user asks about grid-template, grid-area naming, flex-direction, or needs to choose between grid and flex for component or page layout.
Ships in kf-global. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
この skill は、display: grid を第一候補にしつつ、display: flex の使いどころを絞り、視覚配置をコードへそのまま写すためのものです。
grid-template、空セル、grid-area 命名、flex-direction の選択を主に扱います。
ブレイクポイント、Container Queries、流体サイズの単位選定は ../kf-g-css-tak-responsive-rules/SKILL.md を優先し、gap と margin の責務分離は ../kf-g-css-spacing-gap-margin-rules/SKILL.md を優先します。
display: grid と display: flex のどちらを選ぶか決めるときgrid-template と grid-template-areas のどちらで書くか見直すときgrid-area の命名ルールを決めるときgrid で表現できないか検討するときflex が混ざっていないか確認するときgrid-template でそのまま表現できないかflex が必要なのは一列方向の整列だけかgrid や flex を足さない。grid を第一候補にする。grid-template で書けないか考える。gap、開始位置、将来の並び替えを考えると grid のほうが崩れにくいことが多い。flex は横一列の整列、両端寄せ、中央寄せ、折り返し可能な軽い並びに限定して使う。flex を選ぶ理由は、一方向の分配や整列で十分だからであり、二次元の配置や空白の設計が主題になった時点で grid に戻す。grid-template を最優先にするgrid-template で視覚的に表現できないか考える。grid-template-areas より grid-template を優先する。エリア名とトラックサイズを同じ場所に書けるため、見た目と実装の対応が崩れにくい。.feature {
display: grid;
gap: 1rem 1.5rem;
grid-template:
"... title" auto
"media body " auto
"media meta " auto
/ 12rem 1fr;
}
gap と margin の使い分けは ../kf-g-css-spacing-gap-margin-rules/SKILL.md を参照する。grid-area 名は [grid-area] で持つgrid-area 名のソースにしない。[grid-area] 属性へ分離する。[grid-area] の値は、見た目ではなくレイアウト上の役割で命名する。* ではなく :where([grid-area]) に限定する。[grid-area] へ限定した共通 rule のパフォーマンス懸念は小さい。属性セレクタの一致対象が絞られ、grid-area 自体も grid item にしか効かないためである。attr() を content 以外で使う typed syntax は互換性がまだ揃っていない。基礎 CSS に入れる場合は、対応ブラウザが保証される案件か、@supports 付きのプログレッシブエンハンスメントに限る。<section class="feature">
<h1 class="feature-title" grid-area="title">タイトル</h1>
<div class="feature-media" grid-area="media">...</div>
<p class="feature-body" grid-area="body">...</p>
</section>
@supports (grid-area: attr(grid-area type(<custom-ident>), auto)) {
:where([grid-area]) {
grid-area: attr(grid-area type(<custom-ident>), auto);
}
}
grid-area 宣言をフォールバックとして持つ。flex は横一列の整列に絞るflex を使ってよい。justify-content、align-items、flex-wrap を使いたい場面は flex が自然である。grid へ戻す。.actions {
display: flex;
flex-wrap: wrap;
gap: 0.5rem;
align-items: center;
}
grid-template で書けるのに、grid-template-areas と行列定義が分かれていないか。grid-area 名を class 名から流用していないか。grid-area の共通 rule を * へ当てていないか。[grid-area] へ限定しているか。attr() を使う前提なのに、対応ブラウザや @supports を無視していないか。flex で二次元レイアウトを無理に組んでいないか。grid と flex のどちらを選ぶか、その理由を一文で明示する。grid を選ぶ場合は、grid-template で視覚構造を先に示す。flex を選ぶ場合は、一方向の整列だけで十分な理由を示す。[grid-area] を使う場合は、class とレイアウト名の責務分離を明示する。[grid-area] の共通 rule を使う場合は、パフォーマンスより互換性が論点であることと、[grid-area] 限定かどうかを明示する。grid や flex を足していないか。grid-template で表現できるのに、別の書き方へ逃げていないか。grid-area 名は [grid-area] へ分離されているか。attr() を使う共通 rule は :where([grid-area]) へ限定し、@supports か対応ブラウザ保証の条件があるか。flex は横一列の整列に限定されているか。What SKILL.md sets; muted values are Claude Code's defaults
/kf-global:kf-g-css-flex-gridfrom kf-global
npx claudepluginhub melumuccu/ai --plugin kf-global35 skills in this plugin
/kf-g-agent-git-managed-workflowUse this skill when changing any git-managed files in a repository. Always apply it before creating issues, dedicated worktrees, commits, or pull requests for such changes; covers issue-first planning, worktree path and branch naming, atomic commits, push, PR creation, presenting the PR URL to the user, and stopping on hook failures without --no-verify.
/kf-g-agent-planning-design-as-finalUse this skill whenever creating or revising planning documents, design docs, issue/PR planning HTML, or any equivalent design text. Rewrite the published text as one complete final design, as if it had been planned that way from the start, for a reader with no prior conversation./kf-g-agent-research-report-only-unless-approvedOther plugins' skills for the same job