The project's README from github.com/gfodor/legal-skills. As one markdown file: README.md.
Replace billable hours with markdown files and an AI that actually follows them.
This repository is a public, executable playbook for U.S. utility-patent work. Not a chatbot wrapper. Not a "talk to a lawyer" landing page. A set of agent skills — SKILL.md files, checklists, examiner/adversary protocols, intake questionnaires, and deterministic Python — that make a language model do the work a patent boutique currently invoices at several hundred dollars an hour.
The goal is not to "assist" counsel. The goal is to displace legal fees. If an inventor, founder, or in-house engineer can run a 316-item pre-filing audit, a simulated USPTO prosecution loop, and an adversarial design-around attack without opening a matter, that is a win. If a firm that used to charge $18,000 to draft and file a utility application is now competing with a checkout of this repo and a model that costs less than lunch, that is also a win.
Lawyers who are good at judgment, strategy, and courtroom work will still have work. Lawyers whose product is walking a known statute, filling known forms, and billing the walk — this repo is aimed at that product.
Read this before you use anything in this repository.
This project is not a law firm. It does not create an attorney–client relationship. Nothing here is legal advice, a legal opinion, a patentability opinion, an infringement opinion, a freedom-to-operate opinion, or a representation that any application will be allowed, valid, enforceable, or commercially useful.
The GPL-3.0 license already disclaims warranty. This paragraph is the same idea in English: use at your own risk.
That disclaimer is required because the work is real enough to hurt you if you treat it as magic. It is not a retreat from the pitch. The pitch is that most of what you were paying for was process, and process belongs in files.
Patent work is already a document pipeline:
Firms wrap that pipeline in scarcity, letterhead, and a rate card. This repo unwraps it.
| What you used to buy | What this repo is |
|---|---|
| A $400/hr associate reading the draft once | 11 specialized agents, each with the whole application and a part-file of checklist items they are forbidden to skip |
| A partner "doing the claims" from muscle memory | A 64-item claims part, a mechanical parser that builds the dependency graph, and a red-team examiner who has to write a real Office Action |
| A design-around "gut check" in a conference room | Fresh competitor subagents plus an outer-agent umbrella classification that will not let you claim a result you did not disclose |
| An invoice | git clone |
The files are the product. If a better model ships next quarter, the same files get cheaper and sharper. If the PTO changes a form, you edit a markdown file instead of waiting for a CLE.
Three skills. They are designed to be run in order. Each one is a complete agent skill: a SKILL.md the orchestrator reads as its contract, plus the payloads, templates, and scripts that keep the model honest.
legal-skills/
├── patent-audit/ Pre-filing audit. 316 checklist items. Deterministic pre-pass.
├── patent-examine/ Recurrent simulated USPTO examination until two independent examiners clear the same version.
├── patent-workaround/ Adversarial design-around testing. Strengthen only what is supported and patentable.
├── LICENSE GNU GPL v3
└── README.md This file
Suggested pipeline
inventor facts + draft
│
▼
┌───────────────┐
│ patent-audit │ Is this even fileable? Stop on statutory bars.
└───────┬───────┘
│ ranked defects + parsed.json
▼
┌───────────────┐
│patent-examine │ Mock prosecution. Amend only after a simulated OA.
└───────┬───────┘
│ version-locked "allowable" candidate
▼
┌──────────────────┐
│patent-workaround │ Can a competitor keep the value and miss the claims?
└────────┬─────────┘
│
└── iterate examine ↔ workaround until two examiners
and two adversaries clear the same packet
patent-examine and patent-workaround will use patent-audit's parser and mechanical checks if that sibling skill is installed. A prior audit is not a substitute for examination. A prior examination is not a substitute for workaround testing.
These are agent skills: a directory with a SKILL.md the model is instructed to follow. Copy the three skill folders into the skills directory of whatever agent you run.
| Agent | Typical location |
|---|---|
| Grok | ~/.grok/skills/ |
| Claude Code | ~/.claude/skills/ or project .claude/skills/ |
| Codex / Cursor / other skill hosts | that product's skills directory |
On Windows, from this repo:
Copy-Item -Recurse .\patent-audit, .\patent-examine, .\patent-workaround $HOME\.grok\skills\
Then tell the agent, in plain language:
$patent-audit to audit this draft before I file it.$patent-examine until two fresh examiners independently find the same version allowable.$patent-workaround to pressure-test this draft against credible design-arounds.Python 3 is required for the scripts. The audit parser accepts .txt, .md, .pdf, and .docx. PDF needs PyMuPDF; .docx needs python-docx. Missing optional dependencies fail loudly instead of silently producing a half-parse. The state lockers (cycle_state.py, coverage_state.py) use only the standard library.
Do not point a model at the draft and skip the skill. The value is the protocol, not "an LLM that has heard of patents."
patent-audit — pre-filing auditWhen: before you file a utility application, a provisional, or a claim set you are about to spend money on.
What it returns: a ranked defect list with honest coverage accounting — every item is pass, fail, cannot_assess, not_applicable, or not_reached. Silence is never a pass.
What it is not: a rewrite of the application. Audit agents are forbidden to edit the draft. Remediation is a later pass.
The checklist is a primary-source pre-filing audit of a U.S. utility draft — 35 U.S.C., 37 CFR, the MPEP, and current USPTO practice — not a vibe. Every item has an id, part, severity, owner agent, input types, automation class, and a blocking flag. Routing is precomputed in reference/checklist_index.json. The full item text lives in reference/parts/ — those files are the agent payloads. Each item body cites a statute, rule, MPEP section, or current official page.
| Part | File | Items | Fatal | What it actually checks |
|---|---|---|---|---|
| A | A_threshold.md |
37 | 18 | Is this patentable at all? §101 class + judicial exceptions, utility, novelty, statutory bars, nonobviousness. The "don't file" gate. |
| B | B_search.md |
22 | 1 | Was the search real? Classes and keywords, NPL, foreign docs, citation chaining, reading references as disclosures, IDS queue. |
| C | C_inventorship.md |
21 | 9 | Who conceived a claimed limitation? Employment agreements, shop rights, joint-owners agreements, assignments, utility vs design vs plant. |
| D | D_priority_deadlines.md |
46 | 16 | PPA enablement, one-year conversion, foreign rights, NPR conflicts, continuation/divisional/CIP labeling, double patenting, term. |
| E | E_disclosure.md |
27 | 8 | Enablement, written description, best-mode without naming a favorite, software listings/flowcharts, patent profanity, no-new-matter completeness. |
| F | F_spec_sections.md |
29 | 3 | PTO section order, Background that does not confess the invention, numeral hygiene, structure-then-operation, ramifications, 150-word abstract. |
| G | G_claims.md |
64 | 17 | Breadth vs prior art, antecedent basis, means-plus-function support, single-means ban, method-actor unity, CRM claims, claim count/fees. |
| H | H_drawings.md |
22 | 3 | Every claimed feature shown, no new-matter holes, OPAP formalities, line types, color/photo petitions. Multimodal — sheets must be attached as images. |
| I | I_filing_packet.md |
48 | 17 | Declaration/ADS consistency, entity status, IDS, NPR, EFS-Web vs paper, PME, fee arithmetic, form versions. |
316 items. 105 are blocking — a fail on one of those stops the audit. 28 are mechanical (code). 169 are assisted (model + structured evidence). 119 are judgment.
26 items can only be answered from intake facts. No amount of document review reaches them (disclosure/bar dates, inventorship knowledge, duty of candor, some foreign and fee facts). If you skip intake, those come back cannot_assess. That is the correct answer. Guessing a first-public-disclosure date is how people lose the U.S. right and then pay a lawyer to confirm they lost it.
cannot_assess is a valid verdict. Duty of candor cannot be established from any document. An agent that guesses has failed the skill.| Phase | What happens |
|---|---|
| 0 — Intake | prepass.py with no --intake writes the questionnaire and stops. Fill it. Parts A, C, and D are unanswerable without it. |
| 1 — Deterministic pre-pass | Parse → mechanical checks → deadline table. Exit 2 if the parse looks like the wrong document. |
| 2 — Gates (fail-fast) | gate_threshold → gate_inventorship → gate_priority. A blocking fail stops the run. Do not spend tokens polishing prose on a barred application. |
| 3 — Document fan-out | Eight specialist agents plus three red-team agents, launched together. |
| 4 — Adversarial verification | Every blocking fail is re-tried by three fresh verifiers who see the draft and the claim but not the finding's reasoning. Survivors need 2 of 3. |
| 5 — Synthesis | synthesize.py ranks defects and reports not_reached. If that count is not zero, an agent skipped work. |
| Agent | Owns | Lens |
|---|---|---|
doc_enablement |
Part E items (plus claim-support items in G) | Skilled artisan trying to build it. Every place you'd have to invent something is a gap. |
doc_narrowing |
Narrowing-language items across E/F | Opposing counsel hunting admissions, essentiality language, and claim-construction traps. |
doc_spec_sections |
Part F | Walk the spec in PTO order. |
doc_claims_law |
§112 form, definiteness, antecedents, 112(f) | Adjudicate the mechanical pass's candidates lists. Do not re-derive them. |
doc_claims_arch |
Claim-set architecture | Is claim 1 the broadest? Does each dependent add real scope? Are the classes covered? |
doc_drawings |
Part H + I05, I33 | Attach the sheets as images. Text-only, this agent silently passes. |
doc_filing |
Part I | ADS, declaration, fees, IDS, NPR. |
doc_search |
Part B | Was the search adequate, were the references read as disclosures rather than as claim sets? |
Split E/F/G by the owner field in checklist_index.json, not by file. Workload is uneven on purpose: gate_priority 48, doc_filing 46, doc_claims_law 39, gate_threshold 35, then down to doc_narrowing at 14.
Red team (same batch, not checklist-shaped):
redteam_examiner — write the first Office Action you would actually issue.redteam_design_around — three products that keep the commercial value and miss claim 1. If this is easy, claim 1 is too narrow. No checklist item will tell you that.redteam_invalidity — assume it issued. Attack priority, §112, and the art the applicant missed.python patent-audit/scripts/prepass.py --draft DRAFT --drawings DRAWINGS `
--intake intake.yaml --workdir audit_run
| Script | Job |
|---|---|
prepass.py |
One command for all of Phase 1. No --intake → write the questionnaire and stop. Exit 1 = missing intake. Exit 2 = parse refused. |
parse_application.py |
Draft → parsed.json: sections, claim dependency graph, element decomposition, antecedent-basis candidates, numeral tables, figure inventory. |
mechanical_checks.py |
Deterministic checks → findings_mechanical.json. A mechanical pass never suppresses a later agent fail on the same item. |
deadlines.py |
Intake → deadlines.json with weekend/holiday rollover. Agents interpret dates; they do not compute them. |
synthesize.py |
All findings → ranked report + coverage. Non-zero exit if a fatal item failed. |
prepass.py refuses to continue when no claims parsed, fewer than four sections were recognized, or the detailed description yielded no reference numerals. That is how you keep eleven agents from confidently auditing a document that isn't there.
Every audit agent returns only a JSON array to findings/<agent>.json:
[{
"item_id": "G14",
"verdict": "fail",
"severity": "Serious",
"location": "claim 3",
"evidence": "the said locking member",
"explanation": "No earlier claim introduces a locking member.",
"suggested_fix": "Introduce 'a locking member' in claim 1, or recite it in claim 3.",
"confidence": "high"
}]
evidence must be a verbatim quote from the draft. A finding with no quote is not a finding.
assets/intake.yaml — the questionnaire. Leave unknowns null. Null → cannot_assess.assets/sample_draft.md — a draft with planted defects, for testing the harness.Typical wall-clock for a 20–60 page, ~20-claim case is the slowest Phase-3 agent, about 5–10 minutes. Claim sets of 100+ should fan doc_claims_law per claim; keep doc_claims_arch on the whole set.
patent-examine — recurrent simulated examinationWhen: you want the draft stress-tested the way an examiner will actually attack it, then revised until two independent simulated examiners clear the same bytes.
What it returns: a version-locked prosecution record, a final ground-truth application, and a prominent statement that this was a simulation.
What it is not: a USPTO allowance, a validity guarantee, or a one-pass checklist. That last job is patent-audit.
Three artifacts, kept separate:
After a clearance, apply the candidate verbatim to ground truth and verify the content hash. Any unapproved substantive deviation voids the clearance.
python patent-examine/scripts/cycle_state.py init --run-dir examination_run `
--candidate application=application.docx --candidate drawings=drawings.pdf
python patent-examine/scripts/cycle_state.py snapshot --run-dir examination_run `
--candidate application=proposal/application.docx `
--candidate drawings=proposal/drawings.pdf
python patent-examine/scripts/cycle_state.py record --run-dir examination_run `
--examiner examiner-01 --decision conditional-allowable `
--document examination_run/examiner-01/notice-of-allowability.md
python patent-examine/scripts/cycle_state.py promote --run-dir examination_run `
--candidate application=application.docx --candidate drawings=drawings.pdf
python patent-examine/scripts/cycle_state.py status --run-dir examination_run
| Phase | What happens |
|---|---|
| 0 — Packet | Intake. Completeness gate. Refresh official sources. Documented prior-art search. Missing material is missing, not a favorable fact. |
| 1 — Fresh examiner | Spawn one subagent with a unique context ID and no prior examiner's reasoning. First merits response is a simulated non-final Office Action or ALLOWABLE. |
| 2 — Dialogue | Same examiner until CONDITIONAL_ALLOWABLE, ALLOWABLE, or a genuine terminal impasse. Outer agent independently validates every 102/103 mapping. |
| 3 — Promote | Apply the cleared candidate. Re-render the whole application. Re-run mechanical checks. promote must hash-match. |
| 4 — Repeat | A different fresh examiner. Zero qualifying clearances if the application changes. Success = two distinct examiners independently clear the same promoted hash. |
The outer agent does not accept the examiner's chart on faith. For every 102/103 ground it rea