phpstan-check

Run PHPStan type checking and generate error reports with severity levels.

7|2|Updated Apr 16, 2025
One-click install
npx skills add https://github.com/genesiscz/GenesisTools --skill phpstan-check
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: phpstan-check
Source: https://github.com/genesiscz/GenesisTools/tree/main/.claude/old/skills/phpstan-check
Command: npx skills add https://github.com/genesiscz/GenesisTools --skill phpstan-check

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the process of running PHPStan, a static analysis tool, to identify type errors and potential bugs in your PHP codebase, ensuring higher code quality and fewer runtime issues.

Core Features & Use Cases

  • Type Checking: Detects type mismatches, undefined variables, and other common programming errors.
  • Isolated Analysis: Runs PHPStan in a separate context (forked agent) to prevent interference with your main development session.
  • Fix Suggestions: Can optionally suggest fixes for detected errors, aiding in code refactoring.
  • Use Case: Before committing your code, run /phpstan-check --files=src --level=7 to ensure all new code adheres to strict type checking standards.

Quick Start

Run a full PHPStan check on all files in the 'app' directory with the highest error reporting level.

Frequently Asked Questions about phpstan-check

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run static analysis on PHP code before committing?

Static analysis for PHP code is executed by running PHPStan type checking in an isolated sub-agent context, scanning specified files or patterns to identify type errors and generating a detailed report with suggested fixes.

What does PHPStan type checking detect in a PHP codebase?

PHPStan type checking detects type mismatches, undefined variables, and other common programming errors to identify potential bugs and ensure higher code quality with fewer runtime issues.

Can I validate specific directories for type errors during refactoring?

Yes, you can validate specific directories during refactoring by specifying file patterns like 'src' and setting a strict error reporting level, which generates a breakdown of severity levels and suggested fixes.

Does PHP code static analysis run without interfering with my development session?

Static analysis runs in a separate, forked sub-agent context to prevent interference with your main development session, analyzing results independently before outputting a comprehensive report.

What is the best way to enforce strict type safety standards on feature branches?

The best way to enforce type safety on feature branches is to run a PHPStan check with a high error reporting level, such as level 7, to ensure all new code adheres to strict type checking standards.