Logotipo de Legal Evaluator

Legal Evaluator

Comunidad
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.

Descripción general

Editorfedec65
Repositoriobettercallclaude
Nombre de la habilidadlegal-evaluator
Estrellas
46
Forks
10
Archivos incluidos
2
LicenciaAGPL-3.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Archivos incluidos: 2

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por fedec65 en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Legal Evaluator en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/legal-evaluator
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

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
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Legal Evaluator en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Legal Evaluator automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Legal Evaluator no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

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)

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Son archivos de solo lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA 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.

¿Por qué usar Legal Evaluator en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Legal Evaluator está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Legal Evaluator en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/legal-evaluator. TypingMind lee el archivo SKILL.md de esa carpeta, empaqueta los archivos de la carpeta e instala el conjunto como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Legal Evaluator?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Legal Evaluator?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Legal Evaluator con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Legal Evaluator?

Sí. fedec65 la ha publicado en GitHub bajo la licencia AGPL-3.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇