.claude/skills/gen-test/SKILL.md
Generate a PHPStan rule test class and fixture data file
npx skillsauth add mglaman/phpstan-drupal gen-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a test class and fixture file for a PHPStan rule in this project.
Rules\Classes\ -> tests/src/Rules/Rules\Deprecations\ -> tests/src/Rules/Rules\Drupal\ -> tests/src/Rules/Rules\Drush\ -> tests/src/Rules/Type\ -> tests/src/Type/mglaman\PHPStanDrupal\Tests\DrupalRuleTestCasedeclare(strict_types=1) at the topfinalgetRule() returning an instance of the rule@dataProvider cases with a generator[files, errors] where errors are [message, line, tip?]tests/src/Rules/data/ or tests/src/Type/data/php vendor/bin/phpunit --filter=TheNewTestClass to verify<?php
declare(strict_types=1);
namespace mglaman\PHPStanDrupal\Tests\Rules;
use mglaman\PHPStanDrupal\Rules\Drupal\ExampleRule;
use mglaman\PHPStanDrupal\Tests\DrupalRuleTestCase;
final class ExampleRuleTest extends DrupalRuleTestCase
{
protected function getRule(): \PHPStan\Rules\Rule
{
return new ExampleRule();
}
/**
* @dataProvider cases
*
* @param list<array{0: string, 1: int, 2?: string|null}> $errors
*/
public function test(array $files, array $errors): void
{
$this->analyse($files, $errors);
}
public static function cases(): \Generator
{
yield 'passing case' => [
[__DIR__ . '/data/example-pass.php'],
[],
];
yield 'failing case' => [
[__DIR__ . '/data/example-fail.php'],
[
['Error message here.', 10],
],
];
}
}
development
Navigate and read PHPStan's internal source code from the phar file
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".
testing
Host security hardening and risk-tolerance configuration for OpenClaw deployments. Use when a user asks for security audits, firewall/SSH/update hardening, risk posture, exposure review, OpenClaw cron scheduling for periodic checks, or version status checks on a machine running OpenClaw (laptop, workstation, Pi, VPS).
testing
Create, edit, improve, or audit AgentSkills. Use when creating a new skill from scratch or when asked to improve, review, audit, tidy up, or clean up an existing skill or SKILL.md file. Also use when editing or restructuring a skill directory (moving files to references/ or scripts/, removing stale content, validating against the AgentSkills spec). Triggers on phrases like "create a skill", "author a skill", "tidy up a skill", "improve this skill", "review the skill", "clean up the skill", "audit the skill".