MCPInstall

legal-text-format

将法律文本(法律条文或法律案例)转换为规范的 Markdown 格式,删除推广冗余信息。本技能应在用户需要处理法律条文(如民法典、刑法等)、整理法律案例(如最高法典型案例、裁判文书等)、或从粘贴文本中格式化法律文档时使用。注意:本技能只负责格式化和内容清理,不包含内容抓取能力。内容获取应由其他 skill(如 wechat-article-fetch)完成,AI 会自动判断技能协作顺序。内置 archive 机制,所有结果自包含存储在 skill 目录内。

Installs
158
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/cat-xierluo/legal-skills --skill legal-text-format
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads legal-text-format automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

法律文本格式化工具

概述

将法律文本(法律条文或法律案例)转换为规范的 Markdown 格式,删除推广冗余信息,自动识别文本类型并应用相应的格式化规则。

核心职责:只负责格式化和内容清理,不包含内容抓取能力。

与其他技能的协作

典型工作流程

场景:用户请求格式化网页上的法律文本

用户请求 → AI 判断来源 → 抓取类 skill 获取内容 → legal-text-format 格式化

示例流程:

  1. 用户提供微信公众号链接 → AI 使用 wechat-article-fetch 抓取 → AI 调用 legal-text-format 格式化
  2. 用户提供普通网页链接 → AI 使用其他工具抓取 → AI 调用 legal-text-format 格式化
  3. 用户直接粘贴文本 → AI 直接调用 legal-text-format 格式化

技能职责边界:

  • wechat-article-fetch / 其他抓取工具:负责从各种来源获取原始文本内容
  • legal-text-format:负责对已获取的文本进行格式化和清理

核心原则

内容完整性保证:除格式调整和去除推广内容外,所有法律案例和法条的实质内容必须完整保留,不得有任何遗漏!

工作流程

步骤 1:分析文本类型

使用 LLM 分析输入文本:

  • 判断是法律条文还是法律案例
  • 识别文本结构特征(章节、条款、案号等)
  • 确定适合的格式化策略
  • 提取主题用于文件命名

分析提示词参考:

分析以下文本,判断其类型:
- 如果是法律条文:识别章、节、条的结构
- 如果是法律案例:识别案例标题、案号、案情、裁判结果、典型意义等
- 提取主题用于文件命名

步骤 2:保存原始内容

将输入的原始内容保存为本地 Markdown 文件:

  • 文件位置:archive/{YYYYMMDD_HHMMSS}_{主题}/
  • 文件命名:{YYYYMMDD}_{主题}_raw.md
  • 目的:提供溯源依据,便于内容比对验证

归档目录结构示例:

archive/20250122_153400_个人信息保护检察公益诉讼典型案例/
├── 20250122_个人信息保护检察公益诉讼典型案例_raw.md      # 原始内容
├── 20250122_个人信息保护检察公益诉讼典型案例_formatted.md # 格式化后的内容(步骤4生成)
└── meta.json                                              # 元信息(可选)

步骤 3:格式化文本

重要:一次性处理完整文本,不进行分段。

格式化提示词(参考 examples.md 中的详细示例):

请将以下法律文本格式化为规范的 Markdown 格式。

# 法律条文格式化规则
- 章前面添加二级 markdown 格式(##)
- 不同条文之间添加空行
- 每一条条文内部换行时不应有多余空行
- "第X条"进行加粗(**第X条**)
- 如果一段文字的最后没有句号或分号,则删除后方的回车
- 保持所有条文内容完整,不得遗漏任何条款

# 法律案例格式化规则
- 把英文标点符号替换成中文标点符号(包括括号、逗号、句号、冒号、分号等)
- 案例序号或名称前添加二级 markdown 格式(##),序号后要紧跟案例名称
- 每个案例的章节前添加三级 markdown 格式(###)
- 每个案例的章节内部不应有大于1个的空行(连续换行数不超过2个)
- 清理多余的连续空行,保持段落间适当的分隔
- 把数字格式调整为半角
- 内容范围限定:
  - 仅保留从第一个案例到最后一个案例的内容
  - 删除前面的文章介绍、作者信息、引言、目录等
  - 删除底部的宣传推广内容、二维码、公众号介绍、相关文章推荐等
  - 保留标准:只保留案例标题、案号、基本案情、裁判结果、典型意义等法律案例本身的内容
- 保持所有案例实质内容完整,包括案情、裁判、意义等所有部分

# 参考示例
详见 references/examples.md 文件,其中包含4个完整的格式化示例。

法律条文格式化规则摘要

  • 章前面添加二级 markdown 格式(##)
  • 不同条文之间添加空行
  • 每一条条文内部换行时不应有多余空行
  • "第X条"进行加粗(**第X条**)
  • 如果一段文字的最后没有句号或分号,则删除后方的回车
  • 保持所有条文内容完整,不得遗漏任何条款

法律案例格式化规则摘要

  • 把英文标点符号替换成中文标点符号
  • 案例序号或名称前添加二级 markdown 格式(##),序号后要紧跟案例名称
  • 每个案例的章节前添加三级 markdown 格式(###)
  • 每个案例的章节内部不应有大于1个的空行(连续换行数不超过2个)
  • 清理多余的连续空行,保持段落间适当的分隔
  • 把数字格式调整为半角
  • 内容范围限定:
    • 仅保留从第一个案例到最后一个案例的内容
    • 删除前面的文章介绍、作者信息、引言、目录等
    • 删除底部的宣传推广内容、二维码、公众号介绍、相关文章推荐等
    • 保留标准:只保留案例标题、案号、基本案情、裁判结果、典型意义等法律案例本身的内容
  • 保持所有案例实质内容完整,包括案情、裁判、意义等所有部分

步骤 4:保存

保存格式化后的文档:

  • 文件位置:archive/{YYYYMMDD_HHMMSS}_{主题}/
  • 文件命名:{YYYYMMDD}_{主题}_formatted.md
  • 与 raw.md 保存在同一归档目录下

确定性脚本的保守边界

使用 python3 scripts/format_legal_cases.py 输入.md 输出.md 法院名称 原文URL 文档标题 处理案例文本。脚本仅需 Python 3 标准库;不联网、不调用模型,也不负责法条结构识别或语义核验。

  • 先按工作流程保存原始内容;完成后将结果与原文比对。
  • 不按日期、首个案例词、空段位置或固定字数裁切正文。函数调用方只有显式传入 keep_from_marker 才可指定前缀裁切点;CLI 默认保留前缀,含糊的介绍与推广文本留待人工确认。
  • 只清理已识别的完整文末来源/结束标记及紧随其后的已知推广行;正文中的来源、联系等词、引用行和证据图片保留。无法判断是否属于页脚时保留,不能将脚本输出当作已完成语义清理的证明。
  • 保留案例序号、小数、千分位、URL、邮箱、Markdown 链接与行内代码语法;围栏代码/证据块按原文保留;普通正文标点仍按中文排版规则调整,普通正文数字仍按既有规则转半角。
  • 不保证解析任意嵌套 Markdown 或识别所有推广版式。对有歧义的边界及证据引文人工复核,不补写、摘要或省略案例内容。

回归检查:python3 -m unittest discover -s scripts/tests -v。测试只使用虚构案例,不能替代真实文书的完整性核验。

参考文档

格式化示例

详细的格式化示例和对比请参见 examples.md,包含:

  • 4个完整的法律案例格式化示例
  • 每个示例包含原始文本和格式化后的对比
  • 格式化要点总结(标点符号处理、标题层级、空行处理、内容范围等)

准确性要求

  • 不改变原文含义:格式调整不得改变法律文本的原意
  • 保留关键信息:案号、法院名称、当事人等关键信息必须保留
  • 序号保持:案例序号、条文序号不得修改

输出文档结构

归档目录组织

所有格式化结果按时间戳归档存储:

archive/
├── {YYYYMMDD_HHMMSS}_{文档主题}/
│   ├── {YYYYMMDD}_{主题}_raw.md        # 原始抓取内容
│   ├── {YYYYMMDD}_{主题}_formatted.md  # 格式化后的内容
│   └── meta.json                       # 元信息(可选)

命名规则:

  • 目录名:{YYYYMMDD_HHMMSS}_{主题}(例:20250122_153400_个人信息保护典型案例)
  • 文件名:
    • 原始文件:{YYYYMMDD}_{主题}_raw.md(例:20250122_个人信息保护典型案例_raw.md)
    • 格式化文件:{YYYYMMDD}_{主题}_formatted.md(例:20250122_个人信息保护典型案例_formatted.md)
  • 主题限制:从文本中提取的核心主题,限制30字以内
  • 日期格式:YYYYMMDD(例:20250122)

formatted.md 内容结构

# {文档标题}

## 元信息
- **原文链接**:{从原始文件的 `> 原文链接:` 行提取,无则省略此行}
- **处理时间**:{时间戳}
- **文本类型**:{法律条文/法律案例}

---

{格式化后的正文内容}

原文链接提取规则:当输入来自 wechat-article-fetch 时,原始 Markdown 文件头部包含 > 原文链接: https://mp.weixin.qq.com/s/xxxxx,必须提取该 URL 写入元信息的"原文链接"字段。

质量标准

  • 标点符号统一:所有标点符号使用中文标点
  • 数字格式统一:数字使用半角字符
  • 层级结构清晰:正确使用二级、三级标题
  • 空行规范:段落间空行适当,不过多也不缺失
  • 内容完整性:保留所有法律相关内容,去除无关推广信息

适用场景

  • 整理法律条文汇编
  • 规范化法律案例集
  • 准备法律学习材料
  • 建立法律文本知识库
  • 清理从网页抓取的法律文本

输入要求

本技能接受以下类型的输入:

  1. 已抓取的文本内容:由其他 skill(如 wechat-article-fetch)获取的文本
  2. 用户粘贴的文本:用户直接提供的文本内容
  3. 本地文件:已保存的 Markdown/文本文件

不接受:网页链接(链接应由专门的抓取类 skill 处理)

来自 wechat-article-fetch 的自动调用

当 wechat-article-fetch 检测到法律内容且本技能已安装时,会自动链式调用本技能。此时输入为已保存的 Markdown 文件路径。处理流程不变:

  1. 读取指定路径的 Markdown 文件内容作为输入
  2. 按步骤 1-4 执行(分析类型、保存原始、格式化、验证)
  3. 结果保存到本技能的 archive/ 目录
  4. 文件路径记录在 formatted.md 元信息的"来源"字段中

FAQ

What does the legal-text-format skill do?

将法律文本(法律条文或法律案例)转换为规范的 Markdown 格式,删除推广冗余信息。本技能应在用户需要处理法律条文(如民法典、刑法等)、整理法律案例(如最高法典型案例、裁判文书等)、或从粘贴文本中格式化法律文档时使用。注意:本技能只负责格式化和内容清理,不包含内容抓取能力。内容获取应由其他 skill(如 wechat-article-fetch)完成,AI 会自动判断技能协作顺序。内置 archive 机制,所有结果自包含存储在 skill 目录内。

How do I install legal-text-format?

Run npx skills add https://github.com/cat-xierluo/legal-skills --skill legal-text-format in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/legal-text-format/ (personal) or .claude/skills/legal-text-format/ (project).

Which AI agents can use legal-text-format?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is legal-text-format safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains legal-text-format?

It is published by cat-xierluo in cat-xierluo/legal-skills. It has 158 recorded installs.

More from cat-xierluo/legal-skills

View all →

multi-search

cat-xierluo/legal-skills

智能多主题深度研究工具,支持任意材料输入,使用独立研究 Agent进行并行深度检索并生成系统化研究文档。本技能应在用户需要深度研究多个相关课题、进行系统性信息检索、整合多角度分析时使用。

Business & Finance719 installs

douyin-batch-download

cat-xierluo/legal-skills

抖音视频批量下载工具 - 基于 F2 框架实现高效、增量的视频下载功能。支持单个/批量博主下载,自动 Cookie 管理,差量更新机制。本技能应在用户需要批量下载特定博主视频、服务器部署自动化下载、或定期更新视频库时使用。

Business & Finance615 installs

litigation-analysis

cat-xierluo/legal-skills

判决书深度分析。本技能应在用户需要读懂一份判决书、拆解法院事实认定与裁判理由、解释判决主文或提炼文内疑点时使用。不要用于起诉状与证据初评、庭审笔录复盘、多材料综合研判或完整上诉再审决策;这些任务使用 legal-case-analysis。

Business & Finance349 installs

md2word

cat-xierluo/legal-skills

Markdown转Word文档技能。将Markdown文档转换为符合中文排版标准的专业格式Word文档,支持多种预设格式。适用于正式文档、论文、报告等需要规范排版的文档转换。

Docs & Writing261 installs

funasr-transcribe

cat-xierluo/legal-skills

使用本地 FunASR 服务将音频或视频文件转录为带时间戳的 Markdown 文件,支持 mp4、mov、mp3、wav、m4a 等常见格式。本技能应在用户需要语音转文字、会议记录、视频字幕、播客转录时使用。

Docs & Writing232 installs

legal-proposal-generator

cat-xierluo/legal-skills

Open the skill to read its SKILL.md instructions.

Business & Finance183 installs

Popular business & finance skills

View category →

sales-enablement

coreyhaines31/marketingskills

When the user wants to create sales collateral, pitch decks, one-pagers, objection handling docs, or demo scripts. Also use when the user mentions 'sales deck,' 'pitch deck,' 'one-pager,' 'leave-behind,' 'objection handling,' 'deal-specific ROI analysis,' 'demo script,' 'talk track,' 'sales playbook,' 'proposal template,' 'buyer persona card,' 'battle card,' 'battlecard,' 'competitive one-pager,' 'win-loss analysis,' 'why are we losing deals,' 'loss reasons,' 'how do I respond to this objection,' 'prospect just said,' 'help my sales team,' 'sales materials,' or 'what should I give my sales reps,' 'cold call script,' or 'voicemail script.' Use this for any document or asset that helps a sales team close deals. For public competitor comparison pages, see competitors. For running buyer interviews or churn research, see customer-research. For marketing website copy, see copywriting. For cold outreach emails, see cold-email. For the offer being sold (bonuses, guarantees, pricing structure),

Business & Finance119.5K installs

revops

coreyhaines31/marketingskills

When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes. Also use when the user mentions 'RevOps,' 'revenue operations,' 'lead scoring,' 'outbound pipeline stages,' 'lead routing,' 'MQL,' 'SQL,' 'pipeline stages,' 'deal desk,' 'CRM automation,' 'marketing-to-sales handoff,' 'data hygiene,' 'leads aren't getting to sales,' 'pipeline management,' 'lead qualification,' or 'when should marketing hand off to sales.' Use this for anything involving the systems and processes that connect marketing to revenue. For cold outreach emails, see cold-email. For email drip campaigns, see emails. For pricing decisions, see pricing.

Business & Finance114.1K installs

sales-funnel-blueprint

autonnel/autonnel-skills

Turn an offer into a concrete multi-step sales funnel spec - page-by-page structure, price ladder, copy outline and the metrics each step must hit. Use when asked to build a sales funnel, marketing funnel, landing page flow, lead magnet funnel, webinar funnel, tripwire or VSL funnel, when planning a product launch page flow, or when someone asks "what pages do I need" for selling something online.

Business & Finance104.5K installs

pricing

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' 'should I offer a free plan,' 'pricing page teardown,' 'pricing page audit,' 'is my pricing page AI-readable,' or 'can AI read my pricing.' Use this whenever someone is figuring out what to charge, how to structure their plans, or wants to audit a pricing page (for humans and for the AI agents that shortlist tools). For in-app upgrade screens, see paywalls. For offer construction (bonuses, guarantees, value framing, naming) on services/courses/coaching/high-ticket B2B, see offers.

Business & Finance80K installs

cross-border-ecommerce

nexscope-ai/ecommerce-skills

Cross-border e-commerce expansion advisor. Scores target markets on 8 weighted dimensions (market size, ecommerce penetration, competition, regulatory complexity, logistics infrastructure, payment ecosystem, cultural distance, IP protection), compares 5 fulfillment models with cost and transit data, provides country-by-country tax/duty compliance guides (EU VAT/IOSS, UK VAT, US sales tax, CA GST, AU GST, JP consumption tax), maps local payment preferences by market, and builds a phased expansion roadmap. No API key required.

Business & Finance62.9K installs

pricing-strategy

coreyhaines31/marketingskills

When the user wants help with pricing decisions, packaging, or monetization strategy. Also use when the user mentions 'pricing,' 'pricing tiers,' 'freemium,' 'free trial,' 'packaging,' 'price increase,' 'value metric,' 'Van Westendorp,' 'willingness to pay,' 'monetization,' 'how much should I charge,' 'my pricing is wrong,' 'pricing page,' 'annual vs monthly,' 'per seat pricing,' or 'should I offer a free plan.' Use this whenever someone is figuring out what to charge or how to structure their plans. For in-app upgrade screens, see paywall-upgrade-cro.

Business & Finance61.2K installs