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.
npx skills add rshankras/claude-code-apple-skills --skill test-data-factorygit clone --depth 1 https://github.com/rshankras/claude-code-apple-skillsWrote 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.
[](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-data-factory)<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-data-factory"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-data-factory/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/test-data-factory"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/test-data-factory.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00034 | $0.02301 |
| Opus 5.5 | $0.00014 | $0.00920 |
| Sonnet 5.5 | $0.00007 | $0.00460 |
| Haiku 4.5 | $0.00003 | $0.00230 |
Grade A, and why
test-data-factory 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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 353 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Test Data Factory
Generate factory helpers that make creating test data effortless. Eliminates boilerplate in test setup so writing tests has zero friction.
When This Skill Activates
Use this skill when the user:
- Has repetitive test setup code
- Asks for "test fixtures" or "test factories" or "sample data"
- Wants to reduce boilerplate in tests
- Says "my tests have too much setup"
- Is building a test suite and needs realistic sample data
- Mentions "builder pattern" for tests
Why Test Factories
// ❌ Without factory — every test repeats this
let item = Item(
id: UUID(),
title: "Test Item",
description: "A test description",
category: .general,
createdAt: Date(),
updatedAt: Date(),
isFavorite: false,
tags: [],
author: User(id: UUID(), name: "Test User", email: "[email protected]")
)
// ✅ With factory — one line, override only what matters
let item = Item.fixture()
let favoriteItem = Item.fixture(isFavorite: true)
let taggedItem = Item.fixture(tags: ["swift", "testing"])
Process
Phase 1: Discover Models
Glob: **/*.swift (in source targets)
Grep: "struct.*:.*Identifiable|class.*:.*Identifiable|@Model"
Grep: "struct.*:.*Codable|struct.*:.*Sendable"
Identify models that appear in test files:
Grep: "let.*=.*Model(" in test targets (manual construction)
Phase 2: Choose Factory Pattern
Ask via AskUserQuestion:
-
Factory style?
- Static factory methods (simpler, recommended)
- Builder pattern (more flexible, for complex models)
- Both
-
Where to add?
- Test target extension (recommended — keeps production code clean)
- Shared test helper file
Phase 3: Generate Factories
Pattern 1: Static Factory Extension
// Tests/Factories/Item+Factory.swift
import Foundation
@testable import YourApp
extension Item {
/// Creates a test fixture with sensible defaults.
/// Override only the properties relevant to your test.
static func fixture(
id: UUID = UUID(),
title: String = "Test Item",
description: String = "A test description",
category: Category = .general,
createdAt: Date = Date(timeIntervalSince1970: 1_700_000_000),
updatedAt: Date = Date(timeIntervalSince1970: 1_700_000_000),
isFavorite: Bool = false,
tags: [String] = [],
author: User = .fixture()
) -> Item {
Item(
id: id,
title: title,
description: description,
category: category,
createdAt: createdAt,
updatedAt: updatedAt,
isFavorite: isFavorite,
tags: tags,
author: author
)
}
/// Named fixtures for common test scenarios
static var sample: Item { .fixture() }
static var favorite: Item { .fixture(isFavorite: true) }
static var empty: Item { .fixture(title: "", description: "") }
/// Collection fixtures
static var sampleList: [Item] {
[
.fixture(id: UUID(), title: "First Item", category: .work),
.fixture(id: UUID(), title: "Second Item", category: .personal),
.fixture(id: UUID(), title: "Third Item", category: .general)
]
}
}
extension User {
static func fixture(
id: UUID = UUID(),
name: String = "Test User",
email: String = "[email protected]"
) -> User {
User(id: id, name: name, email: email)
}
static var sample: User { .fixture() }
}
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.
- 2d ago First seen · 353 lines · 34 tokens per session scan A 503d04f8a708
test-data-factory is a skill published in the GitHub repository rshankras/claude-code-apple-skills (867 stars, last pushed today), licensed MIT. It adds 34 tokens to every session and 2,301 once invoked, about $0.0001 per session on Opus 5.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-11-05.
test-data-factory compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| test-data-factoryrshankras/claude-code-apple-skills | Skill | 867 | today | MIT | A | 34 | Claude Code |
| tdd-workflowaffaan-m/ECC | Skill | 299k | today | MIT | A | 43 | Claude Code, Codex |
| cpp-testingaffaan-m/ECC | Skill | 299k | today | MIT | A | 34 | Claude Code, Kiro |
| swift-protocol-di-testingaffaan-m/ECC | Skill | 299k | today | MIT | A | 32 | Claude Code, Kiro |
| temporal-python-testingwshobson/agents | Skill | 42k | 2d ago | MIT | A | 45 | Claude Code |
| image-crop-rotateinstavm/coderunner | Skill | 901 | 3d ago | Apache-2.0 | A | 50 | Claude Code, Codex |
| test-generatorvstorm-co/pydantic-deepagents | Skill | 1.1k | 8d ago | MIT | A | 12 | Claude Code, Codex |