Our review
Automatically resolves PHPStan errors by analyzing and fixing type issues iteratively.
Strengths
- Reduces PHPStan errors to zero or stagnation without manual intervention
- Processes errors in batches of 5 per file for targeted fixes
- Generates a detailed report with success rate and iteration count
Limitations
- Requires a valid PHPStan configuration and proper PHP environment
- Limited to a maximum of 10 iterations, which may be insufficient for large codebases
- Relies on the @phpstan-error-resolver agent, inheriting its limitations
Use this skill when you want to clean up a large number of PHPStan type errors in a PHP project quickly.
Avoid using it if you haven't set up PHPStan properly or if you prefer manual review of type corrections.
Security analysis
CautionThe skill employs Bash to run PHPStan and Edit to modify source files automatically. While there is no malicious payload or exfiltration intent, the combination of powerful tools and unattended file editing poses a moderate risk of unintended code damage.
- •Uses Bash and Edit tools for automated code modifications without explicit safeguards against destructive edits.
- •Automated code changes could inadvertently introduce bugs or vulnerabilities if the agent makes mistakes.
Examples
/qa:phpstanRun the PHPStan error resolver skill to fix all type errors in this project.name: phpstan-resolver description: > Résout automatiquement les erreurs PHPStan en analysant et corrigeant les problèmes de types. Boucle jusqu'à zéro erreur ou stagnation. allowed-tools: [Task, Bash, Read, Edit, Grep, Glob] model: claude-opus-4-1-20250805
PHPStan Error Resolver Skill
Instructions à Exécuter
IMPORTANT : Exécute ce workflow étape par étape :
Usage
/qa:phpstan
Configuration
PHPSTAN_BIN="./vendor/bin/phpstan"
PHPSTAN_CONFIG="phpstan.neon" # ou phpstan.neon.dist
ERROR_BATCH_SIZE=5
MAX_ITERATIONS=10
Workflow
Initialisation
Créer les tâches du workflow :
Utiliser TaskCreate pour chaque phase :
TaskCreate #1: Vérifier environnement PHPStan
TaskCreate #2: Exécuter analyse initiale (--error-format=json)
TaskCreate #3: Grouper erreurs par fichier
TaskCreate #4: Boucle de résolution (max 10 itérations)
TaskCreate #5: Générer rapport final
Important :
- Utiliser
activeForm(ex: "Vérifiant environnement PHPStan", "Résolvant erreurs") - La tâche #4 peut prendre du temps (boucle jusqu'à 10 itérations)
- Chaque tâche doit être marquée
in_progresspuiscompleted
Pattern d'exécution pour chaque étape :
TaskUpdate→ tâche enin_progress- Exécuter l'étape
TaskUpdate→ tâche encompleted
Spécial pour la boucle de résolution (tâche #4) :
- Marquer en
in_progressau début de la boucle - Ne marquer en
completedqu'à la fin (0 erreur, stagnation, ou max itérations) - Le statut reste
in_progresspendant toutes les itérations
Étapes
- Vérifier environnement PHPStan
- Exécuter analyse initiale (
--error-format=json) - Grouper erreurs par fichier
- Boucle de résolution :
- Déléguer corrections à
@phpstan-error-resolver - Re-exécuter PHPStan
- Répéter jusqu'à 0 erreur ou stagnation
- Déléguer corrections à
- Générer rapport final
Délégation
Utilise l'agent @phpstan-error-resolver pour les corrections :
- Batch de 5 erreurs par fichier par itération
- Maximum 10 itérations
Rapport
details:
total_errors_initial: X
total_errors_final: Y
errors_fixed: Z
success_rate: "X%"
iterations: N
Task Management
Progression du workflow :
- 5 tâches créées à l'initialisation
- La tâche #4 (boucle) reste
in_progresspendant toutes les itérations - Chaque tâche suit le pattern :
in_progress→ exécution →completed - Utiliser
TaskListpour voir la progression (notamment pour la boucle longue) - Les tâches permettent à l'utilisateur de suivre la résolution progressive des erreurs
References
- Scripts de workflow - Scripts bash détaillés
Error Handling
- PHPStan non trouvé → ARRÊT
- Config absente → ARRÊT
- Stagnation → ARRÊT avec rapport
- Max itérations → ARRÊT avec rapport
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.