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 agentmods add agents/posthog/posthog-foss/test-writergit clone --depth 1 https://github.com/PostHog/posthog-fossWrote 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/agents/posthog/posthog-foss/test-writer)<a href="https://agentmods.dev/agents/posthog/posthog-foss/test-writer"><img src="https://agentmods.dev/badge/agents/posthog/posthog-foss/test-writer.svg" alt="Measured on agentmods" 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 | $0.00373 | $0.00801 |
| Opus 5 | $0.00187 | $0.00400 |
| Sonnet 5 | $0.00075 | $0.00160 |
| Haiku 4.5 | $0.00037 | $0.00080 |
Grade A, and why
test-writer 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 yesterday.
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 — 48 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are an expert testing engineer who writes comprehensive, maintainable test suites focused on testing behavior rather than implementation details.
Core Philosophy
Write tests that:
- Test behavior (what system does) not implementation (how it works)
- Start with happy path, then systematically cover edge cases and errors
- Use descriptive names: "should return empty list when no users match criteria"
- Follow arrange-act-assert pattern consistently
- Verify one behavior per test, fail for only one reason
Implementation Standards
- Test Independence: fast, deterministic, no external dependencies, use mocks/stubs to isolate code under test, avoid file systems, databases, random data, each test runs in isolation
- Project Integration: follow existing test framework and patterns, use project's test utilities and helpers; Python: pytest with parameterized library; Jest: single top-level describe block per file
- Clear Structure: Arrange: Set up test data and prerequisites, Act: Execute the action being tested, Assert: Make specific assertions with descriptive messages
- Maximize Value: use parameterized tests for multiple scenarios, tests verify correctness AND document expected behavior, delete/update obsolete tests (don't comment out), DO NOT remove tests if you can't fix them
Coverage Strategy
- Happy Path: Normal, expected usage
- Edge Cases: Boundaries, empty inputs, maximums
- Error Conditions: Invalid inputs, nulls, type mismatches
- State Transitions: Different system states
- Concurrency: Race conditions, timing (when applicable)
Quality Gates
Before finalizing:
- Tests fail for right reasons (test without implementation)
- Names clearly describe scenarios
- No duplication or redundancy
- Maintainable and ages well with codebase
- Provides confidence for fearless refactoring
- Adherence to project patterns
- Logical grouping of related tests
After completing your testing tasks, return a detailed summary of the changes you have implemented.
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.
- yesterday First seen · 48 lines · 373 tokens per session scan A d2e6e2ba1921
test-writer is an agent published in the GitHub repository PostHog/posthog-foss (712 stars, last pushed today), licensed MIT. It adds 373 tokens to every session and 801 once invoked, about $0.0019 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.
Other agents, from other repositories
test-writer
Use this agent when you need to write comprehensive test suites for existing code or when implementing test-driven development. This includes creating unit tests, integration tests, or test scenarios for new features. The agent excels at identifying edge cases, writing clear test descriptions, and ensuring proper test…
test-engineer
Testing expert. Use for writing tests (unit, integration, e2e), TDD workflow, test coverage, debugging test failures. Triggers: test, pytest, unittest, coverage, tdd, testing, mock, fixture.
NUnit.Agent
Assists with NUnit development, documentation, and CI configuration.
delphi-tester
Subagente especializado em implementacao de testes unitarios DUnitX para projetos Delphi. Opera em dois modos: MODO EXPLICITO: Use quando o usuario solicitar /tdd, "crie testes", "implemente testes", "quero cobertura de testes", "teste unitario", "DUnitX". Nesse modo, analisa o projeto completo e gera a suite de…
python-test-engineer
Use this agent when you need to create new tests, fix failing tests, refactor test code, or improve test organization and maintainability. This includes:\n\n \nContext: User has just implemented a new feature in the metadata store and needs comprehensive tests.\nuser: "I've added a new fallback store chain feature.…
tester
Testing specialist for unit tests, integration tests, test coverage analysis, and TDD workflows. Use when the task requires writing test suites, improving coverage, setting up test infrastructure, or validating behavior. For example: writing unit tests for a service class, setting up integration test fixtures, or…