tabular-review-lawvable について
Tabular Reviewは、複数のPDFやWord文書から指定項目を抽出し、引用付きのExcel表にまとめるスキルです。並列処理と追跡可能な出典参照を活用する文書レビューに適しています。
主な機能
- 01抽出項目の指定
- 02PDFとWord文書の検索
- 03文書の並列処理
- 04ページ・段落の引用記録
- 05出典リンク付きExcel表の作成
活用シーン
- 01複数契約の主要条項の比較
- 02引用付き文書レビュー表の作成
- 03PDFとWord文書の一括処理
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ lawve-ai/ awesome-legal-skills --skill tabular-review-lawvableインストール後、Claude Code で/tabular-review-lawvableを入力して読み込まれたか確認します。
同梱ファイルLICENSE.txtREADME.md
詳細
Tabular Review
複数のドキュメントから構造化データを抽出し、引用付きの Excel マトリクスにまとめます。
必要なスキル
- pdf - PDF ドキュメントの読み取り用
- docx - Word ドキュメントの読み取り用
- xlsx - Excel 出力の作成用
ワークフロー
ステップ 1:ユーザー要件の確認
AskUserQuestion を使用して、次の情報を収集します。
- ドキュメントフォルダーのパス - ドキュメントはどこにありますか?
- 出力ファイル名 - Excel ファイルの名前
- 抽出する列 - 各ドキュメントからどの情報を取得しますか?
列の定義例:
- Parties: Names of all parties to the agreement
- Effective Date: When the agreement becomes effective
- Term: Duration of the agreement
- Governing Law: Jurisdiction for disputes
ステップ 2:ドキュメントの検索
Glob を使用して、すべてのドキュメントを検索します。
Glob(pattern: "**/*.pdf", path: "<folder>")
Glob(pattern: "**/*.docx", path: "<folder>")
ステップ 3:ドキュメントの並列処理
バックグラウンドエージェントを起動し、ドキュメントを並行して処理します。各エージェントは次の処理を行います。
- 割り当てられたドキュメントを pdf または docx スキルを使用して読み取る
- 各列の値を抽出する
- ページ/段落の引用情報を記録する
- 構造化された JSON を返す
エージェントを起動:
Task(
prompt: "<agent_prompt>",
subagent_type: "general-purpose",
run_in_background: true
)
エージェントプロンプトのテンプレート:
You are processing documents for a tabular review.
DOCUMENTS TO PROCESS:
<list of document paths>
COLUMNS TO EXTRACT:
<column definitions>
For each document:
1. Read the document using the pdf skill (for .pdf) or docx skill (for .docx)
2. Extract the requested information for each column
3. Note the page number (PDF) or section (DOCX) where you found the information
4. Include a brief quote (30-50 chars) showing the source text
Return your results as JSON:
{
"results": [
{
"document": "<filename>",
"path": "<absolute_path>",
"extractions": [
{
"column": "<column_name>",
"value": "<extracted_value>",
"page": <page_number>,
"quote": "<brief_context_quote>"
}
]
}
]
}
If you cannot find information for a column, set value to "Not found" and explain in the quote field.
割り当て方法:
- ドキュメント数が N、エージェント数が M の場合、各エージェントは ceil(N/M) 件のドキュメントを処理します
- デフォルト:最大 10 エージェント
- ドキュメント数に応じて調整します
ステップ 4:結果の収集
すべてのバックグラウンドエージェントが完了するまで待機します。
TaskOutput(task_id: "<agent_id>", block: true)
すべての結果を集約し、ドキュメントの抽出結果をまとめた 1 つの配列にします。
ステップ 5:Excel 出力の生成
xlsx スキルを呼び出して、出力ファイルを作成します。
Create an Excel workbook at <output_path>:
SHEET 1: "Document Review"
- Header row: Document | <Column1> | <Column2> | ...
- Data rows: One row per document
For each extraction cell:
- Cell value: The extracted text
- Cell hyperlink: file://<document_path>#page=<N> (for PDFs)
- Cell comment: "Page <N>: '<quote>'"
SHEET 2: "Summary"
- Total documents: <count>
- Documents processed: <count>
- Extraction date: <today>
JSON スキーマ
抽出結果の形式:
{
"document": "Contract_ABC.pdf",
"path": "/path/to/Contract_ABC.pdf",
"extractions": [
{
"column": "Parties",
"value": "Acme Corp and Beta Inc",
"page": 1,
"quote": "entered into between Acme Corp and Beta Inc"
},
{
"column": "Effective Date",
"value": "January 15, 2025",
"page": 1,
"quote": "effective as of January 15, 2025"
}
]
}
Excel 出力形式
引用付きセル:
- 値:「Acme Corp and Beta Inc」
- ハイパーリンク:
file:///path/to/Contract_ABC.pdf#page=1 - コメント:
Page 1: "entered into between Acme Corp and Beta Inc"
色分け(任意):
- 緑:確信度の高い値が見つかった
- 黄:値は見つかったが、不確か
- 赤:値が見つからなかった
エラー処理
| 状況 | 対応 |
|---|---|
| ドキュメントを読み取れない | エラーを記録し、行を失敗としてマークして続行する |
| 列が見つからない | 値を「見つかりません」に設定し、コメントで説明する |
| エージェントがタイムアウトした | 部分的な結果を収集し、未完了であることを記録する |
| 必要なスキルがない | 必要なスキルをインストールするようユーザーに促す |
使用例
User: I want to do a tabular review of my contracts
Claude: [Uses AskUserQuestion]
- What folder contains your documents?
- What should I name the output Excel file?
- What columns do you want to extract?
User: ~/Contracts, review.xlsx, Parties/Date/Term/Governing Law
Claude: [Discovers 15 documents via Glob]
Claude: [Launches 5 background agents, 3 docs each]
Claude: [Collects results via TaskOutput]
Claude: [Creates review.xlsx via xlsx skill]
Output: review.xlsx with 15 rows, 4 columns, hyperlinks and citations
コメント
Markdown 対応