agentleFS
solanodzsolanodz/harness-engineering-skills/skills/harness-diagnose/SKILL.md

harness-diagnose

Skill4 starsChanged 6 months agoMITView on GitHub

When the agent keeps failing, attribute the failure to a harness layer and fix the environment before swapping models. Use for repeated failures, verification gaps, or Lesson 01 diagnostic loops.

  • Reads credentials
  • Installs packages

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the same layer fails twice in a row, that layer is your bottleneck — invest there before anywhere else.

    line 40
  2. Very specific:

    Remove one subsystem (e.g.

    line 96
  3. Distinctive:

    Do not treat ablation alone as bottleneck proof.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Harness Diagnose

What this does for you

  • Fix harness first — don't reach for a bigger model until you know the layer
  • Named failure modes — task spec, context, environment, verification, state
  • Measurable gap — track when the agent says "done" vs what actually passes

Strong models still fail in bad harnesses (Lesson 01). harness-audit scores overall health (0–100). This skill diagnoses one concrete failure and prescribes the smallest harness fix.

Diagnostic rule

When something fails:

  1. Do not change the model first
  2. Do attribute the failure to one primary layer
  3. Do fix that layer and re-run the same task
  4. Do log the outcome — build a failure register over time

Five diagnostic layers

Map every failure to exactly one primary layer (secondary layers optional):

LayerSymptomHarness fix
Task specAgent built the wrong thingNarrow feature_list entry, sprint contract, observable user_visible_behavior
ContextAgent violated "everyone knows" rules or edited the wrong folderAGENTS.md, docs/REPO_MAP.md — see harness-instructions and harness-repo-knowledge
Environmentpip install / build / version hellinit.sh, lockfiles, .env.example — see harness-environment
VerificationAgent said done; tests never ran or only unit tests./init.sh, Definition of Done, harness-verification, harness-e2e
StateNext session re-discovered everythingprogress.md, handoff, feature_list evidence — see harness-state

If the same layer fails twice in a row, that layer is your bottleneck — invest there before anywhere else.

Diagnostic loop

Run task → Failure observed
  → Classify layer (one primary)
  → Apply smallest harness patch for that layer
  → Re-run SAME task (same model, same prompt class)
  → Pass? Log and continue : iterate (max 3 rounds before escalating)

Verification gap measurement

Track across 5–10 tasks:

TaskAgent claimed done?Independent check passed?Gap?
…yes/noyes/noyes/no

Verification gap = claimed done but check failed. High gap → prioritize harness-verification + harness-evaluator, not model upgrades.

Failure report template

## Failure diagnosis: [task name]

**Observed:** [what actually broke]
**Agent claimed:** [what the agent said]
**Primary layer:** task spec | context | environment | verification | state
**Evidence:** [command output, log snippet, screenshot path]

**Harness patch applied:**
- [ ] File/command changed
- [ ] Re-run result: pass / fail

**Next if still failing:** [second-layer hypothesis]

Template: templates/failure-diagnosis.md

Quick attribution guide

If you hear…Likely layer
"That's not what I asked for"Task spec
"It used the wrong pattern/version"Context
"Tests won't run / deps broken"Environment
"It said done but nothing works"Verification
"New session had no idea where we were"State

Ablation (optional, Lesson 02)

To quantify a layer's marginal value on your project:

  1. Fix model + task
  2. Remove one subsystem (e.g. delete AGENTS.md, skip init.sh)
  3. Measure success drop
  4. Combine with failure logs — largest drop suggests highest ROI fix

Do not treat ablation alone as bottleneck proof; use it with real failure attribution.

Anti-patterns

  • "Let's try GPT/Claude/Opus instead" before checking verification commands
  • Adding 20 lines to AGENTS.md for every failure without classifying layer
  • Diagnosing "the model is bad" when init.sh fails on fresh checkout
  • Fixing state when the real issue was no Definition of Done

Related skills

  • harness-audit — score all five subsystems (0–100)
  • harness-verification — close verification-layer gaps
  • harness-evaluator — close confidence-calibration gaps
  • harness-environment — toolchain, env vars, services, init.sh health
  • harness-repo-knowledge — repo map so agents find the right files
  • harness-scaffold — bootstrap missing harness artifacts

Course reference

  • Lesson 01: Why capable agents still fail
  • Lesson 02: Ablation and five subsystems
  • Project 01: Prompt-only vs rules-first experiment

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.