quality-metrics
Software quality metrics and measurement
What this skill does
# Quality Metrics Skill
Patterns for measuring software quality.
## Code Quality Metrics
### Coverage Metrics
```markdown
## Coverage Types
### Line Coverage
Percentage of code lines executed by tests.
Formula: (Executed Lines / Total Lines) × 100
Target: ≥ 80%
### Branch Coverage
Percentage of decision branches tested.
Formula: (Executed Branches / Total Branches) × 100
Target: ≥ 70%
### Function Coverage
Percentage of functions called by tests.
Formula: (Called Functions / Total Functions) × 100
Target: ≥ 85%
### Statement Coverage
Percentage of statements executed by tests.
Formula: (Executed Statements / Total Statements) × 100
Target: ≥ 80%
```
### Complexity Metrics
```markdown
## Complexity Measurements
### Cyclomatic Complexity
Number of linearly independent paths through code.
Calculation: E - N + 2P
- E = edges in flow graph
- N = nodes in flow graph
- P = connected components
| Score | Complexity | Risk |
|-------|------------|------|
| 1-10 | Simple | Low |
| 11-20 | Moderate | Medium |
| 21-50 | Complex | High |
| 50+ | Very Complex | Very High |
### Cognitive Complexity
Measures how difficult code is to understand.
Factors:
- Nesting depth
- Control flow breaks
- Multiple conditions
Target: ≤ 15 per function
### Maintainability Index
Composite metric for maintainability.
Formula: 171 - 5.2×ln(V) - 0.23×(G) - 16.2×ln(LOC)
- V = Halstead Volume
- G = Cyclomatic Complexity
- LOC = Lines of Code
| Score | Maintainability |
|-------|-----------------|
| 0-9 | Low |
| 10-19 | Moderate |
| 20+ | High |
```
## Defect Metrics
### Defect Density
```markdown
## Defect Measurements
### Defect Density
Defects per unit of code.
Formula: Total Defects / KLOC (thousands of lines)
Target: < 5 defects/KLOC
### Defect Escape Rate
Defects found after release.
Formula: (Production Bugs / Total Bugs) × 100
Target: < 5%
### Mean Time to Detect (MTTD)
Average time to discover defects.
Formula: Σ(Detection Time - Introduction Time) / Number of Defects
Target: < 1 sprint
### Mean Time to Repair (MTTR)
Average time to fix defects.
Formula: Σ(Fix Time - Report Time) / Number of Defects
Target: < 2 days for P1
```
### Defect Classification
```markdown
## Severity Levels
### Critical (P1)
- System down
- Data loss
- Security breach
- No workaround
SLA: 4 hours
### High (P2)
- Major feature broken
- Significant impact
- Workaround available
SLA: 24 hours
### Medium (P3)
- Feature partially broken
- Moderate impact
- Easy workaround
SLA: 1 week
### Low (P4)
- Minor issue
- Cosmetic
- Enhancement
SLA: Next release
```
## Performance Metrics
### Response Time
```markdown
## Latency Metrics
### Percentile Latencies
- P50 (Median): Typical user experience
- P95: Worst case for most users
- P99: Worst case experience
Targets:
- P50: < 100ms
- P95: < 200ms
- P99: < 500ms
### Throughput
Requests per second the system handles.
Formula: Total Requests / Time Period
### Error Rate
Percentage of failed requests.
Formula: (Failed Requests / Total Requests) × 100
Target: < 0.1%
```
### Availability
```markdown
## Availability Metrics
### Uptime
Percentage of time system is available.
| Nines | Uptime | Downtime/Year |
|-------|--------|---------------|
| 2 | 99% | 3.65 days |
| 3 | 99.9% | 8.76 hours |
| 4 | 99.99% | 52.6 minutes |
| 5 | 99.999% | 5.26 minutes |
### MTBF (Mean Time Between Failures)
Average time between system failures.
Formula: Total Uptime / Number of Failures
### MTTR (Mean Time To Recovery)
Average time to restore service.
Formula: Total Downtime / Number of Failures
```
## Process Metrics
### Velocity
```markdown
## Team Velocity
### Sprint Velocity
Story points completed per sprint.
Calculation: Sum of completed story points
Use: Capacity planning, predictability
### Lead Time
Time from request to delivery.
Formula: Delivery Date - Request Date
Target: < 2 weeks
### Cycle Time
Time from work start to delivery.
Formula: Delivery Date - Work Start Date
Target: < 1 week
### Deployment Frequency
How often code is deployed.
Target: Multiple times per day
```
## Reporting
### Quality Dashboard
```yaml
# Grafana dashboard definition
panels:
- title: "Code Coverage"
type: gauge
thresholds:
- value: 70
color: red
- value: 80
color: yellow
- value: 90
color: green
- title: "Defect Trend"
type: graph
queries:
- metric: defects_open
- metric: defects_closed
- title: "Response Time (P95)"
type: timeseries
thresholds:
- value: 200
color: yellow
- value: 500
color: red
```
### Weekly Report
```markdown
## Weekly Quality Report
### Coverage
- Current: 85.2% (+1.2%)
- Target: 80% ✅
### Defects
- Open: 12 (-3)
- Critical: 0
- New this week: 5
- Fixed this week: 8
### Performance
- P95 Latency: 145ms ✅
- Error Rate: 0.02% ✅
- Uptime: 99.98% ✅
### Trends
📈 Coverage improving
📉 Defects decreasing
➡️ Performance stable
```
## Integration
Used by:
- `quality-analyst` agent
- `evaluation-specialist` agent
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.