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 tmj-90/gaffer --skill test-fixtures-and-factoriesgit clone --depth 1 https://github.com/tmj-90/gafferWrote 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/tmj-90/gaffer/test-fixtures-and-factories)<a href="https://agentmods.dev/skills/tmj-90/gaffer/test-fixtures-and-factories"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/test-fixtures-and-factories/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/tmj-90/gaffer/test-fixtures-and-factories"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/test-fixtures-and-factories.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.00091 | $0.01380 |
| Opus 5.5 | $0.00036 | $0.00552 |
| Sonnet 5.5 | $0.00018 | $0.00276 |
| Haiku 4.5 | $0.00009 | $0.00138 |
Grade A, and why
test-fixtures-and-factories 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 16d 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 — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Build test fixtures and factories that stay honest
Good test data is minimal, explicit about what matters, and impossible to share by accident. A factory gives every test a valid object in one line and lets it override only the fields the test is about; a 200-line JSON blob nobody understands is a liability. Isolation is not optional: tests that share state pass alone and fail in parallel, or — worse — pass because an earlier test left the data they needed.
Procedure
- Find the repo's pattern. Look for
factories/,fixtures/,testing/,__fixtures__/,conftest.py, builder helpers, a seed script, or a test-database setup (in-memory SQLite, per-test schema or transaction, Testcontainers). Callsearch_lorefor conventions. Match what exists; add a library (fishery, factory_boy,@faker-js) only if the repo already uses it. (Independent tester: only paths the runner counts as tests survive — atest/,tests/,__tests__/,spec(s)/,e2e/orfixture(s)/directory,*.test.*/*.spec.*JS/TS files, ortest_*/test-*/test.*files. A new file underfactories/,testing/or__fixtures__/, or a rootconftest.py, counts as implementation and HOLDS the run; keep factories inside your test directory — seeblack-box-test.) - Prefer factories for domain objects.
makeUser({ role: "admin" })builds a valid default and applies overrides. Keep defaults boring and valid. Generate uniqueness with a per-run sequence (user-${seq}@example.com) rather than randomness; where randomness is used, it is seeded and the seed logged. Provide builders for related graphs (makeOrder({ user })) rather than hidden auto-creation that surprises the test. - Keep static fixtures for recorded external shapes — a webhook payload, an API
response, a sample file. Record them from the real source, redact secrets and personal
data, commit them, and name them by scenario (
stripe-invoice-paid.json). - Isolate every resource a test touches:
- Database: fresh in-memory DB with real migrations per test, or a transaction rolled back per test, or a unique schema; never a module-level connection shared by tests.
- Files: a unique temp dir per test (
mkdtempSync(join(tmpdir(), "x-")), pytesttmp_path, Got.TempDir()), removed in teardown — never a fixed path like./dataor/tmp/test.db. - Ports and processes: bind to port 0 and read the assigned port; teardown kills every spawned process even when the test fails.
- Globals: env vars, clocks, module caches and singletons restored after each test.
- Support concurrency and persistence tests. When an AC is about concurrent writers,
restarts or crashes, fixtures must make the real schedule easy: a helper that starts the
app as a separate process on a temp data dir and returns
{ url, stop, kill, pause, resume }(SIGTERM, SIGKILL, SIGSTOP, SIGCONT), and a helper that fires N operations together. Shared on-disk state is then deliberate and scoped to one test — not leaked between tests. - Never use production data or secrets. No real personal data, no real tokens or
keys; use obviously fake values (
[email protected],sk_test_placeholder). This is a security rule. - Make the test readable at a glance. The test body shows the inputs its assertion depends on; everything else lives in the factory default. If a reader must open the factory to understand the assertion, move that field into the override list.
- Type the data. Factories return the real domain type or a schema-validated shape, so a schema change breaks the factory at compile/parse time instead of silently making a test assert nonsense.
- Prove isolation. Run the suite shuffled and in parallel where the runner supports it
(Vitest
--sequence.shuffle, Jest default workers, pytest-randomly /-n autoif the repo has those plugins,go test -shuffle=on -count=1), then run one changed test alone. Record evidence with therecord-evidenceskill (test_output).
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.
- 16d ago Changed · +27 lines · +2 tokens per session a8da00f584dd
- 19d ago First seen · 61 lines · 89 tokens per session scan A a10b72e000f5
test-fixtures-and-factories is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 17d ago), licensed Apache-2.0. It adds 91 tokens to every session and 1,380 once invoked, about $0.0004 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-09-28.
Other skills, from other repositories
test-audit
Audit test suites for T1-T4 violations using AST analysis, mock detection, and multi-stage synthesis. Invoke when user asks to audit tests, check test quality, find mock violations, review test effectiveness, or inspect test suites for over-mocking. Triggers automatic rewrites when quality gates fail.
mock-detection
Deep mock appropriateness analysis for Test Audit pipeline.
bug-magnet-data
Curated edge case test data for boundary testing, verification scripts, and test generation. Provides pre-curated reference data organized by data type with context-specific loading guidance.
assertion-patterns
Real output verification vs mock calls. Use when transforming T1-T4 violating tests to verify observable behavior.
test-classification
Prompt template for test classification stage in Test Audit pipeline.
fix-bug
Run the Fix Validation pipeline to investigate, fix, and validate a bug. Ensures deterministic pipeline execution with IssueAnalyzer, FixWriter, TestWriter (conditional), TestAudit (conditional), and FixValidator stages.