用途:作为 Apple HIG 相关工作的验证环节,先运行审计找出具体问题,再用匹配的 HIG 技能与参考主题修复。
主要能力:HIG Doctor 以文档站点 https://apple.raintree.technology 发布为 hig-doctor,基于正则扫描项目,按 critical、serious、moderate、positive 分级输出发现。critical 视为发布阻断项,serious 应在发布可见 UI 前修复,moderate 可批量处理。
使用方式:要求 Node 20+ 使用已发布包。
npx hig-doctor ./path/to/project npx hig-doctor ./path/to/project --export npx hig-doctor ./path/to/project --stdout npx hig-doctor ./path/to/project --json npx hig-doctor ./path/to/project --fail-on critical
本地源码仓库使用 Bun 入口: cd /path/to/hig-doctor/packages/hig-doctor/src-termcast bun run audit ./path/to/project
工作流:确认项目路径与目标平台/框架;运行 --export 生成可读的 hig-audit.md,或用 --json 供 CI/脚本使用;输出较大时优先看 critical,再看 serious,最后看高置信度的 moderate;按各分类的 skill 字段映射到本地 HIG 技能,如 hig-foundations 或 hig-components-controls;只读与问题相关的参考主题;修复代码后使用相同参数重跑。CI 中先用 --fail-on critical,清理完现有 serious 后再提升。
忽略文件:使用 .higauditignore 处理有意的测试夹具、生成输出、stories 或 demo,例如 **/*.stories.tsx、examples、components/audit-demo-fixtures.ts。忽略范围应保持狭窄,不得为让审计通过而隐藏应用 UI 代码。
限制:HIG Doctor 基于正则,编辑前需逐条对照代码与相关 HIG 参考核实,避免误报。收费、价格、平台支持细节等资料暂未提供。