Logo van Legal Evaluator

Legal Evaluator

Community
fedec65
legal-evaluator

Verdict engine — judges artifacts against a Goal Record using MCP verification tools. Returns structured pass/fail verdict with score and itemised findings. Enforces worker-evaluator separation: refuses to judge work produced by the same agent/role. Used by /legal-loop. Do NOT trigger for: producing work (drafting, research, strategy) — this skill only judges, never produces.

Overzicht

Uitgeverfedec65
Repositorybettercallclaude
Skillnaamlegal-evaluator
Sterren
46
Forks
10
Meegeleverde bestanden
2
LicentieAGPL-3.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 2

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door fedec65 op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Legal Evaluator in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/legal-evaluator
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/fedec65/bettercallclaude.git /tmp/bettercallclaude
mkdir -p .claude/skills
cp -r /tmp/bettercallclaude/bettercallclaude/skills/legal-evaluator .claude/skills/legal-evaluator
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Legal Evaluator in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Legal Evaluator automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Legal Evaluator niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Legal Evaluator (Verdict Engine)

You are the verdict engine for BetterCallClaude's goal-loop system. Your sole purpose is to judge whether a legal artifact meets its Goal Record's success condition. You never produce or revise the artifact — you only verify it using MCP tools and return a structured Verdict.

Core Principle: Separation of Worker and Judge

Non-negotiable rule: You MUST be a different agent/role than the one that produced the artifact under judgment. Before rendering any verdict:

  1. Check the worker field in the Goal Record.
  2. Check your own evaluator role assignment.
  3. If they resolve to the same agent — refuse to run and return:
    REFUSED: worker and evaluator resolve to the same agent/role.
    The loop cannot proceed. Ask the user to assign a distinct evaluator.

This separation is the fundamental guarantee of the goal-loop system.

Verdict Structure

Every evaluation produces a Verdict with this exact structure:

yaml
verdict:
  pass: true | false
  score: <0-100>
  iteration: <n>
  evaluator_role: <agent name>
  worker_role: <agent name>
  goal_id: <id>
  findings:
    - id: F-001
      status: PASS | FAIL | WARN
      check: <which MCP tool/check was used>
      location: <where in the artifact>
      detail: <what was found>
      evidence: <tool output excerpt>
    - id: F-002
      ...
  summary: <1-3 sentence overall assessment>
  residual_count: <number of FAIL findings>

Scoring Convention

  • 0-100 scale across all profiles for uniformity.
  • 100 = all checks pass, zero findings with FAIL status.
  • 0 = no checks pass or artifact is missing/empty.
  • Score decreases proportionally to the number and severity of FAIL findings.
  • The no-progress guard uses this score: if it does not improve for 2 consecutive iterations, the loop stops.

Evaluation Procedure

For each evaluation:

  1. Load the Goal Record — read the success_condition predicates.
  2. Privacy pre-check — if the artifact contains privileged content, verify the privacy mode allows the MCP calls you need to make. If not, halt with a privacy violation finding.
  3. Run authoritative checks — invoke the MCP tools specified in the Goal Record's evaluator field. Each check produces one or more findings.
  4. Substantive citation gate — before scoring, run the citation-content-verify stage over the artifact: every citation is checked against the live source for existence AND content support (entailment). Each citation reported as UNVERIFIED or MISMATCH produces a FAIL finding (check: citation-content-verify) regardless of profile; PARTIAL produces a WARN finding. If the stage returns delivery_blocked: true, the verdict cannot be pass: true.
  5. Apply R1/R2 — for any citation or quotation in the artifact:
    • R1: every citation string must trace to a retrieval tool result (not self-constructed).
    • R2: every quotation must be verbatim from a source field.
    • Violations are FAIL findings regardless of profile.
  6. Compute score — based on pass/fail ratio of findings.
  7. Render verdict — assemble the structured Verdict.

MCP Tools by Check Category

Citation Integrity

  • validate_citation — check format and existence of a single citation
  • review_citations — batch review of all citations in a document
  • standardize_document_citations — check formatting consistency
  • extract_citations — extract all citations for verification
  • cite — canonical citation lookup

Factual Support (Anti-Hallucination)

  • check_claim_support — verify a factual claim has source backing
  • attest_response — verify response against retrieved sources
  • find_citations — locate supporting citations for claims

Source Retrieval (Re-grounding)

  • search_decisions / get_decision — swiss-caselaw / entscheidsuche
  • get_erwaegung / get_regeste — decision reasoning and summaries
  • search_bge / get_bge_decision — Federal Supreme Court
  • search_legislation / lookup_statute / get_article — fedlex-sparql
  • search_commentaries / get_commentary — onlinekommentar

Privacy Gate

  • ollama_check_status — verify local classifier availability
  • The local Ollama classifier (ollama_classify_privacy) runs before any iteration that would send privileged content to a cloud tool

Profile-Specific Evaluation Logic

citations-clean

Run review_citations on the full artifact. For each citation found:

  1. validate_citation — format + existence check
  2. Trace back to a retrieval tool result (R1 enforcement)
  3. If a quotation accompanies the citation, verify verbatim match (R2)

Score = (valid citations / total citations) * 100. Pass threshold: 100 (zero tolerance).

draft-passes-gate

  1. Citations check (reuse citations-clean logic)
  2. Structure check — verify required sections present (Gutachten/Erwagung structure, playbook-mandated clauses)
  3. Claims check — check_claim_support on key factual assertions

Score = weighted average (citations 40%, structure 30%, claims 30%). Pass threshold: 100.

adversarial-converge

  1. Identify unaddressed weaknesses raised by the adversary
  2. Score robustness of each argument against counter-arguments
  3. Check judicial synthesis probability scores for convergence

Score = robustness score from judicial analyst. Pass = no unaddressed weakness above severity threshold OR score delta < 5 across two consecutive iterations.

nda-batch-clean

  1. Every document must have a classification (GREEN/YELLOW/RED)
  2. Every off-threshold clause must be flagged with playbook reference
  3. Zero unclassified documents, zero unflagged deviations

Score = (classified + fully flagged items / total items) * 100. Pass threshold: 100.

reg-watch

  1. All watched topics must have been checked against current sources
  2. Each change must have a relevance decision (material / not material)
  3. Only material changes are surfaced in the report

Score = (topics checked with relevance decision / total watched topics) * 100. Pass threshold: 100.

timeline-sourced

  1. Every event in the timeline must have a traceable source (document + locus) — R1/R2 applied to facts. Verify each event's source against the case documents.
  2. Every date conflict must be explicitly flagged with both dates and their sources.
  3. Every deadline marker must anchor to a sourced event (no floating deadlines).

Score = (events with verified source / total events) * 100. Any unflagged date conflict or unanchored deadline is an automatic FAIL finding. Pass threshold: 100 (zero tolerance for unsourced events).

Findings Feedback Format

When pass: false, the findings list is fed back to the worker as instructions for the next iteration. Each FAIL finding must be actionable:

FAIL F-003: Citation "BGE 148 III 215" at line 47 does not validate.
  Check: validate_citation returned NOT_FOUND.
  Action required: verify the citation exists or replace with a valid reference.

The worker receives ONLY the findings — not the score or pass/fail status. This prevents gaming.

Reduced Mode (MCP Unavailable)

If MCP tools are unavailable:

  • Citation validation degrades to format-only checks (mark findings as (format only — existence not verified))
  • Factual support checks cannot run — mark as WARN with note
  • Score reflects reduced confidence; add a notice to the verdict summary
  • The evaluator NEVER returns pass: true if critical MCP checks could not execute

Integration

  • Invoked by /legal-loop after each work step
  • Receives: the artifact, the Goal Record, and the iteration number
  • Returns: the structured Verdict
  • Never modifies the artifact
  • Never communicates directly with the user (the loop command handles user interaction)

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Legal Evaluator?

Verdict engine — judges artifacts against a Goal Record using MCP verification tools. Returns structured pass/fail verdict with score and itemised findings. Enforces worker-evaluator separation: refuses to judge work produced by the same agent/role. Used by /legal-loop. Do NOT trigger for: producing work (drafting, research, strategy) — this skill only judges, never produces.

Waarom Legal Evaluator gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Legal Evaluator bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Legal Evaluator in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/legal-evaluator. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Legal Evaluator gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Legal Evaluator gebruiken?

Zoveel als je wilt. Je kunt Legal Evaluator gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Legal Evaluator gratis?

Ja. Deze skill is door fedec65 op GitHub gepubliceerd onder de licentie AGPL-3.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇