Legal Citation Automatorのロゴ

Legal Citation Automator

コミュニティ
NEU-ZHA
legal-citation-automator

法学脚注DOCX実行ツールです。legal-citation-comprehensiveによる診断、補完、確認が済んだ法学引用をWord文書に挿入し、Word/WPSの脚注構造との互換性を確認します。脚注の自動追加、一括修正、DOCX footnotes.xmlの処理、脚注番号の確認、脚注参照マーカーの挿入に適しています。引用ルールを判断するツールとしては使用しないでください。複雑な引用ルールは、必ず先にlegal-citation-comprehensiveに確認してください。

Add to TypingMind

概要

公開者NEU-ZHA
リポジトリlegal-ai-skills
スキル名legal-citation-automator
スター
70
フォーク
7
同梱ファイル
10
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 10個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    NEU-ZHAがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Legal Citation Automator」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-citation-automator
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでLegal Citation Automatorを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にLegal Citation Automatorを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Legal Citation Automatorは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Legal Citation Automator」では何ができますか?

法学脚注DOCX実行ツールです。legal-citation-comprehensiveによる診断、補完、確認が済んだ法学引用をWord文書に挿入し、Word/WPSの脚注構造との互換性を確認します。脚注の自動追加、一括修正、DOCX footnotes.xmlの処理、脚注番号の確認、脚注参照マーカーの挿入に適しています。引用ルールを判断するツールとしては使用しないでください。複雑な引用ルールは、必ず先にlegal-citation-comprehensiveに確認してください。

TypingMindでLegal Citation Automatorを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Legal Citation Automatorはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにLegal Citation Automatorをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-citation-automatorを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Legal Citation Automatorを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Legal Citation Automatorで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもLegal Citation Automatorを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Legal Citation Automator」は無料ですか?

はい。NEU-ZHAがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇