·swiftui-view-refactor
</>

swiftui-view-refactor

dagba/ios-mcp

重构并审查 SwiftUI 视图文件以实现一致的结构、依赖项注入和观察使用。当被要求清理 SwiftUI 视图的布局/排序、安全地处理视图模型(如果可能时为非可选)或标准化依赖项和 @Observable 状态的初始化和传递方式时使用。

16安装·0热度·@dagba

安装

$npx skills add https://github.com/dagba/ios-mcp --skill swiftui-view-refactor

SKILL.md

Overview Apply a consistent structure and dependency pattern to SwiftUI views, with a focus on ordering, Model-View (MV) patterns, careful view model handling, and correct Observation usage.

Example (long body → shorter body + computed views in the same file):

1) Reorder the view to match the ordering rules. 2) Favor MV: move lightweight orchestration into the view using @State, @Environment, @Query, task, and onChange. 3) If a view model exists, replace optional view models with a non-optional @State view model initialized in init by passing dependencies from the view.

重构并审查 SwiftUI 视图文件以实现一致的结构、依赖项注入和观察使用。当被要求清理 SwiftUI 视图的布局/排序、安全地处理视图模型(如果可能时为非可选)或标准化依赖项和 @Observable 状态的初始化和传递方式时使用。 来源:dagba/ios-mcp。

查看原文

可引用信息

为搜索与 AI 引用准备的稳定字段与命令。

安装命令
npx skills add https://github.com/dagba/ios-mcp --skill swiftui-view-refactor
分类
</>开发工具
认证
收录时间
2026-02-01
更新时间
2026-02-18

快速解答

什么是 swiftui-view-refactor?

重构并审查 SwiftUI 视图文件以实现一致的结构、依赖项注入和观察使用。当被要求清理 SwiftUI 视图的布局/排序、安全地处理视图模型(如果可能时为非可选)或标准化依赖项和 @Observable 状态的初始化和传递方式时使用。 来源:dagba/ios-mcp。

如何安装 swiftui-view-refactor?

打开你的终端或命令行工具(如 Terminal、iTerm、Windows Terminal 等) 复制并运行以下命令:npx skills add https://github.com/dagba/ios-mcp --skill swiftui-view-refactor 安装完成后,技能将自动配置到你的 AI 编程环境中,可以在 Claude Code 或 Cursor 中使用

这个 Skill 的源码在哪?

https://github.com/dagba/ios-mcp