Agent Skills
› Automattic/studio
› testing-php
testing-php
GitHub用于检测 PHP 文件语法错误的技能。通过 find 命令定位文件,使用 php -l 检查语法,自动修复并验证,最多3轮循环,仅修正语法错误,不修改业务逻辑,最后输出 PASS/FAIL 报告。
Trigger Scenarios
用户要求检查 PHP 代码语法
需要批量验证项目内 PHP 文件是否存在语法错误
Install
npx skills add Automattic/studio --skill testing-php -g -y
SKILL.md
Frontmatter
{
"name": "testing-php",
"description": "Guidelines for running PHP linting to catch syntax errors",
"disable-model-invocation": true
}
When to use me
Use this skill when validating PHP files for syntax errors. Do not use this skill for JavaScript or CSS validation.
Step 1: Identify PHP files
Find all PHP files in the project, excluding vendor/, node_modules/, and build/ directories:
find . -name "*.php" -not -path "*/vendor/*" -not -path "*/node_modules/*" -not -path "*/build/*"
Step 2: Run PHP syntax check
Check each PHP file for syntax errors using php -l:
php -l <file>
- A file with valid syntax prints
No syntax errors detected in <file>and exits 0. - A file with syntax errors prints the error message with line number and exits non-zero.
- Fix any syntax errors found by editing the file, then re-run
php -lto confirm.
Rules
- Syntax only: This skill checks for PHP syntax errors. Do not run PHPCS or other coding standard tools.
- Max 3 cycles: Run at most 3 fix-then-retest cycles per file. If issues remain after 3 cycles, report them as unresolved.
- Never modify business logic: Only fix syntax errors. Do not change how the code works.
- Report format: After testing, report results as:
- PASS: No syntax errors
- FAIL: List remaining errors with file, line, and message
Version History
- 0d55cb5 Current 2026-08-20 12:16


