Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Shuke Document Formatting

v1.0.1

数科公司文印格式自动化工具包。自动按照数科公司文印格式要求(方正小标宋简体、仿宋GB2312、楷体GB2312、黑体等字体,28字/行,22行/页)格式化Word文档并生成PDF。

0· 106·1 current·1 all-time
byshuchang@an0027

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for an0027/shuke-document-formatting.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Shuke Document Formatting" (an0027/shuke-document-formatting) from ClawHub.
Skill page: https://clawhub.ai/an0027/shuke-document-formatting
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install shuke-document-formatting

ClawHub CLI

Package manager switcher

npx clawhub@latest install shuke-document-formatting
Security Scan
VirusTotalVirusTotal
Suspicious
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
The scripts and SKILL.md consistently implement document formatting, PDF generation, font installation/verification and batch processing — which aligns with the description. However the package uses several system tools (pandoc, weasyprint, pdffonts, fc-list, reportlab, PyPDF2) that are not listed in the SKILL.md "pre-requirements" nor in the registry metadata. That omission is unexpected and should have been declared.
!
Instruction Scope
Runtime instructions ask you to run install_shuke_fonts.py and conversion scripts. install_shuke_fonts.py will recursively scan directories for TTF files, copy matched fonts into a system-wide directory, update font cache, and write a CSS template into a root workspace path. check_pdf_fonts.py has a hard-coded fallback path (/root/.openclaw/workspace/...) if no PDF argument is provided. These behaviors modify system state and reference root-home paths beyond simply reading or transforming a single user-supplied document.
Install Mechanism
There is no remote install step or downloaded code; this is an instruction + code bundle (no network installers). That lowers risk compared to fetching arbitrary code. The highest-risk action is local file writes to system font directories done by the included install_shuke_fonts.py script.
Credentials
The skill does not request credentials or environment variables (none declared). However it expects and invokes system utilities (pandoc, weasyprint, pdffonts, fc-list, fc-cache) and Python packages (reportlab, python-docx, PyPDF2) which the SKILL.md does not fully declare — this mismatch may lead users to run unchecked commands as root to satisfy requirements. No secret access is requested.
!
Persistence & Privilege
The font installer requires root privileges and writes into /usr/share/fonts/数科文印字体 and updates fc-cache, and it also writes files into a root workspace path (/root/.openclaw/...). Those are legitimate operations for installing system fonts but are high-privilege actions; users should not run them without verifying the font files and source. The skill itself is not marked always:true and does not persist as a background service.
What to consider before installing
What to consider before installing or running this skill: - The code appears to do what the description says (format DOCX → PDF and install/verify fonts), but it performs system-level changes: install_shuke_fonts.py requires root and will copy TTF files into /usr/share/fonts/数科文印字体 and run fc-cache. Only proceed if you trust the font files and the author. - Missing declared dependencies: the SKILL.md lists python-docx but does not list system binaries and Python packages actually used (pandoc, weasyprint, pdffonts/pdfinfo, fc-list/fc-cache, reportlab, PyPDF2). Install those in a controlled environment first (or inspect code) rather than elevating privileges to install them on the system blindly. - Inspect font files before installing: the installer will scan and copy any matching TTFs from the provided directory. Verify that the TTF files are legitimate and licensed for your use; do not install unknown or untrusted fonts as root. - Hard-coded paths: some tools default to /root/.openclaw/workspace paths if no arguments are given. Run the scripts with explicit input/output paths to avoid accidental operations on unexpected files. - Test in an isolated environment: if possible, run the tool in a disposable VM or container first (or in a non-root user account) and avoid running install_shuke_fonts.py as root until you’ve verified the font files and the script behavior. - Backup system fonts: if you decide to install, backup existing font directories first so you can recover if something goes wrong. - If you only need formatting/PDF conversion and not system-wide font installation, try running the conversion tools with local font files or use the generate_proper_example/doc_generator utilities to see behavior without modifying /usr/share. If you want, I can highlight the exact lines that (a) copy files into /usr/share, (b) require root checks, and (c) reference the hard-coded /root workspace paths so you can inspect them directly.

Like a lobster shell, security has layers — review code before you run it.

latestvk97902caej1naghfhjc4eahbfs83s4g5
106downloads
0stars
2versions
Updated 1mo ago
v1.0.1
MIT-0

数科文印格式自动化工具包

🎯 技能概述

shuke-document-formatting 是一套完整的自动化工具包,用于按照数科公司严格的文印格式要求处理文档。

核心功能

  1. 智能文档格式化:基于目录结构分析,自动识别标题层次(一、二、三级标题),应用正确的字体、字号、对齐方式
  2. 精确PDF生成:使用指定字体(方正小标宋简体、仿宋GB2312、楷体GB2312、黑体)生成完全符合格式要求的PDF
  3. 字体安装与管理:一键安装所需字体,验证字体安装结果
  4. 批量处理:支持批量转换文件夹中的所有文档
  5. 格式验证:检查PDF使用的字体是否符合要求

支持的格式要求

  • 标题:方正小标宋简体,二号,居中
  • 一级标题:黑体,三号,左对齐
  • 二级标题:楷体GB2312,三号,加粗,左对齐
  • 三级标题:仿宋GB2312,三号,左对齐
  • 正文:仿宋GB2312,三号,首行缩进2字符
  • 页面设置:上3.5cm,下3.5cm,左2.8cm,右2.8cm
  • 网格要求:28字/行,22行/页
  • 行距:固定值28磅

🚀 快速开始

前置要求

  • Python 3.8+
  • python-docx 库
  • 字体文件(可通过工具自动安装)

安装依赖

pip install python-docx

字体安装

使用内置工具安装所需字体:

python install_shuke_fonts.py
python verify_shuke_fonts.py

基本使用

1. 格式化Word文档

python smart_format_v3.py input.docx output.docx

2. 生成符合格式的PDF

python convert_to_pdf_shuke_final.py input.docx output.pdf

3. 批量转换

python batch_convert_shuke_pdf.py input_folder/ output_folder/

4. 生成示例文档

python generate_proper_example.py example.docx

📁 工具说明

核心工具

  1. smart_format_v3.py - 智能格式化工具

    • 基于目录结构分析,智能识别标题级别
    • 自动应用正确的字体、字号、对齐方式
    • 修复常见格式错误
  2. convert_to_pdf_shuke_final.py - PDF生成工具

    • 使用精确字体生成PDF
    • 确保页面设置符合要求
    • 验证字体使用情况
  3. install_shuke_fonts.py - 字体安装工具

    • 自动安装数科公司要求的4种字体
    • 支持系统级字体注册
  4. verify_shuke_fonts.py - 字体验证工具

    • 验证字体是否安装成功
    • 检查字体名称匹配
  5. batch_convert_shuke_pdf.py - 批量转换工具

    • 批量处理文件夹中的所有Word文档
    • 保持目录结构
  6. check_pdf_fonts.py - PDF字体检查工具

    • 检查PDF文档使用的字体
    • 验证是否符合格式要求
  7. doc_generator.py - 文档生成器

    • 根据内容自动生成符合格式的Word文档
  8. generate_proper_example.py - 示例生成器

    • 生成完全符合文印格式的示例文档

辅助工具

  • analyze_document_structure.py - 文档结构分析
  • fix_docx.py - 文档修复工具
  • check_docx.py - 文档检查工具

📖 详细使用指南

文档格式化原理

工具采用三级标题识别策略:

  1. 先识别目录结构:分析文档整体组织架构
  2. 再分析上下文关系:判断标题级别和从属关系
  3. 最后应用格式规则:基于结构应用正确的字体、字号、对齐方式

标题层次定义

  • 一级标题:中文序号(一、二、三、...),黑体,三号
  • 二级标题:中文括号序号((一)(二)(三)...),楷体GB2312,三号,加粗
  • 三级标题:数字序号(1. 2. 3. ...),仿宋GB2312,三号
  • 正文:仿宋GB2312,三号,首行缩进2字符

常见问题解决

问题1:字体缺失

症状:PDF生成后字体不符合要求 解决:运行字体安装工具,确保字体文件位于/usr/share/fonts/truetype/sim/目录

问题2:标题识别错误

症状:一级标题被识别为三级标题 解决:使用smart_format_v3.py的智能识别功能,或手动调整文档结构

问题3:页面设置不正确

症状:文档页边距或行距不符合要求 解决:确保使用convert_to_pdf_shuke_final.py生成PDF

🔧 技术细节

字体映射

  • 方正小标宋简体 → 标题,二号,居中
  • 黑体 → 一级标题,三号,左对齐
  • 楷体GB2312 → 二级标题,三号,加粗,左对齐
  • 仿宋GB2312 → 三级标题和正文,三号,左对齐

页面设置参数

  • 页边距:上3.5cm,下3.5cm,左2.8cm,右2.8cm
  • 页眉:2.5cm,页脚:2.5cm
  • 纸张:A4
  • 网格:28字/行,22行/页
  • 行距:固定值28磅

编码处理

所有文档使用GBK编码,确保中文兼容性。ZIP打包时使用英文文件名避免乱码。

📄 许可证

MIT-0 License

👥 贡献者

  • 小强 (xiaoqiang) - 主要开发者

📞 支持

如有问题,请在工作区中创建issue或联系开发者。


最后更新:2026-03-28

Comments

Loading comments...