
Agent Skill为AI编码工具提供专家Swift测试指导:涵盖测试双重、夹具、异步模式、XCTest迁移及测试最佳实践。
概览
为任何支持 Agent Skills 开放格式的 AI 编码工具提供专家指导——Swift Testing 框架、测试双重、夹具及测试最佳实践。 - 采用Swift Testing框架的团队,需要现代测试模式。- 编写单元测试、集成测试或快照测试的开发者。- 任何需要可靠测试基础设施(模拟测试、存根、间谍、夹具)的人。- 团队从XCTest迁移到Swift Testing。 只需一个命令即可安装此技能: 然后在你的 AI 代理中使用该技能,例如:使用 swift testing 技能,帮我为 UserService 类编写测试 GitHub Copilot 支持 VS Code、VS Code Insiders 和 Copilot CLI 中的代理技能。 将 swift-testing/ 文件夹复制到你仓库的 .github/skills/ 目录: 你的项目结构应是: 为了在所有项目中个人使用,请复制到你的家庭目录:
概述(AI 翻译)
为任何支持 Agent Skills 开放格式的 AI 编码工具提供专家指导——Swift Testing 框架、测试双重、夹具及测试最佳实践。
这是给谁的
- 采用Swift测试框架的团队,需要现代测试模式。
- 编写单元测试、集成测试或快照测试的开发者。
- 任何需要可靠测试基础设施(模拟、存根、间谍、夹具)的人。
- 团队从XCTest迁移到Swift Testing。
如何使用这项技能
选项A:使用 skills.sh(推荐)
只需一个命令即可安装此技能:
然后在你的AI代理中使用该技能,例如:
使用Swift测试技能,帮我为UserService类编写测试
选项B:GitHub Copilot
GitHub Copilot 支持 VS Code、VS Code Insiders 和 Copilot CLI 中的代理技能。
项目技能(推荐)
将 swift-testing/ 文件夹复制到你仓库的 .github/skills/ 目录中:
你的项目结构应是:
个人技能
为了在所有项目中个人使用,请复制到你的家庭目录:
VS 代码配置
确保在VS Code设置中启用了代理技能:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Swift Testing Agent Skill
Expert guidance for any AI coding tool that supports the Agent Skills open format — Swift Testing framework, test doubles, fixtures, and testing best practices.
Who this is for
- Teams adopting Swift Testing framework who need modern testing patterns.
- Developers writing unit tests, integration tests, or snapshot tests.
- Anyone wanting reliable test infrastructure (mocks, stubs, spies, fixtures).
- Teams migrating from XCTest to Swift Testing.
How to Use This Skill
Option A: Using skills.sh (recommended)
Install this skill with a single command:
npx skills add https://github.com/bocato/swift-testing-agent-skill --skill swift-testing
Then use the skill in your AI agent, for example:
Use the swift testing skill and help me write tests for the UserService class
Option B: GitHub Copilot
GitHub Copilot supports Agent Skills in VS Code, VS Code Insiders, and Copilot CLI.
Project Skills (Recommended)
Copy the swift-testing/ folder to your repository’s .github/skills/ directory:
# Clone this repo and copy the skill
git clone https://github.com/bocato/swift-testing-agent-skill.git
cp -r swift-testing-agent-skill/swift-testing .github/skills/
Your project structure should look like:
your-project/
├── .github/
│ └── skills/
│ └── swift-testing/
│ ├── SKILL.md
│ └── references/
│ └── ...
└── ...
Personal Skills
For personal use across all projects, copy to your home directory:
# Create personal skills directory if it doesn't exist
mkdir -p ~/.copilot/skills
# Copy the skill
cp -r swift-testing-agent-skill/swift-testing ~/.copilot/skills/
VS Code Configuration
Ensure Agent Skills are enabled in VS Code settings:
{
"chat.useAgentSkills": true
}
Copilot will automatically discover and load the skill when relevant to your testing tasks.
Option C: Claude Code Plugin
Personal Usage
To install this Skill for your personal use in Claude Code:
-
Add the marketplace:
/plugin marketplace add bocato/swift-testing-agent-skill -
Install the Skill:
/plugin install swift-testing@swift-testing-agent-skill
Project Configuration
To automatically provide this Skill to everyone working in a repository, configure the repository’s .claude/settings.json:
{
"enabledPlugins": {
"swift-testing@swift-testing-agent-skill": true
},
"extraKnownMarketplaces": {
"swift-testing-agent-skill": {
"source": {
"source": "github",
"repo": "bocato/swift-testing-agent-skill"
}
}
}
}
When team members open the project, Claude Code will prompt them to install the Skill.
Option D: Gemini CLI
Gemini CLI supports custom instructions through GEMINI.md files or the .gemini/ directory.
Project Instructions (Recommended)
推荐工具
换一个关键词,或者移除筛选条件。
安装
npx skillfish add bocato/swift-testing-agent-skill