code-quality
Enforce code quality standards, test coverage, and static analysis. Use when working with code coverage thresholds, mutation testing, linting, code formatting, or quality gates. Maintains high code quality standards through automation.
When & Why to Use This Skill
The Code Quality Enforcer skill automates the maintenance of high software standards by managing test coverage, static analysis, and mutation testing. It helps development teams implement rigorous quality gates, ensure consistent code formatting, and identify weak test suites to improve overall system reliability and maintainability.
Use Cases
- Automated Coverage Enforcement: Set and maintain minimum test coverage thresholds to prevent regressions in code quality during the development lifecycle.
- Mutation Testing Analysis: Use tools like Stryker.NET to identify 'surviving mutants,' helping developers find gaps where tests pass but fail to actually validate the underlying logic.
- Static Analysis & Security Scanning: Integrate CodeQL and .NET analyzers to automatically detect code smells, security vulnerabilities, and architectural complexity issues.
- CI/CD Quality Gates: Configure automated checks that block pull requests if they fail to meet formatting standards, linting rules, or specific quality metrics.
- Quality Trend Tracking: Create and monitor quality dashboards to visualize trends in technical debt, cyclomatic complexity, and test effectiveness over time.
| name | code-quality |
|---|---|
| description | Enforce code quality standards, test coverage, and static analysis. Use when working with code coverage thresholds, mutation testing, linting, code formatting, or quality gates. Maintains high code quality standards through automation. |
Code Quality Enforcer
Current Quality Infrastructure
- ✅ Test Coverage: Collected with Coverlet (31% baseline)
- ✅ Mutation Testing: Stryker.NET weekly runs
- ✅ Code Formatting: .NET format enforcement in CI
- ✅ Static Analysis: .NET analyzers enabled
- ✅ Pre-commit Hooks: Format and lint checks
Expertise Areas
1. Coverage Enforcement
- Set minimum coverage thresholds
- Fail builds on coverage regression
- Track coverage trends over time
- Identify uncovered critical paths
2. Mutation Testing
- Validate test effectiveness with Stryker.NET
- Identify weak tests that pass but don't validate logic
- Improve test quality through mutation analysis
- Weekly automated mutation test runs
3. Static Analysis
- CodeQL security scanning
- .NET analyzers and Roslyn
- Custom analyzer rules
- Complexity metrics tracking
4. Code Formatting
- Consistent style with .NET format
- EditorConfig enforcement
- Pre-commit format validation
- CI format verification
5. Quality Gates
- Fail builds on quality regression
- Enforce coverage thresholds
- Block PRs with quality issues
- Quality trend dashboards
Enhancement Opportunities
- Increase Coverage: From 31% baseline to 50%+
- SonarCloud Integration: Code smells and tech debt
- Complexity Metrics: Track cyclomatic complexity
- Performance Regression: Detect performance degradation
- Quality Dashboards: Visualize quality trends
Related Skills
security-compliance- Security is qualityintegration-testing- Quality through testing
Examples
Example 1: Enforce Coverage Threshold
User: "Fail builds if coverage drops below 31%" Action: Add coverage enforcement to test workflow, fail on regression
Example 2: Run Mutation Tests
User: "Run Stryker mutation testing" Action: Execute Stryker, review mutation score, identify weak tests, improve coverage
Example 3: Quality Dashboard
User: "Create quality metrics dashboard" Action: Integrate CodeCov, add badges to README, visualize trends