Document Drafting Studio
The Document Drafting Studio helps legal and professional teams assemble consistent, high-quality documents from a reusable clause library and structured templates. You author clauses once, compose templates with variables and conditional sections, then generate tailored DOCX drafts (with optional PDF preview) that land in your Files library for sharing and collaboration.
Getting Started
Open Drafting from the sidebar. The page has four tabs:
| Tab | Purpose |
|---|---|
| Document Types | Group templates and clauses by document family (e.g. SPA, NDA) and link each type to a knowledge collection |
| Clause Library | Author and maintain reusable clause text with variants |
| Templates | Build ordered section lists, variable schemas, and inclusion rules |
| Drafts | Fill variables, generate documents, preview, download, and finalize |
You need the document_drafting capability on your subscription and a selected stack before drafting resources load. Corporate tenants typically see this plugin when the feature is enabled on their plan.
How It Fits the Platform
Drafting reuses other platform capabilities:
- Knowledge — each document type can link to a data category (collection). When AI tailoring is enabled, the generator searches that collection for precedent language to adapt clauses to the client brief.
- Files — every generated draft is saved as a
.docxin the Drafts folder. The file is searchable, shareable, and can be ingested into knowledge like any other upload. - Documents — a content item is created automatically for the output file, so colleagues can collaborate on the finished draft.
- Cost Management — LLM tailoring consumes
llm_tokensquota, tracked as the Draft Generation action in usage analytics.
Document Types
Document types are the top-level taxonomy for your drafting library.
- Open the Document Types tab and click Add Document Type
- Enter a name and slug (the slug is auto-generated from the name unless you edit it)
- Optionally add a description
Later you can associate a document type with a knowledge collection and a house-style DOCX (a Word file that carries your firm's paragraph styles and numbering). House styles flow to templates and generated output.
Clause Library
Clauses are the reusable building blocks of your documents.
Creating a Clause
- Go to Clause Library and click New Clause
- Enter a title, key/slug, and document type (optional — leave blank for cross-type clauses)
- Write the clause body in the rich-text editor (headings, bold, lists, and
{{variable}}tokens are supported) - Add variants when you need alternate wordings (e.g. mutual vs one-way, pro-buyer vs pro-seller)
- Set status to Active when the clause is ready for templates
Variables in Clauses
Insert {{variable_name}} tokens in clause text. When a draft is generated, the platform substitutes values from the template's variable schema. Unresolved tokens appear as warnings in the generation result.
Filtering and Status
Filter the library by document type. Clauses can be Draft, Active, or Archived. Only active clauses should be referenced in production templates.
Templates
Templates define how clauses assemble into a finished document.
Create a Template
- Open Templates and click New Template
- Choose a document type, name, and slug
- Select the template in the left panel to edit its sections and variable schema
Sections
Each section maps to part of the output document:
- Attach a clause (and optionally pin a variant)
- Or write inline body text directly in the section
- Set a heading and heading style for DOCX output
- Define an include condition so the section appears only when variable values match a rule
- Mark sections as required or repeatable
Drag sections to reorder them. The order in the template is the order in the generated document.
Variable Schema
Use the Variable Schema editor to declare fields draft authors must fill in (key, label, type, required flag, default value, and optional grouping). The Drafts tab auto-builds a form from this schema when you compose a new draft.
Drafts — Composing and Generating
The Drafts tab is where template + variables become a deliverable file.
Create a Draft
- Click New Draft
- Enter a title and optional matter reference
- Select a template — the variable form appears from the template schema
- Fill in all required variables
- Paste the client request or brief into the request context field (used when AI tailoring is on)
- Toggle AI tailoring if you want the model to adapt clause language using RAG over the document type's knowledge collection
- Save the draft
Generate DOCX / PDF
- Click Generate on a saved draft
- A background task assembles sections, optionally tailors text, renders DOCX, and saves the file to Files → Drafts
- Track progress from the background-tasks indicator in the header
- When complete, use Preview for PDF preview or Download for the DOCX
Versions and Finalize
- Versions — each generation creates a version with resolved section text, token usage, and a link to the output file
- Finalize — mark a draft as finalized when it is ready for delivery; status moves from Drafting → In Review → Finalized
Permissions
| Permission | Typical use |
|---|---|
DRAFTING_READ | View document types, clauses, templates, and drafts |
DRAFTING_WRITE | Create and edit library content, templates, and drafts |
Template and clause management generally requires write access. Your tenant administrator assigns these through the standard permissions model.
Tips and Best Practices
- Start with one document type and a small clause set before building complex templates
- Use variants instead of duplicating clauses when only wording differs
- Test include conditions with sample variable values before rolling out a template firm-wide
- Upload a house-style DOCX so generated documents match firm formatting
- Keep AI tailoring off for boilerplate sections; enable it only where client-specific language adds value
- After generation, open Files → Drafts to share, ingest, or collaborate on the output
Troubleshooting
Drafting page shows "Select a stack"
Choose an active stack from the stack selector in the header. Drafting resources are stack-scoped.
Generate button does nothing or fails
Confirm the template has at least one section, required variables are filled, and your subscription has available LLM token quota if tailoring is enabled.
Formatting looks wrong in DOCX
Attach a house-style file at the document-type or template level. The renderer maps HTML clause bodies onto named styles from that file.
Generated file not in Files
Check the Drafts folder in the Files plugin. Generation runs asynchronously — wait for the background task to complete.
Related Documentation
Related Topics
⏱️ Read time: 16 minutes | 📊 Difficulty: intermediate | 🔄 Last updated: 2026-06-08