All skills
cat-xierluo avatar

/legal-qa-extractor

@60b2815

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

Use this Skill: https://skilld.dev/gh/cat-xierluo/legal-skills/legal-qa-extractor

This session only. Nothing lands on disk.

referencesbatch-processing-rules.md

≈587 tokens on demand. Your agent reads this file only when SKILL.md points to it.

目录批处理规则

本规则定义 legal-qa-extractor 在接收目录路径时的稳定行为。

一、适用范围

目录模式第一版只处理已经转换为文本的咨询记录:

  • .md
  • .txt

不直接处理:

  • PDF
  • DOCX
  • 音频、视频
  • 图片

二、扫描规则

1. 默认递归

输入一个目录路径后,默认递归扫描全部子目录。

2. 候选文件类型

只将以下文件纳入候选:

  • *.md
  • *.txt

3. 默认排除项

以下文件或目录默认不进入候选集:

  • 隐藏文件(以 . 开头)
  • 隐藏目录中的文件
  • 非文本文件
  • 已生成结果文件:*_法律问答提取_*.md

4. 稳定排序

候选文件应按相对路径字典序排序后再处理,确保同一目录多次运行时处理顺序一致。

三、逐文件处理规则

对每个候选文件,按单文件模式执行:

  1. 读取文本
  2. 根据 intake-checklist.md 判断是否适合抽取
  3. 适合则生成单文件输出
  4. 不适合则跳过,并记录原因

单文件结果仍保存到源文件同目录,命名规则保持: {原文档名}_法律问答提取_{YYYYMMDD}.md

四、跳过规则

当出现以下情形时,应跳过该文件:

  • 文件虽为文本,但主体并非咨询记录
  • 基本没有可识别的法律问题
  • 几乎全是行政沟通、报价、排期、材料流转
  • 文本严重残缺,无法形成稳定问题主卡
  • 文件本身就是已生成的历史抽取结果

跳过时:

  • 不生成结果文件
  • 在本次批处理返回中写出“相对路径 + 简短原因”

五、目录模式返回摘要

批处理完成后,AI 在对话中应返回简短摘要,包括:

  • 已处理文件数
  • 已跳过文件数
  • 跳过原因分类
  • 是否存在高比例 待确认 文件

示例:

批量处理完成:
- 已处理:12 份
- 已跳过:4 份
- 跳过原因:行政沟通为主 2 份,已生成结果文件 1 份,文本残缺 1 份
- 需人工重点复核:3 份(待确认主卡占比较高)

六、明确不做的事情

目录模式第一版不做:

  • 生成目录级总索引文件
  • 统一汇总全部主卡到单一大文件
  • 自动调用其他技能处理 PDF、DOCX、音频
  • 对目录中每个无效文件都生成“空结果文件”

Source: SKILL.md on GitHub

1 warning15d4 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill is designed to extract structured legal Q&A pairs from local consultation records while applying strict desensitization rules for personal information. It uses local environment files for configuration and maintains state through a local JSON log file. The primary security risk is a low-level exposure to indirect prompt injection, as the skill processes untrusted text documents that could contain embedded instructions.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

  • Runlayer7mo

    4/4 files flagged

Signed by skilld at 60b2815. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
homepage
https://github.com/cat-xierluo/legal-skills
author
杨卫薪律师(微信ywxlaw)
version
1.0.0

README badge

README badge for cat-xierluo/legal-skills/legal-qa-extractor