用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/nodetool-ai/nodetool --skill sandbox-docx命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | sandbox-docx |
| description | Build a Word document in a Code node or CodeAct action, with docx running on the host |
Specifier: @nodetool-ai/sandbox-docx. Import it at the top of the body.
docx builds a document out of class instances (Paragraph, TextRun,
Table, …) that cannot cross the guest boundary as plain data. This pack is a
host module: you describe the document as a JSON element list and the host
builds the real .docx bytes.
.docx bytesimport { build } from "@nodetool-ai/sandbox-docx";
const bytes = await build({
properties: { title: "Q3 Report", author: "NodeTool" },
elements: [
{ type: "heading", text: "Q3 Report", level: 1 },
{ type: "paragraph", text: "Revenue grew 12% quarter over quarter.", bold: true },
{ type: "table", rows: [["Month", "Revenue"], ["Jul", "120k"], ["Aug", "134k"]] },
{ type: "pageBreak" },
{ type: "paragraph", text: "See appendix for methodology.", alignment: "CENTER" }
]
});
await workspace.writeBytes("report.docx", bytes);
Element types:
heading — text, level (1–6, default 1)paragraph — text, alignment (LEFT/CENTER/RIGHT/JUSTIFY, default
LEFT), bold, italic, fontSize (points, default 12)table — rows, a 2D array; every cell is stringifiedimage — data (a Uint8Array), width/height in inchespageBreak — no fieldsproperties.title/author/subject/keywords set the document's metadata.
build is async and returns a Uint8Array..docx, use
@nodetool-ai/sandbox-mammoth instead — these are two different libraries on
two different sides of the format.width/height follow docx's own
convention; omit them and the image renders at a fixed placeholder size.data field.