| name | harness-analyzer |
| description | Analyze all 14 SEA harness zone families deterministically and produce a HarnessDiagnosis JSON artifact. Use when you want to understand the current structural health of the agent harness before deciding whether to mutate it.
Trigger words: "audit harness for evolution", "diagnose harness", "analyze harness", "harness health check", "what zones need mutation", "harness score".
Do NOT trigger for general harness questions — use for evolution-cycle analysis only.
|
harness-analyzer Skill
Purpose
Produces a HarnessDiagnosis JSON by running deterministic structural checks
across all 14 SEA harness zone families. This is the first step in the
slow-loop evolution cycle.
Role in the two-loop model:
fast loop → task execution (unchanged)
slow loop → [harness-analyzer] → harness-transformer → harness-candidate-pr-loop
Trigger
Use this skill when the user says:
- "audit harness for evolution"
- "diagnose harness"
- "analyze harness health"
- "what zones need mutation"
- "harness readiness score"
Execution Steps
-
Resolve workspace root using $CLAUDE_PROJECT_DIR (never use parents[N] path hacking):
import os
harness_dir = os.environ['CLAUDE_PROJECT_DIR']
-
Run the analyzer:
python ${CLAUDE_PLUGIN_ROOT}/scripts/harness_core/analyzer.py \
--harness-dir $CLAUDE_PROJECT_DIR \
--json-output ${CLAUDE_PLUGIN_ROOT}/state/harness-report.json
-
Parse the output and produce a HarnessDiagnosis struct (see schemas/diagnosis.json).
-
Emit HARNESS_EVOLUTION_STATE.md using the state template if the diagnosis
reveals mutation_pressure >= 0.3 or any critical/high severity findings with
mutation_candidate: true.
-
Report a concise summary:
- Overall score
- Top 3 findings by severity
- Whether mutation is recommended (pressure threshold)
- Zone scores for zones with score < 0.8
Output Format
Harness Diagnosis Summary
─────────────────────────
Overall score: 0.742 (threshold for mutation: < 0.85)
Mutation pressure: 0.41 (threshold: >= 0.30 → recommend mutation)
Top findings:
🔴 [governed-speed] gs-001: services/policy-gateway/ is missing [CANDIDATE]
🟠 [invariants] inv-003: 2 invariant file(s) not in REF-012 §10 [CANDIDATE]
🟡 [thin-contract] thin-002: AGENTS.md is 267 lines (threshold: 250) [CANDIDATE]
Zone scores (< 0.80):
governance: 0.65
surface_coverage: 0.75
Recommendation: mutation recommended → route to harness-transformer
Constraints
- Read-only: This skill must not modify any harness files.
- No LLM mutation: The analyzer is deterministic Python — it does not use LLM
judgment to score zones in V1.
- Workspace root via env: Always use
$CLAUDE_PROJECT_DIR, never compute relative paths.
- Max retries: 1: If the analyzer script fails, retry once with
--quiet flag.
If it fails again, report the error and stop.
Error Handling
If analyzer.py exits non-zero:
- Report the stderr output to the user.
- Do NOT produce a partial diagnosis.
- Do NOT route to harness-transformer — a failed diagnosis is not a valid trigger for mutation.
Next Skill
If mutation_pressure >= 0.30, route to harness-transformer skill. Otherwise,
report "harness is healthy, no mutation needed" and stop.