CAP-007: Quality Validation

Structured Data

Capability Metadata

FieldValue
IDCAP-007
Versionv1.1
DomainQuality & Testing
StatusDocumented
RelatedCAP-003, CAP-008, CAP-025
Sourcesrc/validation/conflict-detector.ts
Togglequality_validation (integration.json)

Configuration Reference

Toggle: quality_validation in integration.json

{
  "quality_validation": true,
  "conflict_detection_sensitivity": 0.85,
  "validate_on_skill_creation": true
}

Sensitivity: 0.0–1.0 (higher = stricter conflict detection)

Auto-run: triggered on skill creation when validate_on_skill_creation: true

Technical Specifications

Class: ConflictDetector

// Validation result returned by ConflictDetector
interface ValidationResult {
  conflicts: ConflictPair[];    // Skills that collide
  score: number;                // 0.0–1.0 activation likelihood
  recommendations: string[];    // Suggested resolutions
}

interface ConflictPair {
  skill_a: string;              // Skill name
  skill_b: string;              // Conflicting skill name
  similarity: number;           // Semantic similarity score
  conflict_type: "overlap" | "contradiction";
}

class ConflictDetector {
  validate(library: Skill[]): ValidationResult;
  scoreActivation(skill: Skill, context: string): number;
}

Embeddings: local HuggingFace model for semantic comparison

Overview

Quality Validation prevents the skill library from degrading over time. As more skills are added, some naturally overlap or contradict each other — two skills might give conflicting instructions for the same situation, or trigger on identical patterns. The conflict detector uses semantic similarity (via local HuggingFace embeddings) to identify these collisions before they cause confusing behavior.

Beyond conflict detection, Quality Validation also scores activation likelihood — estimating how likely a given skill is to actually fire in a given context. A skill with a very high activation score dominates the context; a skill with a near-zero score is dead code, consuming token budget without contributing. Both extremes are problems the validator surfaces for human review.

The output is a ValidationResult: a list of detected conflict pairs, an activation score, and a set of human-readable recommendations. Conflicts can be resolved by merging two skills, deleting the redundant one, or adjusting the trigger conditions so they no longer overlap. The validator recommends but does not automatically resolve — all structural changes to the skill library require explicit user action.

History

Quality Validation was introduced in v1.1, the first post-release expansion. The original v1.0 system had no quality checks — skills were manually curated and trusted. When users began accumulating larger skill libraries (20–50 skills became common quickly), conflicts emerged organically: two skills with similar trigger patterns would both fire, issuing contradictory instructions to Claude in the same session.

The v1.1 solution was clever: use the same local embeddings that would later power Agentic RAG (CAP-029) to detect when two skills "mean the same thing" or "say opposite things." Activation scoring — estimating how likely a skill is to fire in a given context — was added to help users understand their library's effective coverage. A skill that never fires is wasted context; a skill that always fires regardless of context is a pollution source. The validator identifies both.

Key Concepts

For Students & Teachers

Imagine two sticky notes on your desk saying "always use tabs" and "always use spaces." When you need to write code, which do you follow? Quality Validation finds these contradictions in your skill library before they confuse Claude, and scores how likely each skill is to actually activate in real situations.

The system uses semantic similarity — a measure of how much two pieces of text "mean the same thing" — to detect when two skills are giving overlapping or conflicting instructions. You don't need to read every skill carefully yourself; the validator reads them all at once and flags the problematic pairs for your review.

Usage Examples

Example 1: Run conflict detection on your skill library

# Trigger validation from CLI
skill-creator validate

# Output example:
# Scanning 23 skills for semantic conflicts...
# [CONFLICT] skill-a.md ↔ skill-b.md (similarity: 0.91, type: overlap)
#   Recommendation: Merge into single skill or narrow trigger conditions
# [OK] No contradictions detected
# Activation scores: 18 high, 4 medium, 1 low
# Low activation: rarely-used-skill.md (score: 0.12) — consider removing

Example 2: Interpret a conflict report

// ConflictPair returned in ValidationResult
{
  "skill_a": "commit-style.md",
  "skill_b": "git-conventions.md",
  "similarity": 0.88,
  "conflict_type": "overlap"
}

// Resolution options:
// 1. Merge both files into one authoritative skill
// 2. Delete the less complete one
// 3. Narrow trigger conditions so they fire in different contexts

Example 3: Resolve a conflict by adjusting trigger conditions

# Before: both skills trigger on "git commit"
# After: scope each skill to distinct contexts

# commit-style.md frontmatter
---
triggers: ["commit message", "conventional commits", "git commit -m"]
---

# git-conventions.md frontmatter
---
triggers: ["branch naming", "PR description", "merge strategy"]
---

Related Capabilities