Coding agent examples
Give your agent the requirements and the llms.txt documentation index link. You do not need to copy the entire SDK documentation into the prompt. Start from the reusable template below, or paste one of the three complete examples.
One requirements template
Replace <…> with your own requirements. Describe one visible result before planning an entire office suite.
Build a locally runnable <application name> with Univer Office SDK.First read https://docs.univer.ai/llms.txt and the relevant complete examples.Keep SDK packages on the same version.Initial content: <a small, ready-to-edit dataset or document>.Core experience: <one user action and the immediate visible result>.Acceptance criteria: <two or three concrete, interactive checks>.Implement only this minimal workflow with the native Univer editorand real SDK capabilities. Start it, verify it in a browser,and provide a preview link. Identify any missing required configuration.Optional: install the application-building Skill
If your coding agent supports Skills, install build-with-univer so that it can consult the SDK documentation independently and determine how Web SDK, Server SDK, and AI SDK fit into your application.
npx skills add dream-num/skills --skill build-with-univerRun the command in the project that your agent has open. Confirm the installation with npx skills list, then use the template above or one of the examples below. Follow the current documentation and the SDK versions that your project actually uses.
Example 1: spreadsheet binding
Bind a quantity input to a spreadsheet cell and display the formula result on the page.
Build a locally runnable, single-page quote workspace with Univer Office SDK.First read https://docs.univer.ai/llms.txt and the relevant complete examples.Keep SDK packages on the same version.Use the basic Sheets preset and an editable native spreadsheet.Seed 2 monitors at 1200 each, 5 keyboards at 300 each,and 3 headsets at 200 each. Use sheet formulas for line totals and the total.Place a monitor quantity input and a quote total card beside the sheet.Bind the input to its cell in both directions. Read the real formula resultfor the card; do not recalculate the quote in page code.Support browser-local saving and restoration on refresh.Verify: the initial total is 4500; quantity 3 produces 5700;editing the cell updates the input and card; saving and refreshingrestores the changes. Implement only these features,verify the running application, and provide a preview link.Try it: Change the monitor quantity from 2 to 3, and the total goes from 4500 to 5700. Editing the sheet directly updates the page as well. After you save and refresh, the data is restored. Continue with Web SDK installation and Facade APIs.
Example 2: document collaboration
Open two independent sessions on the same document and verify that edits appear on both sides.
Build a locally runnable, two-person document collaboration demowith Univer Office SDK. First read https://docs.univer.ai/llms.txtand the current examples athttps://github.com/dream-num/univer-collaboration-examples.Keep frontend and server SDK packages on the same version.Place native Univer modern document editors side by side for Alice and Bob.Use separate runtimes and online sessions connected to a real Server SDKcollaboration service. Follow the official example to explicitly loadthe same server-created document. Seed a few short sentences.Typing on the left appears on the right; typing on the right updates the left.Synchronize through the SDK collaboration protocol. Use two fixed demo users,in-memory storage, and one local service for frontend and backend.Omit login, file management, and AI chat. Read a Pro License from the environment;retain the SDK's default behavior and notices when none is configured.Verify that edits in both directions converge, the server commits updates,and refreshing reloads the edited content. Explain that restarting the serviceresets in-memory data. Implement only these features,verify the running application, and provide a preview link.Try it: Type a sentence on the left, then continue typing on the right. Both sides receive the updates. Refresh the page, and the text remains. This demo stores all data in memory, so a service restart clears it; connect a persistent database before deployment. Continue with the Server SDK collaboration quick start.
Example 3: build your own you-cli
Build your own Office tooling and provide it to the agent that you already use. The tooling should cover Sheet, Doc, Slide, Relational Table, and Canvases, but start with a single Doc to try the "generate → preview → revise through conversation" workflow.
Build a project-local you-cli and Web preview with Univer Office SDK.First read https://docs.univer.ai/llms.txt and the complete content-operationexamples at https://github.com/dream-num/univer-cli-examples.Align frontend, server, and AI SDK versions; check the installed API types.Support Sheet, Doc, Slide, Relational Table, Canvases; start with Doc.Provide ./you-cli create <type> --name <name>, inspect --unit <id>,execute --unit <id> --file <path>, open --unit <id>, and --help.Keep the tool in this project. Supply instructions or a Skill for the current agent.Return JSON with the relevant unitId, type, commit result, and preview URL.CLI and Web must use the same real collaborative content and native editor.Wait for confirmed writes, read them back, and persist content and its catalog.open returns a URL; the agent opens it in the host preview panel when available.Use the existing agent for language understanding. Read licenses from the environment.Verify: create a weekly report through conversation and open its preview;then add a risk and owner using the same unitId, updating the open preview.Refreshing and restarting the service must restore content. Run these checks,provide the preview and usage guide, and start only this example's service.Use it through conversation
Give the prompt above to your coding agent. Once the tool exists and the agent has read its project instructions, enter the following in the same conversation:
Use you-cli to create a weekly project report with progress, risks, and next steps.Open its Web preview.After you have reviewed the result, continue:
Add a risk to that same report: delivery may be delayed, with Alice as the owner.Update the preview that is already open.The agent reuses the unitId of the same document. If the host provides a preview panel, the page appears beside the conversation; other environments use the returned browser link.
you-cli command reference
The following are the project-local commands that the prompt specifies. Replace UNIT_ID with the unitId that create returns. The agent writes edit.js using the Facade APIs.
| Action | Command | Result |
|---|---|---|
| Create | ./you-cli create doc --name "Weekly report" | Create a document and return unitId; other types are sheet, slide, base, and board. |
| Inspect | ./you-cli inspect --unit UNIT_ID | Read the real content and the current revision. |
| Edit | ./you-cli execute --unit UNIT_ID --file edit.js | Execute the changes, wait for the commit, and return the result. |
| Preview | ./you-cli open --unit UNIT_ID | Return the same document's Web URL for the agent to open. |
./you-cli --help prints the complete interface. For the APIs behind these commands, see AI SDK content operations and the complete CLI SDK Examples.
Application architecture
Your application and the agent that you already run can work on the same Office content. The interface handles interaction, the agent calls tools, and your backend retains ownership of identity, permissions, and storage.
Blue nodes are supplied and managed by you: your interface, your existing agent, the business API with identity and permissions, the database, and file storage. The nodes marked SDK are Univer capabilities that you integrate into the application.
If you only embed an editor, local snapshots are sufficient; shared editing requires a backend. Retain the model and orchestration that your agent already uses, let AI SDK handle content operations, and add Worktree when you need isolated edits, comparison, and review.
How is this guide?