# Document Drafting
> Source: https://legalcode.md/use-cases/document-drafting | [HTML version](https://legalcode.md/use-cases/document-drafting)

Draft legal documents grounded in current law — from your local files, not a cloud editor.

Legal drafting is only as good as the law it reflects. Legalcode's document drafting skill gives your agent access to current statutory frameworks, regulatory requirements, and case law when drafting contracts, pleadings, motions, and correspondence — so the first draft is substantively grounded, not just stylistically fluent.

## How It Works

1. **Specify the document context locally** -- Tell the agent what you need drafted, the governing jurisdiction, and the relevant facts. Load any reference documents — precedents, templates, counterparty drafts — from your local files. Your instructions and source materials stay on your device.

2. **Legal framework retrieved** -- The skill retrieves the applicable statutory and regulatory framework for the document type — court procedural rules for pleadings, legislation for contract compliance clauses, guidance for regulatory submissions.

3. **First draft produced** -- A structured first draft is produced, with provisions linked to the applicable legal basis and flagged where legal requirements affect the language.

4. **Iterate and refine** -- Ask the agent to adjust language, add provisions, align with counterparty redlines, or check a specific clause against the applicable law — each iteration grounded in live legal data, working alongside your local files.

## Outputs

- Structured first draft in the required format
- Provision-level legal basis annotations
- Compliance checklist against applicable mandatory requirements
- Alternative clause language options for key provisions
- Court filing format compliance check (for pleadings and motions)

## Jurisdictions

US, UK, EU, CA, AU, NZ, SG, IE, DE, FR, HK

## FAQ

### Can I draft from my local templates and precedent bank?

Yes — that's how it's designed. Your AI agent reads your local templates, precedent agreements, and style guides, then uses Legalcode for the current legal framework. Your proprietary materials stay on your device, and you get drafts grounded in current law rather than stale training data.

### What types of legal documents can the skill draft?

The skill covers commercial contracts, NDAs, employment agreements, terms and conditions, privacy policies, pleadings and motions (with court-specific formatting), demand letters, regulatory submissions, and board resolutions.

### Does the skill check court-specific formatting rules for pleadings?

Yes. For US federal and state courts, and for UK courts (CPR-compliant), the skill checks the draft against the applicable procedural rules and flags formatting, page limit, or content requirement issues.

### How is this different from document drafting in a web-based legal AI tool?

Web-based tools require you to draft inside their platform, upload your instructions, and store your work product on their servers. With Legalcode, you draft in your own environment — your editor, your file system, your tools — and the agent queries only the legal framework. Your work product stays local.

---
*Legalcode -- legalcode.md*
