openswiftui-test-authoring
GitHub指导 OpenSwiftUI 测试编写与审查,涵盖单元测试、兼容性、符号双态及 UI 测试。规范测试文件结构、导入排序及头文件格式,并引导根据具体测试类型参考相应指南,确保验证有效且符合约定。
Trigger Scenarios
Install
npx skills add OpenSwiftUIProject/OpenSwiftUI --skill openswiftui-test-authoring -g -y
SKILL.md
Frontmatter
{
"name": "openswiftui-test-authoring",
"description": "Route OpenSwiftUI test authoring and review work to the appropriate test guide while applying shared test-file conventions. Use for unit, compatibility, symbol-dual, or UI tests."
}
OpenSwiftUI Test Authoring
Testing and Verification
- Do not write tests for reversible, low-impact changes that only mirror the implementation. Add tests when they provide meaningful and necessary verification of observable behavior, boundaries, failures, or regression risks.
- Run the narrowest relevant tests permitted by
AGENTS.mdand complete required checks. Once those pass, broaden or repeat testing only when new changes, failures, or unresolved concerns justify it; otherwise, continue toward completing the task.
Shared Conventions
-
Follow the organization and naming of the nearest tests in the same target.
-
Sort import declarations alphabetically by imported module name, preserving any attributes attached to each declaration.
-
Start each new Swift test file with this header, substituting the actual file name and the actual test target name:
// // <FileName.swift> // <TestTargetName>Leave one blank line after the target name. Do not add a closing decorative
//line, and do not copy a target name from an unrelated example.
Test-Type Guides
Read only the guide that matches the requested test type:
- Unit tests: unit-tests.md
- Compatibility tests: compatibility-tests.md
- Symbol-dual tests: symbol-dual-tests.md
- UI tests: ui-tests.md
Version History
-
0.21.0
Current 2026-09-09 08:34
新增 Testing and Verification 章节,明确测试编写原则(如避免为低影响镜像变更写测试)及执行策略(先运行窄范围测试,再视情况扩展)。
- 0.20.1 2026-08-28 11:47


