shade-use-primitives
它能做什么
这个技能告诉 AI 智能体使用 Shade 的布局组件,而不是手写布局类。适合构建界面、并希望间距和结构保持一致的开发者。
适用场景
- ✓当你在基于 Shade 的应用中排列界面、区块或一行内容的时候。
- ✓当你需要设置元素的间距、对齐、堆叠或换行的时候。
- ✓当你想为普通包裹元素添加布局类的时候。
技能链接
https://github.com/TryGhost/Ghost/blob/main/apps/shade/skills/shade-use-primitives/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请帮我用 Shade 的布局组件排列设置页面中的表单字段,让它们间距均匀。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会为每个包裹元素选择一个布局组件,例如垂直分组使用 Stack,一行内容使用 Inline。它会用 Shade 命名的间距档位设置间隙和内边距,只有属性无法覆盖的地方才使用类名。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Shade use primitives
Layout in Ghost UI reads by intent: Stack, Inline, Box, Grid,
Container and Text replace hand-written flex and grid classes. The rules
live in Primitives.
Docs links use https://shade.ghost.org. If the project's AGENTS.md says
where Shade's docs are (another address, or a source folder), use that
instead. Fetch web pages with curl -s.
Workflow
- Check for a larger shape first. A whole page starts from
shade-page-templates; a recurring product shape may already be a pattern in Patterns. - Pick the primitive for each wrapper with Use a primitive when.
- Set gaps and padding from the Spacing scale.
- Reserve
classNamefor what the props don't cover.
Self-check
- No wrapper element in your diff carries only layout classes.
- Spacing on primitives uses the named steps, and direction, gap, alignment and justification come from props.
- Nothing in Don't applies to your diff.
常见问题
主要的布局组件有哪些?
该技能列出了 Stack、Inline、Box、Grid、Container 和 Text 作为基础组件。
我还需要写 flex 或 grid 类吗?
该技能说明,布局应当体现设计意图,因此这些基础组件可以替代大部分手写的 flex 和 grid 类。
整个页面有捷径吗?
有。整个页面从页面模板开始,重复出现的结构可能已经有现成的模式可用。
详情
作者的原始描述
Lay out Ghost UI with Shade's layout primitives. Use when laying out a screen, section or row, or when spacing, aligning, stacking or wrapping elements.
repo: TryGhost/Ghost
热度
- GitHub 星标
- 56k
- 排名
- #3287
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
tinybird-cli-guidelines
56k指导你的智能体使用 Tinybird CLI 命令进行本地开发、分支工作、构建、部署和数据管理。
tinybird
56k教你的智能体为数据源、管道、端点和物化视图编写 Tinybird 文件格式、SQL 规则和性能模式。
build-ghost-app
56k帮你的智能体使用 Vite 和 React 构建 Ghost 应用,将其连接到 Ghost Admin,并设置其清单和安装链接。
build-ghost-app-ui
56k帮你的智能体使用 Ghost 的设计系统 Shade 构建 Ghost 应用的界面,并将它指向正确的文档和技能。