Use this skill when the user wants a traceable SDS/MSDS package that must preserve a supplied Word template.
Use {baseDir} to refer to this skill folder.
Preconditions
- - Before production use, replace the placeholder company block in
{baseDir}/config/fixed_company.yml with the owning company's approved supplier information. - The runtime needs Python 3.11+.
- OCR is optional. If scanned PDFs are expected,
tesseract must be available on the host or in the sandbox/container runtime. - PDF export requires
soffice or libreoffice on the execution runtime. - This package is self-bootstrapping at runtime: the Python launcher creates
.venv and installs requirements.lock inside the skill folder on first use. - ClawHub publishes text files only. The fallback base template
assets/templates/sds_base.docx is generated locally on first use when it is missing.
Canonical entrypoint
Prefer the bundled cross-platform Python launcher instead of shell-only wrappers:
CODEBLOCK0
Windows launcher variants:
CODEBLOCK1
Workflow
- 1. If the runtime looks incomplete, run:
python3 {baseDir}/scripts/runtime_doctor.py
On Windows use
py or
python.
- 2. Run the canonical entrypoint. The launcher creates or repairs
.venv, installs requirements.lock, and generates a generic base template if assets/templates/sds_base.docx is missing. - Use
--enable-ocr only when scanned PDFs are expected. If no OCR backend is available, the run fails clearly. - Return the generated files from
outputs/runs/.../final. - When provenance or review details matter, inspect
outputs/runs/.../audit.
Output expectations
Primary deliverables:
- - INLINECODE17
- INLINECODE18 when a PDF engine is available
- INLINECODE19
- INLINECODE20
- INLINECODE21
Audit outputs may also include:
- - INLINECODE22
- INLINECODE23
- INLINECODE24
- INLINECODE25
Guardrails
- - Preserve the supplied template layout. Do not clear the document body when the user provides a client template.
- Do not invent safety-critical values such as GHS classifications, UN numbers, packing groups, flash points, LD50 values, or regulatory identifiers.
- Treat
structured_data.json, field_source_map.csv, and review_checklist.md as first-class deliverables alongside the DOCX/PDF.
技能名称: template-sds-generator
详细描述:
当用户需要一份可追溯的SDS/MSDS文件包,且必须保留所提供的Word模板时,使用此技能。
使用{baseDir}来指代此技能文件夹。
前置条件
- - 在生产使用前,请将{baseDir}/config/fixedcompany.yml中的占位公司信息替换为所属公司已批准的供应商信息。
- 运行环境需要Python 3.11+。
- OCR为可选功能。如果预期会处理扫描版PDF,则主机或沙箱/容器运行环境中必须安装tesseract。
- PDF导出功能要求运行环境中安装soffice或libreoffice。
- 此软件包在运行时自动引导:Python启动器会在首次使用时在技能文件夹内创建.venv并安装requirements.lock。
- ClawHub仅发布文本文件。当缺少备用基础模板assets/templates/sdsbase.docx时,会在首次使用时在本地生成该模板。
标准入口
优先使用捆绑的跨平台Python启动器,而非仅限Shell的包装器:
text
python3 {baseDir}/scripts/runopenclawskill.py --template-docx --prompt-file --sources [ ] --outdir --mode draft
Windows启动器变体:
text
py {baseDir}\scripts\runopenclawskill.py --template-docx --prompt-file --sources [ ] --outdir --mode draft
python {baseDir}\scripts\runopenclawskill.py --template-docx --prompt-file --sources [ ] --outdir --mode draft
工作流程
- 1. 如果运行环境看起来不完整,请运行:
python3 {baseDir}/scripts/runtime_doctor.py
在Windows上使用py或python。
- 2. 运行标准入口。启动器会创建或修复.venv,安装requirements.lock,并在assets/templates/sds_base.docx缺失时生成一个通用基础模板。
- 仅在预期处理扫描版PDF时使用--enable-ocr参数。如果没有可用的OCR后端,运行将明确失败。
- 从outputs/runs/.../final目录返回生成的文件。
- 当需要关注来源或审查细节时,检查outputs/runs/.../audit目录。
输出预期
主要交付物:
- - final/sdsdocument.docx
- final/sdsdocument.pdf(当PDF引擎可用时)
- final/structureddata.json
- final/fieldsourcemap.csv
- final/reviewchecklist.md
审计输出可能还包括:
- - audit/contentpolicyreport.json
- audit/ocraudit.json
- audit/fieldsourcemap.md
- runmanifest.json
防护措施
- - 保留所提供的模板布局。当用户提供客户模板时,请勿清空文档正文。
- 不要编造安全关键值,如GHS分类、UN编号、包装组、闪点、LD50值或监管标识符。
- 将structureddata.json、fieldsourcemap.csv和reviewchecklist.md视为与DOCX/PDF同等重要的一级交付物。