Quality Standards
by VilnaCRM-Org
Overview of protected quality thresholds and quick reference for all quality tools. Use when you need to understand quality metrics, run comprehensive quality checks, or learn which specialized skill to use. For specific issues, use dedicated skills (deptrac-fixer for Deptrac, complexity-management for PHPInsights, testing-workflow for coverage).
Skill Details
Repository Files
1 file in this skill directory
name: quality-standards description: Overview of protected quality thresholds and quick reference for all quality tools. Use when you need to understand quality metrics, run comprehensive quality checks, or learn which specialized skill to use. For specific issues, use dedicated skills (deptrac-fixer for Deptrac, complexity-management for PHPInsights, testing-workflow for coverage).
Quality Standards Skill
Context (Input)
- Need to understand protected quality thresholds
- Running comprehensive quality checks before commit
- Determining which specialized skill to use for specific issues
- Quick reference for quality tool commands
Task (Function)
Understand quality metrics and route to appropriate specialized skill for fixes.
Success Criteria: Know which skill to use for your specific quality issue.
Protected Quality Thresholds
CRITICAL: These thresholds are protected and must NEVER be lowered.
PHPInsights (Source Code)
| Metric | Required | Fix With |
|---|---|---|
| Quality | 100% | complexity-management |
| Complexity | 93% | complexity-management |
| Architecture | 100% | deptrac-fixer |
| Style | 100% | Run make phpcsfixer |
PHPInsights (Tests)
| Metric | Required | Fix With |
|---|---|---|
| Quality | 95% | complexity-management |
| Complexity | 95% | complexity-management |
| Architecture | 90% | deptrac-fixer |
| Style | 95% | Run make phpcsfixer |
Other Tools
| Tool | Metric | Required | Fix With |
|---|---|---|---|
| Deptrac | Violations | 0 | deptrac-fixer |
| Psalm | Errors | 0 | Fix reported issues |
| Psalm | Security Issues | 0 | Fix tainted flows |
| Infection | MSI | 100% | testing-workflow |
| PHPUnit | Coverage | 100% | testing-workflow |
Quick Reference Commands
Comprehensive Checks
# Run all CI checks (recommended before commit)
make ci
Success: Must output "✅ CI checks successfully passed!"
Individual Quality Checks
| Check | Command | Purpose |
|---|---|---|
| Code quality | make phpinsights |
All PHPInsights metrics |
| Complexity analysis | make phpmd |
Find high-complexity methods |
| Static analysis | make psalm |
Type checking and errors |
| Security taint | make psalm-security |
Security vulnerability scan |
| Architecture | make deptrac |
Layer boundary validation |
| Code style | make phpcsfixer |
Auto-fix PSR-12 style |
| Composer validation | make composer-validate |
Validate composer.json |
Testing Commands
| Check | Command | Purpose |
|---|---|---|
| Unit tests | make unit-tests |
Domain/Application logic |
| Integration tests | make integration-tests |
Component interactions |
| E2E tests | make e2e-tests |
Full user scenarios (Behat) |
| All tests | make all-tests |
Unit + Integration + E2E |
| Test coverage | make tests-with-coverage |
Generate coverage report |
| Mutation tests | make infection |
Test quality validation |
Routing to Specialized Skills
When quality checks fail, use the appropriate specialized skill:
Architecture Issues
-
Deptrac violations → deptrac-fixer
- Domain depends on Infrastructure
- Layer boundary violations
- "must not depend on" errors
-
DDD architecture patterns → implementing-ddd-architecture
- Creating new entities/value objects
- Implementing CQRS patterns
- Understanding layer responsibilities
Code Quality Issues
-
High cyclomatic complexity → complexity-management
- PHPInsights complexity < 94%
- PHPMD reports high CCN
- Methods too complex
-
Code style issues → Run
make phpcsfixer- PSR-12 violations
- Line length > 100 chars
- Formatting issues
Testing Issues
- Test failures → testing-workflow
- Unit/Integration/E2E failures
- Mutation testing (Infection)
- Test coverage < 100%
Workflow Integration
-
Before committing → ci-workflow
- Run all checks systematically
- Fix failures in priority order
- Ensure all checks pass
-
PR review feedback → code-review
- Fetch and address PR comments
- Systematic comment resolution
Quality Improvement Workflow
Step 1: Run Comprehensive Checks
make ci
Step 2: Identify Failing Check
Check output for specific failure:
❌ CI checks failed:
- phpinsights: Complexity score too low (93.5% < 94%)
Step 3: Use Specialized Skill
Based on failure type, use appropriate skill:
| Failure Pattern | Skill to Use |
|---|---|
| "Complexity score too low" | complexity-management |
| "Deptrac violations" | deptrac-fixer |
| "must not depend on" | deptrac-fixer |
| "tests failed" | testing-workflow |
| "Psalm found errors" | Fix type errors directly |
| "escaped mutants" | testing-workflow |
Step 4: Re-run CI
make ci
Repeat until: "✅ CI checks successfully passed!"
Constraints (Parameters)
NEVER
- Lower quality thresholds in config files (
phpinsights.php,infection.json5, etc.) - Skip failing checks to "save time"
- Commit code without all CI checks passing
- Modify
deptrac.yamlto allow violations (fix code, not config) - Disable security checks
ALWAYS
- Fix code to meet standards (not config to meet code)
- Run
make cibefore creating commits - Use specialized skills for specific quality issues
- Maintain 100% test coverage
- Keep cyclomatic complexity low (target: < 5 per method)
- Respect hexagonal architecture boundaries
Format (Output)
Expected CI Output
✅ CI checks successfully passed!
Expected PHPInsights Output
[CODE] 100.0 pts ✅ Target: 100%
[COMPLEXITY] 94.0 pts ✅ Target: 94%
[ARCHITECTURE] 100 pts ✅ Target: 100%
[STYLE] 100.0 pts ✅ Target: 100%
Expected Deptrac Output
✅ No violations found
Expected Infection Output
Mutation Score Indicator (MSI): 100%
Verification Checklist
After using this skill:
- Identified which quality check is failing
- Selected appropriate specialized skill for the issue
- Ready to execute specialized skill workflow
- Understand which threshold applies to the failure
- Know the command to re-run the check after fixes
Related Skills
- ci-workflow - Run comprehensive CI validation
- complexity-management - Reduce complexity, improve quality
- deptrac-fixer - Fix architectural violations
- implementing-ddd-architecture - Understand DDD patterns
- testing-workflow - Fix test failures, improve coverage
Reference Documentation
For detailed examples and patterns, see:
- Refactoring patterns → complexity-management skill
- Architecture rules → implementing-ddd-architecture skill
- Layer boundaries → deptrac-fixer skill
- Testing strategies → testing-workflow skill
Related Skills
Dbt Transformation Patterns
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
Anndata
This skill should be used when working with annotated data matrices in Python, particularly for single-cell genomics analysis, managing experimental measurements with metadata, or handling large-scale biological datasets. Use when tasks involve AnnData objects, h5ad files, single-cell RNA-seq data, or integration with scanpy/scverse tools.
Xlsx
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
Tensorboard
Visualize training metrics, debug models with histograms, compare experiments, visualize model graphs, and profile performance with TensorBoard - Google's ML visualization toolkit
Deeptools
NGS analysis toolkit. BAM to bigWig conversion, QC (correlation, PCA, fingerprints), heatmaps/profiles (TSS, peaks), for ChIP-seq, RNA-seq, ATAC-seq visualization.
Scvi Tools
This skill should be used when working with single-cell omics data analysis using scvi-tools, including scRNA-seq, scATAC-seq, CITE-seq, spatial transcriptomics, and other single-cell modalities. Use this skill for probabilistic modeling, batch correction, dimensionality reduction, differential expression, cell type annotation, multimodal integration, and spatial analysis tasks.
Statsmodels
Statistical modeling toolkit. OLS, GLM, logistic, ARIMA, time series, hypothesis tests, diagnostics, AIC/BIC, for rigorous statistical inference and econometric analysis.
Dask
Parallel/distributed computing. Scale pandas/NumPy beyond memory, parallel DataFrames/Arrays, multi-file processing, task graphs, for larger-than-RAM datasets and parallel workflows.
Senior Data Scientist
World-class data science skill for statistical modeling, experimentation, causal inference, and advanced analytics. Expertise in Python (NumPy, Pandas, Scikit-learn), R, SQL, statistical methods, A/B testing, time series, and business intelligence. Includes experiment design, feature engineering, model evaluation, and stakeholder communication. Use when designing experiments, building predictive models, performing causal analysis, or driving data-driven decisions.
Scikit Survival
Comprehensive toolkit for survival analysis and time-to-event modeling in Python using scikit-survival. Use this skill when working with censored survival data, performing time-to-event analysis, fitting Cox models, Random Survival Forests, Gradient Boosting models, or Survival SVMs, evaluating survival predictions with concordance index or Brier score, handling competing risks, or implementing any survival analysis workflow with the scikit-survival library.
