LegalDocument Review

Text Provenance

Use when you need to identify the likely source of a text passage, attribute text to documents in a RAG system, detect plagiarism, or match contract clauses to their origin.

LLegalQuants·Legal·Apache-2.0

Library skill — the default version is maintained in GitHub; edits you make live in your own clone.

Use this skillDownload .zip
How does this work?
  • ChatGPT opens a new chat with the skill loaded. If it's too long for a link, it's copied to your clipboard — just paste.
  • Claude works the same way. To install it permanently, download the .zip and upload it under Claude → Settings → Capabilities → Skills (Pro/Team/Enterprise).
  • Copy prompt copies the skill so you can paste it into any assistant, including Grok.

text-provenance

When to Use

How It Works

Core Approach

Lightweight text similarity metrics — no embeddings or API calls at runtime. Fast, deterministic string matching that works in-browser or server-side.

Comparison Methods

Usage

import { findProvenance } from 'text-provenance';

const sources = await findProvenance(
  "the quick brown fox jumps over the lazy dog",
  corpusDocuments
);
// Returns ranked list of potential sources with confidence scores

Edge Cases

Works where embeddings fail: - Short text snippets - Exact phrase matching - High-precision attribution tasks - Privacy-sensitive contexts (no data leaves the machine)

Audience and Work Shape

Audience: developers and lawyers building RAG-citation, contract-derivation, or plagiarism-detection workflows. The output is a candidate ranking, not a finding.

Work shape: Pattern-Matched Review. Lexical similarity is the matching function; the user decides what counts as a match.

Scope and Legal Use

This skill provides legal support, not legal advice. The output is a ranked list of candidate sources with similarity scores — never an attribution conclusion, never a plagiarism finding, never a contract-derivation determination of legal effect.

Privilege and confidentiality. Runs client-side with no network calls. No text leaves the user's machine unless the calling application chooses to transmit it. Skill itself does not create new privilege exposure.

Accountability. A qualified lawyer must review and accept any output before relying on it for an attribution, plagiarism, or contract-derivation decision. The similarity score is a signal, not a verdict.

Confidence Bands

Map the raw similarity score to action bands:

Out of Scope

Escalation

Stop and route to the responsible lawyer when: - the top result is in the Low band but the calling workflow expects a definitive source; - the use case is disciplinary, evidentiary, or potentially defamatory (e.g., flagging a lawyer or student for plagiarism); - two or more candidates score within 0.05 of each other and the workflow requires a single source attribution.

Limitations