AI-powered legal document automation. Fills court forms, generates pleadings, validates jurisdiction-specific formatting — all via natural language.
Paralegals and pro-se litigants spend hours manually filling court forms that vary across 50 states, 3,000+ counties, and thousands of court types. A single typo in a case number or a misformatted address can get a filing rejected. Commercial legal automation (Clio, MyCase, LegalZoom) locks this capability behind $100+/mo subscriptions.
ClauseForge uses Google Gemini to intelligently map plain-English case facts to fillable PDF fields. Select your jurisdiction (state -> county -> court type), describe the case, and get a validated, court-ready PDF.
- PDF Support — Upload any fillable court form (Family, Civil, Probate, Small Claims)
- Gemini Field Mapping — Natural-language input translated to structured form data
- Jurisdiction Engine — 50 states, county-level court rules, format validators
- Legal Validator — Case numbers, party names, addresses, caption formatting
- No Data Retention — Uploads processed in-memory, nothing persisted without consent
- Docker Deploy — One-command production deployment
git clone https://github.com/tlancas25/clauseforge.git
cd clauseforge
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # add your GEMINI_API_KEY
python app.py/plugin marketplace add tlancas25/clauseforge
+-------------+ +--------------+ +-------------+
| PDF Upload | -> | PDF Extractor| -> | Field Map |
+-------------+ +--------------+ +-------------+
|
+-------------+ +--------------+ +-------------+
| Filled PDF | <- | PDF Filler | <- |Gemini Mapper|
+-------------+ +--------------+ +-------------+
| |
+-------------+ +-------------+
| Validator | <---------------------| Jurisdiction|
+-------------+ +-------------+
| Layer | Tool |
|---|---|
| Backend | Flask 3.0 |
| PDF Processing | PyMuPDF 1.23.8 |
| AI | Google Generative AI (Gemini) |
| Frontend | Bootstrap 5 + Vanilla JS |
| Testing | pytest + pytest-flask |
| Deployment | Docker + Gunicorn |
clauseforge/
+-- app.py # Flask entry point
+-- services/
| +-- pdf_extractor.py # PDF field extraction
| +-- gemini_service.py # AI field mapping
| +-- pdf_filler.py # PDF form filling
| +-- legal_validator.py # Legal format validation
+-- templates/index.html # Main UI
+-- static/css/style.css
+-- static/js/app.js
+-- tests/ # pytest suite
+-- .claude-plugin/ # Claude Code plugin manifest
+-- skills/clauseforge/ # Behavioral SKILL.md
+-- .cursor/rules/ # Cursor IDE support
+-- Dockerfile
+-- requirements.txt
+-- CLAUDE.md # AI pair-programming context
pytest tests/ -vClauseForge is a drafting tool, not legal advice. Output must be reviewed by a licensed attorney before filing. Not a substitute for legal counsel. The author assumes no liability for filings made using this tool.
MIT (c) Terrell Lancaster. See LICENSE for details.
Built by Terrell Lancaster — Cloud Security Architect, AI Infrastructure Engineer, Claude Code Operator.
- Website: terrell-lancaster.com
- LinkedIn: linkedin.com/in/tlancas
- X: @openclawguru