Legal Qa Extractor logo

Legal Qa Extractor

Community
cat-xierluo
legal-qa-extractor

从律师与客户沟通记录中提取有价值的法律问答对,生成结构化知识库内容。本技能应在用户需要整理客户咨询记录、从对话中提取可复用法律知识、创建问答知识库、或准备内容营销素材时使用。支持严格客户信息脱敏处理。

Overview

Publishercat-xierluo
Repositorylegal-skills
Skill namelegal-qa-extractor
Stars
722
Forks
109
Bundled files
16
LicenseCC-BY-NC
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.

  • 16 bundled files

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

  • Open source

    Published by cat-xierluo on GitHub. Read the source before you install it.

Installation

Install the Legal Qa Extractor 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/cat-xierluo/legal-skills/tree/main/skills/legal-qa-extractor
  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/cat-xierluo/legal-skills.git /tmp/legal-skills
mkdir -p .claude/skills
cp -r /tmp/legal-skills/skills/legal-qa-extractor .claude/skills/legal-qa-extractor
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Legal Qa Extractor 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 Qa Extractor 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 Qa Extractor 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.

法律问答提取技能

概述

从律师与客户的沟通记录中提取有价值的法律问答对(客户问题 + 律师解答),生成结构化知识库内容。适用于将客户咨询转化为可复用的法律知识,供后续整理成文章、案例或学习材料。

核心价值:提取那些可以被其他客户复用的问答内容,而不是单一客户的具体案情。

核心原则

客户信息保护

绝对禁止在问答内容中包含:

  • ❌ 客户真实姓名
  • ❌ 企业/机构名称
  • ❌ 具体地址、联系方式
  • ❌ 任何可识别个人或企业的信息

脱敏处理标准:

  • ✅ 客户姓名 → 使用"当事人"、"客户"、"甲/乙"等代称
  • ✅ 企业名称 → 使用"某公司"、"某企业"、"该企业"等代称
  • ✅ 具体信息 → 模糊化为"某地"、"某时间"、"相关人员"等
  • ✅ 客户原话 → 脱敏后引用:"客户询问..."而非"张总说..."

问答对的价值判断

提取的问答应该满足以下条件之一:

  • 普遍性:其他客户也可能遇到同类问题
  • 典型性:代表了某类法律场景的常见关切
  • 教育性:律师的解答有普法价值或指导意义
  • 复用性:可以独立成文或作为知识库条目

工作流程

步骤 1:分析输入内容

获取沟通记录文档和用户的具体要求,理解:

  • 文档中的沟通内容和情境
  • 用户希望重点关注哪些方面
  • 哪些问答具有复用价值

步骤 2:识别有价值的问答对

完整梳理文档中的问答内容,按以下维度识别价值:

问答识别维度
  1. 直接问答 - 客户明确提出问题,律师给出解答
  2. 追问回应 - 客户追问,律师进一步解释
  3. 风险提醒 - 律师主动提醒的风险点及应对建议
  4. 操作指引 - 涉及流程、步骤、注意事项的问答
  5. 普遍关切 - 其他客户也可能遇到的同类问题
问答提取方法
  • 语义分析:理解客户真实问题和律师核心观点
  • 逻辑归纳:将分散的对话整理为独立问答对
  • 价值评估:判断问答是否具有普遍适用性
  • 标准化表述:将口语化表达转化为规范的问答格式

步骤 3:生成结构化报告

输出文件保存至原文档的同一目录,文件命名:{原文档名}_法律问答提取_{YYYYMMDD}.md

输出格式详见 output-template.md。

每个问答对包含以下部分:

  • 问题:客户提出的问题(标准化表述)
  • 律师解答:律师的核心观点和建议(300-500字)
  • 问题背景(可选):该问题出现的情境(200-300字)
  • 价值标签:普遍性/典型性/教育性/复用性
  • 适用场景:什么情况下读者会关心这个问答

步骤 4:问答分类与关联

提供以下分析维度:

  • 问答特征分析:重点问答数量、常规问答数量、价值分布
  • 领域分类:按法律领域或业务场景分类
  • 关联分析:哪些问答之间存在关联、可组合成文章

质量标准

  • 独立性:每个问答对可以独立理解,不依赖完整对话背景
  • 普遍性:问答内容对其他客户也有参考价值
  • 完整性:问题和解答都清晰完整,没有断章取义
  • 脱敏严格:严格遵循客户信息保护规则
  • 可复用:提取的问答可以直接用于文章、知识库或学习材料

输入要求

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

  1. 文档路径:用户提供的沟通记录文档路径
  2. 粘贴内容:用户直接粘贴的沟通记录内容
  3. 用户要求:用户希望重点关注哪些类型的问答

配置与归档

用户配置

本技能支持通过 config/.env 文件自定义扫描行为:

bash
# 复制模板
cp config/.env.example config/.env

# 编辑配置
QA_EXTRACTOR_SCAN_PATHS=~/Documents/legal-consultations
QA_EXTRACTOR_SCAN_DEPTH=3
QA_EXTRACTOR_FILE_TYPES=md,txt

扫描记录

技能会维护 archive/scan-log.json 记录扫描状态:

json
{
  "version": "1.1.0",
  "last_full_scan": "2026-05-10T23:00:00+08:00",
  "watch_paths": [
    {
      "path": "~/Documents/legal-consultations",
      "last_scanned": "2026-05-10T23:00:00+08:00",
      "status": "active"
    }
  ],
  "projects": {
    "潜在项目_A": {
      "source_files": ["path/to/file1.md", "path/to/file2.md"],
      "last_extracted": "2026-05-10",
      "qa_count": 8,
      "output_file": "archive/extractions/2026-05-10_潜在项目_A_qa.md",
      "status": "active"
    }
  },
  "files": {
    "path/to/file.md": {
      "content_hash": "sha256:abc123...",
      "last_modified": "2026-05-09",
      "last_extracted": "2026-05-10",
      "qa_count": 5,
      "status": "active"
    }
  },
  "archived": {
    "path/to/old_project": {
      "archived_at": "2026-05-01",
      "reason": "moved_by_user"
    }
  }
}

字段说明:

字段用途
files.*.content_hash文件内容指纹,变化时触发重新提取
files.*.statusactive / archived,归档后跳过扫描
projects.*.source_files同一项目的多份沟通记录,合并输出
projects.*.statusactive / archived,项目归档后锁定
archived.*记录已移走的路径,防止重复扫描

增量扫描逻辑:

文件夹类型判断(用于识别归档与活动项目):

命名模式类型处理方式
纯数字 / 日期区间(如 24、25 01-06、26 01-06)归档容器深度扫描内部子文件夹
日期+姓名(如 260323 张美金...、260404 顾忆芬...)直接项目直接扫描该文件夹
其他项目直接扫描该文件夹
  1. 遍历 watch_paths 下所有直接子文件夹
  2. 判断每个文件夹类型(归档容器 / 直接项目)
  3. 对归档容器递归扫描;对直接项目扫描内容文件
  4. 对每个文件计算 content_hash
  5. 若文件不在 scan-log,或 hash 与记录不一致 → 触发提取
  6. 若项目内所有文件均变化才触发提取
  7. 提取完成后,按项目合并多份记录,输出单份 QA 文件

抽取结果归档

抽取的问答对保存在 archive/extractions/ 目录,按项目聚合:

archive/
├── scan-log.json              # 扫描状态记录
└── extractions/
    ├── 2026-05-10_潜在项目_A_qa.md   # 项目A的多轮咨询合并
    ├── 2026-05-10_潜在项目_B_qa.md   # 项目B的单次记录
    └── 2026-05-11_潜在项目_C_qa.md   # 项目C(后续增量新增)

多轮咨询合并逻辑:

  • 同一项目文件夹内的所有 .md/.txt 文件视为同一项目的多轮沟通
  • 提取时按文件顺序(文件名或修改时间)整合所有问答对
  • 去重:相同问题的多次出现保留最新解答
  • 输出文件名:{日期}_{项目名}_qa.md

注意:archive/ 目录不纳入 Git 版本控制。

适用场景

  • 整理客户咨询记录为可复用知识
  • 从对话中提取内容营销素材
  • 建立法律问答知识库
  • 准备普法文章的素材
  • 制作客户常见问题清单
  • 定时扫描项目文件夹,增量提取新内容

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 Qa Extractor AI skill do?

从律师与客户沟通记录中提取有价值的法律问答对,生成结构化知识库内容。本技能应在用户需要整理客户咨询记录、从对话中提取可复用法律知识、创建问答知识库、或准备内容营销素材时使用。支持严格客户信息脱敏处理。

Why use Legal Qa Extractor on TypingMind?

Because you install it once and use it with any model. Legal Qa Extractor 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 Qa Extractor in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/cat-xierluo/legal-skills/tree/main/skills/legal-qa-extractor. 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 Qa Extractor?

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 Qa Extractor?

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

Is the Legal Qa Extractor AI skill free?

Yes. It is published on GitHub by cat-xierluo under the CC-BY-NC 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 👇