Boucle de vérification Laravel

VérifiéPrudence

Processus de vérification complet pour projets Laravel : contrôles d'environnement, lint, analyse statique, tests avec couverture, audit de sécurité et préparation au déploiement.

Spar Skills Guide Bot
DevOpsIntermédiaire
29/08/2026
Claude CodeCursorWindsurfCopilotCodex
#laravel#php#static-analysis#ci-cd#pre-deploy

Recommandé pour

Synthèse automatique

Décrit une boucle de vérification séquentielle pour un projet Laravel, allant du contrôle de l'environnement et de Composer jusqu'à la préparation au déploiement, en passant par le lint, l'analyse statique, les tests et l'audit de sécurité.

Points forts

  • Ordre des phases explicitement justifié (environnement → Composer → lint/PHPStan → tests → audit → migrations → caches → queues), avec arrêt immédiat si les contrôles d'environnement échouent
  • Commandes concrètes et copiables, avec variantes Sail, Psalm, Horizon et queue:monitor
  • Couvre des points souvent oubliés : migrations destructives, méthodes down(), cache de config/routes/vues, backlog des queues et planificateur
  • Propose une vérification active de queue (job no-op sur une queue dédiée) clairement restreinte aux environnements hors production

Limites

  • Ne fournit ni script prêt à l'emploi ni configuration CI complète : les commandes doivent être assemblées manuellement
  • Suppose Pint, PHPStan, Xdebug, Horizon déjà installés et configurés, sans expliquer leur mise en place
  • La couverture de tests est invoquée sans seuil minimal ni critère d'échec défini
Quand l'utiliser

À utiliser avant d'ouvrir une pull request, après une refonte ou une montée de dépendances majeure, ou juste avant un déploiement en staging ou en production sur un projet Laravel.

Quand l'éviter

Inutile pour un projet non-Laravel, ou lors d'un prototypage rapide où l'on ne souhaite ni lint ni analyse statique ni tests.

Analyse de sécurité

Prudence
Score qualité92/100

The skill uses legitimate Laravel verification commands, none of which are destructive or exfiltrating. However, it involves execution of shell commands that alter local project state and includes a tinker-based active verification step, so it warrants caution rather than a fully safe rating.

Points d'attention
  • •Skill instructs execution of shell commands (composer, artisan, vendor/bin tools) which can modify project state such as cache clearing, autoload regeneration, and queue worker processing.
  • •Includes `php artisan tinker --execute` to dispatch a job; while restricted to a healthcheck job on staging, tinker is a powerful tool that could be misused if the skill is adapted.
Comment cette analyse est faite

Exemples

Pre-PR verification
Run the full Laravel verification loop on this project before I open the PR: php/composer/artisan version checks, composer validate, Pint --test, PHPStan, php artisan test with coverage, composer audit, and migrate --pretend.
Production deploy readiness
We deploy to production tomorrow — walk through the Laravel pre-deploy checklist: verify APP_ENV and APP_DEBUG, review pending migrations for destructive changes, warm config/route/view caches, and confirm storage and bootstrap/cache are writable.
Queue and scheduler check on staging
Check the queue and scheduler setup on staging: run schedule:list and queue:failed, show horizon:status if Horizon is used, then dispatch a healthcheck job to a dedicated queue and process it with a single worker to confirm it works.

name: laravel-verification description: "Verification loop for Laravel projects: env checks, linting, static analysis, tests with coverage, security scans, and deployment readiness. Use when verifying a Laravel project before merge or deploy — lint, static analysis, tests, coverage, security." metadata: origin: ECC

Laravel Verification Loop

Run before PRs, after major changes, and pre-deploy.

When to Use

  • Before opening a pull request for a Laravel project
  • After major refactors or dependency upgrades
  • Pre-deployment verification for staging or production
  • Running full lint -> test -> security -> deploy readiness pipeline

How It Works

  • Run phases sequentially from environment checks through deployment readiness so each layer builds on the last.
  • Environment and Composer checks gate everything else; stop immediately if they fail.
  • Linting/static analysis should be clean before running full tests and coverage.
  • Security and migration reviews happen after tests so you verify behavior before data or release steps.
  • Build/deploy readiness and queue/scheduler checks are final gates; any failure blocks release.

Phase 1: Environment Checks

php -v
composer --version
php artisan --version
  • Verify .env is present and required keys exist
  • Confirm APP_DEBUG=false for production environments
  • Confirm APP_ENV matches the target deployment (production, staging)

If using Laravel Sail locally:

./vendor/bin/sail php -v
./vendor/bin/sail artisan --version

Phase 1.5: Composer and Autoload

composer validate
composer dump-autoload -o

Phase 2: Linting and Static Analysis

vendor/bin/pint --test
vendor/bin/phpstan analyse

If your project uses Psalm instead of PHPStan:

vendor/bin/psalm

Phase 3: Tests and Coverage

php artisan test

Coverage (CI):

XDEBUG_MODE=coverage php artisan test --coverage

CI example (format -> static analysis -> tests):

vendor/bin/pint --test
vendor/bin/phpstan analyse
XDEBUG_MODE=coverage php artisan test --coverage

Phase 4: Security and Dependency Checks

composer audit

Phase 5: Database and Migrations

php artisan migrate --pretend
php artisan migrate:status
  • Review destructive migrations carefully
  • Ensure migration filenames follow Y_m_d_His_* (e.g., 2025_03_14_154210_create_orders_table.php) and describe the change clearly
  • Ensure rollbacks are possible
  • Verify down() methods and avoid irreversible data loss without explicit backups

Phase 6: Build and Deployment Readiness

php artisan optimize:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache
  • Ensure cache warmups succeed in production configuration
  • Verify queue workers and scheduler are configured
  • Confirm storage/ and bootstrap/cache/ are writable in the target environment

Phase 7: Queue and Scheduler Checks

php artisan schedule:list
php artisan queue:failed

If Horizon is used:

php artisan horizon:status

If queue:monitor is available, use it to check backlog without processing jobs:

php artisan queue:monitor default --max=100

Active verification (staging only): dispatch a no-op job to a dedicated queue and run a single worker to process it (ensure a non-sync queue connection is configured).

php artisan tinker --execute="dispatch((new App\\Jobs\\QueueHealthcheck())->onQueue('healthcheck'))"
php artisan queue:work --once --queue=healthcheck

Verify the job produced the expected side effect (log entry, healthcheck table row, or metric).

Only run this on non-production environments where processing a test job is safe.

Examples

Minimal flow:

php -v
composer --version
php artisan --version
composer validate
vendor/bin/pint --test
vendor/bin/phpstan analyse
php artisan test
composer audit
php artisan migrate --pretend
php artisan config:cache
php artisan queue:failed

CI-style pipeline:

composer validate
composer dump-autoload -o
vendor/bin/pint --test
vendor/bin/phpstan analyse
XDEBUG_MODE=coverage php artisan test --coverage
composer audit
php artisan migrate --pretend
php artisan optimize:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan schedule:list

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/laravel-verification-loop-mte1lkmg' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/laravel-verification-loop-mte1lkmg/download' --output '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md.part' && mv '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md.part' '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && test -s '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/laravel-verification' && cp -R '.skill-downloads/laravel-verification-loop-mte1lkmg' '.claude/skills/laravel-verification'

Cursor
test -f '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && test -s '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/laravel-verification' && cp -R '.skill-downloads/laravel-verification-loop-mte1lkmg' '.cursor/skills/laravel-verification'

Codex
test -f '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && test -s '.skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/laravel-verification' && cp -R '.skill-downloads/laravel-verification-loop-mte1lkmg' '.agents/skills/laravel-verification'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/laravel-verification-loop-mte1lkmg'

openskills read 'laravel-verification-loop-mte1lkmg'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/laravel-verification-loop-mte1lkmg/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires