Agent skill · Testing & QA

test-generator

Generate test templates for unit tests, integration tests, and UI tests using Swift Testing and XCTest. Use when adding tests to iOS/macOS apps.

rshankrasgithub.com/rshankrasGitHub ↗
claude-codecan modify filesMIT
Install
npx skills add rshankras/claude-code-apple-skills --skill test-generator --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 3
SKILL.md size: 11 KB
Bundled scripts: none
Allowed tools: ReadWriteEditGlobGrepBashAskUserQuestion
Path: skills/generators/test-generator/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 589
Language: Swift

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Test Generator Generate test templates for unit tests, integration tests, and UI tests in iOS/macOS apps. ## When This Skill Activates Use this skill when the user: - Asks to "add tests" or "write tests" for their app - Asks about unit testing, UI testing, or XCTest - Wants to test ViewModels, services, or repositories - Mentions TDD or test-driven development - Asks about Swift Testing framework (`@Test`, `#expect`, `@Suite`) - Wants mock objects or test helpers - Asks about snapshot testing or preview tests ## Decision Tree ``` What tests do you need? | +-- Unit tests for business logic | +-- Swift Testing (@Test, #expect) -- recommended for iOS 16+ | +-- XCTest -- for iOS 13-15 support or existing XCTest projects | +-- Integration tests (component interactions) | +-- Protocol-based mocks with dependency injection | +-- UI tests | +-- XCUITest with Screen Object pattern | +-- Snapshot/preview tests +-- PreviewSnapshots or swift-snapshot-testing ``` ## Pre-Generation Checks ### 1. Project Context Detection - [ ] Identify existing test targets and test runner - [ ] Detect testing framework already in use (Swift Testing vs XCTest) - [ ] Verify deployment target (Swift Testing requ

What's inside
Steps it walks through
  1. When This Skill Activates
  2. Decision Tree
  3. Pre-Generation Checks
  4. 1. Project Context Detection
  5. 2. Conflict Detection
  6. 3. Architecture Detection
  7. Configuration Questions
  8. 1. Testing Framework
  9. 2. Test Types to Generate
  10. 3. Architecture Pattern
  11. Generated Files
  12. Unit Tests
  13. UI Tests
  14. Swift Testing (Modern)
Ships with 2 files
  • templates.md
  • testing-patterns.md
Commands it runs
Command line
xcodebuild test -scheme YourApp -destination 'platform=iOS Simulator,name=iPhone 16'
With coverage
xcodebuild test -scheme YourApp -enableCodeCoverage YES
More from claude-code-apple-skills
All skills →
About this skill
What does the test-generator skill do?

Generate test templates for unit tests, integration tests, and UI tests using Swift Testing and XCTest. Use when adding tests to iOS/macOS apps.

How do I install it?

Run `npx skills add rshankras/claude-code-apple-skills --skill test-generator --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going