Logo: Legal Citation Automator

Legal Citation Automator

Communautéit
NEU-ZHA
legal-citation-automator

法学脚注 DOCX 执行器。用于把已经由 legal-citation-comprehensive 诊断、补全或确认过的法学引注插入 Word 文档,并进行 Word/WPS 脚注结构兼容性检查。适用于自动添加脚注、批量脚注修复、DOCX footnotes.xml 处理、脚注编号检查、脚注引用标记插入。不要把它当作引注规则大脑;复杂引注规则必须先交给 legal-citation-comprehensive。

Add to TypingMind

Iwwersiicht

EditeurNEU-ZHA
Repositorylegal-ai-skills
Skill-Nummlegal-citation-automator
Stären
70
Forks
7
Matgeliwwert Dateien
10
LizenzMIT
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.

  • 10 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    NEU-ZHA huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Legal Citation Automator an TypingMind, fir e mat all LLM ze benotzen, oder setzt 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 „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-citation-automator
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng 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 d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/NEU-ZHA/legal-ai-skills.git /tmp/legal-ai-skills
mkdir -p .claude/skills
cp -r /tmp/legal-ai-skills/skills/legal-citation-automator .claude/skills/legal-citation-automator
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Legal Citation Automator 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 Legal Citation Automator automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Legal Citation Automator 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-Schlësselen.

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

Legal Citation Automator

Role

This skill is the DOCX execution layer. It inserts or repairs footnotes only after citation text has been diagnosed and approved by legal-citation-comprehensive.

Do not invent citation content here. Do not rely on this skill to decide legal citation format. Use the comprehensive skill first for source type, missing elements, and final footnote wording.

Weak-agent guardrail: if any required fact is uncertain, stop. Output a repair checklist. Do not edit the DOCX just because the user asked for automation.

Safe Workflow

  1. Run legal-citation-comprehensive.
    • Diagnose each messy footnote or citation candidate.
    • Search the full handbook index for non-trivial or unusual sources.
    • Produce either final citation text or a [待补] checklist.
  2. Prepare a citation insertion plan.
    • Each item must include the exact body text anchor or paragraph/run location.
    • Each item must include final footnote text.
    • If multiple sources support the same anchor, combine them into one footnote_text separated by semicolons. Do not create two insertion items for the same sentence-final anchor.
    • If source facts are missing, stop and return a report instead of editing the DOCX.
  3. Insert footnotes using OOXML, preserving the existing document structure.
  4. Verify:
    • every w:footnoteReference has a matching w:footnote;
    • separator IDs remain -1 and 0;
    • generated replacement notes may start at 4+ as a conservative repair convention;
    • footnote text style matches the target document/template;
    • DOCX zip, content types, and relationships are valid.

Input Contract

The safe input to an insertion script is a JSON array:

json
[
  {
    "anchor_text": "依《民法典》第153条第1款",
    "placement": "after_anchor",
    "footnote_text": "《中华人民共和国民法典》第153条:“……”",
    "source_status": "verified"
  }
]

Required fields:

  • anchor_text: exact text in the body, or an equivalent precise location object.
  • placement: after_anchor, after_sentence, or a precise custom instruction.
  • footnote_text: final text from legal-citation-comprehensive.
  • source_status: must be verified; if needs_user_input, do not edit.

When to Refuse Editing

Do not modify the DOCX when:

  • the footnote text contains [待补: ...];
  • the comprehensive skill has not supplied handbook rule numbers;
  • the citation source has not been verified;
  • the anchor appears multiple times and the user has not clarified which instance;
  • two or more insertion items target the same anchor/placement and would create adjacent footnote references; merge them first unless the body text has distinct citation anchors;
  • the source is a PDF/book/article but required bibliographic facts are absent;
  • the requested citation format conflicts with the handbook and no user override is explicit.

Instead, produce a citation repair report using the comprehensive skill output.

Scripts

  • scripts/diagnose_with_comprehensive.py: wrapper that calls the comprehensive skill diagnostic script when available.
  • scripts/add_footnotes.py: legacy OOXML insertion utility. Use only after reviewing its target-location behavior for the current task.
  • scripts/docx_compat_check.py: final DOCX compatibility gate.
  • scripts/fix_footnote_conflict.py: repair mismatched or unsafe footnote IDs.
  • scripts/identify_citations.py: first-pass candidate detector; always review candidates manually.

Important DOCX Rules

  • The clean template pattern is separator footnotes -1 and 0; a regular note ID 1 is valid.
  • Starting generated replacement notes at 4+ is a conservative repair convention, not a universal rule.
  • Never create a body footnoteReference without a matching footnote definition.
  • Never add footnote definitions without confirming the body reference was actually inserted.
  • If multiple anchors match, pause and ask for clarification.
  • Strip leading/trailing whitespace from every footnote_text before writing it to footnotes.xml. Keep at most the normal single delimiter space after the footnote number; do not let the citation text itself start with a blank.
  • Do not emit adjacent footnote references after the same punctuation. If a sentence needs two supporting sources, put them in the same footnote separated by ;.
  • For Civil Law homework, combine with legal-homework-formatter so footnote style remains 小五、左对齐、单倍行距、段前后 0、首行不缩进.

Relationship to Comprehensive Skill

Use legal-citation-comprehensive as the authoritative source for:

  • source classification;
  • missing element diagnosis;
  • full handbook rule lookup;
  • standard footnote wording;
  • direct/indirect quotation analysis;
  • repeat citation forms.

This skill is successful only when the final DOCX structure is valid and the citation content has already been validated.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Legal Citation Automator?

法学脚注 DOCX 执行器。用于把已经由 legal-citation-comprehensive 诊断、补全或确认过的法学引注插入 Word 文档,并进行 Word/WPS 脚注结构兼容性检查。适用于自动添加脚注、批量脚注修复、DOCX footnotes.xml 处理、脚注编号检查、脚注引用标记插入。不要把它当作引注规则大脑;复杂引注规则必须先交给 legal-citation-comprehensive。

Firwat Legal Citation Automator op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Legal Citation Automator 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 en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Legal Citation Automator an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-citation-automator an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Legal Citation Automator 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 Legal Citation Automator benotzen?

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

Ass de KI-Skill Legal Citation Automator gratis?

Jo. NEU-ZHA huet de Skill ënner der Lizenz MIT 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 weiderverwendbare Pak vun Instruktiounen, deen 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 e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

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