Implementation Status: All phases completed Test Coverage: 96.91% line coverage (227 tests, 720 assertions) All 10 tool commands implemented and tested
This document outlines the Minimal Viable Product (MVP) implementation plan for the cpsit/quality-tools package. The MVP focuses on creating a simple command-line interface (CLI) tool called 'qt' (quality tools) that wraps existing tool configurations with user-friendly commands.
This MVP has been successfully completed and is ready for production use.
- Configuration Files: Complete configurations for Rector, Fractor, PHPStan, PHP CS Fixer, TypoScript Lint in
config/directory - Tool Dependencies: All quality tools already defined in
composer.json - TYPO3 Integration: Configurations automatically detect TYPO3 project root and target appropriate paths
- Documentation: Individual tool documentation exists for each quality tool
- Long Command Paths: Commands like
app/vendor/bin/rector -c app/vendor/cpsit/quality-tools/config/rector.php --dry-runare verbose and error-prone - Tool Discovery: Users need to know individual tool syntax and options
- Configuration Management: No unified interface for tool configurations
- Developer Experience: Steep learning curve for teams new to quality tools
- Simplify Command Usage: Replace long command paths with simple
qtcommands - Standardize Interface: Provide consistent command structure across all tools
- Maintain Flexibility: Preserve existing tool functionality and options
- Zero Breaking Changes: Existing configurations and usage patterns remain functional
- Commands are 80% shorter than current equivalents
- New team members can run quality checks within 5 minutes
- All existing tool functionality remains accessible
- Installation requires no additional configuration
- Symfony Console: Industry-standard PHP CLI framework
- Composer Binary: Install
qtcommand via Composer bin configuration - Basic Path Resolution: Simple composer.json traversal for project root detection
qt <category>:<action> [options] [arguments]Categories:
lint: Static analysis and checking (no file changes)fix: Automated fixing and code transformationcheck: General quality checks and validation
| Current Command | New Command | Description |
|---|---|---|
vendor/bin/rector -c config/rector.php --dry-run |
qt lint:rector |
Rector dry-run analysis |
vendor/bin/rector -c config/rector.php |
qt fix:rector |
Apply Rector changes |
vendor/bin/fractor process --dry-run -c config/fractor.php |
qt lint:fractor |
Fractor TypoScript analysis |
vendor/bin/fractor process -c config/fractor.php |
qt fix:fractor |
Apply Fractor changes |
vendor/bin/phpstan analyse -c config/phpstan.neon |
qt lint:phpstan |
PHPStan static analysis |
vendor/bin/php-cs-fixer fix --dry-run --config=config/php-cs-fixer.php |
qt lint:php-cs-fixer |
PHP CS Fixer dry-run |
vendor/bin/php-cs-fixer fix --config=config/php-cs-fixer.php |
qt fix:php-cs-fixer |
Apply PHP CS Fixer changes |
vendor/bin/typoscript-lint -c config/typoscript-lint.yml |
qt lint:typoscript |
TypoScript linting |
vendor/bin/composer-normalize --dry-run |
qt lint:composer |
Composer.json validation |
vendor/bin/composer-normalize |
qt fix:composer |
Normalize composer.json |
Objective: Build working qt commands that transform complex tool paths into simple shortcuts
-
Set up Symfony Console Application
- Create
src/Console/QualityToolsApplication.php - Configure application name, version, and command registration
- Basic composer.json traversal for project root detection
- Create
-
Create Base Command Class
src/Console/Command/BaseCommand.php- Single base class for shared functionality- Simple project root detection (find nearest composer.json)
- Basic configuration path resolution
- Common option handling (verbose, quiet, config override)
-
Implement Tool Commands
src/Console/Command/RectorLintCommand.php-qt lint:rectorsrc/Console/Command/RectorFixCommand.php-qt fix:rectorsrc/Console/Command/FractorLintCommand.php-qt lint:fractorsrc/Console/Command/FractorFixCommand.php-qt fix:fractorsrc/Console/Command/PhpStanCommand.php-qt lint:phpstansrc/Console/Command/PhpCsFixerLintCommand.php-qt lint:php-cs-fixersrc/Console/Command/PhpCsFixerFixCommand.php-qt fix:php-cs-fixersrc/Console/Command/TypoScriptLintCommand.php-qt lint:typoscriptsrc/Console/Command/ComposerLintCommand.php-qt lint:composersrc/Console/Command/ComposerFixCommand.php-qt fix:composer
-
Configure Composer Binary
- Update
composer.jsonwithbinconfiguration forqtcommand - Create
bin/qtexecutable script - Set up autoloading for new classes
- Update
- All
qt lint:*andqt fix:*commands working - Simple project root detection
- Basic error handling and output forwarding
- PHP 8.3+ compatibility
- Symfony Console ^6.0 or ^7.0 dependency
- Symfony Process ^6.0 or ^7.0 dependency
- PSR-4 autoloading configuration
Objective: Finalize MVP with testing, documentation, and production features
-
Testing and Validation
- Unit tests for base command functionality
- Integration tests with real tool execution
- Error handling validation
-
Documentation and Help
- Command help text and usage examples
- Update README.md with qt command examples
- Basic troubleshooting guide
-
Production Readiness
- Proper exit codes and error handling
- Tool availability validation
- Release preparation and versioning
- Production-ready MVP release
- Basic documentation
- Test coverage for core functionality
src/
├── Console/
│ ├── QualityToolsApplication.php
│ └── Command/
│ ├── BaseCommand.php
│ ├── RectorLintCommand.php
│ ├── RectorFixCommand.php
│ ├── FractorLintCommand.php
│ ├── FractorFixCommand.php
│ ├── PhpStanCommand.php
│ ├── PhpCsFixerLintCommand.php
│ ├── PhpCsFixerFixCommand.php
│ ├── TypoScriptLintCommand.php
│ ├── ComposerLintCommand.php
│ └── ComposerFixCommand.php
bin/
└── qt
tests/
└── Unit/
- Extends Symfony Console Application
- Registers all available commands
- Provides version and metadata
- Single base class for all commands
- Simple project root detection via composer.json traversal
- Basic configuration path calculation
- Common option handling (verbose, quiet, config override)
- Process execution via Symfony Process component
- Output forwarding from underlying tools
- Each tool has dedicated command classes (e.g., RectorLintCommand)
- Minimal logic: build command string and execute
- Inherit common functionality from BaseCommand
- Tool-specific configuration path resolution
{
"symfony/console": "^6.0|^7.0",
"symfony/process": "^6.0|^7.0"
}- Symfony Console: Industry standard for PHP CLI applications
- Symfony Process: Safe external process execution
- Use existing configuration files in
config/directory - Auto-detect TYPO3 project root via Composer
- Apply default paths based on project structure
qt lint:rector --config=/custom/path/rector.php
qt lint:phpstan --path=./custom/srcQT_PROJECT_ROOT=/path/to/project
QT_CONFIG_DIR=/path/to/configsImpact: Medium - Breaking changes in Symfony Console could affect CLI Probability: Low - Symfony maintains good backward compatibility Mitigation:
- Support multiple Symfony Console versions (^6.0|^7.0)
- Comprehensive test suite covering different versions
- Regular dependency updates and testing
Impact: Medium - Changes in underlying tools could break command execution Probability: Medium - Tools like Rector/Fractor evolve frequently Mitigation:
- Version-lock tool dependencies in composer.json
- Abstract tool execution through ProcessRunner service
- Comprehensive integration testing with locked versions
Impact: High - CLI won't work if project structure not detected Probability: Low - Uses standard Composer mechanisms Mitigation:
- Multiple detection strategies (Composer, file system, environment)
- Clear error messages for detection failures
- Manual override options for edge cases
Impact: High - Could delay MVP delivery significantly Probability: Medium - Natural tendency to add "just one more feature" Mitigation:
- Strict adherence to MVP feature list
- Document "nice to have" features for future releases
- Regular review of implementation progress against plan
Impact: Medium - Existing users could be affected Probability: Low - MVP preserves existing functionality Mitigation:
- No changes to existing configuration files
- Existing command paths continue to work
- Comprehensive compatibility testing
- Command Length Reduction: Achieve 80% reduction in command character count
- Setup Time: New users productive within 5 minutes
- Tool Coverage: Support 100% of existing tool functionality
- Performance: Commands execute within 10% performance overhead
- Developer Experience: Simplified onboarding and daily usage
- Consistency: Uniform command structure and output formatting
- Documentation: Clear, actionable documentation with examples
- Maintainability: Clean, testable code architecture
- Interactive Mode: Guided quality check workflows
- Configuration Generator: Create custom configurations interactively
- CI Integration: Specialized commands for continuous integration
- Reporting: HTML/JSON output formats for tooling integration
- Watch Mode: Automatic quality checks on file changes
- Plugin System: Allow third-party tool integrations
- Configuration Profiles: Environment-specific configurations
- Remote Configurations: Shared team configurations
- Quality Metrics: Historical tracking and reporting
This MVP provides a solid foundation for the cpsit/quality-tools package while maintaining simplicity and focusing on immediate developer productivity gains. The phased approach ensures steady progress and early feedback opportunities while building toward a comprehensive quality tools ecosystem.