dream-num/dsh-univer-office/univer-doc
- community
Checking that the SKILL.md file is still in the repository.
Read, create, edit, paginate, chart, inspect, export, and review Univer Doc Units through DSH tools and the Lite Interface. Use proactively for paragraphs, rich text, lists, tasks, tables, images, charts, headers, footers, page layout, Traditional or Modern documents, docx import/export, and any Doc Unit task.
Install
npx vskill@latest install dream-num/dsh-univer-office/univer-docSKILL.md
Univer Doc Units
Load univer first. univer_execute provides univerAPI, api (the same object), and doc (the FDocument selected by unitId). Do not redeclare them. A Doc Unit does not provide workbook or presentation; if one appears undefined, verify the selected Unit type.
Select paragraphs with doc.getParagraphs() and doc.getParagraph(paragraphId). Resolve exact signatures and enums with univer_api; do not guess or use Doc model internals.
Model essentials
- A new Doc starts with one empty paragraph. Usually update it with
setTextor append withdoc.appendParagraph(text). - Paragraph editing methods live on
doc:appendParagraph,insertParagraph,insertText, anddeleteRange. - Paragraph IDs are stable across multi-step edits; indexes drift as content changes.
FDocumentParagraphsupportsgetText,setText,appendText,setStyle, andgetRange.- Lists and task helpers include
isListItem,isTask, andsetTaskChecked. - Native charts use the direct
doc.newChart(),doc.insertChart(),doc.getCharts(), and
doc.getChart() methods.
- Colors must use
#RRGGBB. Docs do not support formulas or recalculation.
Data stream
The body is one dataStream string. Paragraphs are separated by \r, and the document ends with \r\n. body.paragraphs[i].startIndex identifies the terminating \r; offsets passed to insertText, deleteRange, and text-style operations address this stream. Preserve paragraph terminators.
Paragraph and text styles
Pass paragraph properties and textStyle together to paragraph.setStyle when the entire paragraph shares one style. Query IParagraphStyle rather than guessing enum values.
Important paragraph fields include horizontalAlign, namedStyleType, headingId, indentStart, and indentFirstLine. Text style uses compact fields such as bl, it, cl: { rgb }, and bg: { rgb }. Later style writes can replace earlier fields, so merge base font family, size, spacing, and color with local overlays deliberately.
Native images
Use a stable Base64 data URI for local reproducible authoring. In the headless authoring runtime, always provide both width and height. Set wrapping explicitly and use a body range rather than a transient selection.
Use INLINE for normal content, WRAP_SQUARE or WRAP_TOP_AND_BOTTOM when text should reflow, and reserve BEHIND_TEXT / IN_FRONT_OF_TEXT for intentional overlays. Never persist temporary signed URLs, install global image polyfills, or write drawing storage directly. Verify doc.getImages() and docx export when requested.
Document flavor and pagination
Check doc.getDocumentFlavor() or doc.isTraditional() before page-specific work. A new Doc is Modern and pageless. Traditional section/page APIs reject Modern Docs; do not simulate pages with large spacers.
univer_import imports .docx as Traditional by default so page size, orientation, margins, and headers/footers survive export. Pass docType: "modern" only when the user asks for a pageless document or the source has no page layout worth keeping: modern rewrites page geometry to a fixed layout and the source page setup cannot be recovered.
For a Traditional Doc, insert a hard page boundary with one atomic section command:
Use section.getEffectivePageSetup() for resolved geometry. keepNext, keepLines, and widowControl improve natural pagination but do not create hard breaks.
Tables and layout
For fixed columns in a Traditional Doc, prefer a borderless layout table. Real data tables must define column widths, header rows, merges, and borders explicitly.
Constrain cell-local paragraph edits with table.getCellContentRange(row, column) and confirm the target text. Do not search duplicate text globally and broadcast a mutation. The public Facade has no verified dynamic current-page field, table-cell padding mutation, or cell vertical-alignment mutation; report these gaps instead of faking them.
Native charts
Create detached chart information directly from doc, then insert it to obtain a live FDocumentChart. Query FDocument.newChart, FDocument.insertChart, FDocument.getCharts, FDocument.getChart, FDocumentChartBuilderOf, and DocsChartInsertAnchorKind before authoring.
doc.getCharts() and doc.getChart(id) return live charts. Await chart.setDataSource(values) for data changes. For a complete replacement, use chart.toBuilder().build() and await chart.update(info). Remove it with await chart.remove() and check the boolean. Await every asynchronous mutation before execution returns. Verify in a fresh read-only execution with doc.getCharts().map((item) => ({ id: item.getId(), drawingId: item.getDrawingId(), type: item.getType(), info: item.getInfo() })).
Inspect and verify
After each mutation:
- Call
univer_inspectfor the document overview and relevant paragraph/range when supported. - Use a fresh read-only
univer_executeto confirm full paragraph text/order, stable IDs, styles, lists/tasks, table dimensions, image identities, chart descriptions, document flavor, section breaks, headers, footers, and page setup required by the task. - Call
univer_screenshotwith the DocunitId, selected worktree or trunk, and an explicit workspaceoutputdirectory. Inspect every returned page PNG for wrapping, physical pagination, image placement, and layout failures. Logical inspection alone cannot prove these facts. - If
.docxdelivery is requested, calluniver_exportonly after structural readback succeeds. - Follow the
univerready/status handoff workflow.
compile-typst is not available in this plugin. Do not reproduce it with unrelated converters.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/univer-doc/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dream-num/dsh-univer-office/univer-doc)