Skip to content

CSlawyer1985/legal-skillhub / skills/ambiguity-report

ambiguity-report

Verified

将法律文本(合同、法规、规章或司法意见)的诠释性歧义审查转化为精美的交付物。可生成多页面网站(默认)、单页面交互式网站、Microsoft Word 文档、PowerPoint 演示文稿或 LaTeX/PDF。当用户持有压力测试结果、歧义审查或"这将在何处被诉"场景分析,并希望发布、演示或分享时使用。触发词包括"发布审查报告"、"据此制作报告"、"将其转化为网站/演示文稿/简报/Word 文档"、"制作 Netlify 网站"、"制作这些歧义点的幻灯片"、"渲染场景"、"打包这份压力测试"、"生成 LaTeX 版本"等。与歧义压力测试技能(底层分析)配套使用,但也适用于任何结构化或半结构化的歧义分析。视觉设计有明确风格倾向,但用户可覆盖颜色、字体和品牌标识。大多数格式需要 Python 和可写的文件系统;单文件 HTML 在主机两者皆无时仍可运行。

FileKindSize
LICENSEother11.1 KB
NOTICEother1.7 KB
README.mdmarkdown964 B
SKILL.mdskill md16.8 KB
assets/latex-preamble.texother3.8 KB
assets/site-style.cssother23.9 KB
resources/data-format.mdmarkdown11.7 KB
resources/format-docx.mdmarkdown6.5 KB
resources/format-inline-html.mdmarkdown3.6 KB
resources/format-latex.mdmarkdown6.4 KB
resources/format-pptx.mdmarkdown6.1 KB
resources/format-website.mdmarkdown6.1 KB
resources/parsing-unstructured.mdmarkdown6.5 KB
scripts/generate_latex.pyscript19.4 KB
scripts/generate_site.pyscript37.7 KB

resources/parsing-unstructured.md

View on GitHub
# 解析非结构化输入

本技能最理想的情形是 `ambiguity-stress-test` 的结构化输出——每个场景带标签字段的 Markdown。真实用户不一定总能提供这样的输入。本文件描述如何处理更杂乱的情形。

## 三种输入特征

**特征 A——完全结构化。** 带 `### S-N — Title` 标题和标签字段的 Markdown:
```
### S-1 — Title

*Narrative:* ...
*Anchors:* ...
*Family:* ...
*Weak point:* ...
*Likely outcome:* ...
*Redraft:* ...
```
或者使用**粗体标签**而非斜体的变体。两种都常见。直接映射到标准规范字段:
- `Title` → `title`
- `Narrative` 或 `Situation` → `situation`
- `Anchors` → `anchors`(解析逗号分隔的 ID)
- `Family` 或 `Defect family` → `families`(按斜杠或"+"拆分)
- `Weak point` → `weak_point`
- `Likely outcome` → `likely_outcome`
- `Redraft` → `redraft`

叙述部分可能已经内嵌了两个立场——如"公诉方主张……居民主张……"这样的句子。提取它们:
- 查找"The [actor] argues" / "The [actor] contends" / "[Actor] argues" / "[Actor] says"。
- 拆分为两个带 `actor` 和 `argument` 的 `positions` 对象。
- 其余句子(通常是铺垫事实的前 1-2 句)成为 `situation`。
- 如果叙述确实是一个没有明确立场的整体,请用户指明两个对立的主体。

**特征 B——半结构化。** 散文形式的编号场景,每个场景一两段但没有标签字段。有时提到改写文本或"可能结果"但没有标注。应用下面的提取启发式方法。

**特征 C——原始散文。** 提到歧义点但未将其分离出来的备忘录、简报或记录。技能必须做更多工作:识别候选歧义点、提出场景结构、与用户确认。

## 特征 B 和 C 的提取启发式方法

**识别场景。** 寻找以下结构线索:
- 编号或带标签的列表("First, …"、"Second, …"、"Issue #1: …")。
- 重复的段落开头("Another ambiguity arises when…"、"A second problem is…")。
- 话题转换信号(破折号、项目符号、过渡短语)。

不确定时询问用户:"我看到您识别了 [N] 个独立的歧义点——我应该把每个都作为单独的场景处理,还是合并一些?"不要静默合并或拆分。

**识别锚点。** 寻找引文模式:
- 法规:`§ 7.2`、`(b)(3)`、`subsection (a)`、`Section 7.1`。
- 合同:`Section X`、`Clause Y`、`paragraph Z`。
- 规章:`Rule X.Y`、`§ XXX.YY(a)`。
- 意见书:`holding`、`paragraph N`、`the rule of X v. Y`。
如果引用的单元不在 `source.sections` 中,要么添加它(如果它在源文本中但尚未解析),要么标记此不匹配。

**识别缺陷类别。** 阅读散文并分类:
- 讨论*词语的含义* → `vague` 或 `def`。
- 讨论*规则是否触及某主体* → `scope`。
- 讨论*谁的意图重要*或对主观状态的沉默 → `mensrea`。
- 讨论*两条条款指向不同方向* → `conflict`。
- 讨论*某种解读引发合宪性疑虑* → `conlaw`。
- 讨论*无标准的单方权力* → `discretion`。

如果类别确实不清楚,询问。如果多个适用,全部列出。

**识别立场。** 即使在原始散文中,真实的争议也有双方。寻找:
- 对抗性框架("原告会主张……被告会回应……")。
- 保守的不确定性表达("一种解读……另一种解读……")。
- 政府对公民的模式、买方对卖方的模式、监管者对被监管者的模式。

当散文只勾勒了一方时,**根据文本可能支持的内容构建最强版本的另一方**。然后向用户展示你所做的:"我根据您提供的文本勾勒了[对方]的立场——请确认或修改。"

**识别弱点和可能结果。** 这些在非结构化输入中往往留作隐含。可以推断:
- "弱点"是一句描述文本未能说明之处的话。
- "可能结果"是关于争议在相关解释规则或普通法原则下如何解决的保守预测。

如果输入确实两者皆无,技能仍可以仅用情境和立场渲染场景——但分析层会明显单薄。向用户标记此情况并提供补全选项(或请其补全)。

**识别改写文本。** 改写文本是文本上的治疗方案。如果输入没有提出改写,技能可以:
- 基于弱点提出一个(默认行为)。
- 将该字段留空并标记为"由起草人提出"。
- 询问用户偏好哪种。

默认提出改写文本。起草人可以覆盖;空白的改写文本在渲染输出中会显得突兀。

## 源文本解析

规范中的 `source` 块要求将受审文本拆分为可寻址单元。如果输入包含完整源文本,解析它:

**法规。** 对分项标记使用正则表达式——`Sec.`、`§`、`(a)`、`(b)(1)`、`(b)(1)(A)`。构建树:顶层条款是章节标题的子节点;子条款作为 `subprovisions` 嵌套。通过去除括号并拼接来分配 ID:`(b)(6)(B)` → `b6B`。

**合同。** 标题通常带编号(1、2、2.1、2.1(a))。按层级解析。ID:`s2_1_a`。

**规章。** 与法规类似,但注意渲染器应作为标题处理的"Subpart"和"Part"分组。

**意见书。** 段落可寻址但大多数意见书中没有标签。要么按顺序给段落编号(`p1`、`p2`、……),要么在存在时使用法院自己的编号。"holding"通常可识别;将其标记为顶层章节。

如果解析不确定——编号方案重叠、分项含糊——先生成草稿树并展示给用户更正,然后再构建场景。

## 源文本未提供时怎么办

场景引用的锚点 ID 在渲染器可见的任何地方都不存在。网站/文档会显得损坏:无目标的锚点标签、显示"[source not provided]"的法规页面。

两个选项:
1. **请求源文本。** 几乎总是正确做法。即使粘贴相关章节一次也足够。
2. **以"仅场景"模式渲染。** 跳过网站上的法规面板;跳过 docx/LaTeX 中的法规块。结果可作为备忘录使用,但缺少本技能设计的骨架。仅在源文本确实不可用时使用。

## 展示推断出的内容

解析后,向用户展示提取内容与推断内容的简要摘要:

```
Parsed input:
  - Identified 4 scenarios.
  - Anchored to source sections (a), (b)(2), (b)(7), (c).
  - Inferred defect families for 3 of 4 scenarios; scenario 2 was explicit.
  - Constructed Position B for scenarios 1 and 3 (input had only Position A).
  - Proposed redrafts for all 4; user supplied redrafts for scenarios 2 and 4.

Want me to render this, or do you want to revise first?
```

这可以防止静默过度推断。用户可以在产生任何输出之前更正。
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall