English | Deutsch
Open-source AI workflow for source-grounded legal first-look orientation under German law.
Note
AI / LLM Agent Discovery: A machine-readable summary is available in llms.txt (last checked: 2026-09-09).
Important
Important Notice / Wichtig: AI-assisted first-look legal orientation, no legal advice. This tool is not a law firm, not a hosted legal service, and not a replacement for an individual legal assessment by an admitted attorney-at-law. Whether a specific deployment constitutes a regulated legal service under the German Legal Services Act (Rechtsdienstleistungsgesetz, RDG) depends on operational model, operator role, and the individual case. There is no automated deadline monitoring and no guarantee of completeness or currency. If official, administrative, or judicial legal correspondence and running deadlines are involved, consult qualified legal counsel immediately.
- Overview
- System Architecture
- Workflow Lifecycle
- Governance & Runtime Invariants
- Legal Framework & RDG Classification
- Sibling Tools & Ecosystem
- Installation & Quickstart
- Adding New Statutes
- Data Privacy & Confidentiality
- Statute Registry Inventory
- Repository Layout
- Security Policy
- Provenance & Authorship
- License & Disclaimers
law-checker (Rechtsabteilung) is a modular skill and agent collective for local LLM developer environments such as Claude Code. It produces structured, documented first-look legal assessments grounded in German federal and European Union law.
The system enforces strict evidentiary discipline:
- Zero Hallucinated Citations: Every statutory assertion must be drawn directly from locally stored, official statute texts and cited down to the exact article or section, paragraph, and sentence (
§ 823 Abs. 1 BGB+ verbatim excerpt + source file/retrieval timestamp). Memory-based norm citations are rejected. - Embodiment Principle: A specialized generic agent ("You ARE the statute book") reads only the authentic statutory text — applying strict scope discipline (assessing applicability prior to application) and candidly flagging: "My statutory wording does not decide this; here judicial interpretation begins."
- Separate Jurisprudence Layer: Court decisions are never recalled from training memory. Case law is gathered strictly via live web verification (court, date, docket number, ECLI, and verified citation). Negative lookups are explicitly marked as "not identified".
- Risk Traffic Light & Escalation Matrix: Objective risk classification across Low, Medium, High, and Critical tiers, complemented by a legal specialization routing matrix and strict deadline discipline for incoming legal mail.
The architecture separates orchestration, authentic statutory sources, judicial interpretation, and report generation into clean modular layers:
flowchart TD
User["User Legal Query"] --> Skill["SKILL.md Orchestrator"]
Skill --> Config["config.json Statute Registry"]
Config --> Fetcher["_tools/gesetze_fetch.py"]
Fetcher --> OfficialSources["Official Sources (gesetze-im-internet.de / EUR-Lex)"]
OfficialSources --> LocalData["Local Statute Data Files (_data/gesetze/)"]
LocalData --> Embodiment["agents/gesetzbuch.md (Statute Agent)"]
Skill --> WebCaseLaw["Web-Verified Case Law Layer"]
Embodiment --> ReportFormat["references/berichtsformat.md"]
WebCaseLaw --> ReportFormat
ReportFormat --> Assessment["First-Look Assessment & Risk Matrix (_gutachten/)"]
Assessment --> Escalation["references/eskalation_risiko.md (Lawyer Referral)"]
The 10-step assessment lifecycle defined in SKILL.md ensures every legal orientation is reproducible, disciplined, and transparent:
sequenceDiagram
autonumber
actor User as "User / Practitioner"
participant Skill as "SKILL.md (Orchestrator)"
participant Config as "config.json (Registry)"
participant Fetcher as "_tools/gesetze_fetch.py"
participant Agent as "agents/gesetzbuch.md"
participant Web as "Case Law Layer (Web)"
participant Reporter as "references/berichtsformat.md"
participant Reviewer as "Review Model (Optional)"
User->>Skill: Legal Query / Case Facts (Step 2: auftrag_klaeren)
Note over Skill: Step 2: Immediate Deadline Check on Incoming Mail
Skill->>Config: Step 0 & 4: Load Active Statutes & Settings
Config-->>Skill: Enabled Statutes & Source Files
opt Missing or Outdated Statute Text
Skill->>Fetcher: Fetch Official Law XML (gesetze-im-internet.de)
Fetcher-->>Skill: Local Text File (_data/gesetze/)
end
loop For Each Relevant Statute (Step 5: verkoerperungs_runde)
Skill->>Agent: Embody Statute (Strict Wording Bound)
Agent-->>Skill: Structured Raw Findings (Norm, Para, Sentence)
end
Skill->>Web: Step 6: Query Web-Verified Rulings (Court, Date, Az, ECLI)
Web-->>Skill: Verified Case Law (or explicitly "not found")
Skill->>Skill: Step 7 & 8: Subsumption & Risk Score (Green/Yellow/Orange/Red)
opt Substantial Assessment (Step 10: review_optional)
Skill->>Reviewer: Adversarial Second-Opinion Review
Reviewer-->>Skill: Objections / Validation Findings
end
Skill->>Reporter: Step 9: Render 6-Section Assessment
Reporter-->>User: Structured Gutachten (_gutachten/YYYY-MM-DD_<slug>.md)
The tool guarantees 10 immutable architectural and runtime invariants:
| # | Invariant | Description | Enforcement Mechanism |
|---|---|---|---|
| 1 | 100% Local-First & Zero-Egress | Statute retrieval and report generation execute locally; zero telemetry, tracking, or automated data egress. | .gitignore strictly ignores _gutachten/, _data/gesetze/, and config.local.json. |
| 2 | Strict Source Grounding | Statutory statements must cite exact norm articles/sections, paragraphs, sentences, and quotes from local texts. | agents/gesetzbuch.md and references/berichtsformat.md reject memory-recalled statutes. |
| 3 | Web-Verified Jurisprudence | Court decisions require court, date, docket number, and ECLI; unverified rulings are recorded as "not found". | SKILL.md Step 6 disallows citing case law from LLM parameters. |
| 4 | Non-Advisory Self-Use Boundary | Strict legal demarcation under § 2 Abs. 1 RDG; orientation only, creating no attorney-client relationship. | Prominent notices in README.md, SKILL.md, and Section 5 of every generated report. |
| 5 | Strict Deadline Discipline | Incoming legal notices or administrative mail mandate an immediate deadline check prior to substantive analysis. | references/eskalation_risiko.md prioritizes statutory and court deadlines. |
| 6 | Statute Registry Versioning | Statute additions and state modifications are deliberate, versioned configuration events. | Schema version counter in config.json with corresponding changelog entries. |
| 7 | Non-Elevation & User-Mode Safety | Runs under standard unprivileged user accounts with no administrative elevation (RunAsInvoker). |
Pure Python 3 standard library and CLI invocation without system-level hooks. |
| 8 | Deterministic Risk Scoring | Maps legal findings to an objective 4-level traffic light (Low, Medium, High, Critical) with specialty routing. | Fixed evaluation matrix in references/eskalation_risiko.md. |
| 9 | Multi-OS CI Matrix & Concurrency | Tested across Ubuntu, Windows, and macOS with concurrent run cancellation (cancel-in-progress: true). |
GitHub Actions workflow (.github/workflows/ci.yml) on Python 3.10 through 3.13. |
| 10 | Bilingual Documentation Parity | Full structural, conceptual, and navigation parity across English and German documentation. | Automated contract verification in tests/test_metadata.py. |
This tool is designed exclusively for locally operated self-use: You apply it within your own LLM environment to your own questions and factual matters. There is no hosted platform, no client intake, no legal advisory support, and no deadline management by the authors.
Assessment under the German Legal Services Act (Rechtsdienstleistungsgesetz, RDG — project self-evaluation, as of 2026-07-11):
| Deployment Mode | Legal Classification |
|---|---|
| Use for own factual matters | Not a legal service (no "matter of another party", § 2 Abs. 1 RDG). |
| Publication / distribution of software | Not a legal service (generic instrument, not handling an individual case; cf. BGH, 09.09.2021 — I ZR 113/20 "Smartlaw" — applicable by analogy depending on design). |
| Deployment to evaluate cases for third parties | May constitute a regulated legal service (§ 2 Abs. 1 RDG is tool-neutral) — commercial provision requires an official license (§ 3 RDG); gratuitous service imposes statutory requirements (§ 6 Abs. 2 RDG). This is expressly outside the intended purpose of this project. |
Any entity modifying the operational structure (hosting, providing services, or handling matters for third parties) must re-evaluate legal compliance independently.
EU AI Act self-classification: see docs/ai-act-note.md.
law-checker operates in harmony with sibling tools across the ellmos-ai developer ecosystem and umbrella organization open-bricks:
| Project | Role / Integration | Repository |
|---|---|---|
ellmos-ai |
Core AI infrastructure organization and MCP server collective | ellmos-ai |
open-bricks |
Umbrella open-source developer tooling and desktop ecosystem | open-bricks |
policy-registry |
Cross-agent governance policy management and signed delegation authority | policy-registry |
anonymizer |
Fail-closed document pseudonymization library for privacy-first pre-processing | anonymizer |
lock-master |
Multi-agent concurrency coordination and project locking system | lock-master |
automation-master |
Event-sourced credit and reservation management for autonomous background agents | automation-master |
system-gap-master |
Multi-agent gap detection, policy enforcement, and repository hygiene auditing | system-gap-master |
companion-for-agy |
Headless CLI runner, PTY lifecycle supervision, and diagnostic session recording | companion-for-agy |
gardener |
Ephemeral, sandboxed tool runner and local SQLite knowledgebase repository | gardener |
marblerun |
Multi-agent turn-based tactical orchestration and worker handoff engine | marblerun |
report-forge |
Domain-neutral core engine for formatted report generation pipelines | report-forge |
steuer-assistent |
Standalone tool for self-application tax expense documentation and orientation | steuer-assistent |
git clone https://github.com/ellmos-ai/law-checker.git
cd law-checker
# Install editable package (requires Python >=3.10)
pip install -e .Statute texts are retrieved directly from official repositories and stored locally:
# List all registered and active statutes
PYTHONIOENCODING=utf-8 python _tools/gesetze_fetch.py --list
# Download and parse all enabled federal statutes
PYTHONIOENCODING=utf-8 python _tools/gesetze_fetch.py# Copy skill orchestrator and embodiment agent into your Claude environment
cp SKILL.md ~/.claude/skills/rechtsabteilung/SKILL.md
cp agents/gesetzbuch.md ~/.claude/agents/gesetzbuch.mdIn ~/.claude/skills/rechtsabteilung/SKILL.md, set <MODUL> to the absolute path of your local clone.
Invoke in Claude Code:
/rechtsabteilung Is an imprint (Impressum) legally mandatory for purely personal open-source repositories on GitHub?
Expanding the statute catalog does not require modifying agent code:
- Add Entry to
config.json: Define a new key undergesetzbuecher(specifyingname,kurz,zitierweise,quelle, andxml_zipfor federal law). - Fetch Official Text:
PYTHONIOENCODING=utf-8 python _tools/gesetze_fetch.py <key>
- Increment Version: Bump the
versionfield inconfig.jsonand record the change in the changelog.
Note on EU and State Laws: For legislation without XML endpoints on gesetze-im-internet.de (e.g., GDPR or Interstate Media Treaty), save the official text as a UTF-8 file in _data/gesetze/ with source URL and retrieval timestamp in the file header.
Legal inquiries frequently involve sensitive personal data, business secrets, or privileged correspondence. Adhere to these principles:
- Data Minimization First: Redact or pseudonymize names, addresses, docket numbers, and identifiable business details before prompting. Consider using
anonymizerfor automated pre-processing. - Cloud LLM Exposure: Prompts sent to cloud models are processed by the respective provider. Never enter unredacted confidential legal mail, trade secrets, or medical data into third-party LLMs without appropriate data processing agreements.
- Zero Data Egress in Local Tooling: The tool operates entirely offline on your workstation. Statute downloads and generated assessments stay in
_data/gesetze/and_gutachten/; nothing is transmitted to the authors. - Never Post Case Facts to Public Issues: For GitHub issues or bug reports, use purely hypothetical, fabricated factual examples.
For further information, review SECURITY.md.
The default statute registry (config.json, version 5) configures 13 statutes across German federal and EU law:
| Key | Statute Name | Jurisdiction | Status | Primary Source |
|---|---|---|---|---|
gg |
Grundgesetz für die Bundesrepublik Deutschland (Basic Law) | Federal (DE) | Active | gesetze-im-internet.de |
bgb |
Bürgerliches Gesetzbuch (Civil Code) | Federal (DE) | Active | gesetze-im-internet.de |
sgb5 |
Sozialgesetzbuch V (Social Code Book V — Statutory Health Insurance) | Federal (DE) | Active | gesetze-im-internet.de |
urhg |
Urheberrechtsgesetz (Copyright Act) | Federal (DE) | Active | gesetze-im-internet.de |
rdg |
Rechtsdienstleistungsgesetz (Legal Services Act) | Federal (DE) | Active | gesetze-im-internet.de |
markeng |
Markengesetz (Trade Mark Act) | Federal (DE) | Active | gesetze-im-internet.de |
stberg |
Steuerberatungsgesetz (Tax Advisory Act) | Federal (DE) | Active | gesetze-im-internet.de |
uwg |
Gesetz gegen den unlauteren Wettbewerb (Unfair Competition Act) | Federal (DE) | Active | gesetze-im-internet.de |
dsgvo |
General Data Protection Regulation (Regulation (EU) 2016/679) | European Union | Active | EUR-Lex |
ehds |
European Health Data Space (Regulation (EU) 2025/327) | European Union | Active | EUR-Lex |
grch |
Charter of Fundamental Rights of the European Union | European Union | Active | EUR-Lex |
stgb |
Strafgesetzbuch (Criminal Code) | Federal (DE) | Inactive | gesetze-im-internet.de |
mstv |
Medienstaatsvertrag (Interstate Media Treaty) | State Laws (DE) | Inactive | die-medienanstalten.de |
law-checker/
├── .github/workflows/ci.yml ← Multi-OS CI matrix (Ubuntu, Windows, macOS)
├── SKILL.md ← Orchestrating skill workflow (10-step process)
├── config.json ← Statute registry and pipeline definition (v5)
├── agents/
│ └── gesetzbuch.md ← Generic statute embodiment agent prompt
├── references/
│ ├── berichtsformat.md ← 6-section legal report schema & citation rules
│ └── eskalation_risiko.md ← Risk traffic light, deadline check, lawyer matrix
├── _tools/
│ ├── __init__.py ← Python package marker
│ └── gesetze_fetch.py ← Statute fetcher and XML parser
├── docs/
│ └── ai-act-note.md ← EU AI Act self-classification note
├── tests/
│ ├── test_gesetze_fetch.py ← Unit tests for statute fetching & extraction
│ └── test_metadata.py ← Automated contract and metadata parity tests
├── CHANGELOG.md ← Version and release history
├── SECURITY.md ← Security policy with 48h response SLA
├── MARKETING-LOG.txt ← Local marketing & discoverability backlog
├── llms.txt ← Machine-readable context for AI coding agents
├── ellmos-module.v2.json ← Standardized module manifest (rechtsabteilung)
├── pyproject.toml ← PEP 621 package metadata & test configuration
├── _data/gesetze/ ← Downloaded statute files (ignored via .gitignore)
└── _gutachten/ ← Generated legal assessments (ignored via .gitignore)
Security, confidentiality, and data safety are foundational. Vulnerabilities may be reported privately through:
- GitHub Security Advisories
- Direct Security Contacts:
security@ellmos.ai|security@open-bricks.org|support@lukasgeiger.com|lukas@open-bricks.org
Commitments: Acknowledgment within 48 hours; initial triage and impact assessment within 5 business days. Full details are documented in SECURITY.md.
This project synthesizes three proven operational building blocks:
- Editorial Legal Policy: Standardized report templates, 4-tier objective risk scoring, specialty attorney matching, and uncompromising deadline discipline.
- Living Constitution Research Prototype: The statute embodiment paradigm (
Du BIST das Gesetzbuch) enforcing strict fidelity to enacted legal text and distinct judicial interpretation layers. - Jurisprudential Knowledge Base: Structured taxonomy of German law domains and traditional legal methodology (Gutachtenstil).
The first complete evaluation executed by this workflow was its own public release audit — including an adversarial review by an independent secondary LLM.
- License: Released under the MIT License covering source code, agent prompts, and documentation.
- Warranty Disclaimer: Provided "as is" without warranty of any kind regarding accuracy, completeness, or timeliness. Legal texts change over time; always verify against the official federal gazette (Bundesgesetzblatt) before relying on them.
- No Legal Advice: This software facilitates initial orientation and research only. It does not provide legal advice or create an attorney-client relationship.
