I Built a Free Open-Source Library of 89 Romanian Legal Document Templates — Then Added Malbolge
The Romanian internet has a problem.
If you need a rental contract, a resignation letter, or a simple power of attorney, you'll find one of three things: a site from 2009 with broken formatting, an aggressive paywall for a document that should cost nothing, or a PDF so riddled with ads it takes 30 seconds to load.
I got tired of it. So I built something different.
What Is This Project?
acte-juridice-romania is a free, open-source library of 89 legal document templates organized into 14 categories, covering the most common legal situations a Romanian citizen encounters in everyday life.
Every document is:
- ✅ Free (MIT license)
- ✅ In Markdown format — human-readable, versionable, copy-pasteable
- ✅ Annotated with checklists and links to official sources
- ✅ Marked clearly when it requires a notary, lawyer, or specific institution
- ✅ No ads. No tracking. No paywalls.
The 14 Categories
| Category | What's Inside | Templates |
|---|---|---|
| 🏡 Locuință (Housing) | Rental contracts, loan for use, notifications, deposit, inventory | 10 |
| 👔 Muncă (Work) | Resignation, leave requests, remote work, certificates, ITM complaints | 11 |
| 💼 Afaceri (Business) | NDA, services, consulting, maintenance, IP assignment, payment notices | 12 |
| 👨👩👧 Familie (Family) | Powers of attorney, declarations, parental consent, hosting agreements | 7 |
| 🏛️ Administrativ | ANAF requests, Law 544 (FOIA), ONRC, certificates, fine contestations | 11 |
| 🛒 Consumatori (Consumers) | ANPC complaints, returns, warranty, online order cancellations | 6 |
| 🤝 Vânzare-Cumpărare (Sales) | Movable goods, receipt, advance payment, rescission notice | 7 |
| ⚖️ Succesiuni (Inheritance) | Wills, acceptance/renunciation, partition, notary requests | 5 |
| 🚗 Auto | Vehicle sale, loan for use, authorization, handover report | 4 |
| 🏠 Imobiliare (Real Estate) | Pre-contracts, sale promise, earnest money, non-execution notice | 4 |
| 💰 Împrumuturi (Loans) | Personal loan, debt acknowledgment, personal guarantee | 3 |
| 🏭 Firme & PFA (Companies) | Sole associate decision, AGM resolution, office loan, PFA suspension | 4 |
| 🔒 GDPR | Data access, erasure, and processing objection requests | 3 |
| 🏢 Asociație Proprietari | HOA requests and expense contestations | 2 |
Each template uses [FIELD] placeholders that you replace with real values. They include:
- A checklist of what to verify before using the document
- Links to official Romanian legislation
- Notes on when professional help is mandatory
The Technical Stack — Because Why Not Go Overboard?
1. The Core: Markdown Templates
The base format is Markdown. Simple, clean, versionable with Git, renderable anywhere. You can open it in VS Code, Notion, Obsidian, or your terminal. No proprietary formats.
templates/
├── locuinta/
│ ├── contract-inchiriere-locuinta.md
│ ├── contract-comodat-locuinta.md
│ ├── notificare-reziliere-inchiriere-chirias.md
│ └── ... (10 total)
├── munca/
│ ├── demisie-cu-preaviz.md
│ ├── demisie-fara-preaviz.md
│ └── ... (11 total)
└── ... (14 categories)
2. The Julia Package
Because if you're going to build a legal document library, you should absolutely also ship it as a Julia package.
using ActeJuridiceRomania
# List all categories
lista_categorii()
# => ["administrativ", "afaceri", "asociatie_proprietari", ...]
# See what fields a document needs
campuri_necesare("locuinta", "contract-inchiriere-locuinta")
# => ["ADRESA", "CNP", "DATA", "DATA INCEPUT", "MONEDA", "NUME CHIRIAS", ...]
# Generate a filled document
doc = genereaza_document("munca", "demisie-cu-preaviz", Dict(
"DATA" => "20.06.2026",
"NUME ANGAJAT" => "Popescu Ion",
"FUNCTIA" => "Software Engineer",
"ANGAJATOR" => "SC TechRomania SRL",
"DATA PREAVIZ" => "20.07.2026"
))
# Save it
salveaza_document("munca", "demisie-cu-preaviz", fields, "resignation.md")
# Search across all categories
cauta_documente("garantie")
# => [("consumatori", "cerere-garantie-produs"), ("locuinta", "cerere-restituire-garantie-inchiriere")]
The package structure:
src/
├── ActeJuridiceRomania.jl # Main module with the public API
└── templates/
├── administrativ.jl # 11 documents embedded as Julia strings
├── afaceri.jl # 12 documents
├── locuinta.jl # 10 documents
└── ... # 14 modules total
All 89 templates are embedded directly into the Julia source as string constants inside their respective modules. Zero runtime file I/O. Zero dependencies beyond the standard library.
The full API:
lista_categorii() # all 14 categories
lista_documente(category) # documents in a category
obtine_template(category, document) # raw Markdown content
campuri_necesare(category, document) # extract [FIELD] placeholders
genereaza_document(category, document, fields) # fill and return document
salveaza_document(category, document, fields, path) # fill and save to file
cauta_documente(keyword) # search all categories
3. The Interactive Web Generator
A single self-contained index.html file (~141 KB) with all 89 documents embedded. No server required. Drop it on GitHub Pages and it works.
Features:
- 🔍 Live search across all documents, titles, categories, and field names
- 📂 Category filter sidebar with document counts
- 📝 Dynamic form generation —
[FIELD]placeholders become input fields automatically - 👁 Live preview with unfilled fields highlighted in yellow
- ⬇️ Download as
.mdor.txtwith one click - 📋 Copy to clipboard
- 📱 Fully responsive
The entire data layer is a JavaScript constant object with all 89 documents embedded:
const TEMPLATES = {
"munca": {
label: "Muncă",
icon: "👔",
docs: [
{
id: "demisie-cu-preaviz",
title: "Demisie cu preaviz",
fields: ["DATA", "LOCALITATE", "NUME ANGAJAT", "FUNCTIA", ...],
content: `# Demisie cu preaviz\n\nCătre: [ANGAJATOR]\n\n...`
},
// ...
]
},
// 13 more categories
};
No build step. No npm install. No webpack. One file, open in browser, done.
The Easter Egg: Malbolge
Here's where things get interesting.
The repository also contains acte-juridice-romania.malbolge.
For the uninitiated: Malbolge is widely considered the hardest programming language ever created. It was designed in 1998 by Ben Olmstead with one explicit goal: to be impossible to understand or write programs in.
Named after the eighth circle of Hell in Dante's Inferno — reserved for fraudsters and deceivers — it runs on a ternary virtual machine (base 3, not base 2), and every instruction self-encrypts in memory as it executes. The same instruction does something different the second time the code pointer passes through it.
The instruction set has 8 valid operations out of 94 possible values. All others crash the program. The current instruction is determined by:
effective_instruction = (memory[c] - 33 + c) mod 94
After execution, memory at position c is replaced by:
((memory[c] - 33 + 1) mod 94) + 33
This means reading Malbolge code tells you nothing about what it does. You have to simulate every single step mentally, accounting for how each execution mutates future executions.
Less than 10-20 people in the world can write functional Malbolge. The first ever Malbolge program — Hello World — was not written by a human. It was found in 2000 by Lou Scheffer using a beam search algorithm running on a dedicated computer for approximately two days.
The result? 64 characters that look like keyboard mashing:
(=<`#9]~6ZY32Vx/4Rs+0No-&Jk)"Fh}|Bcy?`=*z]Kw%oG4UUS0/@-ejc(:'8dc
When you feed that to a Malbolge interpreter, it prints Hello, World!
The .malbolge file in this repository contains:
- Full project documentation (in comments — Malbolge ignores
#lines) - A complete explanation of the ternary machine, all 8 instructions, the crazy operation, and auto-encryption
- A minimal Python interpreter you can copy-paste to run it locally
- The actual verified Hello World program on the last line
Why put Malbolge in a legal document repository?
Because the person who finds it is exactly the kind of person who will share the repository link with five colleagues. The regular user looking for a rental contract never sees it. The developer browsing the repository on GitHub finds it and does a double-take.
It's an easter egg that generates organic reach in technical communities where a legal document library would otherwise never appear.
What's Missing (And What's Coming)
This is a first version. Here's what's on the roadmap:
More categories — the obvious gaps are Healthcare (medical refusal, patient records requests), Banking (debt restructuring, Law 77/2016 notices), Courts (simple civil claim, legal aid request), and Insurance (RCA damage notification, ASF complaint).
Filled examples — fictional but realistic completed versions of every template, so people can see what a finished document looks like before adapting it.
Official source monitoring — Romanian law changes. A system that monitors the Official Gazette (Monitorul Oficial) and automatically flags documents that may need updates would make this genuinely valuable as a maintained resource, not just a static dump.
npm and PyPI packages — the Julia package exists. Python and JavaScript developers deserve the same.
Multilingual — Romanian diaspora in Germany, Italy, France, and Spain sometimes needs Romanian documents explained in their working language. Partial EN/DE/IT/FR translations for the business and GDPR section would serve a real audience.
The Uncomfortable Disclaimer (But a Necessary One)
Every document in this library carries a clear warning:
These are educational templates and starting points. They do not constitute legal, tax, or notarial advice and do not replace verification by a lawyer, notary, tax consultant, or competent institution. Legislation can change; always verify official sources before use.
This is not boilerplate. It's real. A rental contract that's wrong in one clause can cost you months of legal dispute. A resignation letter missing the required preaviz period can cost you your salary. Use these as starting points, not final answers.
The Philosophy Behind It
The Romanian internet is full of people charging for things that should be free. Legal document templates fall into that category — the knowledge of how to write a standard rental contract is not proprietary. It's accumulated legal practice that belongs to everyone.
This repository is an attempt to build the cleanest, most organized, most accessible version of that shared knowledge. No ads. No upsells. No account required. Just the documents, the fields, and links to the laws they're based on.
If it helps one person send a correct resignation letter, or one landlord write a legally sound rental contract, or one consumer file an effective ANPC complaint — it was worth building.
Try It
Web generator (no install):
Drop index.html anywhere and open it in a browser. Or host it on GitHub Pages.
Julia package:
include("src/ActeJuridiceRomania.jl")
using .ActeJuridiceRomania
lista_categorii()
genereaza_document("munca", "demisie-cu-preaviz", Dict("DATA" => "20.06.2026", ...))
Run the Malbolge (for the brave):
# Save the interpreter from the .malbolge file comments as malbolge_interp.py
python malbolge_interp.py acte-juridice-romania.malbolge
# Output: Hello, World!
GitHub: acte-juridice-romania
Built by Ciprian Stefan Plesca. MIT License. Contributions welcome — especially corrections, new templates, and documented legislative updates.
Have you built something similar for your country? I'd genuinely like to know what approaches others have taken for making legal templates accessible. Drop it in the comments.
Top comments (0)