Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

quality-metrics

verified

Software quality metrics and measurement

View on GitHub

Marketplace

alphaagent-team

the-answerai/alphaagent-team

Plugin

aai-quality

quality

Repository

the-answerai/alphaagent-team

plugins/aai-quality/skills/quality-metrics/SKILL.md

Last Verified

February 1, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/the-answerai/alphaagent-team/blob/main/plugins/aai-quality/skills/quality-metrics/SKILL.md -a claude-code --skill quality-metrics

Installation paths:

Claude
.claude/skills/quality-metrics/
Powered by add-skill CLI

Instructions

# 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) / Numbe

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
4866 chars