cache-guard

Detect and clear stale Laravel configuration caches after file changes.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/mim1012/ykp_project --skill cache-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cache-guard
Source: https://github.com/mim1012/ykp_project/tree/main/.claude/skills/cache-guard
Command: npx skills add https://github.com/mim1012/ykp_project --skill cache-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the frustration of stale Laravel configurations, where changes in .env or config files aren't reflected due to outdated caches. It prevents wasted debugging time and ensures your application always uses the latest settings.

Core Features & Use Cases

  • Automatic Cache Management: Detects modifications in .env or config/*.php files and intelligently clears the relevant Laravel caches (config, route, view, application).
  • Cache State Diagnosis: Provides a clear overview of current cache files, their timestamps, and the active configuration source, helping to quickly identify issues.
  • Server Restart Guidance: Offers precise instructions on when and how to restart your PHP server to ensure new configurations are loaded into memory.
  • Use Case: After updating your database credentials in .env, this Skill automatically clears the config cache and guides you to restart your server, ensuring your application connects to the new database without issues.

Quick Start

I just updated my .env file. Please use the cache-guard skill to ensure all Laravel caches are cleared and my changes are applied.

Frequently Asked Questions about cache-guard

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

FAQPage Schema
How do I clear Laravel cache when .env changes aren't reflected?

Clear Laravel cache by running artisan commands like config:clear, cache:clear, and route:clear after modifying .env files. cache-guard automates this detection and executes targeted cache clearing commands, then verifies changes are applied before restart guidance.

Why are my Laravel configuration changes not taking effect?

Stale configuration caches in bootstrap/cache prevent .env and config/*.php updates from loading. cache-guard diagnoses cache state, identifies outdated cache files by timestamp, and clears config, route, view, and service caches to ensure your application uses the latest settings.

How do I automate Laravel cache clearing after updating configuration files?

Set up automated cache management to detect modifications in .env or config/*.php files and trigger artisan commands. cache-guard watches these locations, runs config:clear, cache:clear, route:clear, view:clear, event:clear, and optimize:clear, then provides restart instructions.

What Laravel cache files should I clear when settings stop working?

Clear config.php, routes-v7.php, services.php, packages.php, and events.php from bootstrap/cache. cache-guard validates which cache types are stale, runs the appropriate artisan clear commands for each, and confirms configuration sources are refreshed.

Do I need to restart my PHP server after clearing Laravel caches?

Yes, after clearing caches you must restart your PHP server to load new configurations into memory. cache-guard provides precise restart guidance and verification steps to ensure your application recognizes .env and config file changes.

Can cache-guard work with Laravel projects using custom .env locations?

cache-guard detects modifications in standard .env and config/*.php file locations and applies diagnostic checks to bootstrap/cache. It clears Laravel's default cache types and validates against standard configuration sources, working within Laravel's conventional project structure.