| name | ci-workflow |
| description | Run comprehensive CI checks before committing changes. Use when the user asks to run CI, run quality checks, validate code quality, or before finishing any task that involves code changes. |
CI Workflow Skill
This skill guides you through running comprehensive CI quality checks before committing code changes.
When to Use This Skill
Activate this skill when:
- User explicitly asks to "run CI" or "run quality checks"
- Before finishing any task that involves code changes
- After making significant code modifications
- Before creating a pull request
- When validating code quality
Workflow Steps
1. Run Comprehensive CI Command
Execute the primary CI command that runs all quality checks:
make ci
Expected Outcome: The command MUST output "✅ CI checks successfully passed!" at the end.
2. Monitor CI Execution
The make ci command runs these checks in sequence:
- Composer validation
- Security vulnerability analysis
- Code style fixes (PHP CS Fixer)
- Static analysis (Psalm)
- Security taint analysis (Psalm)
- Code quality analysis (PHPInsights)
- Architecture validation (Deptrac)
- Unit tests
- Integration tests
- End-to-end tests (Behat)
- Mutation testing (Infection)
3. Handle Failures
If CI fails (output shows "❌ CI checks failed:"):
Identify the failing check from the error output
Fix the specific issue:
- Code style: Review PHP CS Fixer suggestions
- Static analysis: Fix Psalm type errors
- Quality issues: Address PHPInsights warnings (reduce complexity, fix architecture)
- Test failures: Debug and fix failing tests
- Mutation testing: Add missing test cases or refactor for testability
Run individual check to verify fix:
make phpcsfixer # For code style issues make psalm # For static analysis errors make phpinsights # For quality issues make unit-tests # For unit test failures make infection # For mutation testing issuesRe-run full CI after fixes:
make ci
4. Iterate Until Success
CRITICAL: Keep fixing issues and re-running make ci until you see:
✅ CI checks successfully passed!
DO NOT finish the task until this success message appears.
5. Quality Standards Protection
NEVER decrease these quality thresholds:
- PHPInsights min-quality: 100% (src/), 95% (tests/)
- PHPInsights min-complexity: 93% (src/), 95% (tests/)
- PHPInsights min-architecture: 100% (src/), 90% (tests/)
- PHPInsights min-style: 100% (src/), 95% (tests/)
- Mutation testing MSI: 100%
- Test coverage: 100%
If quality checks fail, fix the code, don't lower the standards.
Common Issues and Solutions
High Cyclomatic Complexity
Problem: PHPInsights reports complexity score too low Solution:
- Run
make phpmdto identify complex methods - Refactor by extracting methods or using strategy pattern
- Keep methods under 5 complexity score
Escaped Mutants
Problem: Infection finds untested code mutations Solution:
- Review the mutation diff in infection output
- Add specific test cases for edge cases
- Consider refactoring for better testability (injectable time, extracted methods)
Architecture Violations
Problem: Deptrac reports layer violations Solution:
- Review the dependency rule violation
- Move code to appropriate layer
- Follow hexagonal architecture principles
Success Criteria
- Command outputs "✅ CI checks successfully passed!"
- All quality metrics meet or exceed thresholds
- Zero test failures
- Zero escaped mutants
- Zero architecture violations