npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dztabel/docxkit

v0.1.62

Published

Agent-facing CLI for exporting prepared content into polished Word docx reports.

Readme


用户提供资料或报告目标,Agent 负责整理内容,DocxKit 负责把最终内容导出为排版稳定、可编辑、可交付的 Word .docx 报告。

用户可以提供任意可被 Agent 读取和理解的资料,例如:

  • 文档、表格、网页、截图或已有报告。
  • 项目材料、调研资料、会议纪要或数据摘要。
  • 一个明确的报告主题,由 Agent 自行检索和整理资料。

效果预览

以下截图展示 6 份不同业务场景的完整 6 页 Word 报告。

| | | | |:---:|:---:|:---:| | 董事会预算决策 | 客户访谈研究 | 技术交付复盘 | | | | | | 现金流风险简报 | 运营执行手册 | 市场进入评估 | | | | |

安装

1. 安装 CLI

npm install -g @dztabel/docxkit
docx-kit --version

出现类似输出代表 CLI 安装成功:

docx-kit 0.1.62 (cli-contract 0.2)

2. 安装 Agent skill(二选一)

2.1 Codex

node -e "const fs=require('fs'),os=require('os'),path=require('path'),cp=require('child_process');const root=cp.execSync('npm root -g',{encoding:'utf8'}).trim();const src=path.join(root,'@dztabel','docxkit','skills','docxkit');const dest=path.join(os.homedir(),'.agents','skills','docxkit');fs.rmSync(dest,{recursive:true,force:true});fs.mkdirSync(path.dirname(dest),{recursive:true});fs.cpSync(src,dest,{recursive:true});console.log('Codex skill installed');"

检查 Codex skill 是否安装成功,在终端中输入:

node -e "const fs=require('fs'),os=require('os'),path=require('path');const p=path.join(os.homedir(),'.agents','skills','docxkit','SKILL.md');if(!fs.existsSync(p))process.exit(1);console.log('Codex skill installed');"

出现以下输出代表成功:

Codex skill installed

打开 Codex 后输入 $docxkit。能按 Tab 选中该 skill,代表可用。若未出现,按 Cmd+K / Ctrl+K 选择 Force Reload Skills,或重新打开 Codex。

2.2 Claude Code

node -e "const fs=require('fs'),os=require('os'),path=require('path'),cp=require('child_process');const root=cp.execSync('npm root -g',{encoding:'utf8'}).trim();const src=path.join(root,'@dztabel','docxkit','skills','docxkit');const dest=path.join(os.homedir(),'.claude','skills','docxkit');fs.rmSync(dest,{recursive:true,force:true});fs.mkdirSync(path.dirname(dest),{recursive:true});fs.cpSync(src,dest,{recursive:true});console.log('Claude Code skill installed');"

检查 Claude Code skill 是否安装成功,在终端中输入:

node -e "const fs=require('fs'),os=require('os'),path=require('path');const p=path.join(os.homedir(),'.claude','skills','docxkit','SKILL.md');if(!fs.existsSync(p))process.exit(1);console.log('Claude Code skill installed');"

出现以下输出代表成功:

Claude Code skill installed

打开 Claude Code 后输入 /docxkit。能选中该 skill,代表可用。若未出现,输入 /reload-skills 后重试;旧版本 Claude Code 可重新打开窗口。

快速开始

1. 用户带资料生成 Word 报告

$docxkit 请读取我上传的 Excel、PDF 和会议纪要,整理成一份正式项目复盘报告并导出 Word。
/docxkit 请读取我上传的 Excel、PDF 和会议纪要,整理成一份正式项目复盘报告并导出 Word。

2. 用户只给目标,Agent 自行调研

$docxkit 请调研国内储能行业最新进展,整理成行业研究报告并导出 Word。
/docxkit 请调研国内储能行业最新进展,整理成行业研究报告并导出 Word。

3. 用户已有草稿,Agent 重写成可交付报告

$docxkit 请把这份散乱的草稿改写成结构清晰的正式分析报告并导出 Word。
/docxkit 请把这份散乱的草稿改写成结构清晰的正式分析报告并导出 Word。

4. 用户基于反馈迭代报告

$docxkit 请把刚才生成的报告压缩到 8 页,第二章改成更适合管理层阅读的版本,并重新导出 Word。
/docxkit 请把刚才生成的报告压缩到 8 页,第二章改成更适合管理层阅读的版本,并重新导出 Word。

Agent 会完成资料读取、调研、正文组织、格式约束和 Word 导出。

技术细节

Agent 会自动把资料整理成 DocxKit 可处理的中间内容,并调用:

docx-kit build prepared-report.md --out ./report --filename 项目复盘报告.docx
docx-kit qa ./report/项目复盘报告.docx --report-json ./report/report.json --out ./report/qa

DocxKit 输出:

report/项目复盘报告.docx
report/report.json
report/build-result.json
report/qa/qa-result.json

生成的 .docx 默认不内嵌字体:每个模版都在 fontTable 中声明规范字体名与跨平台替代链,Word/WPS 会优先使用目标电脑已安装的字体并保持文档可编辑。若收件人环境缺少规范字体,用 --embed-fonts 显式嵌入本机可合法嵌入的字体子集。

内置三个模版:executive-cn-docx(默认,楷体商务风)、executive-cn-song-docx(宋体正文 + 不加粗黑体标题,正式规范风)和 executive-cn-official-docx(方正小标宋标题、楷体_GB2312 副标题、仿宋_GB2312 三号正文、小四号表格及表题、二三级标题加粗、无页眉、固定 30 磅行距,禁止 callout)。公文范式默认在首页顶部直接排列标题、副标题和正文,不生成独立封面与目录;只有明确需要时才设置 document_mode: report。在 Markdown frontmatter 中用 template: 显式切换。

支持公式(LaTeX 块级与行内,Word 原生可编辑)、表/图/公式/来源四类可点击交叉引用、图目录与表目录;构建内置内容质量门禁(悬空引用等 error 级问题会使构建失败,详见输出 JSON 的 checks 字段)。

排障

当前公开测试版支持 macOS Apple Silicon 与 Windows x64。

如果全局 npm 安装跳过了 optional dependencies,显式安装对应平台包:

npm install -g @dztabel/docxkit @dztabel/docxkit-darwin-arm64

构建失败时,提交 issue 请附:

  • docx-kit --version
  • report/build-result.json
  • 可复现问题的最小 content.md

仓库范围

本公开仓库包含 npm wrapper 元数据、命令 shim、公开 skills、文档和轻量预览资产。

渲染器源码、私有模板、schemas、视觉回归样例和平台二进制不包含在本仓库中。平台二进制通过 npm 平台包分发。

许可

DocxKit 以专有 CLI 二进制形式通过 npm 分发。本仓库提供用于安装和使用 CLI 的公开 wrapper、skills 和文档。