Swift Testing Agent Skill — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Swift Testing Agent Skill (Plugin) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Expert guidance for any AI coding tool that supports the Agent Skills open format — Swift Testing framework, test doubles, fixtures, and testing best practices.
Install this skill with a single command:
npx skills add https://github.com/bocato/swift-testing-agent-skill --skill swift-testingThen use the skill in your AI agent, for example:
Use the swift testing skill and help me write tests for the UserService class
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.
#### Personal Usage
To install this Skill for your personal use in Claude Code:
/plugin marketplace add bocato/swift-testing-agent-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.
Gemini CLI supports custom instructions through GEMINI.md files or the .gemini/ directory.
#### Project Instructions (Recommended)
Copy the skill content to your project's .gemini/ directory:
# Clone this repo
git clone https://github.com/bocato/swift-testing-agent-skill.git
# Create .gemini directory and copy the skill
mkdir -p .gemini/skills
cp -r swift-testing-agent-skill/swift-testing .gemini/skills/Your project structure should look like:
your-project/
├── .gemini/
│ └── skills/
│ └── swift-testing/
│ ├── SKILL.md
│ └── references/
│ └── ...
└── ...#### Personal Instructions
For personal use across all projects, copy to your home directory:
# Create personal Gemini skills directory
mkdir -p ~/.gemini/skills
# Copy the skill
cp -r swift-testing-agent-skill/swift-testing ~/.gemini/skills/Gemini CLI will automatically discover skills in these locations when relevant to your testing tasks.
1) Clone this repository. 2) Install or symlink the swift-testing/ folder following your tool's official skills installation docs (see links below). 3) Use your AI tool as usual and ask it to use the "swift-testing" skill for testing tasks.
#### Where to Save Skills
Follow your tool's official documentation, here are a few popular ones:
.gemini/skills/ (project) or ~/.gemini/skills/ (personal).github/skills/ (project) or ~/.copilot/skills/ (personal)How to verify:
Your agent should reference the triage/playbook in swift-testing/SKILL.md and jump into the relevant reference file for your testing question or task.
This skill gives your AI coding tool comprehensive Swift Testing guidance. It can:
#expect vs #require)#if DEBUGPractical Focus: Based on real-world testing patterns from production codebases, focusing on what developers actually need.
Proper Taxonomy: Uses Martin Fowler's official test double terminology, clarifying the confusion between "mocks" and "spies" in the Swift community.
Non-Opinionated: Focuses on industry-standard best practices like F.I.R.S.T. principles and Arrange-Act-Assert, not architectural preferences.
Swift Testing Ready: Covers the modern Swift Testing framework with @Test, #expect, #require, and @Suite.
Infrastructure Guidance: Includes patterns for test doubles, fixtures, and their proper placement in your codebase.
swift-testing/
├── SKILL.md # Main skill file with decision trees
└── references/
├── _index.md # Quick navigation for all topics
├── test-organization.md # Suites, tags, traits, parallel execution
├── parameterized-tests.md # Testing multiple inputs efficiently
├── async-testing.md # Async patterns, confirmation, timeouts
├── migration-xctest.md # XCTest to Swift Testing migration
├── test-doubles.md # Dummy, Fake, Stub, Spy, SpyingStub, Mock
├── fixtures.md # Fixture patterns and placement
├── integration-testing.md # Module interaction testing
└── snapshot-testing.md # UI regression testingimport Testing
@Test("User can be created with valid data")
func createUser() {
let user = User(name: "Alice", age: 30)
#expect(user.name == "Alice")
#expect(user.age == 30)
}@Test func calculateTotal() {
// Given
let cart = ShoppingCart()
cart.add(Item(price: 10))
// When
let total = cart.calculateTotal()
// Then
#expect(total == 10)
}#if DEBUG
final class UserRepositorySpyingStub: UserRepositoryProtocol {
// Spy
private(set) var savedUsers: [User] = []
// Stub
var usersToReturn: [User] = []
func save(_ user: User) async throws {
savedUsers.append(user)
}
func getAll() async throws -> [User] {
usersToReturn
}
}
#endif#if DEBUG
extension User {
static func fixture(
id: UUID = UUID(),
name: String = "Test User",
email: String = "[email protected]"
) -> User {
User(id: id, name: name, email: email)
}
}
#endifContributions are welcome! This repository follows the Agent Skills open format, which has specific structural requirements.
We strongly recommend using AI assistance for contributions:
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for:
This skill is maintained to reflect the latest Swift Testing best practices and will be updated as the framework evolves.
This skill is open-source and available under the MIT License. See LICENSE for details.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.