api-gateway: Agent for Claude Code

.claude/agents/test-runner.md

test-runner is an agent for Claude Code from membrane/api-gateway. It costs 82 tokens per session (983 once invoked), scanned A, original, Apache-2.0.

A testing guide for the Membrane API Gateway Maven project, which is split into several related modules.

In plain words
What is it for?
Use it to run all tests, test one module and its dependencies, isolate a core test class or package, or run a single distribution or tutorial example.
Why use it?
It avoids Maven test commands that appear to work but run the wrong tests, skip the requested test, or fail because of language settings or network-dependent tests.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths.

This is membrane/api-gateway's own configuration. It tells Claude Code how to work on api-gateway itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything api-gateway configures →

Reuse

Borrowing it

Nothing to install: this file belongs to membrane/api-gateway. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/membrane/api-gateway/master/.claude/agents/test-runner.md
Clone the repo
git clone --depth 1 https://github.com/membrane/api-gateway

Made for: Claude Code.

Wrote 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.

agentmods badge for test-runner

README.md
[![agentmods](https://agentmods.dev/badge/agents/membrane/api-gateway/test-runner/github.svg)](https://agentmods.dev/agents/membrane/api-gateway/test-runner)
Your own site
<a href="https://agentmods.dev/agents/membrane/api-gateway/test-runner"><img src="https://agentmods.dev/badge/agents/membrane/api-gateway/test-runner/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.

agentmods 80×15 button for test-runner

Your own site · 80×15
<a href="https://agentmods.dev/agents/membrane/api-gateway/test-runner"><img src="https://agentmods.dev/badge/agents/membrane/api-gateway/test-runner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 983 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00082 $0.00983
Opus 5.5 $0.00033 $0.00393
Sonnet 5.5 $0.00016 $0.00197
Haiku 4.5 $0.00008 $0.00098

Measured 2mo ago against content hash cba0b9627c4f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-runner 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 2mo 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.

.claude/agents/test-runner.md · 70 lines

How it starts

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

You run tests in the Membrane API Gateway Maven multi-module reactor. Pick the right path below instead of reaching for the naive Maven command — this repo has several non-obvious traps where the naive command looks like it worked but either ran the wrong scope or skipped the target entirely.

1. Which kind of test is this?

A. Full or module-wide unit run (no isolation needed)

  • Whole repo: mvn test
  • One module + its deps: mvn -pl <module> -am test (e.g. -pl core -am test)
  • If failures look like locale-dependent string mismatches, add -Duser.language=en -Duser.country=US — macOS ignores LANG/LC_ALL for the JVM. Avoid -am when only running core/test tests if you don't need to rebuild annot: SpringConfigXSDErrorsTest there asserts English javac diagnostics and fails under a non-English JVM locale.

B. One test class or package inside core -Dtest=ClassName does NOT isolate it. core's surefire is bound to UnitTests.java, a JUnit Platform @Suite with @SelectPackages("com.predic8") — the suite engine ignores Surefire's class filter and runs the whole package regardless (including network-dependent tests that fail offline), while the target class's own line in the report shows Tests run: 0. That silent-zero is the tell that this trap was hit.

To actually isolate one class or package, use the existing script instead of hand-rolling a launcher:

test/scripts/run-core-test.sh <fully.qualified.TestClassName|package.name>

It drives com.predic8.membrane.devtools.SingleTestRunner (a permanent JUnit Platform Launcher entry point under core/src/test/java) and matches Surefire's argLine/CWD so results agree with a real Maven run. Requires the reactor to already be built once (mvn install -DskipTests at the repo root).

C. A distribution/tutorial example test (*ExampleTest / *TutorialTest under com.predic8.membrane.examples.* / com.predic8.membrane.tutorials.*) These are Failsafe ITs that unzip and run the built distribution zip, not the source tree — edits to core, config, or tutorials are invisible until it's rebuilt. -Dit.test doesn't filter them either (same suite trick, via the hardcoded ExampleTests.java). Don't hand-roll this — use the existing skill:

.claude/skills/run-example-test/run-example-test.sh [-b] <TestClassName>

Pass -b (or delete distribution/target/*.zip) if core or another upstream module changed since the last build.

Read the full file on GitHub · 70 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. 2mo ago First seen · 70 lines · 82 tokens per session scan A cba0b9627c4f

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository membrane/api-gateway (656 stars, last pushed yesterday), licensed Apache-2.0. It adds 82 tokens to every session and 983 once invoked, about $0.0003 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-08-30.