officeSkills
Word, Excel, and PowerPoint skills for agents with a sandbox.
@pai/skills-office ships three generated skills for producing Office files in the sandbox. Merge them into defineSkills() next to your own.
import { defineSkills } from "@pai/skills";
import { officeSkills } from "@pai/skills-office";
import { skills as generated } from "./skills/generated";
export const skills = defineSkills({
skills: [...generated, ...officeSkills],
sandbox: true,
});Import
pnpm add @pai/skills-officeimport { officeSkills, type OfficeSkillName } from "@pai/skills-office";Skills
| Name | Produces | Needs in the sandbox image |
|---|---|---|
office-document | Word .docx | Node.js with docx; LibreOffice and Poppler for rendering |
office-presentation | PowerPoint .pptx | Node.js with pptxgenjs; LibreOffice and Poppler for rendering |
office-spreadsheet | Excel .xlsx and .csv | Node.js with exceljs; LibreOffice for recalculation and rendering |
Each skill declares pai-requires: sandbox under metadata, so defineSkills offers it only when sandbox is true for the request. The agent needs sandboxTools() and a provider whose image has the Node.js packages above, installed so a script in /workspace can import them; sandboxes have no network, so the skills cannot install them. Choose the toolchain covers building that image. LibreOffice and Poppler are optional: without them, a skill skips its rendering checks and says so.
The skills write their files under /workspace/artifacts/. A sandbox path is not a download link, so give the agent a tool that publishes a file to the user; the skills use one when the agent has it.
OfficeSkillName is "office-document" | "office-presentation" | "office-spreadsheet", for available rules such as offering only spreadsheets on one plan.