Skip to main content
ClaudeWave
Skill119 repo starsupdated today

compare-harnesses

This Claude Code skill compares two scaffolded harnesses by analyzing their manifest metadata, host adapter lists, and per-file SHA-256 fingerprints. Use it when verifying whether forked templates match upstream versions, debugging why two scaffolding operations produced different results, or running CI checks for byte-equality between candidate and baseline harnesses. It exits with status 0 for identical harnesses, 1 for drift, or 2 when manifests are missing, and supports JSON output via the ADR-031 schema-1 envelope.

Install in Claude Code
Copy
git clone --depth 1 https://github.com/ruvnet/agent-harness-generator /tmp/compare-harnesses && cp -r /tmp/compare-harnesses/.claude-plugin/skills/compare-harnesses ~/.claude/skills/compare-harnesses
Then start a new Claude Code session; the skill loads automatically.

SKILL.md

# compare-harnesses

> Codex skill: diff two scaffolded harnesses — the ADR-031 Bundle JSON
> Pattern surfaced through Codex (iter 105 → iter 109).

## What it does

Two-harness diff. Useful when you've forked an upstream template, when a
support ticket says "mine and theirs scaffolded different things", or when a
CI script wants a byte-equality check between a candidate scaffold and a
known-good baseline.

Reports three sections:

1. **Manifest meta** — same name? same kernel? same surface?
2. **Hosts** — which host adapters each side ships (`claude-code` /
   `codex` / `pi-dev` / `hermes` / `openclaw` / `rvm`)
3. **Files** — added / removed / changed (per-file SHA-256 fingerprints;
   the cheapest possible byte-equality test)

| Verdict | Exit | Meaning |
|---|---|---|
| `IDENTICAL` | 0 | meta + hosts + every file fingerprint matches |
| `DRIFT` | 1 | at least one of meta / hosts / files differs |
| `no-manifest-in-a` | 2 | `a/.harness/manifest.json` missing |
| `no-manifest-in-b` | 2 | `b/.harness/manifest.json` missing |
| `no-manifest-in-either` | 2 | both sides missing manifest |

## Usage from Codex

```
/compare-harnesses a=./my-fork b=./upstream
/compare-harnesses a=./my-fork b=./upstream bundle=true
```

## Equivalent CLI

```bash
harness compare ./my-fork ./upstream                  # text output
harness compare ./my-fork ./upstream --bundle         # ADR-031 schema-1 JSON
```

The `--bundle` form (ADR-031) emits a schema-1 JSON envelope so CI scripts
can json-parse the verdict without re-parsing human text. The envelope
shape is shared with `harness diag --bundle`, `harness export-config`, and
`harness audit --bundle`:

```json
{
  "schema": 1,
  "generatedAt": "2026-06-15T...",
  "a": "/path/to/a",
  "b": "/path/to/b",
  "meta": { "sameKernel": true, "sameSurface": true, "sameName": false },
  "hosts": { "a": ["claude-code"], "b": ["claude-code", "codex"], "verdict": "PASS" | "FAIL" },
  "files": { "added": [...], "removed": [...], "changed": [...] },
  "identical": false,
  "exitCode": 1
}
```

Errors are bundle-formed too (`{ "schema": 1, "error": "no-manifest-in-a" }`),
so a CI script never has to dual-parse text + JSON. Object keys matching
`secret|token|key|password|passphrase` are redacted via the canonical
ADR-031 sanitisation regex before emission — safe to paste into a public
GitHub issue.

## Sample output (text mode)

```
harness compare — diffing /tmp/a /tmp/b

  name:              A=cmp-a   B=cmp-b   FAIL
  kernel:            A=0.1.0   B=0.1.0   PASS
  surface:           A=cli     B=cli     PASS
  hosts:             A=[claude-code] B=[claude-code,codex] FAIL

  added:             3 files
    + src/agents/codex-tester.ts
    + src/agents/codex-reviewer.ts
    + .codex/config.toml
  removed:           0 files
  changed:           1 file
    ~ .harness/manifest.json

DRIFT (exit 1)
```

## When to use it

- You forked the project's upstream template, edited it, and want to know
  exactly what diverged before sending a PR upstream.
- A user files a "this doesn't work" bug; you run `harness compare
  their-zip yours-zip --bundle > diff.json` and attach the bundle to the
  issue.
- CI is the canonical place: a nightly job runs `compare` between today's
  scaffold output and a frozen baseline, fails the run on `DRIFT`.

## Related skills

- `diag-harness` — single-harness kernel-version skew check (iter 66)
- `validate-harness` — release-readiness umbrella (iter 20)
- `verify-witness` — Ed25519 witness signature verification (iter 8)

## See also

- [ADR-030 — Discovery Loop](../../../docs/adrs/ADR-030-discovery-loop.md) —
  why new subcommands propagate to codex skills.
- [ADR-031 — Bundle JSON Pattern](../../../docs/adrs/ADR-031-bundle-json-pattern.md) —
  the envelope shape this skill's `--bundle` mode conforms to.
create-harnessSkill

Scaffold your own focused AI agent harness — pick host (Claude Code, Codex, pi.dev, Hermes), template, agents, skills, and ship a npm-publishable harness with its own npx CLI. Use when a user asks to "create my own agent harness", "scaffold a harness", "make a custom Claude Code plugin like ruflo", or "build a vertical AI assistant for X".

diag-harnessSkill

Kernel-version skew check (ADR-027). Reports manifest surface + manifest kernel + installed kernel + verdict (match/patch-diff/minor-diff/major-diff). Exits 1 on minor/major skew with a copy-pasteable `npm install @metaharness/kernel@X.Y.Z` next step. Exits 2 if no .harness/manifest.json at path.

example-harnessSkill

Scaffold a ready-made AI agent harness in one command from the 19 published @metaharness/* example packages — 9 host integrations (Claude Code, Codex, Hermes, pi.dev, OpenClaw, RVM, Copilot, OpenCode, GitHub Actions) + 10 vertical pods (devops, research, trading, support, legal, coding, education, sales, gaming, repo-maintainer).

harness-secretsSkill

GCP Secret Manager integration: validate setup, fetch values, or confirm an NPM_TOKEN is non-revoked via `npm whoami`. Used for publish-time token rotation without long-lived keys in CI.

list-templatesSkill

List the available harness templates and what each one ships with. Use when the user asks "what templates are available", "what verticals does the harness generator support", or "show me what I can scaffold".

oia-manifestSkill

Emit .harness/oia-manifest.json declaring layer alignment with the OIA v0.1 9-layer reference architecture. Self-describes the harness's MCP wiring, witness signing, audit log, identity posture (always 'none' at v0.1). --check verifies an existing manifest, --dry-run prints without writing, --json emits to stdout.

publish-harnessSkill

Publish a generated harness to npm — runs the smoke test, signs the witness manifest, and dispatches `npm publish --provenance` from your tagged release.

repo-genomeSkill

7-section readiness scorecard for a LOCAL repo. Reports repo type + agent topology + MCP risk + test confidence + release readiness + recommended harness plan + scorecard. Exit 0 ready, 1 needs-work, 2 blocked. --json for the 6-field scorecard, --bundle for the ADR-031 schema-1 envelope.