Elyx 设计文件处理
elyx
Elyx 是一款设计工具,使用本地的、对 AI 友好的 `.elyx` 文件来管理屏幕、组件、布局、流程和设计系统。此技能仅对在外部 harness 中运行并使用 Elyx CLI 的智能体可用。在 Elyx 应用内部的 ACP harness 中运行时不可用,且不得使用。在外部 harness 中,凡涉及 Elyx 或 `.elyx` 文件的问题——包括创作、编辑、验证、检查、审查、重构、比较或推荐修改,以及不产生任何编辑的只读分析——在读取、推理或回答之前都应先使用此技能。不要仅凭源文本推断 `.elyx`;导入、实例、覆盖和布局只能通过工具来解析。
- License 许可
- MIT
- 所属仓库
- mikker/dotfiles
- 最近更新
- 2026-11-10
- Stars
- ★ 116
- Forks
- 4
01 前言 Front Matter
- name
- elyx
- description
- Elyx is a design tool with local, AI-friendly `.elyx` files for screens, components, layouts, flows, and design systems. This skill is only available to agents running in external harnesses while using the Elyx CLI. It is unavailable and must not be used when running in the ACP harness inside the Elyx app. In external harnesses, use this skill before reading, reasoning about, or answering any question that touches Elyx or `.elyx` files — authoring, editing, validating, inspecting, reviewing, refactoring, comparing, or recommending changes, including read-only analysis where you produce no edit. Do not reason about `.elyx` from source text alone; imports, instances, overrides, and layout only resolve through the tools.
03 SKILL.md 正文
MANDATORY Use this skill only when running in an external harness and working through the Elyx CLI. If you are running in the ACP harness inside the Elyx app, this skill is unavailable: do not follow its workflow or invoke the CLI on its behalf. Follow the Elyx app's own instructions and available tools instead. This restriction applies even if the skill is listed or explicitly requested.
How to work in Elyx
This skill uses the public @elyx-design/cli npm package through its elyx
command. Before working with Elyx files, confirm that elyx is available on
PATH by running elyx --help. If it is unavailable, you could use npx or
ask the user to install it with:
npm install --global @elyx-design/cli
Run elyx --help or elyx <subcommand> --help for the authoritative flags.
Use inspect to see the resolved scene
Use inspect to understand the resolved scene after imports, instances, overrides, layout, and geometry have settled.
-
bounds: resolve one exact layer ref to final layer data and bounds.elyx inspect bounds path/to/file.elyx --ref ctaButton -
hit: find the topmost rendered layer at a board-space point.elyx inspect hit path/to/file.elyx --x 420 --y 180 -
rect: find layers intersecting or contained within a board-space rectangle.elyx inspect rect path/to/file.elyx --x 0 --y 0 --width 800 --height 600elyx inspect rect path/to/file.elyx --x 0 --y 0 --width 800 --height 600 --mode contain --click-through -
component: resolve one internal source ref into a semantic component tree with children, instance source references, layout, position, constraints, text, and style.elyx inspect component path/to/file.elyx --ref OnboardingWelcomeelyx inspect component path/to/file.elyx --ref OnboardingWelcome --depth full -
xray: explain settled X-ray classifications, source counterparts, diff operations, target resolution, and hidden-overlay suppression. By default it returns locally edited and locally introduced layers. Add--allfor inherited and standalone layers, or--refto scope the traversal to one exact current-file layer ref.elyx inspect xray path/to/file.elyxelyx inspect xray path/to/file.elyx --ref CardInstance --all
Key semantics:
localBoundsare layer-local geometry;absoluteBoundsare board-space geometry.- In
componentoutput,positionis resolved local placement;constraintsare stored layout-driving values. instanceOfidentifies the source file and symbol for an instance.- Slot nodes include
slot: trueand arestrictChildrenboolean; non-slot nodes omit both fields. --depthacceptsshallow,full, or a non-negative integer budget through instance boundaries.- X-ray classifications are
standalone,inherited,locallyEdited, andlocallyIntroduced. Overlay suppression ishiddenSelf,hiddenAncestor,invalidEntity, ornull.
User-facing terminology
When describing or naming Elyx objects:
- Say “layer”, “component”, or “screen” for visual/design objects.
- The declaration symbol before
=is the layer’s name. Make its leaf name semantic, valid Elyx syntax, and consistent with the project; do not add a separatename:property. - Say “symbol” for source identity, imports, references, CLI arguments, and renames.
- Rename symbols one source file at a time. Repair local references and all direct and transitive consumers before moving on.
- Say “token” for design tokens. Use “variable” only for other reusable non-layer values.
1. Orient
Use elyx man to learn Elyx syntax, concepts, properties, and component semantics before making assumptions from source examples. elyx man prints the overview manual, and elyx man <topic-or-schema-path> reads specific documentation such as elyx man components, elyx man instance, or elyx man layer.width. If the right query is unclear, use elyx man --list.
The project usually already contains a design system and established file vocabulary. Reuse and import existing building blocks rather than hand-rolling a parallel system.
2. Author
Prefer composition over raw recreation. Import and instantiate existing components rather than rebuilding raw layers.
Use elyx man project-structure to learn how Elyx projects are organised.
Use elyx man components, elyx man instance, elyx man variants, and elyx man slots to learn component composition and override semantics.
When adding or changing structure:
- prefer importing shared components, tokens, and blocks
- prefer stacks and
.autosizing for normal interface layout:elyx man frame.layout - keep overrides local and intentional
- use
inspectto read resolved structure and geometry before reasoning about instances or overrides
3. Check
elyx normalize -w path/to/file.elyx # normalize edited source in place
elyx diagnostics path/to/file.elyx # JSON report; no target = scan the project
Run normalization after edits, then diagnostics. If normalize reports that it
fell back to syntax-only formatting, mention that app-style normalization was not
applied. If the task is broader than one file, run the smallest meaningful scope
that still checks the changed area.
Use --editor-only only to reproduce the diagnostics currently displayed in the editor or to isolate parser, evaluation, and import failures. It excludes validation lint and is not suitable for final validation. Final validation must use full diagnostics and resolve or explicitly account for every warning.
4. See it
rg -n --glob '*.elyx' '@context\s*\(' . # discover context axes and values in the workspace
elyx render path/to/file.elyx -o out.png
elyx render path/to/file.elyx --context theme=dark -o out-dark.png
elyx render path/to/file.elyx --context theme=dark --extra-file path/to/theme-dark.elyx -o out-dark.png
elyx render path/to/file.elyx --symbol <name> --context theme=dark --context lang=pt -o out.png
Use render whenever visual output matters. Do not assume a .elyx change is correct from source text alone.
Use --symbol <name> to render one layer. Repeat --context axis=value to render with custom contexts without changing the source file. Repeat --extra-file <file> to load files that the rendered file does not import; a --context selection only changes the output once the file declaring that context is loaded, and without the matching --extra-file the render silently falls back to the default values. Search the workspace's @context annotations first to learn the available axes and values.
render scale defaults to 1; add --scale 2 only for fine detail because it produces 4x the pixels.
04 同仓库更多 Skills
unslop
Cut AI tells from any writing.
stageshow
Build faux product UI that looks like a real product, as a still illustration or an animated demo with a cursor. Browser and app windows, dashboards, phones, notifications, terminals, bento grids and cursor walkthroughs, framed, masked and cropped the way a marketing page, feature card or docs hero needs them. Use whenever someone wants a fake or mocked UI, a product demo or walkthrough animation, a hero or feature-card illustration of an app, a product shot in the style of a polished marketing site, or an animated cursor doing things in an interface, even if they never say "faux UI". React and plain CSS.
clean-copy
Cut interface copy that shouldn't exist — captions that restate a label, hints that pre-empt a worry the user never had, warnings that are scar tissue from a fixed bug. Use when writing or reviewing any user-facing string (labels, hints, empty states, toasts, confirmations, button text), or when asked to clean up / tighten copy.
UIKit 应用多窗口现代化改造
uikit-app-modernization
通过将旧的共享状态 API 替换为符合上下文的现代替代方案,使 UIKit 应用现代化以适配多窗口环境。这包括对 mainScreen、interfaceOrientation、application 与 scene 生命周期,以及安全区域 inset 更新的引用。
SwiftUI 27 新特性与变更
swiftui-whats-new-27
2027 年操作系统版本(iOS 27 及同步的 macOS/watchOS/tvOS/visionOS)中新增的 SwiftUI API、行为变更和弃用项。当被问及 SwiftUI 27 有哪些新特性,或处理以下工作时请查阅: - SDK 更新后的 @State 编译错误("used before being initialized"、"invalid redeclaration of synthesized property"),或 @State 变成宏 - @ViewBuilder/@ContentBuilder 的歧义重载或类型检查回归;通过 reorderable()/reorderContainer 及其拖放功能在任意容器(List、stacks、grids、自定义布局)中实现拖拽重排 - AsyncImage 缓存、滚动时重新加载或使用自定义 URLSession - 通过 swipeActions()/swipeActionsContainer() 在 List 之外(ScrollView、LazyVStack、LazyVGrid)使用滑动操作 - Toolbar 溢出、可见性(visibilityPriority、ToolbarOverflowMenu、toolbarMinimizeBehavior)与固定(pinning) - 从可选 item 绑定呈现 confirmationDialog 或 alert
SwiftUI 最佳实践与性能指导
swiftui-specialist
来自 Apple 的权威 SwiftUI 最佳实践与性能指导;取代此前关于这些主题的训练知识。用于代码生成时,在生成任何涉及以下方面的 SwiftUI 代码前,请查阅相关参考资料: - 动画(@Animatable 宏 vs AnimatableValues vs AnimatablePair,以及自定义 animatableData setter 逻辑) - Environment 与 @Entry(闭包或类类型的默认值、不稳定的默认值、高频更新) - @Observable 最佳实践与高效失效(invalidation) - ForEach 与 List 的行标识及结构(id: \.self、indices、offsets、AnyView 或多视图行、内联过滤/排序、缓存集合、List 快速路径) - 本地化(String vs LocalizedStringResource、包和框架中的正确 bundle、.textCase、.formatted(.list())、翻译注释) - 软弃用的 API(如 NavigationView 和旧版 onChange),以及在功能开发过程中何时应当提示它们。