Legal Toa Formatter logo

Legal Toa Formatter

Community
NEU-ZHA
legal-toa-formatter

格式化法律文书中 Table of Authorities (TOA) 条目的点号填充对齐。当用户需要修改TOA条目格式、统一条目样式(Cases/Statutes/Other Authorities)、将所有条目修改为与第一行相同格式时触发。关键词:TOA、Table of Authorities、点号对齐、法律文书格式、证据目录格式。

Overview

PublisherNEU-ZHA
Repositorylegal-ai-skills
Skill namelegal-toa-formatter
Stars
70
Forks
7
Bundled files
1
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by NEU-ZHA on GitHub. Read the source before you install it.

Installation

Install the Legal Toa Formatter AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-toa-formatter
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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-toa-formatter .claude/skills/legal-toa-formatter
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Legal Toa Formatter in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Legal Toa Formatter on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Legal Toa Formatter is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Legal TOA Formatter

Overview

规范化法律文书中 Table of Authorities (TOA) 的条目格式。核心功能:将所有TOA条目统一修改为与参考条目相同的点号填充(dot leader)对齐格式,确保引用名称与页码之间的视觉一致性。

When to Use

  • 用户要求修改 TOA/Table of Authorities 条目格式
  • 条目需要点号填充对齐(dot leader alignment)
  • 需要统一多个 TOA 条目的样式
  • 触发词:TOA、Table of Authorities、法律文书格式修改、点号对齐

Core Concept

关键理解:Word 的制表符对齐使用 w:leader="dot" 属性,让 Word 自动填充点号,不是在文本中手动添加点号字符。

Workflow

Step 1: 分析源文档

  1. 解包 docx 文件:

    bash
    unzip -o input.docx -d temp_unpacked
  2. 找到 TOA 所在 section(通常在 word/document.xml 的 TOX(Table of Start) 字段中)

  3. 定位 TOA 条目:搜索 <w:p> 段落中包含制表符 <w:tab/> 的条目

Step 2: 分析参考格式

找到第一个正确格式的条目(通常是 TOA 标题后的第一条),分析其 XML 结构:

xml
<w:p>
  <w:pPr>
    <w:widowControl w:val="0"/>
    <w:tabs>
      <w:tab w:val="right" w:leader="dot" w:pos="9016"/>
    </w:tabs>
    <w:spacing w:line="480" w:lineRule="auto"/>
    <w:jc w:val="both"/>
    <w:rPr>
      <w:rFonts w:hint="default" w:ascii="Times New Roman Regular" .../>
      <w:kern w:val="2"/>
      <w:sz w:val="24"/>
      <w:szCs w:val="24"/>
      <w:lang w:val="en-US" w:eastAsia="zh-CN" w:bidi="ar-SA"/>
    </w:rPr>
  </w:pPr>
  <w:r>
    <w:t>, 486 U.S. 531 (1988)</w:t>
  </w:r>
  <w:r>
    <w:tab/>
  </w:r>
  <w:r>
    <w:t>4, 5, 6, 7</w:t>
  </w:r>
</w:p>

关键元素:

  • <w:tabs><w:tab w:val="right" w:leader="dot" w:pos="9016"/></w:tabs> - 定义右对齐点号填充制表位
  • <w:tab/> - 在文本中插入制表符位置
  • 制表位位置 pos="9016" 是 twips 单位(1/20 点)

Step 3: 修改目标条目

对于每个需要修改的条目:

  1. 确保 <w:pPr> 包含正确的 <w:tabs> 定义

  2. 如果条目有 <w:tabs> 但 leader 不是 "dot",修改为 w:leader="dot"

  3. 如果条目完全没有 <w:tabs>,在 <w:pPr> 中的适当位置添加:

    xml
    <w:tabs>
      <w:tab w:val="right" w:leader="dot" w:pos="9016"/>
    </w:tabs>
  4. 在引用名称与页码之间插入 <w:tab/> 元素

Step 4: 重新打包

bash
cd temp_unpacked && zip -r ../output.docx . -x "*.DS_Store"

Quick Fix Script

对于批量处理,使用 scripts/fix_toa_format.py:

bash
python3 scripts/fix_toa_format.py input.docx output.docx

脚本会自动:

  1. 解包 docx
  2. 定位 TOA 条目
  3. 应用一致的点号填充格式
  4. 重新打包

Common Patterns

Pattern 1: 条目完全没有制表符

症状:引用名称和页码直接相连,无分隔

修复:在 <w:pPr> 中添加 <w:tabs>,在合适位置添加 <w:tab/>

Pattern 2: 条目有制表符但无点号

症状:有空隙但没有点号填充

原因:缺少 <w:tabs> 定义,或 w:leader 不是 "dot"

修复:添加/修正 <w:tabs> 为 w:leader="dot"

Pattern 3: 制表位位置不一致

症状:有的条目对齐,有的不对齐

修复:统一使用 w:pos="9016"(或根据页面宽度调整)

Troubleshooting

Q: 点号没有显示? A: 检查 <w:pPr> 是否有 <w:tabs><w:tab w:leader="dot".../></w:tabs>,确保段落引用了正确的制表位

Q: 对齐位置不对? A: 调整 w:pos 值。常见值:

  • 9016 twips ≈ 6.5 英寸(右边界)
  • 9372 twips ≈ 6.5 英寸 + 0.25 英寸边距

Q: 部分条目格式正确,部分不对? A: 说明这些条目缺少 <w:pPr> 中的 <w:tabs> 定义,逐个添加即可

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Legal Toa Formatter AI skill do?

格式化法律文书中 Table of Authorities (TOA) 条目的点号填充对齐。当用户需要修改TOA条目格式、统一条目样式(Cases/Statutes/Other Authorities)、将所有条目修改为与第一行相同格式时触发。关键词:TOA、Table of Authorities、点号对齐、法律文书格式、证据目录格式。

Why use Legal Toa Formatter on TypingMind?

Because you install it once and use it with any model. Legal Toa Formatter is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Legal Toa Formatter in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/NEU-ZHA/legal-ai-skills/tree/main/skills/legal-toa-formatter. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Legal Toa Formatter?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Legal Toa Formatter?

As many as you like. As long as a model supports skills, you can use Legal Toa Formatter with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Legal Toa Formatter AI skill free?

Yes. It is published on GitHub by NEU-ZHA under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇