SuperAPI AI Directory

tabular-review

Data & analytics

View repository

Updated 10-16 05:04

About this skill

/tabular-review
  1. Load ~/.claude/plugins/config/claude-for-legal-zh/corporate-legal/CLAUDE.md → due diligence structure, thresholds, internal formats.
  2. Confirm: what documents, what columns, output where.
  3. Build a typed schema. Write to .review-schema.yaml. Confirm with the user.
  4. Sample run (3-5 documents). Adjust the schema. Confirm.
  5. Expand — one subagent per document, in parallel. Each cell: value + status + verbatim quote + location.
  6. Normalization pass. Flag anomalies and inconsistencies.
  7. Output:.xlsx or an online spreadsheet (ask), plus .csv + _sources.csv + markdown always output. Work product header.
  8. Summary: verify workload (per-column counts of not_present / unclear / needs_review), flagged columns, document locations, remind that each cell is a lead, not a finding.
/corporate-legal:tabular-review
/corporate-legal:tabular-review --schema .review-schema.yaml --docs ./vdr/02-Contracts/
/corporate-legal:tabular-review --template ma-diligence

--schema <路径>: Use the existing schema file rather than creating a new one. For reruns and incremental additions.

--template <名称>: Start from a template in references/ . Currently available:ma-diligence。

--docs <路径>: Document source. Local folder, cloud document folder ID, or data room path. If omitted, ask.

--output <xlsx|在线表格|csv>: Output format. If omitted, ask.

--sample <n>: Sample size for schema checking. Default 5.


Matter context

Matter context. Check for ## 事项工作区in the practice-level CLAUDE.md. If Enabled is ✗(the default for corporate legal users), skip the rest of this section — the skill uses practice-level context and matter mechanics are invisible. If enabled and there is no active matter, ask: "Which matter is this? Run /corporate-legal:matter-workspace switch <事项简称> or say 实务级." Load the active matter's matter.md for matter-specific context and override rules. Output is written to the matter folder ~/.claude/plugins/config/claude-for-legal-zh/corporate-legal/matters/<事项简称>/. Never read files from other matters unless 跨事项上下文 is 开.


Purpose

You have a stack of documents and a list of questions that need to be answered consistently across every one. A due diligence request list. A vendor contract audit. A lease portfolio review. The output is a table: documents as rows, data points as columns, every cell traceable to exact text in the source.

This is not issue spotting.diligence-issue-extraction Find the 30 issues hidden in 2,000 documents. This skill answers the same 15 questions across all 2,000 documents. Both are legitimate; they answer different questions.

This is also not a substitute for a human reading the documents. Every cell this skill produces is alead that needs verification, not a finding. The output is designed to make verification faster, not to skip it.

Load context

  • ~/.claude/plugins/config/claude-for-legal-zh/corporate-legal/CLAUDE.md → due diligence structure, materiality thresholds, internal format preferences
  • ~/.claude/plugins/config/claude-for-legal-zh/corporate-legal/deals/[代码]/deal-context.md(if working on a specific deal)
  • The user's existing schema file (.review-schema.yaml)

Column type system

What makes a table review useful: column C means the same thing in row 1 and row 200. Free text drifts. Types hold.

Each column has atypethat constrains the answer format:

Type What it returns Used for
verbatim Exact quote from the document, verbatim character by character Defined terms, operative clause language, anywhere the wording itself matters
classify One value from a fixed list you define Yes/No, present/absent, clause variants (such as "subject to consent"/"not to be unreasonably withheld"/"not mentioned")
date ISO format date Effective date, expiration date, termination notice deadline
duration Number + unit Term length, notice period, survival period
currency Number + currency code Caps, thresholds, fees, purchase price references
number Bare number Counts, percentages, page numbers
free Short free-text summary Use sparingly—this is the type that drifts. Use only when other types truly do not fit.

Verbatim rule: Every non- verbatim column also captures the exact source quote supporting the answer, as a companion field. The answer in the cell is the interpretation; the quote is the evidence. A classify cell that says "not to be unreasonably withheld" is useless without the source sentence, because the reviewer's job is to check whether that interpretation is correct.

The three states of "not found"

Blank cells hide information. When an affirmative answer cannot be produced, force the use of one of three explicit states:

State Meaning When to use
not_present Document read, the clause does not exist Confident the subject is not addressed
unclear Content exists but cannot be confidently classified Ambiguous drafting, partial clauses, conflicting provisions
needs_review Content found but requires human judgment Edge cases, unusual drafting, answers that depend on judgment the schema does not capture

These are three different pieces of information. The deal team handles "the contract is silent on assignment" very differently from "the assignment clause is ambiguous." Compressing them into one blank cell loses that distinction.

Workflow

Step 0: What and where

Confirm:

  1. Documents. Where are they? Data room MCP (data room/Feishu/Nutstore), local folder, cloud document folder, or file list. How many? If >200, warn that this will take some time and offer to start with a materiality-filtered subset.
  2. Schema. Which columns? Two paths:
    • The user selects a template from references/ (M&A due diligence standard is the default)
    • The user describes the columns in natural language, and you structure them into a typed schema
  3. Output. Excel(.xlsx) or an online spreadsheet—ask which the team uses. CSV and markdown are always written as backups. Output to the deal folder, cloud document, or a location specified by the user.

Step 1: Build and confirm the schema

Convert the user's column list into a structured schema. Each column: a stable id, a human-readable label, a type, a prompt(the question the reviewer will ask when reading the document), and for classify columns a options list.

Write it to the .review-schema.yamlThis file is a reusable artifact—users can edit it, add columns, and rerun it on new files. Show and confirm with the user before expanding.

schema:
  name: "并购尽调 — 项目 [代码]"
  created: 2026-05-07
  columns:
    - id: counterparty
      label: "对方当事人"
      type: verbatim
      prompt: "目标公司以外的合同相对方是谁?"
    - id: effective_date
      label: "生效日期"
      type: date
      prompt: "协议何时生效?"
    - id: change_of_control
      label: "控制权变更"
      type: classify
      options: [未提及, 须经同意, 不得无理拒绝同意, 自动终止, 仅通知]
      prompt: "协议是否涉及目标公司的控制权变更?要求什么?"
    - id: assignment
      label: "合同转让限制"
      type: classify
      options: [未提及, 须经同意, 不得无理拒绝同意, 可自由转让, 可转让给关联方]
      prompt: "目标公司能否转让本协议?有哪些限制?"
    # ... 更多列

Step 2: Sample run

Don't expand on 200 files with an untested schema. First run on 3-5 files. Show the user the rows. Look for:

  • Columns where most answers are unclear —the prompt is ambiguous, rewrite it
  • Columns where answers don't match the options in classify —add options or change to free
  • Columns that return paraphrases rather than verbatim text in verbatim —emphasize that it must be verbatim, character for character

Adjust the schema, rerun the sample, and confirm. This avoids the user doing a full run that will be discarded.

Step 3: Expand

One subagent per file, in parallel. Each subagent:

  1. Reads the full file (not RAG chunks—the whole file).
  2. For each column, finds the associated provision.
  3. Returns a structured row: each column {value, state, quote, location}。
    • value is a typed answer (if state is not answered then null)
    • state is answered | not_present | unclear | needs_review
    • quote is the verbatim supporting text (exact, not paraphrased, no ellipses within a sentence—if truncated, truncate at a sentence boundary and note it)
    • location is where the quote is located (clause number, heading, page number—whatever the file provides)

Quotes are not optional; the verbatim rule is mechanical, not advisory. Before returning a cell with state: answered , every subagent must satisfy all of the following:

  • quote must be contiguous text copied verbatim, character for character, from the source file, retrievable at the location cited by the subagent. Do not assemble quotes from clause headings plus standard template text you expect to be present there. Do not paraphrase and call it verbatim. Do not reconstruct quotes from memory based on how "such clauses usually" read. Do not use ellipses to splice non-contiguous text to fill gaps in the source.
  • location must be specific enough that the normalization pass can reopen the file and reread the same passage—a clause number, heading, or page number that a reviewer can navigate to.
  • If a subagent cannot locate and copy the exact text (source is truncated, OCR is garbled, the provision is implicit but not stated, the clause heading is visible but the body text is not loaded), the cell status is needs_review,value is null,notes must contain quote_unavailable: <原因>. Never set state: answered。
  • with a synthesized or reconstructed quote. The same rule applies to verbatim-type columns as well as to the accompanying source citation attached to classify / date / duration / currency / number / free cells. Supporting quotes carry the same verbatim obligation as the cell value.

The normalization pass in Step 4 spot-checks this by rereading the source at the cited location and comparing the stored quote verbatim, character for character, against the source text. A mismatch downgrades the cell to needs_review, notes quote_mismatch, and flags the entire column for expanded spot-checking—if one subagent assembled a quote, other subagents in the same run may have done so too.

Step 4: Normalize

After expansion is complete, read the entire table column by column. This is the pass that catches the failure mode of every table review tool: the same provision being interpreted inconsistently across files.

For each classify column:

  • Check whether each answered value is in the options list. Reclassify outliers or promote them to needs_review。
  • Check clusters: if 180 documents say 须经同意 and 20 say 不得无理拒绝同意, this is probably real. If 195 say 须经同意 and 5 say 可自由转让, look at those 5—they are either genuinely different or misclassified.

For each date / duration / currency column:

  • Check format consistency. Normalize.
  • Flag implausible values (99-year terms, ¥1 caps) as needs_review。

For each verbatim column and the accompanying source citation on every other column:

  • For a random sample (at least 3-5 rows per column, or 10% of rows, whichever is greater), spot-check by reopening the source file and comparing the stored location verbatim, character by character, against the source at the cited quote .
  • If any citation is pieced together, paraphrased, reconstructed, or cannot be located at the cited snippet: downgrade that cell to needs_review and note quote_mismatchin the remarks, flag the entire column—extend the spot-check to the remaining rows of that column rather than assuming the other rows are clean. One fabricated citation is enough to trigger expanded checking.
  • state: answered and a cell with a citation mismatch is a higher-severity failure than a unclear or needs_review cell—it distorts the evidentiary trail. Downgrade aggressively.

Step 5: Output

Write the table in three formats:

Markdown(always, for in-session review):

| 文件 | 对方当事人 | 生效日期 | 控制权变更 | 合同转让 | ⚠️ 标记 |
|---|---|---|---|---|---|
| 供应商主协议 — Acme | Acme Corp | 2023-04-01 | 须经同意 | 须经同意 | — |
| 供应协议 — Beta | Beta LLC | 2021-11-15 | ⚠️ unclear | 未提及 | CoC模糊 §14.2 |

CSV(.csv, always): one file stores values, one companion file stores citations and locations (_sources.csv). Keep the main file clean and the evidentiary trail intact.

Excel(.xlsx) oronline spreadsheet—depending on the user's work environment. Ask; do not guess. Both follow the same workbook structure (see references/excel-output.md and references/gsheets-output.md). For Excel: use Claude in Excel (Office agent) if available,openpyxl as fallback. For Sheets: use Sheets MCP if available, use the Sheets API via ADC, CSV import as fallback. In the spreadsheet output:

  • Each data column is paired with a hidden source column containing citations and locations. Cell comments (Excel) or notes (Sheets) on visible columns show the citation on hover.
  • Color-code by status: white = answered, yellow = unclear or needs_review, gray = not_present.
  • One Verified column per data column, blank by default. Reviewer marks it. This is the verification/flagging pattern that makes the table auditable—the deal team can see at a glance what a human has actually checked.
  • A _schema table contains the column definitions so the file documents itself.

Add the work-product header from the plugin configuration ## 输出规范 as the top row. Add distribution instructions beside it:

This review is derived from source files that may be privileged, confidential, or both. It inherits the privilege and confidentiality status of the sources—distribution outside the privileged circle may waive privilege. Store in the matter's privileged files and make distribution decisions carefully.

Step 6: Summary

After the table is written, give the user a one-screen readout:

  • Document count, column count, number of completed rows
  • For each column, counts of not_present、unclear、needs_review —this is the verification workload
  • Any column with >10% of rows flagged during the normalization pass
  • Location of the output files
  • Reminder: each cell is a lead, not a finding. It must be verified before forming representations and warranties, schedules, or memos based on it.

Close with a next-step action decision tree

Close with the next-step action decision tree in CLAUDE.md ## 输出规范 . Tailor the options to what this skill just produced—the five default branches (draft X, escalate, gather more facts, monitor and wait, other) are a starting point, not a lock-in. The decision tree itself is the output; the lawyer chooses.

What this skill does not do

  • It does not replace reading the documents. It tells you where to look.
  • It does not produce confidence scores. 0.73 is not information.unclear / needs_review Status and verbatim quotes are the confidence signal—if the quote does not support the value, flag it.
  • It does not silently skip documents. Every document the user points to gets a row. A document that cannot be read gets a row needs_review with an explanation.
  • It does not pretend a paraphrase is a quote. The evidentiary lead is the whole point.

Relationship to other skills

  • diligence-issue-extraction finds issues; this skill extracts data points. If an issue is found during extraction (a material adverse change clause tied to a specific earnings target, a poison pill provision), record it and suggest running diligence-issue-extraction on that document.
  • material-contract-schedule builds a specific table (a disclosure schedule). It can directly consume this skill's output—the schedule is a filtered, reformatted view of the tabular review.
  • ai-tool-handoff hands off bulk review to AI tools when the corpus is too large or the team prefers a dedicated platform. This skill is the in-house option for anything it can handle—run it first, hand off the remainder.

Output safeguards

Every output carries a work product header. Every cell has a source citation or a flagged status. The summary explicitly says verification is required. Excel's Verified column makes verification status auditable. This is not a tool that lets you skip reading; it is a tool that makes reading faster.