agentleFS
existential-birdsexistential-birds/beagle/skills/llm-judge/SKILL.md

llm-judge

Skill91 starsChanged 6 days agoApache-2.0View on GitHub

Use when comparing two or more code implementations against a spec or requirements doc. Triggers on \"which repo is better\", \"compare these implementations\", \"evaluate both solutions\", \"rank these codebases\", or \"judge which approach wins\". Also covers choosing between competing PRs or vendor submissions solving the same problem. Does NOT review a single codebase for quality \u2014 use code review skills instead. Does NOT evaluate strategy docs \u2014 use strategy-review. Requires a spec file and 2+ repo paths.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the spec document into memory.

    line 30
  2. Very specific:

    Write .beagle/llm-judge-report.json with version, timestamp, repo metadata, weights, scores, ranking, and verdict.

    line 175
  3. Distinctive:

    Before completing (maps to Hard gates D and E):

    line 183
  4. Very specific:

    Gate E / completeness: Verify every repo label has scores for every dimension, each weighted_total equals the sum over dimensions of (score …

    line 189
  5. Distinctive:

    Always validate inputs before proceeding

    line 231
  6. Distinctive:

    Run one Phase 2 unit per dimension

    line 233
  7. Distinctive:

    Every score must have a justification

    line 234
  8. Distinctive:

    Write the JSON report before displaying the summary

    line 235

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

LLM Judge

Compare code implementations across multiple repositories using structured evaluation.

Usage

llm-judge <spec> <repo1> <repo2> [repo3...] [--labels=...] [--weights=...] [--branch=...]

Arguments

ArgumentRequiredDescription
specYesPath to spec/requirements document
reposYes2+ paths to repositories to compare
--labelsNoComma-separated labels (default: directory names)
--weightsNoOverride weights, e.g. functionality:40,security:30
--branchNoBranch to compare against main (default: main)

Workflow

  1. Parse the provided inputs into spec_path, repo_paths, labels, weights, and branch.
  2. Validate the spec file, each repo path, and the minimum repo count.
  3. Read the spec document into memory.
  4. Load this skill and the supporting reference files.
  5. Gather facts per repository (one Phase 1 unit per repo) — facts only, no scoring.
  6. Validate the repo-agent JSON results before proceeding.
  7. Score each dimension (one Phase 2 unit per dimension).
  8. Aggregate scores, compute weighted totals, rank repos, and write the report.
  9. Display the markdown summary and verify the JSON report.

Hard gates

Sequenced workflow: do not start the next phase until the current gate passes. Each pass condition must be checkable (file on disk, non-empty content, or json.load succeeds)—not “I reviewed internally.”

GatePass conditionUnblocks
A — Inputsspec_path is a readable file and non-empty; len(repo_paths) ≥ 2; each path contains .git.Phase 1 repo agents
B — Phase 1 factsFor each repo agent output: stdin/stdout parses as JSON; required keys/shape match references/fact-schema.md.Phase 2 judge agents
C — Phase 2 scoresFive judge outputs (one per dimension) each parse as JSON; each includes a score (and justification) for every repo label.Aggregation
D — Report file.beagle/llm-judge-report.json exists; python3 -c "import json; json.load(open('.beagle/llm-judge-report.json'))" exits 0.Markdown summary to the user
E — ConsistencySummary table and verdict use the same labels, weights, and per-dimension scores as the JSON report.Mark task complete

Parallelism is allowed within a phase (all Phase 1 tasks together; all Phase 2 tasks together), but Phase 2 must not start until Gate B passes, and the user-visible summary must not precede Gate D.

Detailed Workflow

Step 1: Parse Inputs

Parse the provided inputs to extract:

  • spec_path: first positional argument
  • repo_paths: remaining positional arguments (must be 2+)
  • labels: from --labels or derived from directory names ($REPO_LABEL)
  • weights: from --weights or defaults
  • branch: from --branch or main

Default Weights:

{
  "functionality": 30,
  "security": 25,
  "tests": 20,
  "overengineering": 15,
  "dead_code": 10
}

Step 2: Validate Inputs

[ -f "$SPEC_PATH" ] || { echo "Error: Spec file not found: $SPEC_PATH"; exit 1; }

for repo in "${REPO_PATHS[@]}"; do
  [ -d "$repo/.git" ] || { echo "Error: Not a git repository: $repo"; exit 1; }
done

[ ${#REPO_PATHS[@]} -ge 2 ] || { echo "Error: Need at least 2 repositories to compare"; exit 1; }

Step 3: Read Spec Document

SPEC_CONTENT=$(cat "$SPEC_PATH") || { echo "Error: Failed to read spec file: $SPEC_PATH"; exit 1; }
[ -z "$SPEC_CONTENT" ] && { echo "Error: Spec file is empty: $SPEC_PATH"; exit 1; }

Step 4: Load the Skill

Load this llm-judge skill and its reference files into context.

Step 5: Phase 1 - Gather Facts Per Repo

If the agent supports subagents, dispatch one Phase 1 repo agent per repository in parallel; otherwise run the same fact-gathering steps sequentially, one repo at a time — the output is identical either way. Give each unit this brief:

You are a Phase 1 Repo Agent for the LLM Judge evaluation.

**Your Repo:** $REPO_LABEL at $REPO_PATH

**Spec Document:**
$SPEC_CONTENT

**Instructions:**
1. Load the **llm-judge** skill's references/repo-agent.md for detailed instructions
2. Follow references/fact-schema.md for the output format
3. Load the **llm-artifacts-detection** skill ([../llm-artifacts-detection/SKILL.md](../llm-artifacts-detection/SKILL.md), if available) for dead-code/overengineering analysis

Explore the repository and gather facts. Return ONLY valid JSON following the fact schema (no markdown or explanations).

Do NOT score or judge. Only gather facts.

Collect all repo outputs into ALL_FACTS.

Step 6: Validate Phase 1 Results

echo "$FACTS" | python3 -c "import json,sys; json.load(sys.stdin)" 2>/dev/null || { echo "Error: Invalid JSON from $REPO_LABEL"; exit 1; }

Step 7: Phase 2 - Score Per Dimension

If the agent supports subagents, dispatch one judge agent per dimension (five total) in parallel; otherwise score each dimension sequentially — identical output. Give each unit this brief:

You are the $DIMENSION Judge for the LLM Judge evaluation.

**Spec Document:**
$SPEC_CONTENT

**Facts from all repos:**
$ALL_FACTS_JSON

**Instructions:**
1. Load the **llm-judge** skill's references/judge-agents.md for detailed instructions
2. Follow references/scoring-rubrics.md for the $DIMENSION rubric

Score each repo on $DIMENSION. Return ONLY valid JSON with scores and justifications.

Step 8: Aggregate Scores

for repo_label in labels:
    scores[repo_label] = {}
    for dimension in dimensions:
        scores[repo_label][dimension] = judge_outputs[dimension]['scores'][repo_label]

    weighted_total = sum(
        scores[repo_label][dim]['score'] * weights[dim] / 100
        for dim in dimensions
    )
    scores[repo_label]['weighted_total'] = round(weighted_total, 2)

ranking = sorted(labels, key=lambda l: scores[l]['weighted_total'], reverse=True)

Step 9: Generate Verdict

Name the winner, explain why they won, and note any close calls or trade-offs.

Step 10: Write JSON Report

mkdir -p .beagle

Write .beagle/llm-judge-report.json with version, timestamp, repo metadata, weights, scores, ranking, and verdict.

Step 11: Display Summary

Render a markdown summary with the scores table, ranking, verdict, and detailed justifications.

Step 12: Verification

Before completing (maps to Hard gates D and E):

  1. Gate D: Confirm .beagle/llm-judge-report.json exists and parses:
    python3 -c "import json; json.load(open('.beagle/llm-judge-report.json'))" && echo "Valid report"
  2. Gate E / completeness: Verify every repo label has scores for every dimension, each weighted_total equals the sum over dimensions of (score × weight / 100) using the configured weights, and the markdown summary matches the JSON report.

Output Shape

The generated report should include:

  • repo labels and paths
  • per-dimension scores and justifications
  • weighted totals and ranking
  • a verdict explaining the winner

Reference Files

FilePurpose
references/fact-schema.mdJSON schema for Phase 1 facts
references/scoring-rubrics.mdDetailed rubrics for each dimension
references/repo-agent.mdInstructions for Phase 1 agents
references/judge-agents.mdInstructions for Phase 2 judges

Scoring Model

DimensionDefault WeightEvaluates
Functionality30%Spec compliance, test pass rate
Security25%Vulnerabilities, security patterns
Test Quality20%Coverage, DRY, mock boundaries
Overengineering15%Unnecessary complexity
Dead Code10%Unused code, TODOs

Scoring Scale

ScoreMeaning
5Excellent - Exceeds expectations
4Good - Meets requirements, minor issues
3Average - Functional but notable gaps
2Below Average - Significant issues
1Poor - Fails basic requirements

Rules

  • Always validate inputs before proceeding
  • Complete all Phase 1 fact-gathering before any Phase 2 scoring (parallel within a phase if subagents are supported, otherwise sequential)
  • Run one Phase 2 unit per dimension
  • Every score must have a justification
  • Write the JSON report before displaying the summary

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.