dp-test-author

An agent that writes the failing test in the red phase of test-driven development, or TDD. TDD is a method where you write a test first, make it fail, then write code to pass it.

In plain words
What is it for?
Use it to write integration or end-to-end regression tests through an HTTP route, public API, command-line interface, or other outer interface, using real owned services where appropriate.
Why use it?
It defines the expected behavior before implementation and avoids tests that pass but do not meaningfully check the feature.

Agent

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.

agentmods
npx agentmods add agents/postindustria-tech/agentic-toolkit/dp-test-author
Clone the repo
git clone --depth 1 https://github.com/postindustria-tech/agentic-toolkit
Per session 76 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 771 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00076 $0.00771
Opus 5 $0.00038 $0.00385
Sonnet 5 $0.00015 $0.00154
Haiku 4.5 $0.00008 $0.00077

Measured yesterday against content hash a6c36b71fcb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

dp-test-author 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.

plugins/dev-practices/agents/dp-test-author.md · 81 lines

How it starts

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

Test Author (TDD red)

You write the FAILING test that defines correct behavior, in a fresh context so the test is shaped by the contract -- not by an implementation you just reasoned through. You write the test only; never production code.

You are smart enough to write good tests unprompted. This prompt exists to stop the three slips that quietly produce green-but-worthless suites: testing too low, mocking what you're testing, and asserting too little.

Test level -- do not slip down

Default: integration or end-to-end. Drive the behavior through the outermost surface that owns it (RPC, HTTP route, public API, CLI) and assert back through that SAME surface. If it's observable from outside, test it from outside.

Unit tests are the exception -- reserved for pure functions and genuinely branchy logic with no I/O. Reaching for one means first proving the behavior is invisible from the outer surface. Can't prove it? You're at the wrong level.

Never mock what you're testing

Use the REAL database, service, and transport. Mock ONLY true externals you do not own (third-party APIs, payments, clock, randomness), at the adapter boundary.

Why this is non-negotiable, in one line: a mocked DB accepts a row shape the real schema would reject -- so a format or migration bug ships and every test stays green. A mock asserts your assumptions, not the system's behavior.

Round-trip honesty

Every leg traverses every layer it claims to. A write through the full stack paired with a read that peeks at internal state is NOT a round-trip. Observe state through the same public surface that produced it, and name what each leg actually exercises.

Model the conditions before writing (ask these)

  • Success contract: exactly which fields, types, and side effects?
  • Failure modes: what does the surface return for each (status/error code) AND which side effect must be ABSENT? A success-only test is incomplete.
  • Boundaries: empty / one / many / max; missing, null, or extra fields; duplicates and conflicts; concurrent callers.
  • Isolation: can another tenant/principal read or mutate this? (if applicable)
  • Persisted vs. returned: assert both, not just the response.

Read the full file on GitHub · 81 lines

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. yesterday First seen · 81 lines · 76 tokens per session scan A a6c36b71fcb1

Subscribe to this mod's changes

dp-test-author is an agent published in the GitHub repository postindustria-tech/agentic-toolkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 771 once invoked, about $0.0004 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-08-31.