Documents

AI-Powered Editing

Generate and refine documents and diagrams with AI that understands selection boundaries — only the part you choose gets edited, everything else stays untouched.

Precision Editing, Not Wholesale Rewriting

Most AI editing tools rewrite your entire document or file. Stable Baseline works differently. The AI operates on exactly the scope you define — whether that's a single sentence, a paragraph, a section, or an entire diagram. Everything outside your selection is completely preserved.

The golden rule: If you didn't select it, the AI won't touch it. Your surrounding content, formatting, diagram relationships, and document structure remain exactly as they were.

Document AI

Generate from Scratch

Start a new document and describe what you want. The AI generates a complete CDMD document with proper structure — headings, sections, callout panels, tables, and relevant content. You can generate entire design docs, runbooks, or API guides in seconds, then refine from there.

Edit Selected Text

Highlight any portion of your document and invoke the AI with a natural language instruction:

"Make this more concise"

Selected paragraph → rewrites only those lines

"Add error handling steps"

Selected procedure → adds steps within that section only

"Convert to a table"

Selected bullet list → replaces with a formatted table

"Translate to formal tone"

Selected text → rephrases without touching the rest

"Add a warning callout about rate limits"

Cursor position → inserts a callout panel at that spot

How It Works Under the Hood

1

Selection capture

The editor captures the exact line range of your selection and the surrounding context.

2

Scoped prompt

Your instruction is sent to the AI along with only the selected content and enough context to understand the document structure. The full document is not sent for rewriting.

3

Surgical replacement

The AI output replaces only the selected lines. Everything before and after remains byte-for-byte identical.

4

Version saved

A new version is created with a change summary describing what the AI did, so you can always revert.

Diagram AI

Diagrams are first-class objects in Stable Baseline — each diagram has its own DSL code, renderer type, and metadata. The AI treats them as independent components that can be generated and modified without affecting anything else in the document.

Generate Diagrams from Description

Describe what you want in plain English and the AI generates the correct DSL for any of the 37 supported diagram types. It automatically selects the right renderer based on your description:

"Draw a sequence diagram of the OAuth 2.1 flow"

Generates Mermaid sequenceDiagram DSL

"Create a C4 container diagram for our microservices"

Generates Structurizr or PlantUML C4 DSL

"Show the order-to-cash BPMN process"

Generates BPMN XML with lanes, tasks, and gateways

"Draw a network topology with a load balancer, 3 app servers, and a database cluster"

Generates D2 or NwDiag DSL with proper icons

"Create an ERD for users, roles, and permissions"

Generates DBML or Mermaid ER diagram DSL

Edit Existing Diagrams

Click on any diagram to select it, then use AI to modify it. The AI reads the existing DSL code, understands the diagram structure, and applies only the changes you request:

"Add a cache layer between the API and database"

Adds a new node and connections — existing nodes and relationships untouched.

"Color the critical path in red"

Adds styling to specific elements — all other styling preserved.

"Rename the UserService to AuthService"

Updates the label and references — layout and connections unchanged.

"Add error handling branches to the payment flow"

Adds new BPMN gateways and paths — existing process flow preserved.

Component isolation: Each diagram in a document is stored as an independent component with its own DSL code. When you edit a diagram, only that diagram's code is modified. Other diagrams, text, images, and formatting in the same document are completely unaffected — even if the document contains dozens of diagrams.

What the AI Preserves

To be explicit — here is what remains untouched when you use AI editing on a selection or diagram:

All text outside the selection
Document title and frontmatter
Other diagrams in the document
Image embeds and captions
Heading hierarchy and structure
Code blocks outside the selection
Callout panels you didn't select
Table formatting and data
Version history (new version added)
Diagram positions and ordering

Getting the Best Results

Be specific with your selection

Select exactly the content you want changed. A tighter selection gives the AI clearer boundaries and produces more precise edits.

Give clear instructions

Instead of "make this better", try "rewrite this paragraph to focus on security implications" or "add error codes to this table".

Iterate in small steps

Make one AI edit at a time. Review the result, then make another. This keeps changes traceable in version history and easy to revert if needed.

Use generation for first drafts

AI generation is excellent for scaffolding — creating the initial structure of a document or diagram. Then refine with targeted AI edits and manual polishing.

Let the AI pick the diagram type

When generating diagrams, describe what you want conceptually. The AI will choose the most appropriate renderer and DSL from the 37 supported types.

Next Steps