The LegalWork Atlas LegalWork's documentation, bound to the code it describes
17 documents

The LegalWork Atlas

LegalWork's documentation, bound to the code it describes

Journeys

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.

  • AGENTS.md Before writing any code or opening a PR — these are the house rules a change is judged against.
  • LegalWork First contact with the repo — what the product is, what it does, and how to get it running locally.

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.

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).