Expert assistant for JBZoo Codestyle - PHP code quality tools, QA configurations, and testing framework for maintaining coding standards across JBZoo projects.
Expert assistant for working with the JBZoo Codestyle library - a comprehensive PHP code quality and standards toolkit that provides configurations and tools for PHPStan, Psalm, PHP-CS-Fixer, PHPUnit, PHPMD, Phan, and other QA tools.
This skill helps you work with the JBZoo Codestyle project, which is a code quality library designed to be included in other JBZoo projects to enforce consistent coding standards. It provides guidance on:
When working with this codebase, follow these guidelines:
**Core Components:**
- `01_defines.Makefile` - Variables and paths
- `03_tests.Makefile` - Test and lint commands
- `04_reports.Makefile` - Coverage and reports
**Key Files:**
**Setup and Dependencies:**
```bash
make update # Install/update Composer dependencies
make autoload # Regenerate optimized autoloader
```
**Running Tests:**
```bash
make test # Run PHPUnit test suite
make test-all # Run all tests and code style checks
make codestyle # Run all linters together
```
**Individual QA Tools:**
```bash
make test-phpstan # PHPStan static analysis
make test-psalm # Psalm static analysis
make test-phpcs # PHP CodeSniffer (PSR-12)
make test-phpcsfixer # Check PHP-CS-Fixer rules
make test-phpcsfixer-fix # Auto-fix with PHP-CS-Fixer
make test-phpmd # PHP Mess Detector
make test-phan # Phan static analyzer
```
**Generating Reports:**
```bash
make report-all # All reports
make report-phpmetrics # PHP Metrics HTML report
make report-pdepend # PHP Depend report
```
**PHP Standards:**
**Testing Patterns:**
The main coding standard (`src/PhpCsFixer/PhpCsFixerCodingStandard.php`) combines:
When modifying rules:
1. Update `PhpCsFixerCodingStandard::getRules()` method
2. Test with `make test-phpcsfixer`
3. Apply fixes with `make test-phpcsfixer-fix`
Projects integrate this library by adding to their Makefile:
```makefile
ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
include ./vendor/jbzoo/codestyle/src/init.Makefile
endif
```
This provides all `make` commands to the parent project.
When creating new test traits or base classes:
1. Place in `src/PHPUnit/` directory
2. Use namespace `JBZoo\Codestyle\PHPUnit`
3. Follow existing trait naming: `Trait*` prefix
4. Add trait documentation for available methods
5. Consider CI environment compatibility (TeamCity, GitHub Actions)
To add a new QA tool:
1. Add configuration file in `src/` or project root
2. Add Make target in `src/Makefiles/03_tests.Makefile`
3. Add Composer dev dependency
4. Update `test-all` and `codestyle` targets
5. Document in README
**Adding a new PHP-CS-Fixer rule:**
**Creating a new PHPUnit trait:**
**Modifying Makefile commands:**
**Updating static analysis rules:**
```bash
make test-all
```
This runs PHPUnit tests plus all linters (PHPStan, Psalm, PHP-CS-Fixer, PHPCS, PHPMD).
```bash
make test-phpcsfixer-fix
```
Automatically applies PHP-CS-Fixer rules to fix formatting issues.
```bash
make report-all
```
Creates HTML reports for code coverage, metrics, and dependencies.
```bash
make test-phpcs
```
Runs PHP CodeSniffer with PHP 8.2 compatibility rules.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/jbzoo-codestyle-qa-assistant/raw