Layout System 标志

Layout System

社区
sanky369
layout-system

修复或构建响应式布局:页面框架、网格、卡片布局、侧边栏、断点策略和容器查询。当用户说“手机上布局乱了”“布局很杂乱”“元素对不齐”“各个区块的间距不一致”“让它适配不同屏幕”“把这个正确居中”,或要求设计仪表盘/页面/网格布局时使用。检查现有 CSS 中的布局问题(固定宽度、绝对定位、媒体查询过多),然后交付可运行的布局代码:重构后的 CSS/JSX、基于规则的 Grid/Flexbox 选择、根据内容确定的断点,以及响应式验证清单。纯粹关于间距 Token 的问题交由 design-foundation 处理,关于文本可读性的问题交由 typography-system 处理。

Add to TypingMind

概览

发布者sanky369
代码仓库vibe-building-skills
技能名称layout-system
星标数
31
复刻数
7
附带文件
1
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 1 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 sanky369 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Layout System AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/layout-system
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/sanky369/vibe-building-skills.git /tmp/vibe-building-skills
mkdir -p .claude/skills
cp -r /tmp/vibe-building-skills/skills/frontend-design/layout-system .claude/skills/layout-system
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Layout System,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Layout System。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Layout System 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Layout System

Produce working, mobile-first layout code for the user's actual screens — a refactored page shell, grid, or component layout — not a CSS tutorial. Governing principle: content determines structure. Choose Grid vs Flexbox by the shape of the content, place breakpoints where the content breaks, and let flexible tracks absorb the rest.

When to use / handoffs

  • Use for page structure, alignment, responsiveness, grids, overlap/overflow bugs, and breakpoint strategy.
  • Spacing values themselves inconsistent across the app (no scale) → establish tokens first via skills/frontend-design/design-foundation.
  • Text hard to read at some widths (line length, fluid type) → skills/frontend-design/typography-system.
  • Layout is fine but the screen feels cluttered → skills/frontend-design/visual-hierarchy-refactoring.

Step 1 — Inspect the codebase

  1. Locate the target. If the user named a screen/component, read it plus its CSS. Otherwise glob the main layout files (**/layout.*, **/App.*, **/*page*, global CSS).
  2. Detect the styling system. Tailwind classes vs CSS Modules vs styled-components — deliver in the same system.
  3. Grep for layout smells and record counts:
    • width:\s*\d+px|w-\[\d+px\] — fixed widths (breakage source #1)
    • position:\s*absolute outside overlays/badges — layout by coordinates
    • float:|margin-top:\s*-|margin-left:\s*- — legacy/negative-margin hacks
    • @media — count distinct breakpoint values; >4 distinct min-widths = breakpoint sprawl
    • overflow-x and 100vw — horizontal-scroll suspects
  4. Read existing breakpoints (Tailwind screens, or media queries) — reuse them unless they're the problem.
  5. Check for spacing tokens — if a scale exists, all new gaps/padding must use it.

Step 2 — Intake

Ask in one batch, only if not inferable: which screen/flow matters most, and the smallest and largest viewports that matter (default: 320px–1440px, content capped ~1200–1280px). Infer density and stack from the code. Don't stall — with a named target and visible code, state assumptions and build.

Step 3 — Build mobile-first, with these decision rules

  1. Start at 320px, single column, then add columns only where content earns them. Never shrink a desktop design downward.
  2. Grid vs Flexbox:
    • Rows AND columns must align (page shell, dashboard, gallery, form with aligned labels) → Grid.
    • One direction, sizes driven by content (navbar, button row, tag list, media-object) → Flexbox.
    • Card grid with unknown item count → Grid with repeat(auto-fit, minmax(min(100%, 280px), 1fr)) — zero media queries.
    • If you're using Flexbox with percentage-width children to fake columns, switch to Grid.
  3. Page shell: Grid with grid-template-areas; collapse areas at smaller widths. Canonical:
css
.shell { display: grid; gap: var(--space-4); grid-template-areas: "header" "main" "footer"; }
@media (min-width: 768px) {
  .shell {
    grid-template-columns: 250px minmax(0, 1fr);
    grid-template-areas: "header header" "sidebar main" "footer footer";
  }
  .sidebar { position: sticky; top: 0; height: fit-content; }
}

(minmax(0, 1fr) — not bare 1fr — so wide children can't blow out the track.) 4. Breakpoints from content: resize until something breaks (line too long, column too squeezed, orphaned whitespace) and put the breakpoint there. Keep to 2–3 per component. Use the project's existing breakpoint tokens. 5. Container queries when a component renders in containers of different widths (card in sidebar AND main): container-type: inline-size on the wrapper, @container (min-width: …) on the component. Viewport media queries only for page-level structure. 6. Media proportions: aspect-ratio + object-fit: cover; never fixed height on responsive images. 7. Units: rem for space/type, %/fr/minmax() for tracks, ch for text measure, px only for borders and true pixel concerns.

For the full pattern gallery (hero, card grid, sidebar, responsive nav, holy-grail, sticky footer, container-query card), read references/layout-patterns.md and adapt rather than reinventing.

Step 4 — Verify at the checkpoints

Test (or reason through, if you can't render) at 320, 375, 768, 1024, 1440. Look for: horizontal scroll, squeezed columns (<~250px of real content), text measure outside 45–75ch, touch targets <44px, content trapped under sticky elements.

Required output format

Deliver code plus this summary:

## Layout changes
[Refactored files with full code — same styling system as the project]

## Decisions
| Question | Choice | Rule applied |
| Shell | Grid, template-areas | 2-D alignment needed |
| Card list | auto-fit minmax(280px, 1fr) | unknown item count → no media queries |
| Breakpoints | 768px, 1024px (existing tokens) | content broke at sidebar collapse |
| Container queries | card only | renders in 2 container widths |

## Smells removed
| Smell | Where | Replaced by |
| fixed width 960px | Header.tsx | max-width + margin-inline auto |
| ... |

## Verified
320 / 375 / 768 / 1024 / 1440 — [result per width, or "reasoned, not rendered" flagged]

Quality bar (check before delivering)

  • No horizontal scrollbar at 320px
  • Zero fixed pixel widths on containers (max-width caps allowed)
  • Grid for 2-D, Flexbox for 1-D — no percentage-width flex-column fakery
  • Body text measure 45–75ch at every breakpoint
  • Touch targets ≥ 44×44px on mobile
  • All gaps/padding use the project's spacing scale (no new magic numbers)
  • ≤3 breakpoints per component, all from the project's breakpoint set
  • Visual reordering (Grid placement, order) doesn't scramble DOM/tab order
  • aspect-ratio on media; no fixed-height image boxes

Integration

  • Consumes: spacing scale + breakpoint tokens from skills/frontend-design/design-foundation.
  • Produces: the page shell and layout patterns that skills/frontend-design/typography-system (measure, fluid type) and skills/frontend-design/visual-hierarchy-refactoring (whitespace, grouping) refine, and that skills/frontend-design/component-architecture encodes as reusable layout components.
  • Accessibility of the result is audited by skills/frontend-design/accessibility-excellence.

References

  • references/layout-patterns.md — copy-adaptable patterns: hero, card grid, sidebar+main, responsive nav, holy grail, sticky footer, container-query card, aspect-ratio media, plus the breakpoint table. Read when building any standard pattern.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Layout System AI 技能有什么作用?

修复或构建响应式布局:页面框架、网格、卡片布局、侧边栏、断点策略和容器查询。当用户说“手机上布局乱了”“布局很杂乱”“元素对不齐”“各个区块的间距不一致”“让它适配不同屏幕”“把这个正确居中”,或要求设计仪表盘/页面/网格布局时使用。检查现有 CSS 中的布局问题(固定宽度、绝对定位、媒体查询过多),然后交付可运行的布局代码:重构后的 CSS/JSX、基于规则的 Grid/Flexbox 选择、根据内容确定的断点,以及响应式验证清单。纯粹关于间距 Token 的问题交由 design-foundation 处理,关于文本可读性的问题交由 typography-system 处理。

为什么在 TypingMind 中使用 Layout System?

因为您只需安装一次,就能搭配任何模型使用。Layout System 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Layout System?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/sanky369/vibe-building-skills/tree/main/skills/frontend-design/layout-system。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Layout System?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Layout System 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Layout System 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Layout System AI 技能免费吗?

是的。sanky369 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇