一键导入
test-fix
Diagnose and fix a failing TinyTest test. Reads the error output, compares test vs source, and repairs the test or explains the source bug.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Diagnose and fix a failing TinyTest test. Reads the error output, compares test vs source, and repairs the test or explains the source bug.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Deep-analyze a single PHP function — trace all code paths, find callers, classify bugs and smells, and generate exhaustive TinyTest unit tests. Useful before /test-cover-file when a function is complex.
Project-wide coverage audit — runs phpdbg across all tests, finds every uncovered function, analyzes each one in context with caller data, generates comprehensive tests for all code paths, and produces a structured bug/smell report with operator decisions. Requires phpdbg.
Project-wide bootstrap — scans all PHP source files, registers any without a test file in test_sources.md, and spawns sub-agents to generate initial test files for each. Run this first on a new project before using test-audit.
Achieve full coverage for a single PHP source file. Phase 1 iterates until every function is called. Phase 2 iterates until every reachable statement and branch is exercised. Requires phpdbg.
Generate an initial TinyTest test file for a PHP source file. Creates the test file, runs it, fixes failures, and registers it in test_sources.md. Contains the full TinyTest assertion and annotation reference.
Review an existing TinyTest test file for quality problems — weak assertions, missing messages, wrong parameter order, PHPUnit drift, incomplete tests, and anti-patterns — then fix all approved issues and verify the suite still passes.
| name | test-fix |
| description | Diagnose and fix a failing TinyTest test. Reads the error output, compares test vs source, and repairs the test or explains the source bug. |
| argument-hint | <test_file> [test_name] |
Find the tinytest path from AGENTS.md or CLAUDE.md in the project root.
php <tinytest_path>/tinytest.php -v -f <test_file>
Or for a specific test:
php <tinytest_path>/tinytest.php -v -f <test_file> -t <test_name>
The verbose output includes:
expected [X] got [Y] "message" — the assertion valuesCommon failure causes:
assert_eq($actual, $expected, "msg"), not reversedassert_eq uses === (strict), so "1" !== 1