Doc Factory
Free for noncommercial use under PolyForm Noncommercial 1.0.0; commercial use needs a licence from Rico. View the source
A business hands over a document it already trusts: an engagement letter, a client update, a change order. The kit turns it into a locked template with fill-in fields. Every document built from that template is checked against what that kind of document has to carry. Every section points back to the source wording it came from. Nothing is released until the owner has read the result and clicked to accept it, and that acceptance is logged.
Experimental

The problem
Small offices send the same kinds of documents over and over, and they do it by re-editing last month's letter. Old client names leak into new letters, one-off promises quietly become standing policy, and gaps nobody noticed get copied forward for years. Generic AI writing tools make this worse: they replace the firm's proven wording with their own prose and give no record of where a sentence came from or who approved it.
How it works
The kit is a set of markdown skill files the AI follows, plus small plain-Node scripts for everything that must come out the same way every time. Extract (workflows/extract-template.md) reads the owner's document, separates locked prose from per-client fields, runs the document-class checks against it, and records provenance (L1, L2... for each locked paragraph). Fill and render (workflows/fill-and-render.md) asks for the fields, runs the mechanical checks in references/universal-checks.js, and produces one offline verification page. That page (references/verify-page.html) holds the document behind a watermark until the owner ticks the attestation and clicks. The click stamps a receipt with the date, version, sources and any accepted flags. Each run also writes a history sidecar, so the next run for the same client starts from what was promised last time.

Features
- Templates come only from the client's own documents
- A judgment library by document class
- Seven named refusals
- Deterministic checks as code
- The verification gate
- Run history
- Stated capability tiers
- No legal advice
- Four worked examples
How it was built
Version 1.0 shipped on 2026-07-15 as a render pipeline around one client-update letter template. The AI filled the fields and produced a ready-to-open HTML page.
An audit on 2026-08-11 found that everything that made the letter good was content the auditor had invented, and the fixed layout buried an urgent decision in section four. The rework the next day made extracting the owner's own best document the first thing the kit does.
Locked paragraphs gained numbered provenance, and a verify page shows each document under a preview watermark until the owner ticks a box and approves it.
Simulated buyers then found the released file used an undefined colour variable, so every download ignored the customer's brand. The builder was changed to read the live brand colour off the page.
Claude Opus agents ran the buyer workouts and an OpenAI model reviewed the first release. Rico kept the owner as the one who validates every document before it leaves.