Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计通过

superdocsuperdoc 文档

Agent Skill

superdoc 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

9,180

周安装

375

GitHub Stars

公开资料未说明

下载量

2,940
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:superdoc(superdoc 文档)
来源仓库:https://github.com/yebo-liu/superdoc
安装命令:
openclaw skills install superdoc
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install superdoc

简介

现代 DOCX 编辑器,具备自定义渲染管道与编程化操作能力。

  • 适合批量生成报告、合同或标准化文档模板的场景。
  • 支持样式继承、表格嵌套等复杂排版需求。superdoc 属于研究检索类 Skill,可作为该场景下的辅助能力补充。
  • 安装后可通过脚本调用,实现文档自动化流水线。
  • 兼容性问题可能出现在旧版 Word 中,建议导出为 PDF 交付。

SKILL.md

name
superdoc
description
Create, edit, and manipulate DOCX files using SuperDoc - a modern document editor with custom rendering pipeline. Use when you need to programmatically work with Word documents for creation, editing, formatting, or template generation. Supports both browser and headless Node.js contexts. Prefer SuperDoc for new document workflows requiring full formatting control; use simpler tools (mammoth, docx-js) for text extraction only. Do NOT use for PDF editing, document analysis/summarization, or OCR tasks.

SuperDoc Skill

SuperDoc is a modern DOCX editor providing programmatic document manipulation with full formatting control.

Installed: v1.17.0 at /usr/local/lib/node_modules/superdoc

Quick Start

Create a new document

const { Document, Paragraph, TextRun } = require('superdoc');

const doc = new Document({
  sections: [{
    children: [
      new Paragraph({
        children: [
          new TextRun({ text: "Hello World", bold: true })
        ]
      })
    ]
  }]
});

// Save to file
const fs = require('fs');
const Packer = require('superdoc').Packer;
Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync('output.docx', buffer);
});

Edit an existing document

const { Document } = require('superdoc');
const fs = require('fs');

// Load existing DOCX
const buffer = fs.readFileSync('input.docx');
const doc = await Document.load(buffer);

// Find and replace text
doc.sections[0].children.forEach(para => {
  para.children.forEach(run => {
    if (run.text) {
      run.text = run.text.replace(/Company A/g, 'Company B');
    }
  });
});

// Save modified document
const output = await Packer.toBuffer(doc);
fs.writeFileSync('output.docx', output);

Template generation (batch)

const { Document, Paragraph, TextRun } = require('superdoc');
const fs = require('fs');

// Load template
const template = fs.readFileSync('template.docx');

// Generate personalized documents
const clients = require('./clients.json');
for (const client of clients) {
  const doc = await Document.load(template);
  
  // Replace placeholders
  doc.sections[0].children.forEach(para => {
    para.children.forEach(run => {
      if (run.text) {
        run.text = run.text
          .replace('{{NAME}}', client.name)
          .replace('{{EMAIL}}', client.email);
      }
    });
  });
  
  const output = await Packer.toBuffer(doc);
  fs.writeFileSync(`output/${client.id}.docx`, output);
}

Common Workflows

Document creation flow

  1. Import required classes: Document, Paragraph, TextRun, Packer
  2. Build document structure with sections and paragraphs
  3. Apply formatting (bold, italic, fonts, colors)
  4. Export using Packer.toBuffer() or Packer.toBlob()

Document editing flow

  1. Load existing DOCX: Document.load(buffer)
  2. Navigate structure: doc.sections[i].children (paragraphs)
  3. Modify content: update run.text or formatting properties
  4. Save: Packer.toBuffer(doc)

Error handling

Common issues:

  • File not found: Check path before fs.readFileSync()
  • Invalid DOCX: Wrap Document.load() in try-catch
  • Memory limits: For large batches, process in chunks (max 100 docs at once)

Headless Node.js Usage

SuperDoc requires browser APIs by default. In CLI/headless contexts:

Setup (one-time):

npm install --global superdoc jsdom

Polyfill browser APIs:

const { JSDOM } = require('jsdom');
const dom = new JSDOM('<!DOCTYPE html>');
global.window = dom.window;
global.document = window.document;
global.localStorage = {
  getItem: () => null,
  setItem: () => {},
  removeItem: () => {}
};

// Now import SuperDoc
const { Document } = require('superdoc');

Alternative: Use browser tool For complex rendering or UI-dependent features, use OpenClaw's browser tool to run SuperDoc in a real browser context.

React Integration

Install:

npm install @superdoc-dev/react

Basic usage:

import { SuperDocEditor } from '@superdoc-dev/react';
import { useState } from 'react';

function App() {
  const [doc, setDoc] = useState(null);
  
  return (
    <SuperDocEditor
      document={doc}
      onChange={setDoc}
      onSave={(buffer) => {
        // Handle save
        const blob = new Blob([buffer], { 
          type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' 
        });
        // Download or upload blob
      }}
    />
  );
}

Key props:

  • document: Document instance or null
  • onChange: Callback when document changes
  • onSave: Callback with buffer when user saves
  • toolbar: Custom toolbar config (optional)

When NOT to Use SuperDoc

  • PDF editing: Use pdf-lib or similar
  • Document analysis/summarization: Use text extraction + LLM
  • OCR: Use tesseract or cloud OCR services
  • Simple text extraction: Use mammoth.js (lighter weight)
  • Legacy .doc (not .docx): Use LibreOffice or online converters

Advanced Usage

For detailed API reference, advanced formatting, tracked changes, and custom rendering:

Troubleshooting

"localStorage is not defined" → Add localStorage polyfill (see Headless Usage section)

"Cannot read property 'children' of undefined" → Document structure may be empty; check doc.sections.length > 0

Large files slow/crash → Process in batches; consider streaming for files >10MB

Formatting not preserved → Ensure you're modifying properties, not replacing objects

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

98.48%
按下载量换算2,895

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills