test-generator

test-generator is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 33 tokens per session (2,662 once invoked), scanned A, original, MIT.

A generator for unit, integration, and user-interface tests in Swift iOS and macOS apps. It supports Swift Testing and XCTest, which are Apple testing frameworks, plus mocks and UI test structure.

In plain words
What is it for?
Use it to test business logic, ViewModels, services, repositories, component interactions, and user flows.
Why use it?
It gives an app a starting test structure instead of leaving test targets, helpers, and dependencies to be organized manually. TDD, or test-driven development, is also covered.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Good fit Use it to test business logic, ViewModels, services, repositories, component interactions, and user flows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/test-generator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add rshankras/claude-code-apple-skills --skill test-generator
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-generator

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-generator.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-generator)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-generator"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-generator.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,662 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.02662
Opus 5 $0.00016 $0.01331
Sonnet 5 $0.00007 $0.00532
Haiku 4.5 $0.00003 $0.00266

Measured 5d ago against content hash 6c0505f763e5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

test-generator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/generators/test-generator/SKILL.md · 387 lines

How it starts

The opening of the file, as written. The whole thing — 387 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 requires iOS 16+ / macOS 13+)
  • Identify project architecture pattern (MVVM, TCA, Repository, etc.)
  • Locate source file directories

2. Conflict Detection

Search for existing test infrastructure:

Glob: **/*Tests.swift, **/*Tests/**/*.swift, **/*Spec.swift
Grep: "import XCTest" or "import Testing" or "@Suite" or "@Test"
Grep: "MockItemRepository" or "protocol.*Repository" or "class Mock"

If existing tests are found:

  • Ask user whether to follow the existing framework (XCTest vs Swift Testing) or migrate
  • Check for existing mock objects to reuse or extend
  • Identify existing test helpers and factories

If a test target already exists:

  • Add new tests to the existing target -- do NOT create a new target
  • Follow the existing directory structure and naming conventions

Read the full file on GitHub · 387 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 387 lines · 33 tokens per session scan A 6c0505f763e5

Subscribe to this mod's changes

test-generator is a skill published in the GitHub repository rshankras/claude-code-apple-skills (710 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 2,662 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

testing-strategy

Follow the testing pyramid — more unit tests, fewer integration tests, even fewer e2e tests.

halflength-ampleness75/claude-code-recipes · 0 tokens

testing-strategy

Comprehensive testing expertise across unit, integration, and e2e tests. Covers pytest, Vitest, Jest, Go testing, Playwright, Cypress. Test pyramids, TDD workflow, mocking patterns, coverage targets, property-based testing, snapshot testing, parameterized tests, fixtures, CI integration. Use when writing tests…

medy-gribkov/arcana · 83 tokens

webapp-testing

Write and run comprehensive web app tests — unit, integration, E2E with Playwright/Cypress, and visual regression.

inbharatai/claude-skills · 29 tokens

memstack-development-test-writer

Use this skill when the user says 'write tests', 'add tests', 'test coverage', 'unit tests', 'integration tests', 'component tests', 'mocking', 'edge cases', or needs to generate tests with proper mocking and edge case coverage. Do NOT use for refactoring plans or database migrations.

cwinvestments/memstack · 70 tokens

accessibility-testing

Skill "accessibility-testing" from vibeeval/vibecosystem, covering accessibility testing, axe-core setup, jest-axe (unit / component tests), playwright-axe (e2e) and cypress-axe.

vibeeval/vibecosystem · 31 tokens

testing-patterns

Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage. Triggers: test, fixture, mock, stub, e2e, TDD, Playwright, Cypress, flaky, coverage, property-based.

softspark/ai-toolkit · 52 tokens