dream-num/dsh-univer-office/univer-sheet
- community
Checking that the SKILL.md file is still in the repository.
Read, write, format, calculate, and verify Univer Sheet Units through DSH tools and the Lite Interface. Use proactively for spreadsheet values, formulas, ranges, tables, charts, images, formatting, validation, filters, pivots, rich text, xlsx/csv/tsv import or export, and any Sheet Unit task.
Install
npx vskill@latest install dream-num/dsh-univer-office/univer-sheetSKILL.md
Univer Sheet Units
Load univer first. univer_execute provides univerAPI, api (the same object), and workbook (the FWorkbook selected by unitId). Do not redeclare them. Execution is ESM and has no require.
Obtain a worksheet with workbook.getActiveSheet() or workbook.getSheetByName("…"). Use getSheetName(); FWorksheet has no getName(). Resolve unfamiliar APIs with univer_api before writing code.
Cell model: v, t, f, and number formats
A cell is structured data: { v, t, f?, s? }.
| Field | Meaning | |
|---|---|---|
v | Stored value used for calculation, comparison, and writeback. | |
t | Type: 1 text, 2 number, 3 boolean, 4 forced text. | |
f | Formula source; its cached result is stored separately in v. | |
s.n.pattern | Number format; changes display only, never v. | |
p | Rich text; when present it overrides the displayed form of v. | |
si | Shared-formula id; preserve only when deep-copying an existing formula cell. | |
displayValue | Visible text rendered from v, t, and number format. |
Always write explicit ICellData. Bare values are inferred and can corrupt identifiers, scores, leading zeros, and date-like strings:
Dates, percentages, and currencies are numbers plus number formats:
Never write display text back as the stored value.
Common APIs
- Ranges:
sheet.getRange("A1:C9")orgetRange(row, col, numRows, numCols). Numeric rows and columns are zero-based. - Sheets:
getActiveSheet(),getSheetByName("Sheet1"),getSheets(). - Authoritative reads:
getCellData()/getCellDatas()forv/t/f/s;getRawValues()for unnormalized stored values. - Presentation reads:
getDisplayValues()for visible text andgetFormula()for formula source. - Writes:
setValue(cell),setValues(grid),setFormula("=…"),clearContent(), andclear(). - Dimensions:
getLastRow(),getLastColumn(), andsetRowCount(n)before out-of-range writes. - Style: use explicit xlsx-safe colors in
#RRGGBBorrgb(r,g,b)form.
setValues() merges cell data. {} or { s } does not clear existing v/f/p. To replace a region, call clearContent() first, then setValues(). To clear one cell explicitly, set { v: null, f: null, p: null, si: null, custom: null }.
Over-grid images
Create an image with sheet.newOverGridImage(), set source, explicit size and position, await buildAsync(), then pass the built data to sheet.insertImages():
Verify with sheet.getImages()[0].toBuilder().getSource() and getSourceType().
Formulas and recalculation
Formula source and cached result are separate. Writing a formula schedules calculation, but an immediate value read can still be stale. Loading a snapshot does not implicitly recalculate existing formulas.
Register onCalculationResultApplied() before triggering calculation, then await it:
For a newly written formula, register the promise before setFormula and await it afterward. Recalculate before exporting because xlsx stores cached values with formulas. If only a final value is required and cache freshness cannot be guaranteed, write the stored value directly.
OOXML table formulas
Use explicit Excel structured-reference scopes:
Orders[[#This Row],[Amount]]orOrders[@[Amount]]reads one row value.Orders[[#Data],[Amount]]reads the complete data column.Orders[Amount]is valid, but prefer explicit#Datafor whole-column aggregates.[@[Amount]]is valid only inside the Host table's calculated column.table[Amount]is invalid unless the real table name is exactlytable.
Copy the exact table name from workbook metadata; do not use table id, Sheet tab name, display label, guessed case, or a placeholder. Await calculation, then verify both the stored formula and computed values.
Rich text
Rich text lives in cell.p, not cell.v. Build it with api.newRichText(); never construct the internal body by hand.
setStyle(start, end, style) uses a half-open range. Derive offsets from inserted JavaScript strings. Common style fields are bl, it, cl, and bg. Verify getCellData().p, text-run ranges, and styles.
Failure prevention
- Specify
tfor every non-formula cell written. - Do not use
getValue()orgetValues()for authoritative reads; formatted values and booleans can be converted. - Deep-copy complete cell data when copying formatted cells.
- After importing csv or tsv, inspect every column's value type and formulas before computing. Mixed values can cause an entire column to import as text.
- Sheet Unit name, worksheet name, and file name are different identifiers.
- Use
univer_apibefore unfamiliar formatting, chart, table, filter, validation, pivot, image, comment, sparkline, or conditional-formatting operations.
Verification
After every mutation:
- Call
univer_inspectwith the exactunitId, worktree, and a range such asSheet1!A1:D20. - Verify stored values, types, formulas, display values, row order, and task-specific calculations.
- Read styles, number formats, rich text, images, charts, tables, or other omitted fields through a fresh read-only
univer_executecall. - For visually relevant formatting, charts, images, or layout, call
univer_screenshotwith the exactunitId, worktree or trunk, a workspaceoutputdirectory, and a narrowrangeplus optionalsheetName. Inspect the returned PNG; use an unscoped full-workbook capture only when the task requires the complete workbook view. - Recalculate and re-read formula results before
univer_export. - Follow the
univerready/status handoff workflow.
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-sheet/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-sheet)