The LegalWork Atlas
LegalWork's documentation, bound to the code it describes
Journeys
Orient: what LegalWork is and how it's built
The fastest path from "never seen this repo" to knowing what the product does, the rules you build under, and how the UI is structured.
3 stops →The legal-document engine
LegalWork's actual legal work is defined as firm-owned agent prompts, not app code. This path walks the two flagship workflows — Word redlining and tabular review — from the user command down to the read-only subagents that do the work.
5 stops →Run it headless: the services
How to stand LegalWork up without the desktop shell — the orchestrator that supervises everything, the workspace API it fronts, and the chat bridge.
3 stops →Extend it: skills, UI, and computer use
The seams LegalWork is meant to be extended through — authoring new skills, the shared UI primitives, and the native automation runtime — ending in real code.
3 stops →Getting Started
Start here. The repo's front-door README (what LegalWork is and how to run it) and AGENTS.md (the contributor contract: pnpm-only, no `any`, smallest possible diff, run the checks before a PR). Read both before touching code.
App Architecture
How the desktop/web UI in `apps/app` is laid out: the enforced split between a React-free `src/app/` layer and the `src/react-app/` shell, the provider stack, route-as-state-of-truth workspace/session model, and the madge-checked dependency rules that keep it acyclic.
- App Architecture (`src/react-app/` + `src/app/`) Before adding or moving anything in `apps/app` — it tells you which layer a file belongs in and which imports are forbidden.
Services & CLIs
The three runnable backends that make up host mode without the desktop shell: `legalwork-server` (the filesystem-backed workspace API), `legalwork-orchestrator` (the CLI that boots opencode + server + router together), and `opencode-router` (the Slack/Telegram bridge). Each ships as a compiled binary and is documented by its own README.
- LegalWork Orchestrator When running LegalWork headless/host mode from the terminal, or debugging sidecar resolution, sandboxing, or pairing.
- LegalWork Server When integrating a client against the server, or wiring/securing a remote workspace — this is the API contract and its auth scopes.
- opencode-router When exposing an opencode/LegalWork workspace through Slack or Telegram, or configuring per-identity channel→directory routing.
Shared Packages
Reusable libraries the apps consume from the pnpm workspace: `@legalwork/handsfree` (the native macOS computer-use runtime) and `@legalwork/ui` (shared React primitives, currently the seeded Paper shader gradients). Source-only exports, no build step for consumers.
- @legalwork/ui When building UI shared across `apps/app` and other consumers, or using the seeded Paper gradient components.
- LegalWork Computer Use When working on macOS computer-use/automation, or wiring the handsfree runtime in as an MCP adapter.
Agent Skills & Commands
The firm-owned agent layer seeded into every workspace's `.opencode/`: the legal-document workflows (docx reading/redlining, tabular review) plus their subagents and slash commands, and the meta-skills for authoring new skills and trying the built-in browser. This is where LegalWork's actual legal work is defined as prompts, not application code.
- browser-setup When verifying the in-app browser automation works, or as a minimal example of a LegalWork command prompt.
- document-extractor When tuning extraction quality or the per-document JSON contract behind the review grid.
- docx-redliner When changing how full-document redline plans are generated, or the comment/ proposal JSON contract the docx engine applies.
- edit-docx When you want the one-line invocation for "redline this contract" rather than the full skill mechanics.
- Skill Creator When creating a new skill for a LegalWork workspace and you want the structure, trigger-phrase rules, and reload-banner convention.
- Tabular Review When building or running multi-document review/diligence grids, or extending the doctype-skill column conventions.
- Word (.docx) reading + editing When implementing or invoking Word document review/editing — the tool contract and the verb-to-action rules.
Project & Legal
The non-code contract around the product: the security disclosure policy and the full Terms & Conditions (local-first data handling, BYO-model licensing, no-legal-advice and liability terms from Eigenwelt Labs).
- LegalWork — Terms & Conditions When you need the legal terms of use — data handling, licensing, liability, and the no-legal-advice position.
- Security Policy When reporting or triaging a security vulnerability.