Deterministic · Offline · Framework-agnostic

Keep your agent harness healthy.

A coding agent is only as good as the repository it works in. Harness Doctor scans for the structure that keeps agents from guessing, reports what's missing, and scores the repo 0–100 so you can watch it improve.

View on GitHub

No model calls. No network. The same repo always produces the same score.

What it checks

Two lenses on a repo, both deterministic — the kind of thing you could answer with ls and wc -l, made rigorous.

🗺️

Structural checks

Reads your repository off disk — its files, layout, and docs. Does an agent entry-point exist? Is it a short map or a 600-line wall of text? Does it actually point into docs/? Is your pnpm setup hardened against supply-chain attacks?

🧹

Dead-code analysis

Finds unused files, unused exports, unused dependencies, and circular imports — the cruft that misleads an agent reading your codebase and quietly drags the score down.

🩺

Fix, not just blame

Every finding comes with a one-line explanation of what's wrong and a concrete fix — written to be read by a human or handed straight to a coding agent.

0–100 Deterministic readiness score
Offline No model calls, nothing to flake
schema v1 Versioned JSON contract
5+ Claude Code, Cursor, Codex, OpenCode…

Quick start

From the root of any project.

1 Audit

Get a score and a list of findings. Add --verbose for file and line numbers.

2 Install for agents

Wire it into your agent's workflow so it reads findings, fixes them, and keeps the score from sliding.

3 Get JSON

Emit a versioned report. Key automations off plugin/rule and schemaVersion, not prose.

Run it in CI

Scan every pull request and leave findings inline. For hardened CI, pin @v1 to a full commit SHA and let Dependabot or Renovate bump it.

CI docs →
.github/workflows/harness-doctor.yml
name: Harness Doctor

on:
  pull_request:
    types: [opened, synchronize, reopened]

permissions:
  contents: read
  pull-requests: write
  issues: write

jobs:
  harness-doctor:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v5
      - uses: abpai/harness-doctor@v1

Configure

Drop a harness.config.ts at your project root. Turn rules up, down, or off.

harness.config.ts
// harness.config.ts
import type { HarnessDoctorConfig } from "harness-doctor/api";

export default {
  deadCode: true,
  docsContract: true,
  rules: {
    "harness-doctor/docs-structure/spec-contract-exists": "error",
  },
} satisfies HarnessDoctorConfig;

Ready when your agents are.

Run it once on any repo and see where it stands.

Star on GitHub ★
Copied to clipboard