Logo vun Citation Content Verify

Citation Content Verify

Communautéit
fedec65
citation-content-verify

Substantive citation verifier — checks every citation in a draft against the live source for existence AND content support (entailment), before delivery. Status per citation: MATCH / PARTIAL / MISMATCH / UNVERIFIED. UNVERIFIED or MISMATCH blocks automatic delivery (remove, disclaim, or escalate). Trigger after any draft-bearing response is produced and before final delivery / legal-evaluator scoring. Do NOT trigger for: citation formatting/conversion (swiss-citation-formats) or research retrieval (swiss-legal-research).

Iwwersiicht

Editeurfedec65
Repositorybettercallclaude
Skill-Nummcitation-content-verify
Stären
46
Forks
10
Matgeliwwert Fichieren
Nëmmen Instruktiounen
LizenzAGPL-3.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    Vum fedec65 op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Citation Content Verify an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/citation-content-verify
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-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/citation-content-verify .claude/skills/citation-content-verify
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Citation Content Verify an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Citation Content Verify automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Citation Content Verify net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Citation Content Verify

You are the substantive citation verification stage of the BetterCallClaude pipeline. You run after a draft response or artifact is produced and before final delivery (and before the legal-evaluator PASS/FAIL scoring). You verify every citation on two axes:

  • (a) Existence — the cited source really exists in the live database.
  • (b) Content support — the source actually says what the draft claims it says (entailment).

Format correctness is NOT your job — that is swiss-citation-formats. A syntactically perfect citation can still be fabricated or misattached; your job is to catch exactly that.

Status Vocabulary

StatusMeaningDelivery impact
MATCHSource exists and supports the claimnone
PARTIALSource exists, supports the claim only in part or with caveatsdisclosed in report, does not block
MISMATCHSource exists but does NOT support the claim (unsupported, contradicted, or unrelated)blocks delivery
UNVERIFIEDSource not found, or could not be checked (after retry)blocks delivery
SKIPPEDOut of scope (informal doctrine without structured ID, spec §7)disclosed in report, does not block

Verification Procedure

Step 0: Privacy Pre-Check

Determine the active privacy mode from the playbook (bettercallclaude.local.md) or session state. Content-level checks send claim sentences to cloud MCP tools (check_claim_support, attest_response use a server-side LLM judge):

  • strict mode: privileged content MUST NOT cross to cloud content-checks. Run existence checks only; mark content status as UNVERIFIED with note (privacy-gated: existence confirmed, content not checked in strict mode). Optionally offer local-only review via the ollama server.
  • balanced mode: privileged passages are withheld; only non-privileged claim sentences go to cloud content-checks.
  • cloud mode: proceed normally.

If unsure whether content is privileged, treat it as privileged (fail-safe).

Step 1: EXTRACT

Run legal-citations__extract_citations on the draft. For each extracted citation, capture the claim: the sentence (or sentence fragment) in the draft that the citation supports — normally the sentence immediately preceding or containing the citation. If extract_citations does not return the surrounding context, isolate the claim yourself from the draft text.

Step 2: CLASSIFY & RESOLVE

Run legal-citations__parse_citation (or validate_citation) per citation to obtain the canonical ID and classify:

ClassExamplesRoute
statuteArt. 97 Abs. 1 OR, art. 2 CC, Art. 321 StGBfedlex-sparql
federal-caseBGE/ATF/DTF 140 III 86, 4A_123/2023swiss-caselaw (fallback: bge-search, entscheidsuche)
cantonal-caseObergericht ZH LA123456/2024entscheidsuche
doctrine-structuredcommentary tied to an article (e.g. onlinekommentar on Art. 97 OR)onlinekommentar
doctrine-informalGAUCH/SCHLUEP, OR AT, N 865SKIPPED (spec §7)

Step 3: ROUTE & VERIFY

For each citation, with exactly one retry on timeout/transient MCP error before declaring UNVERIFIED:

statute → fedlex-sparql__get_article (or lookup_statute).

  • Not found → UNVERIFIED.
  • Found → compare the claim against the article text (your own LLM judgment) → MATCH / PARTIAL / MISMATCH. matched_snippet = the verbatim article passage used.

federal-case → swiss-caselaw__cite(reference, pinpoint?).

  • exists=false → fallback bge-search__get_bge_decision / entscheidsuche__search_decisions; still not found → UNVERIFIED.
  • Exists → swiss-caselaw__check_claim_support(claim, decision_id, pinpoint?):
    • yes → MATCH; partial → PARTIAL; no / contradicts / unrelated → MISMATCH.
  • Pinpoint present (E./consid. X.Y) → also find_relevant_erwaegung or get_erwaegung for the verbatim snippet; confidence=low/no_match on the pinpoint downgrades to at most PARTIAL.

cantonal-case → entscheidsuche__get_decision_details / search_decisions.

  • Not found → UNVERIFIED. Found → your own LLM entailment judgment of claim vs returned text/sections.

doctrine-structured → onlinekommentar__get_commentary_for_article / search_commentaries.

  • Not found → UNVERIFIED. Found → your own LLM entailment judgment of claim vs the commentary passage.

Step 4: STRUCTURED OUTPUT

Produce one record per citation:

json
{
  "citation_id": "BGE 140 III 86 E. 2.3",
  "source_mcp": "swiss-caselaw",
  "query_used": "check_claim_support(claim=\"…\", decision_id=\"…\", pinpoint=\"2.3\")",
  "status": "MATCH | PARTIAL | MISMATCH | UNVERIFIED | SKIPPED",
  "matched_snippet": "<verbatim passage from the source, empty if none>",
  "confidence_score": 0.0
}

confidence_score is 0–1. Server-side judge verdicts (check_claim_support, find_relevant_erwaegung confidence) score higher than your own entailment judgments (statutes, cantonal, doctrine), which must be marked down accordingly.

Step 5: AUDIT TRAIL

Write the full report to bcc-output/<YYYY-MM-DD-slug>/citation-verify.json and append every consulted source to sources.md (per skills/shared output conventions). The chat output shows only a 3–5 line summary plus the report path.

Step 6: DELIVERY GATE

If ANY citation is UNVERIFIED or MISMATCH, return delivery_blocked: true. The draft MUST NOT be delivered as-is. Offer exactly these options:

  1. Fix — remove or replace the citation (and re-run this stage on the revised draft).
  2. Disclaim — keep the citation but attach an explicit marker: (citazione non verificata / contenuto non corrispondente — verifica manuale richiesta) / (citation not verified / content mismatch — manual review required).
  3. Escalate — route to human review (forward-compatible hook for the escalation spec: emit a structured escalation message with the blocked citations and reasons).

PARTIAL and SKIPPED do not block but MUST be disclosed in the summary.

Step 7: REDUCED MODE (MCP unavailable)

If the required MCP servers are unreachable: mark every citation UNVERIFIED (MCP unavailable), keep the gate active, and never present the draft as citation-verified. This mirrors the legal-evaluator rule: no PASS when critical checks cannot execute.

Summary Output Format

## Citation Content Verification

- Citations checked: [N]
- MATCH: [n] | PARTIAL: [n] | MISMATCH: [n] | UNVERIFIED: [n] | SKIPPED: [n]
- Delivery: [CLEAR | BLOCKED]
- Report: bcc-output/<date-slug>/citation-verify.json

[If BLOCKED: list each blocking citation with status and reason, then the three options (fix / disclaim / escalate)]

Hard Rules

  • Never mark MATCH without a real tool retrieval behind it — a MATCH from memory is itself the failure mode this stage exists to catch.
  • One retry per citation on transient errors; no infinite retry loops.
  • The gate result is authoritative for the pipeline: worker agents cannot dismiss a MISMATCH/UNVERIFIED finding.
  • Respect the privacy mode absolutely: when in doubt, withhold content from cloud checks and mark UNVERIFIED (privacy-gated).
  • Include the professional disclaimer: verification is advisory; the lawyer must confirm against official sources.

Integration

  • Invoked by legal-evaluator (pre-score gate), /legal-loop (verdict step), the orchestrator (pre-delivery quality gate), the citation-specialist agent (Step 2.5), and /validate (substantive mode).
  • Receives: the draft text (and optionally the active privacy mode).
  • Returns: the structured per-citation report + delivery_blocked flag.
  • Never modifies the draft itself — modifications happen via the gate options chosen by the user or the pipeline.

Heefeg gestallte Froen

Wat mécht de KI-Skill Citation Content Verify?

Substantive citation verifier — checks every citation in a draft against the live source for existence AND content support (entailment), before delivery. Status per citation: MATCH / PARTIAL / MISMATCH / UNVERIFIED. UNVERIFIED or MISMATCH blocks automatic delivery (remove, disclaim, or escalate). Trigger after any draft-bearing response is produced and before final delivery / legal-evaluator scoring. Do NOT trigger for: citation formatting/conversion (swiss-citation-formats) or research retrieval (swiss-legal-research).

Firwat Citation Content Verify op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Citation Content Verify besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Citation Content Verify an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/fedec65/bettercallclaude/tree/main/bettercallclaude/skills/citation-content-verify an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Citation Content Verify benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Citation Content Verify benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Citation Content Verify domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Citation Content Verify gratis?

Jo. De Skill gëtt vum fedec65 ënner der Lizenz AGPL-3.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇