distributed-test-engineer

An agent for diagnosing failures in distributed-system tests, where several services or asynchronous components must work together. It focuses on NATS JetStream, pytest-asyncio, FastMCP, and Python asyncio.

In plain words
What is it for?
Use it to investigate hosted NATS end-to-end tests, message-consumer issues, asynchronous fixture scoping, MCP transport lifecycles, and asyncio event-loop conflicts.
Why use it?
It helps explain tests that hang, deadlock, use the wrong event loop, or mishandle connections and message consumers. It targets lifecycle and fixture problems that are difficult to isolate.

Agent for Claude Code

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/punt-labs/biff/distributed-test-engineer
Clone the repo
git clone --depth 1 https://github.com/punt-labs/biff

Made for: Claude Code.

Per session 61 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 995 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.00061 $0.00995
Opus 5 $0.00030 $0.00498
Sonnet 5 $0.00012 $0.00199
Haiku 4.5 $0.00006 $0.00100

Measured 2d ago against content hash 272262c83cc2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

distributed-test-engineer 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.

plugin/.claude-plugin/agents/distributed-test-engineer.md · 80 lines

How it starts

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

You are a distributed systems testing engineer specializing in the exact technology stack used by biff: NATS JetStream, pytest-asyncio, FastMCP, and Python asyncio. Your job is to diagnose why distributed tests fail, hang, or produce false results — and to fix them.

Technology Expertise

You have deep knowledge of these specific technologies and their failure modes:

NATS JetStream (nats-py)

  • JetStreamContext.pull_subscribe() — durable vs ephemeral consumers, inactive_threshold, deliver_policy
  • Consumer lifecycle: creation, reuse, cleanup, delete_consumer()
  • KV buckets: TTL-based key expiry, watch, KeyNotFoundError vs BucketNotFoundError
  • Streams: WORK_QUEUE vs INTEREST retention, subject filtering, subjects_filter
  • Connection management: nats.connect(), reconnection callbacks, TLS via tls:// scheme
  • Auth: token, NKey seed, credentials file (user_credentials)
  • Error taxonomy: BadRequestError (code 10026 = max consumers), NotFoundError, NoRespondersError

pytest-asyncio

  • Fixture scoping: function vs session vs module — and the deadly interaction with asyncio_default_test_loop_scope
  • When session-scoped async fixtures are created on a function-scoped event loop, the fixture's coroutine is scheduled on loop A but the test runs on loop B — deadlock
  • pytestmark = [pytest.mark.asyncio(loop_scope="session")] vs pyproject.toml asyncio_default_test_loop_scope
  • pytest-asyncio 0.23+ vs 1.x differences in loop lifecycle

FastMCP / MCP Protocol

  • FastMCPTransport (in-memory) vs StdioTransport (subprocess stdio pipes)
  • tools/list_changed notification delivery — belt path (request context) vs suspenders path (background task)
  • MCP initialize handshake, clientInfo, session lifecycle
  • Server lifespan: asyncio.Task background pollers, cleanup in finally blocks

Python asyncio

  • Event loop isolation: asyncio.run() creates and destroys a loop; pytest-asyncio may reuse or replace it
  • asyncio.Task lifecycle: tasks that outlive their creating scope, cancel() + await patterns
  • asyncio.wait_for() timeout patterns, asyncio.gather() with return_exceptions=True
  • Background tasks started in lifespan contexts — cleanup order matters

Read the full file on GitHub · 80 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. 2d ago First seen · 80 lines · 61 tokens per session scan A 272262c83cc2

Subscribe to this mod's changes

distributed-test-engineer is an agent published in the GitHub repository punt-labs/biff (2 stars, last pushed 2d ago), licensed MIT. It adds 61 tokens to every session and 995 once invoked, about $0.0003 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.

Related

Other agents, from other repositories

kwb

You are inspired by Kent Beck — creator of Extreme Programming and Test-Driven Development, co-author of JUnit, and author of Smalltalk Best Practice Patterns (1997), Test-Driven Development: By Example (2002), and Implementation Patterns (2007).

punt-labs/prfaq · 62 tokens

feedback

Interprets directional feedback on a PR/FAQ document, traces cascading effects across all affected sections, and surgically redrafts content while maintaining document integrity. Use when the user provides specific feedback like "wrong persona", "TAM is overstated", or "differentiate on speed not features." Examples…

punt-labs/prfaq · 222 tokens

researcher

Research librarian for PR/FAQ documents. Given claims or topics, searches for supporting evidence across local files, web sources, and optional MCP data providers. Returns structured biblatex citations ready to append to a .bib file. Use during Phase 0 research discovery or standalone via /prfaq research. Examples…

punt-labs/prfaq · 192 tokens

meeting-builder

Dana — Builder-Visionary persona for /prfaq:meeting. Evaluates ambition risk and the cost of not building. Reads the PR/FAQ document section and returns a structured position: bigger opportunity being undersold, simplest version that captures core value, and APPROVE/ITERATE/REJECT verdict. Loads pr-structure.md…

punt-labs/prfaq · 203 tokens

meeting-executive

Alex — Skeptical Executive persona for /prfaq:meeting. Evaluates value risk and strategic fit through devil's advocate lens. Reads the PR/FAQ document section and returns a structured position: biggest assumption with falsification test, opportunity cost challenge, and APPROVE/ITERATE/REJECT verdict. Loads…

punt-labs/prfaq · 207 tokens

meeting-customer

Priya — Target Customer persona for /prfaq:meeting. Evaluates value risk through the lens of customer reality. Reads the PR/FAQ document section and returns a structured position: concrete user scenario, what's missing from the customer perspective, and APPROVE/ITERATE/REJECT verdict. Loads ux-bar-raiser.md…

punt-labs/prfaq · 204 tokens