# CR-002: Add score_quality Operation

| Field | Value |
|-------|-------|
| CR ID | CR-002 |
| Feature | FEATURE-051-A |
| Epic | EPIC-051 |
| Classification | modification |
| Priority | High |
| Date | 03-17-2026 |
| Requestor | User (product owner) |

## Change Description

Add `score_quality` operation to user manual tool skill. Evaluates content quality across 4 dimensions (completeness, structure, clarity, freshness) using domain expertise.

## Business Justification

Extractor CR-002 delegates quality scoring to tool skills. Tool skill must provide this capability to support the two-tier architecture where tool skills own domain knowledge.

## Implementation Details

### Operation Definition
- **Input:** section_id, content_path
- **Process:** 
  1. Read content
  2. Load acceptance criteria
  3. Evaluate 4 dimensions (completeness 0.4, structure 0.2, clarity 0.3, freshness 0.1)
  4. Compute weighted mean score
  5. Generate improvement hints for dimensions < 0.6
- **Output:** quality_result with section_id, score, dimensions, hints

### SKILL.md Changes
1. Line 58: Added `score_quality` to operation enum
2. Line 60: Updated section_id comment to include score_quality
3. Lines 261-287: New operation section with XML definition
4. Line 295: Updated operation enum in Output Result
5. Lines 318-325: Added quality_result output format
6. Line 356: Updated error count from 5 to 6
7. Line 357-358: Updated error descriptions for score_quality
8. Line 362: Added SCORING_FAILED error
9. Line 373: Updated acceptance-criteria.md description

### Quality Dimensions
- **Completeness (40%):** Ratio of REQ criteria satisfied
- **Structure (20%):** Proper heading hierarchy, code blocks, lists
- **Clarity (30%):** Actionable instructions, concrete examples present
- **Freshness (10%):** Content references current versions, no stale info

### Determinism
Per conflict resolution DC-3, this operation returns dimension weights and configuration. The extractor applies deterministic math to preserve bit-identical scoring guarantee.

### CR-001 Compatibility
Per conflict resolution DEP-4, structure dimension counts H3 headings across all files in `packed/` directory (handles split_mode from CR-001).

## Impact Analysis

- **Operations:** 5 → 6 (adds score_quality)
- **Line count:** 341 → 381 (+40 lines, well under 500 limit)
- **Backward compatibility:** All existing operations unchanged
- **Dependencies:** Used by extractor Phase 5 (EPIC-050)

## Testing Strategy

1. **Unit Tests:** Verify quality_result structure and dimension calculations
2. **Edge Cases:** Missing content, empty content, invalid section_id
3. **Integration Tests:** Call from extractor Phase 5
4. **Validation:** Compare scores against manual quality assessment

## Related Documents

- EPIC-050 CR-002 (extractor changes)
- FEATURE-051-A specification
- Extractor execution-procedures.md Step 5.1
