agentleFS
SprintlawSprintlaw/legal-skills/skills/doc-audit/SKILL.md

doc-audit

Skill0 starsChanged 31 days agoMITView on GitHub

Deterministic integrity check for contracts and legal documents (.docx, .md, .txt). A standard-library script finds defined terms that are undefined, unused or defined twice; cross-references to clauses or schedules that do not exist (reconstructing Word's automatic numbering); placeholders and drafting notes left in; ABN, ACN and NZBN numbers that fail their check digits; amounts in words that do not match the figures; party labels that drift; wrong-currency amounts; statutes, regulators and entity types from the wrong country; wrong-market spelling; missing execution blocks; and lists every authority for citation checking. Use before sending, signing or publishing any document, after every drafting or editing pass, and as the first step of any contract review.

12 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always pass --jurisdiction for the governing law.

    line 17
  2. Distinctive:

    Never call a document clean while errors remain.

    line 18
  3. Very specific:

    Always pass --jurisdiction for the governing law: it turns on the wrong-jurisdiction, currency and spelling checks.

    line 27
  4. Distinctive:

    Warnings: check each. Jurisdiction warnings for entity types (such as "Pty Ltd" in a New Zealand contract) are fine when that party really …

    line 47

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Doc audit

Models and people both miss mechanical errors in long documents, because they read for meaning. A script does not. These are the errors that make a contract look careless to the other side and occasionally change its meaning: a cross-reference to a clause that was deleted, a capitalised term nobody defined, "ten thousand dollars ($1,000)", an Australian statute in a New Zealand contract.

Non-negotiables

  • Always pass --jurisdiction for the governing law.
  • Never call a document clean while errors remain; justify each one you leave.
  • A clean audit is mechanical only. Never present it as a legal review.

Run it

python3 scripts/docaudit.py <file.docx|.md|.txt> --jurisdiction au|uk|nz|us [--json]

Always pass --jurisdiction for the governing law: it turns on the wrong-jurisdiction, currency and spelling checks.

What it checks

CheckSeverityWhat it catches
Definitionserror / warn / infoDefined twice; defined but never used; capitalised as if defined but no definition; lowercase use of a defined term
Cross-referenceserror"clause 7.4", "Schedule 3" with no matching provision (Word auto-numbering is reconstructed)
Placeholderswarn[ ], [insert ...], TBC, XX, blank lines, merge fields, drafting notes
IdentifierserrorABN, ACN, ARBN and NZBN check digits; UK and NZ company number format; EIN format
Amountserror / warnWords and figures disagree; currency symbols from another market
PartieswarnTwo labels for the same role (for example "Client" defined, "Customer" also used)
Jurisdictionerror / warnStatutes, regulators, entity types and concepts from another of the four markets; "GDPR" without "UK GDPR" in a UK document
SpellinginfoAmerican spelling in AU, UK or NZ documents and the reverse
Executioninfo / warnNo signature block; a "deed" without deed execution wording
AuthoritieslistEvery Act, section, case and US citation found, for cite-check

Read the results

  1. Errors: fix all of them unless you can say why it is not an error (for example a cross-reference to another document's clause).
  2. Warnings: check each. Jurisdiction warnings for entity types (such as "Pty Ltd" in a New Zealand contract) are fine when that party really is from that country; statute warnings almost never are, unless the deal is deliberately cross-border.
  3. Info: judgment. Lowercase "services" where "Services" is defined is often deliberate, but check the ones that matter.
  4. Authorities: hand the list to cite-check.

Fix, then run it again until the errors are gone.

Reply

One or two lines: what was found, what was fixed, and any error or warning deliberately left with the reason; then the authorities list for cite-check. Do not paste the whole report to a client.

Limits

  • Mechanical checks only. A clean audit says nothing about whether the terms are fair, enforceable or right for the client.
  • Numbering reconstruction is best effort. Unusual list setups (legal numbering linked to custom styles, numbering restarts set by field codes) can produce false cross-reference errors; confirm against a rendered PDF before "fixing" a reference that looks right on the page.
  • The definition heuristics favour common drafting patterns ("X" means; (the "X")). Unusual definition styles may show as undefined terms.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.