ysato / catalyst
An Artisan command package for Laravel to improve code quality and project structure.
Requires
- php: ^8.2
- composer/composer: ^2.6
- doctrine/coding-standard: *
- illuminate/console: ^12.0
- illuminate/support: ^12.0
- laravel/prompts: ^0.3
- phpmd/phpmd: *
- spatie/temporary-directory: ^2.2
- squizlabs/php_codesniffer: *
- symfony/filesystem: ^7.1
- symfony/finder: ^7.1
README
A command package to streamline the setup of Laravel projects.
This package provides commands to easily configure project architecture, metadata, and development standards.
Installation
Run the following command to install:
composer require --dev ysato/catalyst
Usage
After installation, you can start the setup using the following command:
php artisan catalyst:setup
Command List
Command Name | Description |
---|---|
catalyst:setup |
Executes the overall project setup. |
catalyst:metadata |
Generates composer.json metadata. |
catalyst:architecture-src |
Initializes recommended src architecture. |
catalyst:phpcs |
Initializes PHP Code Sniffer configuration. |
catalyst:phpmd |
Initializes PHP Mess Detector configuration. |
catalyst:spectral |
Initializes Spectral (OpenAPI linter) configuration. |
catalyst:github |
Sets up recommended GitHub workflows and rulesets. |
catalyst:ide |
Initializes recommended IDE (e.g., PhpStorm) settings. |
catalyst:act |
Configures local execution for GitHub Actions. |
Importing Branch Protection Rulesets
This project contains predefined GitHub branch protection rulesets stored as JSON files. You can import these into your GitHub repository to quickly apply consistent branch protection rules.
The following ruleset files are available in the .github/
directory:
branch-all-users-rules.json
: Contains rules generally applicable to all users.branch-exclude-core-contributors-rule.json
: Contains rules that might exclude core contributors from certain restrictions, or apply specific rules to them.
Prerequisites
- You need admin access to the GitHub repository where you want to import these rulesets.
Importing via GitHub UI
GitHub allows you to import ruleset configurations directly.
-
Navigate to your repository on GitHub.
-
Click on Settings.
-
In the left sidebar, under the "Code and automation" section, click on Rules, then Rulesets.
-
Click the "Import ruleset" button (this option might be under a "..." menu or directly visible depending on UI updates).
-
You will be prompted to upload a JSON file.
-
Upload
.github/branch-all-users-rules.json
. -
Review the imported settings and click "Create".
-
Repeat steps 4-7 for
.github/branch-exclude-core-contributors-rule.json
.Note: Carefully review the "Target branches" section for each ruleset after import to ensure they apply to the intended branches (e.g.,
main
,develop
,feature/*
). You might need to adjust these based on your repository's branching strategy.
Verifying the Import
After importing, go to Settings > Rules > Rulesets in your GitHub repository to verify that the new rulesets appear and are configured as expected. Check their enforcement status and target branches.
For Contributors
The following command installs the oldest compatible versions of dependencies
to ensure this package works reliably in diverse environments:
composer update --prefer-lowest
Contribution Guidelines
- Fork this repository.
- Create a new branch.
- Make the necessary changes and commit them.
- Submit a pull request.
License
This package is provided under the MIT License.