返回顶部
s

swiftverifySwift验证

Apple Design Award 标准的 Swift/SwiftUI 项目验证技能。执行编译、架构、设计系统、无障碍、国际化、性能、原生集成七层检查,生成综合报告。

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
81
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

swiftverify

SwiftVerify: Apple 原生应用质量验证技能 (v1.0)

核心任务: 确保代码达到 Apple Design Award 评审标准 (执行 ./tools/quality_gate.sh full)。
执行频率: 每次 Feature 完成后、PR 合并前、发布前必须执行。

技能目录结构

├── scripts/
│ ├── run_all.sh # 入口脚本
│ ├── check_build.sh # Step 1: 编译
│ ├── check_architecture.sh # Step 2: 架构
│ ├── checkdesigntokens.sh # Step 3: 设计
│ ├── check_a11y.sh # Step 4: 无障碍
│ ├── check_i18n.sh # Step 5: 国际化
│ ├── check_performance.sh # Step 6: 性能
│ ├── check_native.sh # Step 7: 原生
│ └── check_tests.sh # Step 8: 测试

技能拓扑图 (Topology)

mermaid
graph TD
User[用户 / CI] -->|调用| RunAll[run_all.sh]

subgraph 验证步骤
RunAll --> Build[1. 编译与代码检查]
RunAll --> Arch[2. 架构]
RunAll --> Tokens[3. 设计令牌]
RunAll --> A11y[4. 无障碍]
RunAll --> I18n[5. 国际化]
RunAll --> Perf[6. 性能]
RunAll --> Native[7. 原生集成]
RunAll --> Tests[8. 单元测试]
end

subgraph 依赖项
Build --> Xcode[xcodebuild]
Build --> SwiftLint[swiftlint]
Tests --> XCTest[XCTest]
Arch --> Grep[grep/awk]
end

subgraph 规则
RunAll -.-|quality_gate.sh| Tools[项目工具]
end

│ ├── check_build.sh # Step 1: 编译检查
│ ├── check_architecture.sh # Step 2: 架构漂移检测
│ ├── checkdesigntokens.sh # Step 3: 设计系统合规
│ ├── check_a11y.sh # Step 4: 无障碍检查
│ ├── check_i18n.sh # Step 5: 国际化检查
│ ├── check_performance.sh # Step 6: 性能基准 (需手动)
│ ├── check_native.sh # Step 7: 原生集成检查
│ └── run_all.sh # 一键执行全部检查
├── templates/
│ └── verification_report.md # 报告模板
└── resources/
└── ada_checklist.md # Apple Design Award 检查清单



1. 执行流程 (Execution Protocol)

快速验证 (Quick Check)

bash ./agent/skills/swiftverify/scripts/run_all.sh

完整验证 (Full Check)

按顺序执行以下检查,任一失败则阻断:
步骤脚本验证内容阻断级别
1checkbuild.sh编译通过 + SwiftLint🔴 硬阻断
2
checkarchitecture.sh | MVVM+ 分层 + 依赖方向 | 🔴 硬阻断 | | 3 | checkdesigntokens.sh | 令牌使用率 100% | 🟡 软阻断 | | 4 | check_a11y.sh | 无障碍标签覆盖 | 🟡 软阻断 | | 5 | check_i18n.sh | 字符串本地化 100% | 🟡 软阻断 | | 6 | check_performance.sh | 性能基准 (手动) | 🟢 信息 | | 7 | check_native.sh | 原生集成验证 | 🟢 信息 | | 8 | check_tests.sh | 单元测试 (XCTest) | 🟡 软阻断 |

2. 检查详情 (Check Details)

无障碍参考

swiftverify 整合了完整的无障碍检查指南。详见 resources/accessibility-checklist.md。

自动检查项

  • - ✅ VoiceOver 标签缺失检测
  • ✅ 硬编码字号检测(破坏动态字体)
  • ✅ 减少动态效果适配提示
  • ✅ 空标签或占位符标签检测
  • ✅ 触控目标大小验证

执行检查
bash
./scripts/check_a11y.sh

步骤 1: 编译检查 (Build Check)

文件: scripts/check_build.sh
检查项标准状态
xcodebuild 编译退出码 0硬阻断
SwiftLint
0 错误 | 硬阻断 | | 生命周期激活 | 所有服务启动 | 硬阻断 |

步骤 2: 架构漂移检测 (Architecture Drift)

文件: scripts/check_architecture.sh
检查项验证规则状态
视图层隔离Views/ 不导入 SwiftData硬阻断
模型层隔离
Models/ 不导入 SwiftUI | 硬阻断 | | Sendable 符合 | 所有模型实现 Sendable | 硬阻断 | | GCD 禁用 | 无 DispatchQueue | 硬阻断 |

步骤 3: 设计系统合规 (Design System Compliance)

文件: scripts/checkdesigntokens.sh
检查项验证规则状态
硬编码颜色无 Color(#...) 或 .red 等软阻断
硬编码数值
无 .padding(16) 等 | 软阻断 | | 标准圆角 | 使用 DesignTokens.CornerRadius | 软阻断 | | 标准间距 | 使用 DesignTokens.Spacing | 软阻断 |

步骤 4: 无障碍检查 (Accessibility)

文件: scripts/check_a11y.sh
检查项验证规则状态
accessibilityLabel所有按钮/图片有标签软阻断
触控区域
交互元素 ≥ 44x44 pt | 软阻断 | | 动态字体 | 无 .font(.system(size:)) | 软阻断 |

步骤 5: 国际化检查 (Internationalization)

文件: scripts/check_i18n.sh
检查项验证规则状态
字符串本地化使用 String(localized:)软阻断
无硬编码中文
Text(中文) 需替换 | 软阻断 |

步骤 6: 性能检查 (Performance)

文件: scripts/check_performance.sh
检查项工具标准
启动时间Instruments< 400ms
内存泄漏
Instruments Leaks | 0 | | 主线程阻塞 | 主线程检查器 | 0 |

⚠️ 性能检查需要手动运行 Instruments

步骤 7: 原生集成检查 (Native Integration)

文件: scripts/check_native.sh
检查项验证规则状态
AppIntent 存在Intents/ 目录非空信息
Shortcuts 注册
AppShortcutsProvider 存在 | 信息 |

步骤 8: 单元测试 (Unit Tests)

文件: scripts/check_tests.sh
检查项验证规则状态
单元测试如果存在测试目标,必须全部通过软阻断
代码覆盖率
(可选) 输出覆盖率报告 | 信息 |

3. 报告生成 (Report Generation)

执行完成后,在 specs/verification_report.md 生成报告:

markdown

验证报告 - [日期]

总体状态: ✅ 通过 / ❌ 失败

检查维度状态违规数
编译检查0
架构一致性
✅ | 0 | | 设计系统 | ⚠️ | 3 | | 无障碍 | ⚠️ | 5 | | 国际化 | ✅ | 0 | | 性能 | ⏳ | - | | 原生集成 | ✅ | 0 | | 单元测试 | ✅ | 0 |

违规详情

...

4. 自动修复 (Auto-Fix)

对于软阻断级别的违规,提供自动修复建议:

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 swiftverify-1776012195 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 swiftverify-1776012195 技能

通过命令行安装

skillhub install swiftverify-1776012195

下载

⬇ 下载 swiftverify v1.0.0(免费)

文件大小: 3.65 KB | 发布时间: 2026-4-13 12:14

v1.0.0 最新 2026-4-13 12:14
- Initial release of SwiftVerify, a comprehensive Swift/SwiftUI project validation skill adhering to Apple Design Award standards.
- Provides 8-step verification: build, architecture, design system, accessibility, internationalization, performance, native integration, and unit testing.
- Generates a detailed, consolidated report, including violation counts and auto-fix suggestions for SOFT issues.
- Includes dedicated scripts for each check and CI/CD integration guidance.
- Supports both quick and full validation flows to ensure high app quality across code, UX, and compliance.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部