Agent skill · Testing & QA

test-data-factory

Generate test fixture factories for your models. Builder pattern and static factories for zero-boilerplate test data. Use when tests need sample data setup.

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

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

Facts
Files in the skill folder: 1
SKILL.md size: 9 KB
Bundled scripts: none
Allowed tools: ReadWriteEditGlobGrepBashAskUserQuestion
Path: skills/testing/test-data-factory/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 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 ```swift // ❌ 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: "test@test.com") ) // ✅ 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" ``` Id

What's inside
Steps it walks through
  1. When This Skill Activates
  2. Why Test Factories
  3. Process
  4. Phase 1: Discover Models
  5. Phase 2: Choose Factory Pattern
  6. Phase 3: Generate Factories
  7. Phase 4: Generate Date/Time Helpers
  8. Phase 5: Generate Mock Response Factories
  9. Factory Design Rules
  10. Defaults Should Be
  11. Naming Conventions
  12. Output Format
  13. References
More from claude-code-apple-skills
All skills →
About this skill
What does the test-data-factory skill do?

Generate test fixture factories for your models. Builder pattern and static factories for zero-boilerplate test data. Use when tests need sample data setup.

How do I install it?

Run `npx skills add rshankras/claude-code-apple-skills --skill test-data-factory --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