native-php-matrix: Agent for Claude Code

.claude/agents/test-runner.md

test-runner is an agent for Claude Code from lisachenko/native-php-matrix. It costs 33 tokens per session (689 once invoked), scanned A, original, MIT.

A test-running and result-reporting workflow for a PHP library that changes how the PHP engine handles operators.

In plain words
What is it for?
Use it to run the full or individual functional tests, handle the required PHP settings, and explain differences in values, types, dimensions, exceptions, or engine crashes.
Why use it?
It identifies exactly which expected behaviours fail, including failures caused by the PHP engine itself, instead of merely reporting that the test suite is red.

Agent for Claude Code

Written for Claude Code: installed under .claude/.

This is lisachenko/native-php-matrix's own configuration. It tells Claude Code how to work on native-php-matrix 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 native-php-matrix configures →

Reuse

Borrowing it

Nothing to install: this file belongs to lisachenko/native-php-matrix. 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/lisachenko/native-php-matrix/master/.claude/agents/test-runner.md
Clone the repo
git clone --depth 1 https://github.com/lisachenko/native-php-matrix

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/lisachenko/native-php-matrix/test-runner/github.svg)](https://agentmods.dev/agents/lisachenko/native-php-matrix/test-runner)
Your own site
<a href="https://agentmods.dev/agents/lisachenko/native-php-matrix/test-runner"><img src="https://agentmods.dev/badge/agents/lisachenko/native-php-matrix/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/lisachenko/native-php-matrix/test-runner"><img src="https://agentmods.dev/badge/agents/lisachenko/native-php-matrix/test-runner.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 689 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.00033 $0.00689
Opus 5.5 $0.00013 $0.00276
Sonnet 5.5 $0.00007 $0.00138
Haiku 4.5 $0.00003 $0.00069

Measured 2mo ago against content hash 7cfb56d436f5, 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 · 66 lines

How it starts

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

You run and interpret the test suite of lisachenko/native-php-matrix, a library that installs Zend Engine operator handlers from userland PHP via z-engine + FFI. Your job is to produce a precise verdict, not to make tests pass.

Running the suite

Preferred:

composer test

If the Composer script is unavailable or its environment lacks the required INI settings, fall back to:

php -d ffi.enable=1 -d opcache.jit=off vendor/bin/phpunit

A single test:

php -d ffi.enable=1 -d opcache.jit=off vendor/bin/phpunit tests/Functional/testCanAddMatrices.phpt

ffi.enable=1 and opcache.jit=off are mandatory in both the parent process and the .phpt children. Every .phpt carries an --INI-- section for the child side. If a test fails with a message about FFI being disabled, check for a missing --INI-- section before suspecting the library.

Interpreting results

  • --EXPECT-- diff. phpt failures print expected vs actual output. Quote the relevant diff lines, then say what the difference means in library terms: wrong dimensions, wrong element values, int where float was expected (PHP's / and ** widen), or an exception where a result was expected. var_dump() output is whitespace- and type-sensitive — int(1) and float(1) are a real difference, not noise.
  • --EXPECTREGEX-- failures usually mean the exception type or message changed. Report the actual message verbatim.
  • Fatal errors from Core::init() mean the PHP version does not match what z-engine was built for. Report the running php -v and stop. Never suggest loosening the ~8.4.0 constraint or skipping initialization.
  • Segmentation fault, bus error, or a child process exiting on a signal is an engine/hook-level bug — memory was read or written at the wrong offset. Do not retry, do not mark the test skipped, do not "work around" it. Report immediately with: the exact command, the test file, php -v, and the last output before the crash. A crash outranks every other finding in your report.

Read the full file on GitHub · 66 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 · 66 lines · 33 tokens per session scan A 7cfb56d436f5

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository lisachenko/native-php-matrix (43 stars, last pushed 10d ago), licensed MIT. It adds 33 tokens to every session and 689 once invoked, about $0.0001 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.

Related

Other agents, from other repositories

fixture-reviewer

Checks .test fixtures for drift after a compiler change.

phel-lang/phel-lang · 15 tokens

php-refactor-expert

Expert PHP code refactoring specialist. Improves code quality, maintainability, and readability while preserving functionality. Applies clean code principles, SOLID patterns, and modern PHP 8.3+ best practices for Laravel and Symfony. Use PROACTIVELY after implementing features or when code quality improvements are…

giuseppe-trisciuoglio/developer-kit · 67 tokens

symfony-tdd-coach

Guides TDD workflow for Symfony projects using Pest PHP or PHPUnit. Drives strict RED-GREEN-REFACTOR cycles with proper test isolation, Foundry factories, and regression protection. Use when writing tests, adding test coverage, or practicing TDD.

dev-toolings/superpowers-symfony · 58 tokens

test-generator

Creates PHP tests for DDD/CQRS projects. Generates unit tests, integration tests, builders, mocks, test doubles. Use PROACTIVELY when writing tests or when acc:test-auditor recommends.

dykyi-roman/awesome-claude-code · 45 tokens

qa-engineer

Use this agent to write, repair, or extend Pest tests for models, controllers, Livewire components, APIs, or packages; to run test suites until green; to analyse coverage gaps and add architecture tests; or to design a test strategy/QA plan for a feature or release (what to test, at which level, with what priority).

nasrulhazim/claude · 73 tokens

php-tests-reviewer

PHP test quality review for PHPUnit assertions, WordPress test utilities (WPUnitTestCase, factories), WooCommerce test patterns, and Brain Monkey isolation.

vladolaru/claude-code-plugins · 35 tokens