A/B 测试专家(验效)。专注于实验设计、样本量计算、统计显著性检验和因果推断,确保实验科学可靠。
日本語の概要は準備中です。原文の説明を表示しています。
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
インストール方法を見るインストールする前に、エージェントに与えられる指示の中身を確認できます。
A .docx file is a ZIP archive containing XML files.
| Task | Approach |
|---|---|
| Read/analyze content | pandoc or unpack for raw XML |
| Create new document | Use docx-js - see Creating New Documents below |
| Edit existing document | Unpack → edit XML → repack - see Editing Existing Documents below |
Legacy .doc files must be converted before editing:
python scripts/office/soffice.py --headless --convert-to docx document.doc
# Text extraction with tracked changes
pandoc --track-changes=all document.docx -o output.md
# Raw XML access
python scripts/office/unpack.py document.docx unpacked/
python scripts/office/soffice.py --headless --convert-to pdf document.docx
pdftoppm -jpeg -r 150 document.pdf page
To produce a clean document with all tracked changes accepted (requires LibreOffice):
python scripts/accept_changes.py input.docx output.docx
Generate .docx files with JavaScript, then validate. Install: npm install -g docx
const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell, ImageRun,
Header, Footer, AlignmentType, PageOrientation, LevelFormat, ExternalHyperlink,
InternalHyperlink, Bookmark, FootnoteReferenceRun, PositionalTab,
PositionalTabAlignment, PositionalTabRelativeTo, PositionalTabLeader,
TabStopType, TabStopPosition, Column, SectionType,
TableOfContents, HeadingLevel, BorderStyle, WidthType, ShadingType,
VerticalAlign, PageNumber, PageBreak } = require('docx');
const doc = new Document({ sections: [{ children: [/* content */] }] });
Packer.toBuffer(doc).then(buffer => fs.writeFileSync("doc.docx", buffer));
After creating the file, validate it. If validation fails, unpack, fix the XML, and repack.
python scripts/office/validate.py doc.docx
// CRITICAL: docx-js defaults to A4, not US Letter
// Always set page size explicitly for consistent results
sections: [{
properties: {
page: {
size: {
width: 12240, // 8.5 inches in DXA
height: 15840 // 11 inches in DXA
},
margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 } // 1 inch margins
}
},
children: [/* content */]
}]
Common page sizes (DXA units, 1440 DXA = 1 inch):
| Paper | Width | Height | Content Width (1" margins) |
|---|---|---|---|
| US Letter | 12,240 | 15,840 | 9,360 |
| A4 (default) | 11,906 | 16,838 | 9,026 |
Landscape orientation: docx-js swaps width/height internally, so pass portrait dimensions and let it handle the swap:
size: {
width: 12240, // Pass SHORT edge as width
height: 15840, // Pass LONG edge as height
orientation: PageOrientation.LANDSCAPE // docx-js swaps them in the XML
},
// Content width = 15840 - left margin - right margin (uses the long edge)
Use Arial as the default font (universally supported). Keep titles black for readability.
const doc = new Document({
styles: {
default: { document: { run: { font: "Arial", size: 24 } } }, // 12pt default
paragraphStyles: [
// IMPORTANT: Use exact IDs to override built-in styles
{ id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 32, bold: true, font: "Arial" },
paragraph: { spacing: { before: 240, after: 240 }, outlineLevel: 0 } }, // outlineLevel required for TOC
{ id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
run: { size: 28, bold: true, font: "Arial" },
paragraph: { spacing: { before: 180, after: 180 }, outlineLevel: 1 } },
]
},
sections: [{
children: [
new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun("Title")] }),
]
}]
});
// ❌ WRONG - never manually insert bullet characters
new Paragraph({ children: [new TextRun("• Item")] }) // BAD
new Paragraph({ children: [new TextRun("\u2022 Item")] }) // BAD
// ✅ CORRECT - use numbering config with LevelFormat.BULLET
const doc = new Document({
numbering: {
config: [
{ reference: "bullets",
levels: [{ level: 0, format: LevelFormat.BULLET, text: "•", alignment: AlignmentType.LEFT,
style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
{ reference: "numbers",
levels: [{ level: 0, format: LevelFormat.DECIMAL, text: "%1.", alignment: AlignmentType.LEFT,
style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
]
},
sections: [{
children: [
new Paragraph({ numbering: { reference: "bullets", level: 0 },
children: [new TextRun("Bullet item")] }),
new Paragraph({ numbering: { reference: "numbers", level: 0 },
children: [new TextRun("Numbered item")] }),
]
}]
});
// ⚠️ Each reference creates INDEPENDENT numbering
// Same reference = continues (1,2,3 then 4,5,6)
// Different reference = restarts (1,2,3 then 1,2,3)
CRITICAL: Tables need dual widths - set both columnWidths on the table AND width on each cell. Without both, tables render incorrectly on some platforms.
// CRITICAL: Always set table width for consistent rendering
// CRITICAL: Use ShadingType.CLEAR (not SOLID) to prevent black backgrounds
const border = { style: BorderStyle.SINGLE, size: 1, color: "CCCCCC" };
const borders = { top: border, bottom: border, left: border, right: border };
new Table({
width: { size: 9360, type: WidthType.DXA }, // Always use DXA (percentages break in Google Docs)
columnWidths: [4680, 4680], // Must sum to table width (DXA: 1440 = 1 inch)
rows: [
new TableRow({
children: [
new TableCell({
borders,
width: { size: 4680, type: WidthType.DXA }, // Also set on each cell
shading: { fill: "D5E8F0", type: ShadingType.CLEAR }, // CLEAR not SOLID
margins: { top: 80, bottom: 80, left: 120, right: 120 }, // Cell padding (internal, not added to width)
children: [new Paragraph({ children: [new TextRun("Cell")] })]
})
]
})
]
})
// CRITICAL: type parameter is REQUIRED
new Paragraph({
children: [new ImageRun({
type: "png", // Required: png, jpg, jpeg, gif, bmp, svg
data: fs.readFileSync("image.png"),
transformation: { width: 200, height: 150 },
altText: { title: "Title", description: "Desc", name: "Name" } // All three required
})]
})
// CRITICAL: PageBreak must be inside a Paragraph
new Paragraph({ children: [new PageBreak()] })
// Or use pageBreakBefore
new Paragraph({ pageBreakBefore: true, children: [new TextRun("New page")] })
width, long edge as height, and set orientation: PageOrientation.LANDSCAPE\n - use separate Paragraph elementsLevelFormat.BULLET with numbering configtype - always specify png/jpg/etcwidth with DXA - never use WidthType.PERCENTAGE (breaks in Google Docs)columnWidths array AND cell width, both must matchmargins: { top: 80, bottom: 80, left: 120, right: 120 } for readable paddingShadingType.CLEAR - never SOLID for table shadingnpm install -g docx (new documents)scripts/office/soffice.py)pdftoppm for imagesまだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
A/B 测试专家(验效)。专注于实验设计、样本量计算、统计显著性检验和因果推断,确保实验科学可靠。
日本語の概要は準備中です。原文の説明を表示しています。
A股研究团队主理人(古见远 · 研究总监)。调度 7 位专业成员(宏观策略师、市场解读师、个股研究员、估值定价师、产业链分析师、资金行为分析师、风险诊断师)按 6 种预设 Workflow 完成 A 股研究工作,输出结构化研究报告。 触发词:A股、股票分析、市场分析、板块分析、持仓诊断、个股研究、 宏观分析、产业链、资金流向、估值分析、风险诊断、 股票推荐、板块推荐、投资建议、该不该买、能不能买、 今天怎么走、开盘前分析、市场情绪、主线、板块、ETF。
日本語の概要は準備中です。原文の説明を表示しています。
学术选刊顾问团 v3.0 主理人 — 输入论文主题+摘要+全文,自动推荐中文普通/中文核心/SCI/SSCI投稿期刊。双管道并行分析(中外刊独立匹配),冲稳保三档策略,附录用概率、审稿周期、证据链。
日本語の概要は準備中です。原文の説明を表示しています。
社媒互动增长专家团 AI 评论运营专家(瑞普 · Reply)。负责评论智能分类与优先级排序,差异化回复策略设计,转化引导话术,品牌人设维护与禁忌词管理,多语言评论处理。 触发词:由 social-engagement-team-lead 主理人调度执行 Phase 3 评论运营任务时激活。不直接面向用户。
日本語の概要は準備中です。原文の説明を表示しています。
AI 内容创作专家团主理人(司远 · 创意制片人)。协调 6 位专业成员(creative-strategist、copywriter、video-generator、image-creator、video-editor、content-adapter)按预设 Workflow 完成多模态内容生产全流程。 触发词:"帮我做个视频"、"生成一段宣传片"、"做一套宣传物料"、"写一篇带配图的文章"、"帮我设计品牌视觉"、"制作短视频"、"内容创作一条龙"。 路由逻辑:单一维度任务走单 Agent 直调;综合性内容需求走对应预设 Workflow。
日本語の概要は準備中です。原文の説明を表示しています。
AI 多模态内容生产技能包,基于 WorkBuddy 内置工具(HY-Video、YT-Video、HY-Image、YT-VITA、ImageGen、ImageEdit), 涵盖创意策略、视频生成、图片创作、视频编辑、发布级精修和素材改编的完整知识体系。 触发词:视频生成、图片创作、AI创作、智能剪辑、视频翻译、素材分析、内容合成、Prompt工程、创意策划、情绪板、广告方向、精修。
日本語の概要は準備中です。原文の説明を表示しています。