Case file analyzer

From LegalQuants/lq-skills · View interactive version

Case file analyzer is an AI agent skill from the GitHub repository LegalQuants/lq-skills. Use when running structured, adversarial analysis across large case-file directories — extracts facts, claims, and legal views into XML metadata via a stateless R.A.L.P.H. loop, then synthesizes contradictions and timeline across all files. Proof of concept; not a finished product.

How to use this skill

Skill file

Stateless Case File Analyzer (Ralph Loop Edition)

⚠️ Proof of concept. This is an open-source demo showing how far agentic case file revision can be implemented efficiently. It is not a finished ready-to-use product.

| Attribute | Value |

| :--- | :--- |

| Description | Stateless, autonomous AI agent utilizing the R.A.L.P.H. pattern for adversarial and structured case file analysis. Runs parallel verification for factual claims, logic, and completeness across massive document directories. |

| Author | Attorney Dennis G. Jansen / J-Law.de |

| Version | 3.1.0 |

| Jurisdiction | Agnostic |

| Last Reviewed | 2026-05 |

| Last Reviewed By | LegalQuants (QA remediation) |

| Tags | legal-analysis, quality-control, multi-agent, verification, adversarial, certificate, ralph-loop |

What it does & What it doesn't do

What it does:

What it doesn't do:

The 3-Step Execution Process

When triggered via "scan case files", the agent orchestrator must execute the following sequence via the R.A.L.P.H. loop:

  1. Step 1: Granular Review & Metadata Extraction

Review each file individually. Create metadata, tags, and review results via the Ralphing Skill, unless the existing review on the disk is already complete and sufficient. Output using the Individual Summary Template.

  1. Step 2: Perspective Analysis

Review the fully prepared review results and metadata from Step 1 across all files under a specific, user-defined legal perspective (e.g., procedural errors, substantive validity, evidentiary contradictions).

  1. Step 3: Holistic Synthesis

Synthesize the conclusion and results across all relevant files into a final case report, utilizing the Synthesis Template.

System References

Initialize the workspace with the following reference modules:

Audience and Work Shape

Audience. Qualified litigators, dispute-resolution lawyers, paralegals, and litigation-support staff who already work with structured case files and understand the role of fact-vs-claim distinction. Not for unsupervised use by non-lawyers, opposing parties, or self-represented litigants. Treat outputs as worked input for a lawyer, not a deliverable.

Work shape — dual. This skill operates in two distinct shapes across its pipeline. Both shapes apply on every run:

The dual shape matters because confidence and escalation rules differ between the two stages, and downstream readers must not treat the synthesis output as if it were the same kind of artifact as the extraction output.

Scope and Legal Use

This skill provides legal support, not legal advice. A completed synthesis is a structured restatement of what is in the case files, with timeline and contradiction flags. It is not a case theory, a litigation recommendation, an admissibility ruling, or a sign-off on any factual or legal conclusion.

Privilege and confidentiality of case files being scanned. Case files routinely contain privileged client communications, work product, settlement-privileged material, and material covered by data-protection regimes (GDPR, attorney-client privilege under the applicable jurisdiction, professional-secrecy rules). Running this skill against such files moves their contents through whichever model API is configured in references/configuration.md and writes structured extracts to disk in the output directory.

Before invoking on real matter files:

Accountability gap. Stateless agents are designed to forget. The R.A.L.P.H. loop deliberately discards context after each iteration, which is good for context-window hygiene but means there is no in-model record of why a given extraction was made, what was discarded, or what edge cases the agent encountered. The on-disk artifacts (PRD.md, progress.txt, summary_*.xml) are the only record. A qualified lawyer must:

Confidence Bands

Confidence is reported separately for the extraction phase and the synthesis phase, because the two work shapes warrant different reliability profiles.

Extraction (Steps 1-2):

Synthesis (Step 3):

Out of Scope

Escalation

Stop the loop and route to the responsible lawyer when:

On escalation, the agent writes the trigger and the file path to progress.txt, marks the synthesis status as REVIEW REQUIRED if Step 3 is in progress, and exits cleanly. The responsible lawyer decides whether to override, restart, or abandon the run.

QA Remediation (LegalQuants, 2026-05)

LegalQuants applied design-quality QA against the Legal Skill Design Framework and added the Audience-and-Work-Shape, Scope-and-Legal-Use (covering legal-advice-vs-support, privilege/confidentiality of case-file inputs, and the accountability gap created by stateless operation), Confidence Bands, Out of Scope, and Escalation sections. The frontmatter was normalized to standard Anthropic Skills format and the file renamed from agent.md to SKILL.md. The technical content (R.A.L.P.H. pattern, 3-step execution process, attribute table, references) is unchanged. Dennis G. Jansen / J-Law.de is retained as author of the underlying skill.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.