Legal

Legal prepares complete document proposals from project evidence and confirmed facts. You review exact content and resolve material gaps before approving writing and committing together.

Flow

Workflow diagram for Legal
View full-size diagram

Start the command

Start on clean main or master. Git and ownership eligibility are checked before discovery, and existing assessment records are validated before substantive source/document review. Legal reviews the source and existing documents before proposing work; a command invocation is not a declaration that every legal document is required.

Legal commits need your exact content and commit approval, even when local auto-commit is enabled. Drafting, owner approval and publication remain separate results.

A Git, ownership, path or state-validation blocker ends the run before further investigation or proposals. Missing facts for an individual document remain distinct from those workflow prerequisites. An unanswered workflow question pauses the run; it does not authorize independent investigation while you decide.

Prepare the useful documents

The agent checks the service, data flows, integrations and existing policies. An ordinary review assesses all six supported document types and relevant existing files within scope, including documents that may already be adequate. The preview then focuses on affected files, labelled Create, Update or Remove, with their paths and reasons. It does not print a status table for every type or list every unchanged document.

Held documents, essential unknowns, material coverage gaps and important reasons not to create a suggested document receive a brief note. Uninspected or unreadable material remains distinct from missing or assessed-not-needed. When no document change is needed, the result states that and its actual scope and limits directly.

Privacy, cookie and relevant disclaimer drafts follow evidenced processing and content. Terms, refunds and EULAs require your request or an existing approved policy. Requested exclusions remain out of scope; the workflow does not generate a standard bundle just to fill a checklist.

For example, browser storage already explained clearly in a privacy notice may not justify a separate cookie document. A new payment flow, however, can raise questions that source code alone cannot answer.

Draft from confirmed facts

Existing approved clauses, document locations and language provide the baseline. The agent asks essential missing questions together. There is no routine home-address intake, and uncertain retention periods, refund promises or jurisdictions are not invented.

The default review uses local and supplied evidence without researching provider policies, legal sources or store requirements online. You can request that research for a named issue; a generic legal invocation does not authorize it. If external evidence is indispensable, the agent explains the missing scope or leaves the affected conclusion pending. Offline drafting does not establish current legal or store compliance.

A concrete material omission holds the affected draft until it can be resolved. Other complete documents may proceed. This differs from declaring an entire project legally insufficient when no such assessment was made.

Legal traces each existing page to its editable source and keeps that format and URL. For a new page, it prefers Markdown and uses the site’s existing renderer to produce HTML. An existing HTML template covers sites that publish HTML directly. A project without a web publishing path gets a Markdown document and a note about the work needed to put it online.

For example, a privacy notice linked from a docs site’s footer belongs in the normal page layout. The notice fills the main content area, with the site’s header, footer and sidebar around it. A notice meant to be shared directly from a portfolio can use a simpler page in the same theme, with ← Back to portfolio above the title. Either layout can be opened at its own URL. A clear title, section headings and readable line width help visitors find what they need.

Shared components keep the legal page’s header, footer and navigation in step with the rest of the site. A back link lines up with the document content, with consistent space before the title across legal pages. Its colors and interaction states follow the site. If it uses an underline, the line stays beneath the text label rather than extending under the arrow.

Longer documents can benefit from an “On this page” menu. On desktop, it starts alongside the back link, or the title when there is no back link, and keeps the current section visible as you scroll. A short viewport must still let you reach every menu item; narrow screens can use a compact or collapsible menu. The current item follows the site’s hover treatment while retaining a clear location cue, such as an existing section marker. Keyboard focus remains visible separately. This does not impose one palette, background highlight or sidebar on every project, and short documents may need only headings.

The preview shows the source path, intended URL and layout. If you request a route, layout or navigation change, you’ll see the exact supporting file changes in the same review. Legal checks the rendered page with the site’s local build or preview when available, including affected back links and section navigation across screen sizes, themes and keyboard use. Existing pages keep their layout unless you request a change. Consent changes and publication have their own scope.

Review before writing

The proposal stays in conversation while existing documents remain intact. For each existing file, you see a diff with literal additions and removals, followed by a Proposed result after approval preview of affected passages. Each new document appears once in full, without a duplicate additions-only diff. Dates, metadata and protected clauses are included in the review. Proposed deletions show exactly what would disappear and explain their dependency effects.

Choose Write and commit or Cancel after the exact content, paths, record changes and commit subject are visible. One approval covers those writes and the commit, even with auto-commit enabled; successful readback and required checks still come first. It grants no publication authority. A failed write or check leaves the actual work recoverable and stops dependent actions.

You can type exact selections, corrections or replacement wording. Only affected previews and missing approval need refreshing; the command does not automatically restart its scan or rewrite unrelated clauses. You can also request write without committing for the shown content. Those files become uncommitted drafts with proposed dates, while removal candidates stay intact and assessment provenance does not advance.

Cancel leaves pending document proposals unapplied. It preserves any earlier specifically approved work or verified record-path repairs, without a separate metadata commit. Files are linked after approved writes so you can continue reviewing them in your editor.

Your result

You receive file links, unresolved facts and the actual draft or commit status on the same branch. The saved assessment advances only for approved substantive document changes, not cosmetic edits or an unrelated source update.

A confirmed document move can be reconciled in the saved record without deleting files or claiming a new legal assessment. Uncertain locations need clarification. Use ship separately when the reviewed work is ready for publication.

Explore the source

For implementation details, read guides/legal.md.