Goal Harness

Goal Harness — work on a goal until /es, /er, /code_standards, and Independent Agent Review all pass via adversarial subagents

jleechanorg 27 updated 25d ago
Claude CodeGeneric
View source ↗
---
description: "Goal Harness — work on a goal until /es, /er, /code_standards, and Independent Agent Review all pass via adversarial subagents"
type: quality
execution_mode: immediate
aliases: [h]
---

# /goal_harness — Goal-Driven Harness Loop

Define a goal (via builtin `/goal`), then iterate until **4 adversarial gates** all pass:

1. **`/es`** — Evidence Standards (both layers: user-scope + project-scope)
2. **`/er`** — Evidence Review (adversarial, independent reviewer)
3. **`/code_standards`** — ZFC + ZFC-leveling + root-cause-first (3 adversarial lanes)
4. **Independent Agent Review** — Independent Agent-run review of the full diff

All four gates use **adversarial subagents** — each gate runs in an isolated context
that receives **only the diff and its evaluation standard**, never the primary agent's
reasoning or optimism.

## Usage

/goal_harness /h # alias


## Flow Diagram

┌─────────────────────────────────────────────────────┐ │ Step 1: Define Goal (/goal) │ └─────────────────────┬───────────────────────────────┘ ▼ ┌─────────────────────────────────────────────────────┐ │ Step 2: Implement │ └─────────────────────┬───────────────────────────────┘ ▼ ┌─────────────────────────────────────────────────────┐ │ Step 3: Run 4 Gates (adversarial subagents) │ │ ├─ /es (evidence standards) │ │ ├─ /er (evidence review) │ │ ├─ /code_standards (3 parallel lanes) │ │ └─ Independent Agent Review │ └─────────────────────┬───────────────────────────────┘ ▼ 4/4 PASS? ▼ ▼ YES NO ▼ ▼ DONE FIX & LOOP ──┐ ▲ │ └─────────┘ (max 10 iter, stall at 2× same)


## Steps

### Step 1 — Define the Goal

Invoke builtin `/goal` with `$ARGUMENTS` to establish the goal and success criteria.
The goal file is written to `.converge/goal.md` (or `.goalexec/goal.md` for legacy state).

### Step 2 — Execute Toward Goal

Implement the goal. After each implementation iteration, run the 4-gate harness.

### Step 3 — Run the Harness (4 adversarial gates)

Each gate dispatches a **subagent** with:
- **Context rules**:
  - **Gates 1-2 (Evidence Gates)**: Full access to the current diff and the evidence bundle/artifacts as context.
  - **Gates 3-4 (Code Gates)**: Only the current diff or changed files as context.
- **Only** the relevant standard/skill as its evaluation criteria
- **No** access to the primary agent's context, reasoning, or optimism
- **Verdict rules**: Gates must ultimately produce a normalized verdict (PASS / WARN / FAIL) with file:line evidence; implementations (such as Gate 2) may emit raw outcomes (e.g., PARTIAL, INCONCLUSIVE) which are mapped to normalized verdicts during the subsequent normalization stage.

#### Gate 1: /es (Evidence Standards)

Evaluate evidence standards via adversarial subagent — spawns the `evidence-reviewer` subagent to apply both evidence-standards skill layers:

Use the Agent tool with: subagent_type: "evidence-reviewer" prompt: "Evaluate the current diff against evidence-standards. Read both skill layers: (1) ~/.claude/skills/evidence-standards/SKILL.md (user-scope) and (2) .claude/skills/evidence-standards.md (project-scope). Apply their rules to the diff and return PASS, WARN, or FAIL with file:line evidence.

Diff and artifacts: <full diff + evidence artifacts>"


#### Gate 2: /er (Evidence Review)

Evaluate evidence review via adversarial subagent — spawns the `evidence-reviewer` subagent to run evidence-review and evidence-standards synthesis. Note that Gate 2 emits raw overall verdicts (PASS, WARN, PARTIAL, FAIL, or INCONCLUSIVE) which are normalized by the harness in the subsequent normalization stage:

Use the Agent tool with: subagent_type: "evidence-reviewer" prompt: "Run evidence review against the current diff and its evidence artifacts. Load and apply: (1) The evidence-review skill from the repo-root required SKILL_PATH (located at .claude/skills/evidence-review.md relative to the repository root). If the repo-root SKILL_PATH is not present, immediately abort Gate 2 and emit a missing-skill error (do not continue synthesis). (2) The evidence-standards skills from ~/.claude/skills/evidence-standards/SKILL.md (user-scope) and .claude/skills/evidence-standards.md (project-scope). Return overall verdict: PASS, WARN, PARTIAL, FAIL, or INCONCLUSIVE with file:line evidence.

Diff and artifacts: <full diff + evidence artifacts>"


#### Gate 3: /code_standards (3 adversarial lanes)

Delegate to `/code_standards` — 3 parallel subagents:

Use the Agent tool with: subagent_type: "code-review" prompt: "Review diff against ZFC (zero-framework cognition). Read ~/.claude/skills/zero-framework-cognition/SKILL.md (user scope; fall back to .claude/skills/zero-framework-cognition/SKILL.md if absent). Check for keyword routing, heuristic scoring, regex intent detection, banned if/else intent chains. Return PASS or FAIL with file:line evidence.

Diff: "

Use the Agent tool with: subagent_type: "code-review" prompt: "Review diff against ZFC-leveling. Read .claude/skills/zfc-leveling-roadmap/SKILL.md (project scope; fall back to ~/.claude/skills/zfc-leveling-roadmap/SKILL.md if absent). Check for level-up fields, modal scoping, stale flag guards. Return PASS or FAIL with file:line evidence.

Diff: "

Use the Agent tool with: subagent_type: "code-review" prompt: "Review diff against root-cause-first. Read ~/.claude/skills/root-cause-first/SKILL.md (user scope; fall back to .claude/skills/root-cause-first/SKILL.md if absent). ```

Maintain Goal Harness?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

[Goal Harness on getagentictools](https://getagentictools.com/loops/jleechanorg-goal-harness-goal-driven-harness-loop?ref=badge)