- How do I install Spatie’s coding guidelines in a Laravel 12+ project?
- Run `composer require spatie/guidelines-skills --dev` and execute `php artisan boost:install`. Select the Spatie guidelines from the Boost UI to enable them automatically. For non-Laravel projects, use `npx skills add spatie/guidelines-skills` via skills.sh.
- Will this work with my existing PHP_CodeSniffer or PHPStan setup?
- Yes, Spatie’s guidelines are modular and non-intrusive. They complement existing linters by adding AI-driven suggestions via Laravel Boost or skills.sh. You can disable specific skills if conflicts arise or use them alongside your current tooling.
- Does this package support Laravel versions below 12?
- No, this package is designed for Laravel 12+ and requires Laravel Boost. For older Laravel versions or non-Laravel projects, use the standalone `skills.sh` CLI tool (`npx skills add spatie/guidelines-skills`), which works with any PHP/JavaScript project.
- Can I customize or override the default coding guidelines?
- Absolutely. Use `.boost/skills.json` (for Laravel Boost) or skills.sh’s config to enable/disable specific skills or override rules. For example, you can enforce stricter security checks while relaxing JavaScript formatting to match your team’s preferences.
- How do I enforce these guidelines in CI/CD pipelines?
- For skills.sh, add a step like `npx skills check spatie/guidelines-skills` to your CI workflow (e.g., GitHub Actions). For Laravel Boost, ensure the `boost:check` command runs in CI, which validates enabled skills against your codebase.
- Will this slow down my IDE or development workflow?
- Spatie’s guidelines are optimized for performance, but real-time analysis in large codebases may introduce minor latency. Test with your project size and disable non-critical skills (e.g., `spatie-javascript`) if needed. Boost’s AI agent is designed to be lightweight.
- Are there alternatives to this package for Laravel coding standards?
- Yes. For traditional linters, consider `php-cs-fixer` (PSR standards) or `laravel-pint` (PHP formatting). For AI-driven tools, Laravel Boost’s built-in skills or `skills.sh` with other packages (e.g., `sharpcoder/skills`) are alternatives. Spatie’s package uniquely combines Laravel-specific, security, and JS guidelines in one.
- How do I keep the guidelines updated to the latest version?
- Run `composer update spatie/guidelines-skills` followed by `php artisan boost:update` for Laravel Boost. For skills.sh, use `npx skills add spatie/guidelines-skills` to pull the latest rules. Both methods ensure you’re using the most current conventions.
- Does this package include security-specific rules for Laravel applications?
- Yes, the `spatie-security` skill covers Laravel application, database, and server security best practices, including input validation, SQL injection prevention, and secure authentication patterns. It aligns with OWASP guidelines and is ideal for compliance-heavy projects.
- Can I use these guidelines in a monorepo with multiple Laravel and non-Laravel projects?
- Yes, via `skills.sh`. Install the package globally in your monorepo’s root and configure `.skills.json` to apply selective skills per project. For Laravel projects, use Laravel Boost’s project-specific configuration. This allows consistent standards across diverse tech stacks.