swiftui-skills

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

swiftui-skills

swiftui-skills

What this is

这是什么

A packaged set of Apple-authored AdditionalDocumentation shipped inside Xcode, plus prompts that enforce Apple-native patterns and reduce hallucinations.
一套打包好的、由苹果官方编写的AdditionalDocumentation(附加文档),这些文档来自Xcode,同时包含可强化Apple原生开发模式、减少幻觉输出的提示词。

Source of truth

事实依据

All factual claims and APIs must be grounded in files under
/docs
.
所有事实声明和API必须以
/docs
目录下的文件为依据。

How to use

使用方法

  • If you are writing code: pick the relevant doc(s), summarize the applicable rules, then produce compile-ready Swift code.
  • If you are reviewing code: list issues and improvements, referencing doc(s) used.
  • If uncertain: ask at most 1 question, only if the answer changes architecture.
  • 如果你要编写代码:选择相关文档,总结适用规则,然后生成可编译的Swift代码。
  • 如果你要审核代码:列出问题和改进点,并注明所参考的文档。
  • 如有疑问:最多提出1个问题,且仅当该问题的答案会影响架构时才提问。

Setup check

安装检查

If the
docs/
folder is empty or contains no
.md
files, the Xcode documentation has not been extracted yet. Tell the user to run the setup script to complete installation:
~/.agents/skills/swiftui-skills/setup.sh
Do not proceed with SwiftUI guidance until docs are available.
如果
docs/
文件夹为空或没有
.md
文件,说明Xcode文档尚未提取完成。 请告知用户运行以下安装脚本以完成设置:
~/.agents/skills/swiftui-skills/setup.sh
在文档准备完成前,请勿提供SwiftUI相关指导。

Non-negotiables

不可协商的规则

  • Do not invent types or APIs. If it is not in
    /docs
    , say so and offer a safe alternative.
  • Prefer minimal, idiomatic SwiftUI and platform conventions.
  • Include availability notes when APIs are new.
  • 不得虚构类型或API。如果某个内容不在
    /docs
    目录中,请如实说明并提供安全替代方案。
  • 优先采用简洁、符合Apple原生风格的SwiftUI及平台约定。
  • 当使用较新的API时,需包含可用性说明。

Output format

输出格式

  1. Selected docs (filenames)
  2. Plan (3 to 6 bullets)
  3. Code (full files or a single cohesive snippet)
  4. Why this matches Apple docs (2 to 5 bullets)
  5. Pitfalls (short)
  1. 所选文档(文件名)
  2. 计划(3至6个项目符号)
  3. 代码(完整文件或连贯的代码片段)
  4. 符合Apple文档的原因(2至5个项目符号)
  5. 注意事项(简短说明)