npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fairbooks-contract-clauses

v0.2.0

Published

Fairbooks Contract Clauses: an MCP agent that checks a contract (.docx, .txt or .md) against your own clause playbook, reports which clauses are present, missing, prohibited or need attention with section and line citations, flags open placeholders, broke

Readme

Fairbooks Contract Clauses (fairbooks-contract-clauses)

Checks a contract's text against your own clause playbook and gives you a cited gap list. Sending or signing is a legally binding send: sending is one human click after a named reviewer, and signing is blocked. Not legal advice.

Important: not legal advice. Fairbooks Contract Clauses is not legal advice and does not replace a lawyer. It gives no guarantee that its clause findings, statuses or citations are accurate or complete: it can miss a clause, flag the wrong one or misread a number. Have a qualified lawyer review any contract before you rely on it, send it or sign it.

Part of Fairbooks Machine domain agents: one agent, one process, nothing outside its lane. Built on fairbooks-core. MIT, Node ≥ 20, runs on your machine, no account or API key needed.

What it does

Not legal advice, and not a substitute for a lawyer. Fairbooks Contract Clauses is a checklist runner: it finds the words and numbers your playbook names and tells you where they are. It does not interpret clauses, weigh risk, or look after the other side's interests.

Give Fairbooks Contract Clauses a contract as a Word file (.docx) or plain text (.txt or .md) and your playbook, a JSON checklist written by you or your counsel. For each clause the playbook lists, you set the phrases that show it is there (find), whether it is required or prohibited, words it must or must not include, an optional number check (for example payment within at most 45 days, or a liability cap of at least 12 months of fees), your position note, and your own fallback wording. For each clause it reports:

  • a status: missing, prohibited_present, needs_attention (expected words absent, forbidden words present, a number outside your limits, or a number it could not find), present, or absent and optional/acceptable;
  • citations: section number and heading, line and a short quote;
  • document checks: unfilled placeholders ([●], [TBD], ____), references to sections that do not exist, and duplicate section numbers;
  • defined terms: capitalised terms that are used but not defined, terms that are defined ("Term" means ... or (the "Term")) but not used anywhere else, and terms defined twice, each with its lines. This is pattern matching: it lists candidates for a person to read and will miss or over-report some. Put names it should skip in the playbook's ignore_terms.

Word files. A .docx is read directly with no extra software: one paragraph becomes one line, so citation "lines" are paragraph numbers. Tracked changes are read as if accepted (insertions kept, deletions dropped) and flagged with their counts; comments are counted but not read; paragraphs that use Word's automatic numbering are flagged, because those numbers are not in the text. Tables, footnotes, headers and text boxes may not come through.

Comparing drafts. clauses_compare_drafts checks two drafts against the same playbook and shows, clause by clause, whether each status got better, worse or stayed the same (with the numbers before and after), which document and defined-term findings are new or resolved, and which sections changed.

Playbook versions. Give the playbook a version (and optionally updated and owner). Every memo cites the playbook version and the first 12 characters of the playbook file's SHA-256, so counsel can tell which checklist a memo was checked against. The playbook is checked against a schema before use: an unknown key or wrong type fails with the path to the problem (fairbooks-contract-clauses validate-config playbook playbook.json).

It writes clause-gaps.md and clause-gaps.csv (and, given a previous draft, draft-changes.md and contract.diff); the report's SHA-256 goes into the audit log. With approval it drafts issues-for-counsel.md: each gap with its citation, your playbook's position, and your fallback wording copied word for word. Fairbooks Contract Clauses writes no contract language of its own, and every section is marked [COUNSEL REVIEW]. Pass the earlier memo as previous_draft to also get issues-for-counsel.diff, a redline of the memo.

Install

npm install -g fairbooks-contract-clauses
fairbooks-contract-clauses demo        # runs on the bundled fictional sample data

As an MCP server

Claude Code

claude mcp add fairbooks-contract-clauses -- npx -y [email protected] mcp --root /path/to/your/exports

Cursor / Claude Desktop / VS Code / Windsurf

{ "mcpServers": { "fairbooks-contract-clauses": { "command": "npx", "args": ["-y", "[email protected]", "mcp", "--root", "/path/to/your/exports"] } } }

--root is the only folder the tools can read or write. Paths outside it are refused.

Tools

| Tool | Policy | What it does | |---|---|---| | clauses_check | allow | Status, citations and issues per playbook clause, plus document checks | | clauses_write_report | allow | Write clause-gaps.md and clause-gaps.csv to fairbooks-out/clauses (plus draft-changes.md and contract.diff with previous_contract) | | clauses_compare_drafts | allow | Compare two drafts against the playbook: clauses better or worse, new and resolved findings, changed sections | | clauses_draft_markup | ask (Auto-eligible) | Draft issues-for-counsel.md from your playbook's own language, citing the playbook version, every section marked [COUNSEL REVIEW]; optional redline against the previous memo | | clauses_request_send | ask · one-click | After a named human approves, record the send (bound to the draft hash) once counsel is named and every [COUNSEL REVIEW] marker is cleared | | send_email | block | Listed so agents see the refusal. Fairbooks Contract Clauses never sends. | | e_sign | block | Listed so agents see the refusal. Fairbooks Contract Clauses never signs or accepts a contract. |

Any other tool name is blocked. fairbooks_info shows the pinned model, mode, caps and every decision.

Modes

  • Review (--mode review): read and report only.
  • Assist (default): the policy above. ask returns an approval_id; a person approves once with fairbooks-contract-clauses approve <id> --as "Your Name".
  • Auto (--mode auto --auto <tool,...>): off by default, opt-in per action, with step/spend caps (--max-steps, --max-spend) and a kill switch (fairbooks-contract-clauses kill).

clauses_check, clauses_compare_drafts and clauses_draft_markup can run on Auto. Sending marked-up clauses, a redline or any contract language is a binding_send: it stays one-click even in Auto, and --auto clauses_request_send is refused. It also needs reviewed_by (the lawyer or authorised person who reviewed it) and is refused while any [COUNSEL REVIEW] marker remains. Counsel removes each marker after reviewing that section, which changes the hash, so the approval covers the reviewed text. Sending and signing stay blocked.

Go-live, revoking access, deleting personal data, moving money, legally binding sends and production deploys always need a person's click, in every Fairbooks pack.

CLI

fairbooks-contract-clauses tools
fairbooks-contract-clauses call clauses_check '{"contract":"contracts/msa.md","playbook":"playbook.json"}'
fairbooks-contract-clauses call clauses_check '{"contract":"contracts/msa.docx","playbook":"playbook.json"}'
fairbooks-contract-clauses call clauses_compare_drafts '{"contract":"contracts/msa-v2-tracked.docx","previous_contract":"contracts/msa.md","playbook":"playbook.json"}'
fairbooks-contract-clauses validate-config playbook playbook.json
fairbooks-contract-clauses eval          # private evals on the bundled fixtures

MCP prompt

contract_playbook_review (arguments: contract, playbook, optional previous_contract) walks a host model through the check, the draft comparison, the report, the issues list, counsel's review and the one-click send. It tells the model to say this is not legal advice and never to tell anyone whether to sign.

Every call is written to .fairbooks/audit.jsonl (hash-chained JSONL; arguments stored as a hash). Read it with fairbooks-audit-evidence or npx -y -p fairbooks-core fairbooks-verify-log .fairbooks/audit.jsonl.

What it is not

  • Not legal advice, not a substitute for a lawyer, and not a contract review. It matches text against your checklist. A clause can match your words and still not do what you need, or do it in words your playbook did not list.
  • It never reviews the other side's interests and never tells anyone whether to sign.
  • .docx, .txt and .md only: export a .pdf or old .doc as text first. In a .docx, tracked changes are read as accepted, comments are not read, and tables, footnotes, headers and automatic numbering may not come through.
  • The defined-terms check and the draft comparison are text matching. They can miss a term, report a name as a term, or call a clause "better" because a number moved inside your limit while other wording changed. A person reads the changes.
  • It never sends, accepts or signs anything.
  • Not fully autonomous: anything risky waits for a named person.

Data

Everything runs locally on files you choose. No network calls, no telemetry. Contracts are confidential, so keep the --root folder private. The bundled contract and playbook are fictional and are not a template or a recommendation.

License

MIT © 2026 Kurt Francisco. Source: https://github.com/fpavia111-creator/fairbooks-agents/tree/master/packages/fairbooks-contract-clauses