swiftui-pro by twostraws/swiftui-agent-skill
npx skills add https://github.com/twostraws/swiftui-agent-skill --skill swiftui-pro审查 Swift 和 SwiftUI 代码的正确性、现代 API 使用情况以及是否符合项目约定。仅报告真实存在的问题——不要吹毛求疵或捏造问题。
审查流程:
references/api.md 检查是否使用了已弃用的 API。references/views.md 检查视图、修饰符和动画是否已优化编写。references/data.md 验证数据流配置是否正确。references/navigation.md 确保导航已更新且性能良好。references/design.md 确保代码使用的设计符合无障碍要求并遵循 Apple 的人机界面指南。references/accessibility.md 验证无障碍合规性,包括动态类型、旁白和减弱动态效果。references/performance.md 确保代码能够高效运行。references/swift.md 快速验证 Swift 代码。广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/hygiene.md 进行最终代码卫生检查。如果进行部分审查,仅加载相关的参考文件。
按文件组织发现的问题。对于每个问题:
foregroundStyle() 代替 foregroundColor()")。跳过没有问题的文件。最后提供一个优先级的总结,列出最需要优先进行的影响最大的更改。
示例输出:
第 12 行:使用 foregroundStyle() 代替 foregroundColor()。
// 修复前
Text("Hello").foregroundColor(.red)
// 修复后
Text("Hello").foregroundStyle(.red)
第 24 行:纯图标按钮对旁白不友好 - 添加文本标签。
// 修复前
Button(action: addUser) {
Image(systemName: "plus")
}
// 修复后
Button("Add User", systemImage: "plus", action: addUser)
第 31 行:避免在视图主体中使用 Binding(get:set:) - 改用 @State 配合 onChange()。
// 修复前
TextField("Username", text: Binding(
get: { model.username },
set: { model.username = $0; model.save() }
))
// 修复后
TextField("Username", text: $model.username)
.onChange(of: model.username) {
model.save()
}
foregroundColor() 应改为 foregroundStyle()。示例结束。
references/accessibility.md - 动态类型、旁白、减弱动态效果和其他无障碍要求。references/api.md - 为现代 API 更新代码,以及它所替代的已弃用代码。references/design.md - 构建符合 Apple 人机界面指南的无障碍应用的指导原则。references/hygiene.md - 使代码能够干净地编译并长期可维护。references/navigation.md - 使用 NavigationStack/NavigationSplitView 进行导航,以及警告、确认对话框和表单。references/performance.md - 优化 SwiftUI 代码以获得最佳性能。references/data.md - 数据流、共享状态和属性包装器。references/swift.md - 编写现代 Swift 代码的技巧,包括有效使用 Swift 并发。references/views.md - 视图结构、组合和动画。每周安装量
6.9K
仓库
GitHub 星标
3.0K
首次出现
2026年3月5日
安全审计
安装于
codex6.7K
opencode6.7K
github-copilot6.6K
cursor6.6K
gemini-cli6.6K
kimi-cli6.6K
Review Swift and SwiftUI code for correctness, modern API usage, and adherence to project conventions. Report only genuine problems - do not nitpick or invent issues.
Review process:
references/api.md.references/views.md.references/data.md.references/navigation.md.references/design.md.references/accessibility.md.references/performance.md.references/swift.md.references/hygiene.md.If doing a partial review, load only the relevant reference files.
Organize findings by file. For each issue:
foregroundStyle() instead of foregroundColor()").Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
Example output:
Line 12: UseforegroundStyle() instead of foregroundColor().
// Before
Text("Hello").foregroundColor(.red)
// After
Text("Hello").foregroundStyle(.red)
Line 24: Icon-only button is bad for VoiceOver - add a text label.
// Before
Button(action: addUser) {
Image(systemName: "plus")
}
// After
Button("Add User", systemImage: "plus", action: addUser)
Line 31: AvoidBinding(get:set:) in view body - use @State with onChange() instead.
// Before
TextField("Username", text: Binding(
get: { model.username },
set: { model.username = $0; model.save() }
))
// After
TextField("Username", text: $model.username)
.onChange(of: model.username) {
model.save()
}
foregroundColor() on line 12 should be foregroundStyle().End of example.
references/accessibility.md - Dynamic Type, VoiceOver, Reduce Motion, and other accessibility requirements.references/api.md - updating code for modern API, and the deprecated code it replaces.references/design.md - guidance for building accessible apps that meet Apple’s Human Interface Guidelines.references/hygiene.md - making code compile cleanly and be maintainable in the long term.references/navigation.md - navigation using NavigationStack/NavigationSplitView, plus alerts, confirmation dialogs, and sheets.references/performance.md - optimizing SwiftUI code for maximum performance.references/data.md - data flow, shared state, and property wrappers.Weekly Installs
6.9K
Repository
GitHub Stars
3.0K
First Seen
Mar 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex6.7K
opencode6.7K
github-copilot6.6K
cursor6.6K
gemini-cli6.6K
kimi-cli6.6K
99,500 周安装
references/swift.md - tips on writing modern Swift code, including using Swift Concurrency effectively.references/views.md - view structure, composition, and animation.